]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Merge branch 'topic/cs5535audio' into to-push
authorTakashi Iwai <tiwai@suse.de>
Thu, 25 Dec 2008 10:40:28 +0000 (11:40 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 25 Dec 2008 10:40:28 +0000 (11:40 +0100)
634 files changed:
Documentation/arm/mem_alignment
Documentation/kernel-parameters.txt
Documentation/local_ops.txt
Documentation/sound/alsa/ALSA-Configuration.txt
Documentation/sound/alsa/soc/machine.txt
Documentation/usb/gadget_serial.txt
Documentation/usb/proc_usb_info.txt
Documentation/usb/usbmon.txt
MAINTAINERS
Makefile
arch/arm/common/sa1111.c
arch/arm/include/asm/bitops.h
arch/arm/include/asm/processor.h
arch/arm/kernel/armksyms.c
arch/arm/kernel/traps.c
arch/arm/mach-omap1/io.c
arch/arm/mach-pxa/include/mach/palmasoc.h [new file with mode: 0644]
arch/arm/mach-pxa/include/mach/reset.h
arch/arm/mm/alignment.c
arch/arm/mm/fault.c
arch/arm/plat-omap/include/mach/omapfb.h
arch/arm/plat-omap/sram.c
arch/arm/plat-orion/pcie.c
arch/avr32/boards/favr-32/flash.c
arch/avr32/boards/favr-32/setup.c
arch/avr32/boot/images/Makefile
arch/avr32/configs/atstk1006_defconfig
arch/avr32/mach-at32ap/at32ap700x.c
arch/ia64/configs/generic_defconfig
arch/ia64/hp/sim/Kconfig
arch/ia64/include/asm/paravirt_privop.h
arch/ia64/kernel/topology.c
arch/ia64/kvm/Makefile
arch/ia64/kvm/optvfault.S
arch/ia64/sn/kernel/irq.c
arch/ia64/sn/kernel/setup.c
arch/m68k/configs/amiga_defconfig
arch/m68k/configs/apollo_defconfig
arch/m68k/configs/atari_defconfig
arch/m68k/configs/bvme6000_defconfig
arch/m68k/configs/hp300_defconfig
arch/m68k/configs/mac_defconfig
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme147_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/configs/q40_defconfig
arch/m68k/configs/sun3_defconfig
arch/m68k/configs/sun3x_defconfig
arch/mips/Kconfig.debug
arch/mips/configs/fulong_defconfig
arch/mips/configs/ip22_defconfig
arch/mips/configs/ip32_defconfig
arch/mips/configs/malta_defconfig
arch/mips/include/asm/asmmacro.h
arch/mips/include/asm/byteorder.h
arch/mips/include/asm/elf.h
arch/mips/include/asm/pci.h
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/vpe.c
arch/mips/mm/dma-default.c
arch/mips/mti-malta/Makefile
arch/mips/mti-malta/malta-mtd.c [deleted file]
arch/mips/mti-malta/malta-platform.c
arch/mips/pci/pci.c
arch/mn10300/kernel/entry.S
arch/mn10300/kernel/gdb-io-serial.c
arch/mn10300/kernel/mn10300-serial.c
arch/mn10300/kernel/module.c
arch/mn10300/kernel/setup.c
arch/mn10300/kernel/vmlinux.lds.S
arch/parisc/include/asm/tlbflush.h
arch/powerpc/boot/Makefile
arch/powerpc/boot/dts/mpc8349emitx.dts
arch/powerpc/configs/83xx/mpc834x_itx_defconfig
arch/powerpc/configs/mpc83xx_defconfig
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kernel/cpu_setup_44x.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/dma.c
arch/powerpc/kernel/misc_32.S
arch/powerpc/kvm/44x_tlb.c
arch/powerpc/kvm/powerpc.c
arch/powerpc/lib/rheap.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/cell/axon_msi.c
arch/powerpc/sysdev/mpic.c
arch/s390/kvm/sigp.c
arch/sh/Kconfig
arch/sparc/include/asm/bitops_32.h
arch/sparc/include/asm/ptrace_32.h
arch/sparc/include/asm/ptrace_64.h
arch/sparc64/kernel/ptrace.c
arch/sparc64/kernel/visemul.c
arch/sparc64/lib/user_fixup.c
arch/um/drivers/mconsole_kern.c
arch/x86/Kconfig.cpu
arch/x86/include/asm/amd_iommu_types.h
arch/x86/include/asm/dma-mapping.h
arch/x86/include/asm/topology.h
arch/x86/include/asm/vmi.h
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu_init.c
arch/x86/kernel/cpu/mcheck/mce_64.c
arch/x86/kernel/microcode_core.c
arch/x86/kernel/microcode_intel.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/paravirt-spinlocks.c
arch/x86/kernel/pci-gart_64.c
arch/x86/kernel/setup.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/vmi_32.c
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/vmx.c
arch/x86/oprofile/nmi_int.c
arch/x86/oprofile/op_model_ppro.c
block/blk-barrier.c
block/blk-core.c
block/blk-map.c
block/blk-settings.c
block/bsg.c
block/compat_ioctl.c
block/elevator.c
block/genhd.c
block/scsi_ioctl.c
crypto/Kconfig
crypto/Makefile
crypto/async_tx/async_xor.c
drivers/acpi/battery.c
drivers/acpi/bus.c
drivers/acpi/toshiba_acpi.c
drivers/acpi/utilities/utglobal.c
drivers/ata/Kconfig
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_hpt366.c
drivers/ata/pata_ninja32.c
drivers/ata/pata_sis.c
drivers/atm/horizon.c
drivers/block/cciss.c
drivers/block/pktcdvd.c
drivers/cdrom/cdrom.c
drivers/char/cp437.uni
drivers/char/serial167.c
drivers/char/vt.c
drivers/char/xilinx_hwicap/buffer_icap.c
drivers/char/xilinx_hwicap/buffer_icap.h
drivers/char/xilinx_hwicap/fifo_icap.c
drivers/char/xilinx_hwicap/fifo_icap.h
drivers/char/xilinx_hwicap/xilinx_hwicap.c
drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/dma/dmaengine.c
drivers/dma/ioat_dma.c
drivers/dma/iop-adma.c
drivers/dma/mv_xor.c
drivers/edac/edac_device.c
drivers/firewire/fw-ohci.c
drivers/firewire/fw-transaction.c
drivers/firewire/fw-transaction.h
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_proc.c
drivers/gpu/drm/i915/i915_gem_tiling.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/radeon/radeon_drv.h
drivers/gpu/drm/radeon/radeon_irq.c
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-highlander.c
drivers/i2c/busses/i2c-pmcmsp.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/ide/Kconfig
drivers/ide/alim15x3.c
drivers/ide/amd74xx.c
drivers/ide/cs5530.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/ide/pmac.c
drivers/ide/sc1200.c
drivers/ide/sgiioc4.c
drivers/ieee1394/nodemgr.c
drivers/isdn/hardware/avm/b1isa.c
drivers/isdn/hysdn/hysdn_net.c
drivers/md/bitmap.c
drivers/md/dm-table.c
drivers/media/dvb/b2c2/Kconfig
drivers/media/dvb/b2c2/flexcop-fe-tuner.c
drivers/media/dvb/b2c2/flexcop-i2c.c
drivers/media/dvb/bt8xx/Kconfig
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/ttpci/Kconfig
drivers/media/video/compat_ioctl32.c
drivers/media/video/cx18/Kconfig
drivers/media/video/cx23885/Kconfig
drivers/media/video/cx88/Kconfig
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/gspca/gspca.c
drivers/media/video/pvrusb2/Kconfig
drivers/media/video/saa7134/Kconfig
drivers/message/fusion/mptscsih.c
drivers/message/i2o/i2o_block.c
drivers/message/i2o/iop.c
drivers/misc/sgi-gru/grufault.c
drivers/misc/sgi-gru/grufile.c
drivers/mtd/devices/m25p80.c
drivers/mtd/maps/physmap.c
drivers/mtd/nand/fsl_upm.c
drivers/mtd/nand/pasemi_nand.c
drivers/mtd/nand/pxa3xx_nand.c
drivers/mtd/onenand/omap2.c
drivers/net/Makefile
drivers/net/bnx2.c
drivers/net/bnx2.h
drivers/net/chelsio/sge.c
drivers/net/e1000e/ich8lan.c
drivers/net/e1000e/netdev.c
drivers/net/enc28j60.c
drivers/net/hp-plus.c
drivers/net/igb/igb_main.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/jme.h
drivers/net/macvlan.c
drivers/net/netx-eth.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/phy/mdio_bus.c
drivers/net/phy/phy_device.c
drivers/net/phy/vitesse.c
drivers/net/ppp_generic.c
drivers/net/pppol2tp.c
drivers/net/sis900.c
drivers/net/spider_net.c
drivers/net/starfire.c
drivers/net/sungem.c
drivers/net/tlan.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath5k/base.h
drivers/net/wireless/ath5k/debug.c
drivers/net/wireless/ath9k/beacon.c
drivers/net/wireless/ath9k/recv.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-sta.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/pci/hotplug/acpiphp.h
drivers/pci/hotplug/acpiphp_core.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/ibmphp_core.c
drivers/pci/hotplug/pciehp_core.c
drivers/pci/pcie/aer/aerdrv_core.c
drivers/pci/pcie/aspm.c
drivers/pci/quirks.c
drivers/pci/slot.c
drivers/pcmcia/bfin_cf_pcmcia.c
drivers/rtc/rtc-ds1672.c
drivers/rtc/rtc-isl1208.c
drivers/rtc/rtc-max6900.c
drivers/rtc/rtc-starfire.c
drivers/rtc/rtc-twl4030.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fc.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_scsi.c
drivers/scsi/aacraid/linit.c
drivers/scsi/device_handler/scsi_dh_hp_sw.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ibmvscsi/ibmvstgt.c
drivers/scsi/libiscsi.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/sd.c
drivers/scsi/sr.c
drivers/scsi/stex.c
drivers/serial/ioc3_serial.c
drivers/serial/mpc52xx_uart.c
drivers/serial/s3c2440.c
drivers/sh/maple/maple.c
drivers/staging/Kconfig
drivers/usb/class/usbtmc.c
drivers/usb/core/driver.c
drivers/usb/gadget/f_rndis.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/storage/unusual_devs.h
drivers/video/aty/radeon_accel.c
drivers/video/aty/radeon_backlight.c
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_pm.c
drivers/video/aty/radeonfb.h
drivers/video/console/fbcon.c
drivers/video/macfb.c
drivers/video/mb862xx/mb862xxfb.c
drivers/video/omap/omapfb_main.c
drivers/w1/w1_io.c
drivers/watchdog/hpwdt.c
drivers/watchdog/iTCO_vendor_support.c
drivers/watchdog/iTCO_wdt.c
drivers/watchdog/mtx-1_wdt.c
fs/9p/fid.c
fs/9p/v9fs.c
fs/9p/vfs_dentry.c
fs/9p/vfs_inode.c
fs/block_dev.c
fs/cifs/cifssmb.c
fs/exec.c
fs/exportfs/expfs.c
fs/ext4/balloc.c
fs/fcntl.c
fs/inotify.c
fs/ioctl.c
fs/lockd/host.c
fs/lockd/svc.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/ocfs2/ocfs2_fs.h
fs/ocfs2/xattr.c
fs/proc/base.c
fs/proc/task_mmu.c
fs/ubifs/commit.c
fs/ubifs/debug.c
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/journal.c
fs/ubifs/key.h
fs/ubifs/lpt_commit.c
fs/ubifs/orphan.c
fs/ubifs/recovery.c
fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/ubifs.h
fs/xfs/xfs_rename.c
include/acpi/acoutput.h
include/acpi/platform/aclinux.h
include/asm-generic/atomic.h
include/asm-generic/audit_write.h
include/asm-mn10300/uaccess.h
include/linux/audit.h
include/linux/blkdev.h
include/linux/can/core.h
include/linux/fs.h
include/linux/ftrace.h
include/linux/ide.h
include/linux/mfd/wm8350/audio.h
include/linux/netdevice.h
include/linux/netfilter/nfnetlink_conntrack.h
include/linux/netfilter/x_tables.h
include/linux/security.h
include/linux/smp.h
include/linux/usb/ch9.h
include/net/af_unix.h
include/net/irda/irda_device.h
include/net/request_sock.h
include/net/timewait_sock.h
include/scsi/scsi_transport_fc.h
include/sound/core.h
include/sound/l3.h [new file with mode: 0644]
include/sound/s3c24xx_uda134x.h [new file with mode: 0644]
include/sound/soc-dai.h [new file with mode: 0644]
include/sound/soc-dapm.h
include/sound/soc.h
include/sound/uda134x.h [new file with mode: 0644]
include/sound/version.h
include/video/radeon.h
kernel/audit.c
kernel/auditsc.c
kernel/cgroup.c
kernel/fork.c
kernel/latencytop.c
kernel/posix-cpu-timers.c
kernel/posix-timers.c
kernel/power/swap.c
kernel/relay.c
kernel/sched.c
kernel/sched_clock.c
kernel/softlockup.c
kernel/time/timekeeping.c
lib/dynamic_printk.c
lib/idr.c
lib/percpu_counter.c
mm/backing-dev.c
mm/migrate.c
mm/page_cgroup.c
mm/slob.c
mm/slub.c
mm/swap.c
mm/vmalloc.c
net/atm/svc.c
net/bluetooth/rfcomm/core.c
net/bridge/br_netfilter.c
net/can/af_can.c
net/can/bcm.c
net/core/netpoll.c
net/core/skbuff.c
net/core/sock.c
net/ipv4/netfilter/nf_nat_rule.c
net/ipv4/tcp_output.c
net/ipv4/tcp_vegas.c
net/ipv6/ndisc.c
net/mac80211/sta_info.c
net/mac80211/wext.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/xt_socket.c
net/netlabel/netlabel_unlabeled.c
net/phonet/pep-gprs.c
net/phonet/pn_dev.c
net/phonet/pn_netlink.c
net/rose/af_rose.c
net/sched/sch_netem.c
net/socket.c
net/sunrpc/svcsock.c
net/unix/af_unix.c
net/unix/garbage.c
net/wireless/reg.c
net/xfrm/xfrm_policy.c
sound/ac97_bus.c
sound/aoa/codecs/Makefile
sound/aoa/codecs/onyx.c [new file with mode: 0644]
sound/aoa/codecs/onyx.h [new file with mode: 0644]
sound/aoa/codecs/snd-aoa-codec-onyx.c [deleted file]
sound/aoa/codecs/snd-aoa-codec-onyx.h [deleted file]
sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h [deleted file]
sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h [deleted file]
sound/aoa/codecs/snd-aoa-codec-tas.c [deleted file]
sound/aoa/codecs/snd-aoa-codec-tas.h [deleted file]
sound/aoa/codecs/snd-aoa-codec-toonie.c [deleted file]
sound/aoa/codecs/tas-basstreble.h [new file with mode: 0644]
sound/aoa/codecs/tas-gain-table.h [new file with mode: 0644]
sound/aoa/codecs/tas.c [new file with mode: 0644]
sound/aoa/codecs/tas.h [new file with mode: 0644]
sound/aoa/codecs/toonie.c [new file with mode: 0644]
sound/aoa/core/Makefile
sound/aoa/core/alsa.c [new file with mode: 0644]
sound/aoa/core/alsa.h [new file with mode: 0644]
sound/aoa/core/core.c [new file with mode: 0644]
sound/aoa/core/gpio-feature.c [new file with mode: 0644]
sound/aoa/core/gpio-pmf.c [new file with mode: 0644]
sound/aoa/core/snd-aoa-alsa.c [deleted file]
sound/aoa/core/snd-aoa-alsa.h [deleted file]
sound/aoa/core/snd-aoa-core.c [deleted file]
sound/aoa/core/snd-aoa-gpio-feature.c [deleted file]
sound/aoa/core/snd-aoa-gpio-pmf.c [deleted file]
sound/aoa/fabrics/Makefile
sound/aoa/fabrics/layout.c [new file with mode: 0644]
sound/aoa/fabrics/snd-aoa-fabric-layout.c [deleted file]
sound/aoa/soundbus/i2sbus/Makefile
sound/aoa/soundbus/i2sbus/control.c [new file with mode: 0644]
sound/aoa/soundbus/i2sbus/core.c [new file with mode: 0644]
sound/aoa/soundbus/i2sbus/i2sbus-control.c [deleted file]
sound/aoa/soundbus/i2sbus/i2sbus-core.c [deleted file]
sound/aoa/soundbus/i2sbus/i2sbus-interface.h [deleted file]
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c [deleted file]
sound/aoa/soundbus/i2sbus/i2sbus.h
sound/aoa/soundbus/i2sbus/interface.h [new file with mode: 0644]
sound/aoa/soundbus/i2sbus/pcm.c [new file with mode: 0644]
sound/core/device.c
sound/core/rawmidi.c
sound/core/rtctimer.c
sound/core/timer.c
sound/drivers/Kconfig
sound/drivers/pcsp/pcsp.c
sound/drivers/pcsp/pcsp.h
sound/drivers/pcsp/pcsp_lib.c
sound/drivers/vx/vx_core.c
sound/drivers/vx/vx_pcm.c
sound/isa/sb/sb8.c
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_patch.c
sound/pci/ca0106/ca0106.h
sound/pci/ca0106/ca0106_main.c
sound/pci/ca0106/ca0106_mixer.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/emumixer.c
sound/pci/es1968.c
sound/pci/hda/patch_sigmatel.c
sound/pci/ice1712/ice1724.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/mixart/mixart_core.c
sound/pci/pcxhr/pcxhr.c
sound/pci/pcxhr/pcxhr_core.c
sound/pci/riptide/riptide.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
sound/ppc/pmac.c
sound/ppc/tumbler.c
sound/soc/Kconfig
sound/soc/Makefile
sound/soc/at32/Kconfig [deleted file]
sound/soc/at32/Makefile [deleted file]
sound/soc/at32/at32-pcm.c [deleted file]
sound/soc/at32/at32-pcm.h [deleted file]
sound/soc/at32/at32-ssc.c [deleted file]
sound/soc/at32/at32-ssc.h [deleted file]
sound/soc/at32/playpaq_wm8510.c [deleted file]
sound/soc/at91/Kconfig [deleted file]
sound/soc/at91/Makefile [deleted file]
sound/soc/at91/at91-pcm.c [deleted file]
sound/soc/at91/at91-pcm.h [deleted file]
sound/soc/at91/at91-ssc.c [deleted file]
sound/soc/at91/at91-ssc.h [deleted file]
sound/soc/atmel/Kconfig [new file with mode: 0644]
sound/soc/atmel/Makefile [new file with mode: 0644]
sound/soc/atmel/atmel-pcm.c [new file with mode: 0644]
sound/soc/atmel/atmel-pcm.h [new file with mode: 0644]
sound/soc/atmel/atmel_ssc_dai.c [new file with mode: 0644]
sound/soc/atmel/atmel_ssc_dai.h [new file with mode: 0644]
sound/soc/atmel/playpaq_wm8510.c [new file with mode: 0644]
sound/soc/atmel/sam9g20_wm8731.c [new file with mode: 0644]
sound/soc/au1x/dbdma2.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c
sound/soc/au1x/sample-ac97.c
sound/soc/blackfin/Kconfig
sound/soc/blackfin/bf5xx-ac97-pcm.c
sound/soc/blackfin/bf5xx-ac97.c
sound/soc/blackfin/bf5xx-ac97.h
sound/soc/blackfin/bf5xx-ad1980.c
sound/soc/blackfin/bf5xx-ad73311.c
sound/soc/blackfin/bf5xx-i2s-pcm.c
sound/soc/blackfin/bf5xx-i2s.c
sound/soc/blackfin/bf5xx-sport.h
sound/soc/blackfin/bf5xx-ssm2602.c
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/ac97.c
sound/soc/codecs/ad1980.c
sound/soc/codecs/ad73311.c
sound/soc/codecs/ak4535.c
sound/soc/codecs/cs4270.c
sound/soc/codecs/l3.c [new file with mode: 0644]
sound/soc/codecs/pcm3008.c [new file with mode: 0644]
sound/soc/codecs/pcm3008.h [new file with mode: 0644]
sound/soc/codecs/ssm2602.c
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.h
sound/soc/codecs/twl4030.c [new file with mode: 0644]
sound/soc/codecs/twl4030.h [new file with mode: 0644]
sound/soc/codecs/uda134x.c [new file with mode: 0644]
sound/soc/codecs/uda134x.h [new file with mode: 0644]
sound/soc/codecs/uda1380.c
sound/soc/codecs/wm8350.c [new file with mode: 0644]
sound/soc/codecs/wm8350.h [new file with mode: 0644]
sound/soc/codecs/wm8510.c
sound/soc/codecs/wm8580.c
sound/soc/codecs/wm8580.h
sound/soc/codecs/wm8728.c [new file with mode: 0644]
sound/soc/codecs/wm8728.h [new file with mode: 0644]
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8900.c
sound/soc/codecs/wm8900.h
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8903.h
sound/soc/codecs/wm8971.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8990.h
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c
sound/soc/davinci/Kconfig
sound/soc/davinci/Makefile
sound/soc/davinci/davinci-evm.c
sound/soc/davinci/davinci-i2s.c
sound/soc/davinci/davinci-pcm.c
sound/soc/davinci/davinci-sffsdr.c [new file with mode: 0644]
sound/soc/fsl/Kconfig
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/mpc5200_psc_i2s.c
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/fsl/soc-of-simple.c
sound/soc/omap/Kconfig
sound/soc/omap/Makefile
sound/soc/omap/n810.c
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-pcm.c
sound/soc/omap/omap2evm.c [new file with mode: 0644]
sound/soc/omap/omap3beagle.c [new file with mode: 0644]
sound/soc/omap/omap3pandora.c [new file with mode: 0644]
sound/soc/omap/osk5912.c
sound/soc/omap/overo.c [new file with mode: 0644]
sound/soc/omap/sdp3430.c [new file with mode: 0644]
sound/soc/pxa/Kconfig
sound/soc/pxa/Makefile
sound/soc/pxa/corgi.c
sound/soc/pxa/e800_wm9712.c
sound/soc/pxa/em-x270.c
sound/soc/pxa/palm27x.c [new file with mode: 0644]
sound/soc/pxa/poodle.c
sound/soc/pxa/pxa-ssp.c [new file with mode: 0644]
sound/soc/pxa/pxa-ssp.h [new file with mode: 0644]
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c
sound/soc/pxa/pxa2xx-pcm.c
sound/soc/pxa/spitz.c
sound/soc/pxa/tosa.c
sound/soc/pxa/zylonite.c [new file with mode: 0644]
sound/soc/s3c24xx/Kconfig
sound/soc/s3c24xx/Makefile
sound/soc/s3c24xx/ln2440sbc_alc650.c
sound/soc/s3c24xx/neo1973_wm8753.c
sound/soc/s3c24xx/s3c2412-i2s.c
sound/soc/s3c24xx/s3c2443-ac97.c
sound/soc/s3c24xx/s3c24xx-i2s.c
sound/soc/s3c24xx/s3c24xx-pcm.c
sound/soc/s3c24xx/s3c24xx_uda134x.c [new file with mode: 0644]
sound/soc/s3c24xx/smdk2443_wm9710.c
sound/soc/sh/dma-sh7760.c
sound/soc/sh/hac.c
sound/soc/sh/sh7760-ac97.c
sound/soc/sh/ssi.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c
sound/usb/caiaq/caiaq-control.c
sound/usb/caiaq/caiaq-device.c
sound/usb/usbmidi.c
sound/usb/usx2y/usb_stream.c

index d145ccca169a37aa3ff42b06c734d9068525d9d7..c7c7a114c78c795c702f8543c57c7558466a9a4b 100644 (file)
@@ -24,7 +24,7 @@ real bad - it changes the behaviour of all unaligned instructions in user
 space, and might cause programs to fail unexpectedly.
 
 To change the alignment trap behavior, simply echo a number into
-/proc/sys/debug/alignment.  The number is made up from various bits:
+/proc/cpu/alignment.  The number is made up from various bits:
 
 bit            behavior when set
 ---            -----------------
index e0f346d201edb70fae654c55f6be842c4465a5ff..c9115c1b672c6e9eadb9ce59c2c198fea024823c 100644 (file)
@@ -220,14 +220,17 @@ and is between 256 and 4096 characters. It is defined in the file
                        Bits in debug_level correspond to a level in
                        ACPI_DEBUG_PRINT statements, e.g.,
                            ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
-                       See Documentation/acpi/debug.txt for more information
-                       about debug layers and levels.
+                       The debug_level mask defaults to "info".  See
+                       Documentation/acpi/debug.txt for more information about
+                       debug layers and levels.
 
+                       Enable processor driver info messages:
+                           acpi.debug_layer=0x20000000
+                       Enable PCI/PCI interrupt routing info messages:
+                           acpi.debug_layer=0x400000
                        Enable AML "Debug" output, i.e., stores to the Debug
                        object while interpreting AML:
                            acpi.debug_layer=0xffffffff acpi.debug_level=0x2
-                       Enable PCI/PCI interrupt routing info messages:
-                           acpi.debug_layer=0x400000 acpi.debug_level=0x4
                        Enable all messages related to ACPI hardware:
                            acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
 
index f4f8b1c6c8ba45ba6ec351aa92c40e798024983c..23045b8b50f090ff806624c763fb2313c1ad9494 100644 (file)
@@ -149,7 +149,7 @@ static void do_test_timer(unsigned long data)
        int cpu;
 
        /* Increment the counters */
-       on_each_cpu(test_each, NULL, 0, 1);
+       on_each_cpu(test_each, NULL, 1);
        /* Read all the counters */
        printk("Counters read from CPU %d\n", smp_processor_id());
        for_each_online_cpu(cpu) {
index 3cd2ad958176c9e4f4969de00597ea55633d0c2c..394d7d378dc74daf6899621d2bca0c37cdd598cf 100644 (file)
@@ -1063,6 +1063,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 
        STAC9227/9228/9229/927x
          ref           Reference board
+         ref-no-jd     Reference board without HP/Mic jack detection
          3stack        D965 3stack
          5stack        D965 5stack + SPDIF
          dell-3stack   Dell Dimension E520
@@ -1076,6 +1077,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 
        STAC92HD73*
          ref           Reference board
+         no-jd         BIOS setup but without jack-detection
          dell-m6-amic  Dell desktops/laptops with analog mics
          dell-m6-dmic  Dell desktops/laptops with digital mics
          dell-m6       Dell desktops/laptops with both type of mics
index f370e7db86af6a970de14433523af4b1ca71d390..bab7711ce96311470a3eddb9a9500772b02a777e 100644 (file)
@@ -9,7 +9,7 @@ the audio subsystem with the kernel as a platform device and is represented by
 the following struct:-
 
 /* SoC machine */
-struct snd_soc_machine {
+struct snd_soc_card {
        char *name;
 
        int (*probe)(struct platform_device *pdev);
@@ -67,10 +67,10 @@ static struct snd_soc_dai_link corgi_dai = {
        .ops = &corgi_ops,
 };
 
-struct snd_soc_machine then sets up the machine with it's DAIs. e.g.
+struct snd_soc_card then sets up the machine with it's DAIs. e.g.
 
 /* corgi audio machine driver */
-static struct snd_soc_machine snd_soc_machine_corgi = {
+static struct snd_soc_card snd_soc_corgi = {
        .name = "Corgi",
        .dai_link = &corgi_dai,
        .num_links = 1,
@@ -90,7 +90,7 @@ static struct wm8731_setup_data corgi_wm8731_setup = {
 
 /* corgi audio subsystem */
 static struct snd_soc_device corgi_snd_devdata = {
-       .machine = &snd_soc_machine_corgi,
+       .machine = &snd_soc_corgi,
        .platform = &pxa2xx_soc_platform,
        .codec_dev = &soc_codec_dev_wm8731,
        .codec_data = &corgi_wm8731_setup,
index 9b22bd14c3481789ac126c34842002ef7093a72a..eac7df94d8e3b7a9367e47f0c74e690502969be7 100644 (file)
@@ -114,11 +114,11 @@ modules.
 Then you must load the gadget serial driver.  To load it as an
 ACM device (recommended for interoperability), do this:
 
-  modprobe g_serial use_acm=1
+  modprobe g_serial
 
 To load it as a vendor specific bulk in/out device, do this:
 
-  modprobe g_serial
+  modprobe g_serial use_acm=0
 
 This will also automatically load the underlying gadget peripheral
 controller driver.  This must be done each time you reboot the gadget
index 077e9032d0cda17b08be1e8f85b496f37cef6b85..fafcd47232600a1a80351fcd5dfc79492e6ce8e9 100644 (file)
@@ -49,8 +49,10 @@ it and 002/048 sometime later.
 
 These files can be read as binary data.  The binary data consists
 of first the device descriptor, then the descriptors for each
-configuration of the device.  That information is also shown in
-text form by the /proc/bus/usb/devices file, described later.
+configuration of the device.  Multi-byte fields in the device and
+configuration descriptors, but not other descriptors, are converted
+to host endianness by the kernel.  This information is also shown
+in text form by the /proc/bus/usb/devices file, described later.
 
 These files may also be used to write user-level drivers for the USB
 devices.  You would open the /proc/bus/usb/BBB/DDD file read/write,
index 2917ce4ffdc4f5df267bdc9b5f239a9679c2e6d4..270481906dc80d1b25a0c29f607ef55e83ae16be 100644 (file)
@@ -34,11 +34,12 @@ if usbmon is built into the kernel.
 Verify that bus sockets are present.
 
 # ls /sys/kernel/debug/usbmon
-0s  0t  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u
+0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u
 #
 
-Now you can choose to either use the sockets numbered '0' (to capture packets on
-all buses), and skip to step #3, or find the bus used by your device with step #2.
+Now you can choose to either use the socket '0u' (to capture packets on all
+buses), and skip to step #3, or find the bus used by your device with step #2.
+This allows to filter away annoying devices that talk continuously.
 
 2. Find which bus connects to the desired device
 
@@ -99,8 +100,9 @@ on the event type, but there is a set of words, common for all types.
 
 Here is the list of words, from left to right:
 
-- URB Tag. This is used to identify URBs is normally a kernel mode address
- of the URB structure in hexadecimal.
+- URB Tag. This is used to identify URBs, and is normally an in-kernel address
+  of the URB structure in hexadecimal, but can be a sequence number or any
+  other unique string, within reason.
 
 - Timestamp in microseconds, a decimal number. The timestamp's resolution
   depends on available clock, and so it can be much worse than a microsecond
index 618c1ef4a397502749b2d08a49e80806e99825d1..701025701514db7f85478f8711285d8d1768dce3 100644 (file)
@@ -779,6 +779,7 @@ ATM
 P:     Chas Williams
 M:     chas@cmf.nrl.navy.mil
 L:     linux-atm-general@lists.sourceforge.net (subscribers-only)
+L:     netdev@vger.kernel.org
 W:     http://linux-atm.sourceforge.net
 S:     Maintained
 
@@ -1526,10 +1527,10 @@ W:      http://ebtables.sourceforge.net/
 S:     Maintained
 
 ECRYPT FILE SYSTEM
-P:     Mike Halcrow, Phillip Hellewell
-M:     mhalcrow@us.ibm.com, phillip@hellewell.homeip.net
-L:     ecryptfs-devel@lists.sourceforge.net
-W:     http://ecryptfs.sourceforge.net/
+P:     Tyler Hicks, Dustin Kirkland
+M:     tyhicks@linux.vnet.ibm.com, kirkland@canonical.com
+L:     ecryptfs-devel@lists.launchpad.net
+W:     https://launchpad.net/ecryptfs
 S:     Supported
 
 EDAC-CORE
@@ -2190,9 +2191,9 @@ S:        Supported
 
 INOTIFY
 P:     John McCutchan
-M:     ttb@tentacle.dhs.org
+M:     john@johnmccutchan.com
 P:     Robert Love
-M:     rml@novell.com
+M:     rlove@rlove.org
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
@@ -3758,6 +3759,15 @@ M:       drzeus-sdhci@drzeus.cx
 L:     sdhci-devel@list.drzeus.cx
 S:     Maintained
 
+SECURITY SUBSYSTEM
+F:     security/
+P:     James Morris
+M:     jmorris@namei.org
+L:     linux-kernel@vger.kernel.org
+L:     linux-security-module@vger.kernel.org (suggested Cc:)
+T:     git kernel.org:pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
+S:     Supported
+
 SECURITY CONTACT
 P:     Security Officers
 M:     security@kernel.org
@@ -3967,7 +3977,7 @@ M:        tiwai@suse.de
 L:     alsa-devel@alsa-project.org (subscribers-only)
 S:     Maintained
 
-SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT
+SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
 P:     Liam Girdwood
 M:     lrg@slimlogic.co.uk
 P:     Mark Brown
@@ -4235,7 +4245,7 @@ M:        dedekind@infradead.org
 P:     Adrian Hunter
 M:     ext-adrian.hunter@nokia.com
 L:     linux-mtd@lists.infradead.org
-T:     git git://git.infradead.org/~dedekind/ubifs-2.6.git
+T:     git git://git.infradead.org/ubifs-2.6.git
 W:     http://www.linux-mtd.infradead.org/doc/ubifs.html
 S:     Maintained
 
@@ -4289,7 +4299,7 @@ P:        Artem Bityutskiy
 M:     dedekind@infradead.org
 W:     http://www.linux-mtd.infradead.org/
 L:     linux-mtd@lists.infradead.org
-T:     git git://git.infradead.org/~dedekind/ubi-2.6.git
+T:     git git://git.infradead.org/ubi-2.6.git
 S:     Maintained
 
 USB ACM DRIVER
@@ -4519,7 +4529,7 @@ S:        Maintained
 USB VIDEO CLASS
 P:     Laurent Pinchart
 M:     laurent.pinchart@skynet.be
-L:     linux-uvc-devel@lists.berlios.de
+L:     linux-uvc-devel@lists.berlios.de (subscribers-only)
 L:     video4linux-list@redhat.com
 W:     http://linux-uvc.berlios.de
 S:     Maintained
index 9a49960f7aadec390237249167aad3bedbe47604..71e98e9e6acd3fd69d868843a000e7d8fc0363f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 28
-EXTRAVERSION = -rc7
+EXTRAVERSION =
 NAME = Erotic Pickled Herring
 
 # *DOCUMENTATION*
index 47ccec95f3e867ce5141f7e0db7bdb7f2e57667d..ef12794c3c68f7f2d6be4ec3dcda643540ed091d 100644 (file)
@@ -630,7 +630,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
                return -ENOMEM;
 
        sachip->clk = clk_get(me, "SA1111_CLK");
-       if (!sachip->clk) {
+       if (IS_ERR(sachip->clk)) {
                ret = PTR_ERR(sachip->clk);
                goto err_free;
        }
index 9a1db20e032a07eb744aba50c1c60a28d0a0b381..63a481fbbed43ed12ecc9802ffc729a06e8d23c6 100644 (file)
@@ -237,6 +237,7 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
 #if __LINUX_ARM_ARCH__ < 5
 
 #include <asm-generic/bitops/ffz.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/fls.h>
 #include <asm-generic/bitops/ffs.h>
@@ -277,16 +278,19 @@ static inline int constant_fls(int x)
  * the clz instruction for much better code efficiency.
  */
 
-#define __fls(x) \
-       ( __builtin_constant_p(x) ? constant_fls(x) : \
-         ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
-
-/* Implement fls() in C so that 64-bit args are suitably truncated */
 static inline int fls(int x)
 {
-       return __fls(x);
+       int ret;
+
+       if (__builtin_constant_p(x))
+              return constant_fls(x);
+
+       asm("clz\t%0, %1" : "=r" (ret) : "r" (x) : "cc");
+               ret = 32 - ret;
+       return ret;
 }
 
+#define __fls(x) (fls(x) - 1)
 #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
 #define __ffs(x) (ffs(x) - 1)
 #define ffz(x) __ffs( ~(x) )
index 517a4d6ffc74b791691a3a2f65099bb6352e5e64..6ff33790f47b16d91054c4907edb09616a21f5d8 100644 (file)
@@ -23,7 +23,7 @@
 #include <asm/types.h>
 
 #ifdef __KERNEL__
-#define STACK_TOP      ((current->personality == PER_LINUX_32BIT) ? \
+#define STACK_TOP      ((current->personality & ADDR_LIMIT_32BIT) ? \
                         TASK_SIZE : TASK_SIZE_26)
 #define STACK_TOP_MAX  TASK_SIZE
 #endif
index c74f766ffc124406e56ab76918db8bdf4c1e30ec..23af3c972c9a7d202c0a71a340e29067d4ac8d74 100644 (file)
@@ -115,6 +115,8 @@ EXPORT_SYMBOL(__strnlen_user);
 EXPORT_SYMBOL(__strncpy_from_user);
 
 #ifdef CONFIG_MMU
+EXPORT_SYMBOL(copy_page);
+
 EXPORT_SYMBOL(__copy_from_user);
 EXPORT_SYMBOL(__copy_to_user);
 EXPORT_SYMBOL(__clear_user);
@@ -181,8 +183,6 @@ EXPORT_SYMBOL(_find_first_bit_be);
 EXPORT_SYMBOL(_find_next_bit_be);
 #endif
 
-EXPORT_SYMBOL(copy_page);
-
 #ifdef CONFIG_FUNCTION_TRACER
 EXPORT_SYMBOL(mcount);
 #endif
index 57e6874d0b809a21a27afe21d436fa8dca9046e9..79abc4ddc0cf602cf8ae77728fefd8d2080ea826 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/personality.h>
 #include <linux/kallsyms.h>
 #include <linux/delay.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
 
index b3bd8ca85118babd632c353c20cfec92fa811108..4c3e582f3d3cc37e7d4db3338d62828f84e10d93 100644 (file)
@@ -128,7 +128,7 @@ void __init omap1_map_common_io(void)
  * Common low-level hardware init for omap1. This should only get called from
  * board specific init.
  */
-void __init omap1_init_common_hw()
+void __init omap1_init_common_hw(void)
 {
        /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
         * on a Posted Write in the TIPB Bridge".
diff --git a/arch/arm/mach-pxa/include/mach/palmasoc.h b/arch/arm/mach-pxa/include/mach/palmasoc.h
new file mode 100644 (file)
index 0000000..6c4b1f7
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _INCLUDE_PALMASOC_H_
+#define _INCLUDE_PALMASOC_H_
+struct palm27x_asoc_info {
+       int     jack_gpio;
+};
+
+#ifdef CONFIG_SND_PXA2XX_SOC_PALM27X
+void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data);
+#else
+static inline void palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) {}
+#endif
+
+#endif
index 7b8842cfa5fce30753914f538a0d125d2d1a349d..31e6a7b6ad80d27f055b9ce49da0b7e036e06755 100644 (file)
@@ -12,9 +12,8 @@ extern void clear_reset_status(unsigned int mask);
 
 /**
  * init_gpio_reset() - register GPIO as reset generator
- *
- * @gpio - gpio nr
- * @output - set gpio as out/low instead of input during normal work
+ * @gpio: gpio nr
+ * @output: set gpio as out/low instead of input during normal work
  */
 extern int init_gpio_reset(int gpio, int output);
 
index 133e65d166b315b0e54aba959846a162643bc927..2d5884ce0435fb436a57bee6d314284b9101e87e 100644 (file)
@@ -70,6 +70,10 @@ static unsigned long ai_dword;
 static unsigned long ai_multi;
 static int ai_usermode;
 
+#define UM_WARN                (1 << 0)
+#define UM_FIXUP       (1 << 1)
+#define UM_SIGNAL      (1 << 2)
+
 #ifdef CONFIG_PROC_FS
 static const char *usermode_action[] = {
        "ignored",
@@ -754,7 +758,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
  user:
        ai_user += 1;
 
-       if (ai_usermode & 1)
+       if (ai_usermode & UM_WARN)
                printk("Alignment trap: %s (%d) PC=0x%08lx Instr=0x%0*lx "
                       "Address=0x%08lx FSR 0x%03x\n", current->comm,
                        task_pid_nr(current), instrptr,
@@ -762,10 +766,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
                        thumb_mode(regs) ? tinstr : instr,
                        addr, fsr);
 
-       if (ai_usermode & 2)
+       if (ai_usermode & UM_FIXUP)
                goto fixup;
 
-       if (ai_usermode & 4)
+       if (ai_usermode & UM_SIGNAL)
                force_sig(SIGBUS, current);
        else
                set_cr(cr_no_alignment);
@@ -796,6 +800,22 @@ static int __init alignment_init(void)
        res->write_proc = proc_alignment_write;
 #endif
 
+       /*
+        * ARMv6 and later CPUs can perform unaligned accesses for
+        * most single load and store instructions up to word size.
+        * LDM, STM, LDRD and STRD still need to be handled.
+        *
+        * Ignoring the alignment fault is not an option on these
+        * CPUs since we spin re-faulting the instruction without
+        * making any progress.
+        */
+       if (cpu_architecture() >= CPU_ARCH_ARMv6 && (cr_alignment & CR_U)) {
+               cr_alignment &= ~CR_A;
+               cr_no_alignment &= ~CR_A;
+               set_cr(cr_alignment);
+               ai_usermode = UM_FIXUP;
+       }
+
        hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
        hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
 
index 2df8d9facf5741c060bb9f028c93b7c3bbe33a6e..22c9530e91e2fd8568fa78e1e5aec95ed7a72a24 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/signal.h>
 #include <linux/mm.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/kprobes.h>
 #include <linux/uaccess.h>
index ec67fb428607c55ba7d4e452db241cd048e7028c..7b74d1255e0b93c7531e607a77188a148bda980b 100644 (file)
@@ -353,8 +353,8 @@ struct omapfb_device {
        u32                     pseudo_palette[17];
 
        struct lcd_panel        *panel;                 /* LCD panel */
-       struct lcd_ctrl         *ctrl;                  /* LCD controller */
-       struct lcd_ctrl         *int_ctrl;              /* internal LCD ctrl */
+       const struct lcd_ctrl   *ctrl;                  /* LCD controller */
+       const struct lcd_ctrl   *int_ctrl;              /* internal LCD ctrl */
        struct lcd_ctrl_extif   *ext_if;                /* LCD ctrl external
                                                           interface */
        struct device           *dev;
index 9f9a921829c00686f5b8a658c89bef8e084558d0..dcd9d16da2e9f5f0df6e36484e09edaed84139e9 100644 (file)
@@ -255,7 +255,7 @@ void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
        if (!_omap_sram_reprogram_clock)
                omap_sram_error();
 
-       return _omap_sram_reprogram_clock(dpllctl, ckctl);
+       _omap_sram_reprogram_clock(dpllctl, ckctl);
 }
 
 int __init omap1_sram_init(void)
@@ -282,8 +282,8 @@ void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
        if (!_omap2_sram_ddr_init)
                omap_sram_error();
 
-       return _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl,
-                                   base_cs, force_unlock);
+       _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl,
+                            base_cs, force_unlock);
 }
 
 static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val,
@@ -294,7 +294,7 @@ void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type)
        if (!_omap2_sram_reprogram_sdrc)
                omap_sram_error();
 
-       return _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type);
+       _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type);
 }
 
 static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
index 883902fead8928f9ff24cdfd781fa28b3013470c..d41d41d78ad98676dea41aeb6466fb1ebf2bb811 100644 (file)
@@ -35,7 +35,7 @@
 #define  PCIE_CONF_REG(r)              ((((r) & 0xf00) << 16) | ((r) & 0xfc))
 #define  PCIE_CONF_BUS(b)              (((b) & 0xff) << 16)
 #define  PCIE_CONF_DEV(d)              (((d) & 0x1f) << 11)
-#define  PCIE_CONF_FUNC(f)             (((f) & 0x3) << 8)
+#define  PCIE_CONF_FUNC(f)             (((f) & 0x7) << 8)
 #define PCIE_CONF_DATA_OFF     0x18fc
 #define PCIE_MASK_OFF          0x1910
 #define PCIE_CTRL_OFF          0x1a00
index 5f139b7cb5f7c0aeb22d7b9b2cdba3b3682702f1..604bbd5e41d9b6c6c98dd7ceec835a345e1b22fd 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 
-#include <asm/arch/smc.h>
+#include <mach/smc.h>
 
 static struct smc_timing flash_timing __initdata = {
        .ncs_read_setup         = 0,
index 7538f3d2b9e0742a4a5647cc37a5b1fa7f6e611d..1ee4faf0742dba057a8dd6db0eb589e9758d5936 100644 (file)
 
 #include <asm/setup.h>
 
-#include <asm/arch/at32ap700x.h>
-#include <asm/arch/init.h>
-#include <asm/arch/board.h>
-#include <asm/arch/portmux.h>
+#include <mach/at32ap700x.h>
+#include <mach/init.h>
+#include <mach/board.h>
+#include <mach/portmux.h>
 
 /* Oscillator frequencies. These are board-specific */
 unsigned long at32_board_osc_rates[3] = {
index 219720a47bf93772c77d8a57787fe46812bbb006..1848bf0d7f62642568356ded4833102e91724216 100644 (file)
@@ -10,7 +10,7 @@ MKIMAGE               := $(srctree)/scripts/mkuboot.sh
 
 extra-y                := vmlinux.bin vmlinux.gz
 
-OBJCOPYFLAGS_vmlinux.bin := -O binary
+OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note.gnu.build-id
 $(obj)/vmlinux.bin: vmlinux FORCE
        $(call if_changed,objcopy)
 
index 8b6e54c9946aa835c1afb055350b8c3d166f839c..6c45a3b77aa3a877dc327ae0b978c7b42cae2d07 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc1
-# Tue Aug  5 15:40:26 2008
+# Linux kernel version: 2.6.28-rc8
+# Thu Dec 18 11:22:23 2008
 #
 CONFIG_AVR32=y
 CONFIG_GENERIC_GPIO=y
@@ -67,6 +67,7 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
@@ -77,15 +78,8 @@ CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
 CONFIG_HAVE_OPROFILE=y
 CONFIG_KPROBES=y
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
 CONFIG_HAVE_KPROBES=y
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
 CONFIG_HAVE_CLK=y
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -118,6 +112,7 @@ CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="cfq"
 CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
 
 #
 # System Type and features
@@ -134,6 +129,8 @@ CONFIG_CPU_AT32AP700X=y
 CONFIG_CPU_AT32AP7000=y
 CONFIG_BOARD_ATSTK1000=y
 # CONFIG_BOARD_ATNGW100 is not set
+# CONFIG_BOARD_FAVR_32 is not set
+# CONFIG_BOARD_MIMC200 is not set
 # CONFIG_BOARD_ATSTK1002 is not set
 # CONFIG_BOARD_ATSTK1003 is not set
 # CONFIG_BOARD_ATSTK1004 is not set
@@ -171,14 +168,14 @@ CONFIG_FLATMEM_MANUAL=y
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
 CONFIG_NR_QUICK=2
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 # CONFIG_OWNERSHIP_TRACE is not set
 CONFIG_NMI_DEBUGGING=y
 # CONFIG_HZ_100 is not set
@@ -186,7 +183,7 @@ CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
-# CONFIG_SCHED_HRTICK is not set
+CONFIG_SCHED_HRTICK=y
 CONFIG_CMDLINE=""
 
 #
@@ -228,6 +225,8 @@ CONFIG_CPU_FREQ_AT32AP=y
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+# CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 
@@ -299,6 +298,7 @@ CONFIG_IPV6_TUNNEL=m
 # CONFIG_ATM is not set
 CONFIG_STP=m
 CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -321,14 +321,8 @@ CONFIG_LLC=m
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-# CONFIG_WIRELESS_EXT is not set
-# CONFIG_MAC80211 is not set
-# CONFIG_IEEE80211 is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -359,6 +353,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_HAVE_MTD_OTP=y
 CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
@@ -407,6 +402,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # Self-contained MTD device drivers
 #
 CONFIG_MTD_DATAFLASH=m
+# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
+CONFIG_MTD_DATAFLASH_OTP=y
 CONFIG_MTD_M25P80=m
 CONFIG_M25PXX_USE_FAST_READ=y
 # CONFIG_MTD_SLRAM is not set
@@ -464,9 +461,10 @@ CONFIG_ATMEL_TCLIB=y
 CONFIG_ATMEL_TCB_CLKSRC=y
 CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
 # CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ICS932S401 is not set
 CONFIG_ATMEL_SSC=m
 # CONFIG_ENCLOSURE_SERVICES is not set
-# CONFIG_HAVE_IDE is not set
+# CONFIG_C2PORT is not set
 
 #
 # SCSI device support
@@ -548,6 +546,9 @@ CONFIG_MACB=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -653,6 +654,7 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_I2C=m
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_ALGOBIT=m
 
 #
@@ -716,6 +718,10 @@ CONFIG_GPIOLIB=y
 # CONFIG_DEBUG_GPIO is not set
 CONFIG_GPIO_SYSFS=y
 
+#
+# Memory mapped GPIO expanders:
+#
+
 #
 # I2C GPIO expanders:
 #
@@ -745,11 +751,11 @@ CONFIG_WATCHDOG=y
 #
 # CONFIG_SOFT_WATCHDOG is not set
 CONFIG_AT32AP700X_WDT=y
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -758,6 +764,10 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -783,6 +793,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -804,10 +815,13 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_ATMEL=y
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_LTV350QV=y
 # CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_TDO24M is not set
 # CONFIG_LCD_VGG2432A4 is not set
 # CONFIG_LCD_PLATFORM is not set
 # CONFIG_BACKLIGHT_CLASS_DEVICE is not set
@@ -818,6 +832,7 @@ CONFIG_LCD_LTV350QV=y
 # CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_LOGO is not set
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_SND=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
@@ -848,28 +863,32 @@ CONFIG_USB_SUPPORT=y
 # CONFIG_USB_ARCH_HAS_EHCI is not set
 # CONFIG_USB_OTG_WHITELIST is not set
 # CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 CONFIG_USB_GADGET=y
 # CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
 # CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
 CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_AT91 is not set
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_ATMEL_USBA=y
 # CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_PXA27X is not set
-# CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_LH7A40X is not set
 # CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
 # CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_ZERO=m
@@ -887,7 +906,7 @@ CONFIG_MMC=y
 # CONFIG_MMC_UNSAFE_RESUME is not set
 
 #
-# MMC/SD Card Drivers
+# MMC/SD/SDIO Card Drivers
 #
 CONFIG_MMC_BLOCK=y
 CONFIG_MMC_BLOCK_BOUNCE=y
@@ -895,10 +914,11 @@ CONFIG_MMC_BLOCK_BOUNCE=y
 # CONFIG_MMC_TEST is not set
 
 #
-# MMC/SD Host Controller Drivers
+# MMC/SD/SDIO Host Controller Drivers
 #
 # CONFIG_MMC_SDHCI is not set
 CONFIG_MMC_ATMELMCI=y
+# CONFIG_MMC_ATMELMCI_DMA is not set
 CONFIG_MMC_SPI=m
 # CONFIG_MEMSTICK is not set
 CONFIG_NEW_LEDS=y
@@ -918,6 +938,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
 # CONFIG_ACCESSIBILITY is not set
 CONFIG_RTC_LIB=y
@@ -950,25 +971,31 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_M41T80 is not set
 # CONFIG_RTC_DRV_S35390A is not set
 # CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
 
 #
 # SPI RTC drivers
 #
 # CONFIG_RTC_DRV_M41T94 is not set
 # CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
 # CONFIG_RTC_DRV_MAX6902 is not set
 # CONFIG_RTC_DRV_R9701 is not set
 # CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
 
 #
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_DS1286 is not set
 # CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
 # CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
 #
@@ -989,6 +1016,8 @@ CONFIG_DMA_ENGINE=y
 # CONFIG_NET_DMA is not set
 CONFIG_DMATEST=m
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -998,12 +1027,17 @@ CONFIG_EXT2_FS=m
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=m
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+CONFIG_EXT4_FS=m
+CONFIG_EXT4DEV_COMPAT=y
+# CONFIG_EXT4_FS_XATTR is not set
 CONFIG_JBD=m
 # CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+# CONFIG_JBD2_DEBUG is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_DNOTIFY is not set
@@ -1036,6 +1070,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -1054,7 +1089,8 @@ CONFIG_TMPFS=y
 # CONFIG_EFS_FS is not set
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
-# CONFIG_JFFS2_FS_WRITEBUFFER is not set
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
 # CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
@@ -1088,6 +1124,7 @@ CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1185,10 +1222,21 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_FRAME_POINTER=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 # CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 # CONFIG_LKDTM is not set
 # CONFIG_FAULT_INJECTION is not set
+
+#
+# Tracers
+#
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1196,17 +1244,26 @@ CONFIG_FRAME_POINTER=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 
 #
 # Crypto core or helper
 #
+CONFIG_CRYPTO_FIPS=y
 CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
 CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
@@ -1257,7 +1314,7 @@ CONFIG_CRYPTO_SHA1=m
 #
 # Ciphers
 #
-# CONFIG_CRYPTO_AES is not set
+CONFIG_CRYPTO_AES=m
 # CONFIG_CRYPTO_ANUBIS is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
@@ -1278,14 +1335,17 @@ CONFIG_CRYPTO_DES=m
 #
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=m
index 0c6e02f80a31ce6cd562aa2147d0144a3e89b913..066252eebf614e98ffb96c1c58705cbb9e35840b 100644 (file)
@@ -967,28 +967,28 @@ static inline void configure_usart0_pins(void)
 {
        u32 pin_mask = (1 << 8) | (1 << 9); /* RXD & TXD */
 
-       select_peripheral(PIOA, pin_mask, PERIPH_B, 0);
+       select_peripheral(PIOA, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
 }
 
 static inline void configure_usart1_pins(void)
 {
        u32 pin_mask = (1 << 17) | (1 << 18); /* RXD & TXD */
 
-       select_peripheral(PIOA, pin_mask, PERIPH_A, 0);
+       select_peripheral(PIOA, pin_mask, PERIPH_A, AT32_GPIOF_PULLUP);
 }
 
 static inline void configure_usart2_pins(void)
 {
        u32 pin_mask = (1 << 26) | (1 << 27); /* RXD & TXD */
 
-       select_peripheral(PIOB, pin_mask, PERIPH_B, 0);
+       select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
 }
 
 static inline void configure_usart3_pins(void)
 {
        u32 pin_mask = (1 << 18) | (1 << 17); /* RXD & TXD */
 
-       select_peripheral(PIOB, pin_mask, PERIPH_B, 0);
+       select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP);
 }
 
 static struct platform_device *__initdata at32_usarts[4];
index e05f9e1d3faaa7d0d1449d60766f4c7efb18f231..27eb67604c53bf2915dd725691a447dcd2f19903 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc1
-# Mon Aug  4 15:38:01 2008
+# Linux kernel version: 2.6.28-rc7
+# Mon Dec  8 08:12:07 2008
 #
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -26,6 +26,7 @@ CONFIG_LOG_BUF_SHIFT=20
 CONFIG_CGROUPS=y
 # CONFIG_CGROUP_DEBUG is not set
 # CONFIG_CGROUP_NS is not set
+# CONFIG_CGROUP_FREEZER is not set
 # CONFIG_CGROUP_DEVICE is not set
 CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
@@ -46,7 +47,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
-CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -63,7 +63,9 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
 CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
@@ -72,15 +74,11 @@ CONFIG_SLUB=y
 # CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
+CONFIG_HAVE_ARCH_TRACEHOOK=y
 CONFIG_HAVE_DMA_ATTRS=y
 CONFIG_USE_GENERIC_SMP_HELPERS=y
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -113,6 +111,7 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Processor type and features
@@ -125,8 +124,6 @@ CONFIG_MMU=y
 CONFIG_SWIOTLB=y
 CONFIG_IOMMU_HELPER=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -139,13 +136,16 @@ CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_IA64_UNCACHED_ALLOCATOR=y
 CONFIG_AUDIT_ARCH=y
+# CONFIG_PARAVIRT_GUEST is not set
 CONFIG_IA64_GENERIC=y
 # CONFIG_IA64_DIG is not set
+# CONFIG_IA64_DIG_VTD is not set
 # CONFIG_IA64_HP_ZX1 is not set
 # CONFIG_IA64_HP_ZX1_SWIOTLB is not set
 # CONFIG_IA64_SGI_SN2 is not set
 # CONFIG_IA64_SGI_UV is not set
 # CONFIG_IA64_HP_SIM is not set
+# CONFIG_IA64_XEN_GUEST is not set
 # CONFIG_ITANIUM is not set
 CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_4KB is not set
@@ -182,16 +182,17 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
+CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_NR_QUICK=1
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 CONFIG_MMU_NOTIFIER=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
@@ -231,12 +232,12 @@ CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
 CONFIG_DMIID=y
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=m
 
-# CONFIG_DMAR is not set
-
 #
-# Power management and ACPI
+# Power management and ACPI options
 #
 CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
@@ -248,7 +249,6 @@ CONFIG_ACPI_PROC_EVENT=y
 CONFIG_ACPI_BUTTON=m
 CONFIG_ACPI_FAN=m
 CONFIG_ACPI_DOCK=y
-# CONFIG_ACPI_BAY is not set
 CONFIG_ACPI_PROCESSOR=m
 CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_THERMAL=m
@@ -256,9 +256,7 @@ CONFIG_ACPI_NUMA=y
 # CONFIG_ACPI_CUSTOM_DSDT is not set
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
-CONFIG_ACPI_EC=y
 # CONFIG_ACPI_PCI_SLOT is not set
-CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 CONFIG_ACPI_CONTAINER=m
 
@@ -275,7 +273,7 @@ CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
-# CONFIG_PCI_MSI is not set
+CONFIG_PCI_MSI=y
 CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
 CONFIG_HOTPLUG_PCI=m
@@ -286,6 +284,7 @@ CONFIG_HOTPLUG_PCI_ACPI=m
 # CONFIG_HOTPLUG_PCI_SHPC is not set
 # CONFIG_HOTPLUG_PCI_SGI is not set
 # CONFIG_PCCARD is not set
+CONFIG_DMAR=y
 CONFIG_NET=y
 
 #
@@ -333,6 +332,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
@@ -353,11 +353,10 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
 # CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
 # CONFIG_WIRELESS_EXT is not set
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
@@ -385,7 +384,7 @@ CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
 # CONFIG_PARPORT is not set
 CONFIG_PNP=y
-# CONFIG_PNP_DEBUG is not set
+# CONFIG_PNP_DEBUG_MESSAGES is not set
 
 #
 # Protocols
@@ -419,10 +418,9 @@ CONFIG_SGI_XP=m
 # CONFIG_HP_ILO is not set
 CONFIG_SGI_GRU=m
 # CONFIG_SGI_GRU_DEBUG is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_IDE_MAX_HWIFS=4
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
@@ -430,12 +428,12 @@ CONFIG_BLK_DEV_IDE=y
 CONFIG_IDE_TIMINGS=y
 CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=y
 CONFIG_BLK_DEV_IDESCSI=m
 # CONFIG_BLK_DEV_IDEACPI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
@@ -705,6 +703,9 @@ CONFIG_TULIP=m
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
@@ -725,11 +726,11 @@ CONFIG_E100=m
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 CONFIG_E1000=y
-# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
 # CONFIG_E1000E is not set
 # CONFIG_IP1000 is not set
 CONFIG_IGB=y
@@ -747,18 +748,22 @@ CONFIG_TIGON3=y
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
 # CONFIG_ATL1E is not set
+# CONFIG_JME is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_ENIC is not set
 # CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
 # CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
 # CONFIG_SFC is not set
 # CONFIG_TR is not set
 
@@ -826,9 +831,11 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
 # CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
@@ -942,15 +949,16 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_VT8231 is not set
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_SENSORS_LIS3LV02D is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 CONFIG_THERMAL=m
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -959,6 +967,8 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -1009,6 +1019,7 @@ CONFIG_VGA_CONSOLE=y
 # CONFIG_VGACON_SOFT_SCROLLBACK is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_SND=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
@@ -1113,8 +1124,7 @@ CONFIG_HID=y
 # USB Input Devices
 #
 CONFIG_USB_HID=m
-# CONFIG_USB_HIDINPUT_POWERBOOK is not set
-# CONFIG_HID_FF is not set
+# CONFIG_HID_PID is not set
 # CONFIG_USB_HIDDEV is not set
 
 #
@@ -1122,6 +1132,34 @@ CONFIG_USB_HID=m
 #
 # CONFIG_USB_KBD is not set
 # CONFIG_USB_MOUSE is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=m
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+CONFIG_HID_BRIGHT=m
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DELL=m
+CONFIG_HID_EZKEY=m
+CONFIG_HID_GYRATION=m
+CONFIG_HID_LOGITECH=m
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=m
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_PANTHERLORD=m
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+CONFIG_HID_SUNPLUS=m
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1138,6 +1176,9 @@ CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_SUSPEND is not set
 # CONFIG_USB_OTG is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
 
 #
 # USB Host Controller Drivers
@@ -1155,6 +1196,12 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 CONFIG_USB_UHCI_HCD=m
 # CONFIG_USB_SL811_HCD is not set
 # CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
 
 #
 # USB Device Class drivers
@@ -1162,13 +1209,14 @@ CONFIG_USB_UHCI_HCD=m
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
 # CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -1191,7 +1239,6 @@ CONFIG_USB_STORAGE=m
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-CONFIG_USB_MON=y
 
 #
 # USB port drivers
@@ -1204,7 +1251,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
 # CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_SEVSEG is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
@@ -1222,7 +1269,9 @@ CONFIG_USB_MON=y
 # CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 # CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
 # CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
@@ -1246,6 +1295,15 @@ CONFIG_INFINIBAND_IPOIB_DEBUG=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
+
+#
+# HP Simulator drivers
+#
+# CONFIG_HP_SIMETH is not set
+# CONFIG_HP_SIMSERIAL is not set
+# CONFIG_HP_SIMSCSI is not set
 CONFIG_MSPEC=m
 
 #
@@ -1260,7 +1318,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
 CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=y
@@ -1271,6 +1329,7 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
 CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=y
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -1282,8 +1341,8 @@ CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
-CONFIG_AUTOFS4_FS=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
 # CONFIG_FUSE_FS is not set
 
 #
@@ -1314,6 +1373,7 @@ CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_VMCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -1356,6 +1416,7 @@ CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
 CONFIG_SUNRPC_XPRT_RDMA=m
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1433,38 +1494,6 @@ CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
 # CONFIG_DLM is not set
-CONFIG_HAVE_KVM=y
-CONFIG_VIRTUALIZATION=y
-# CONFIG_KVM is not set
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-CONFIG_CRC_T10DIF=y
-CONFIG_CRC_ITU_T=m
-CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_PLIST=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_GENERIC_PENDING_IRQ=y
-CONFIG_IRQ_PER_CPU=y
-
-#
-# HP Simulator drivers
-#
-# CONFIG_HP_SIMETH is not set
-# CONFIG_HP_SIMSERIAL is not set
-# CONFIG_HP_SIMSCSI is not set
 
 #
 # Kernel hacking
@@ -1503,8 +1532,19 @@ CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 # CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 # CONFIG_FAULT_INJECTION is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
@@ -1519,14 +1559,19 @@ CONFIG_SYSVIPC_COMPAT=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_RNG=m
 CONFIG_CRYPTO_MANAGER=m
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
@@ -1599,5 +1644,36 @@ CONFIG_CRYPTO_DES=m
 #
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_HW=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
+CONFIG_HAVE_KVM=y
+CONFIG_VIRTUALIZATION=y
+# CONFIG_KVM is not set
+# CONFIG_VIRTIO_PCI is not set
+# CONFIG_VIRTIO_BALLOON is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_IRQ_PER_CPU=y
index f92306bbedb848eb146ece3afde7729abdddac13..8d513a8c5266b4db31ef1cb6fd6eb75777c7dda3 100644 (file)
@@ -4,6 +4,7 @@ menu "HP Simulator drivers"
 
 config HP_SIMETH
        bool "Simulated Ethernet "
+       depends on NET
 
 config HP_SIMSERIAL
        bool "Simulated serial driver support"
index 0b597424fcfcfd825e8f72bde2d3290fd218e75f..33c8e55f5775f7e12330ffe8e37e61568f937f00 100644 (file)
@@ -83,7 +83,6 @@ extern unsigned long ia64_native_getreg_func(int regnum);
 #define paravirt_getreg(reg)                                   \
        ({                                                      \
                unsigned long res;                              \
-               BUILD_BUG_ON(!__builtin_constant_p(reg));       \
                if ((reg) == _IA64_REG_IP)                      \
                        res = ia64_native_getreg(_IA64_REG_IP); \
                else                                            \
index 26228e2d01ae472bcab1e5917b0c973d826f6f3a..c75b914f2d6bb587c413990663e864f573c9368a 100644 (file)
@@ -53,10 +53,12 @@ int __ref arch_register_cpu(int num)
 }
 EXPORT_SYMBOL(arch_register_cpu);
 
-void arch_unregister_cpu(int num)
+void __ref arch_unregister_cpu(int num)
 {
        unregister_cpu(&sysfs_cpus[num].cpu);
+#ifdef CONFIG_ACPI
        unmap_cpu_from_node(num, cpu_to_node(num));
+#endif
 }
 EXPORT_SYMBOL(arch_unregister_cpu);
 #else
index 3ab4d6d507045379fc139836e2091560e4483a5a..92cef66ca268b8631db5b3b72b9887cb8f7dc446 100644 (file)
@@ -58,7 +58,7 @@ endif
 kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o
 obj-$(CONFIG_KVM) += kvm.o
 
-EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
+CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
 kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
        vtlb.o process.o
 #Add link memcpy and memset to avoid possible structure assignment error
index 634abad979b5143953e6eae5191eff3b4a673bc1..32254ce9a1bda61a25f3edce6143206a7d651aa1 100644 (file)
@@ -107,10 +107,10 @@ END(kvm_vps_resume_normal)
 GLOBAL_ENTRY(kvm_vps_resume_handler)
        movl r30 = PAL_VPS_RESUME_HANDLER
        ;;
-       ld8 r27=[r25]
+       ld8 r26=[r25]
        shr r17=r17,IA64_ISR_IR_BIT
        ;;
-       dep r27=r17,r27,63,1   // bit 63 of r27 indicate whether enable CFLE
+       dep r26=r17,r26,63,1   // bit 63 of r26 indicate whether enable CFLE
        mov pr=r23,-2
        br.sptk.many kvm_vps_entry
 END(kvm_vps_resume_handler)
@@ -894,12 +894,15 @@ ENTRY(kvm_resume_to_guest)
        ;;
        ld8 r19=[r19]
        mov b0=r29
-       cmp.ne p6,p7 = r0,r0
+       mov r27=cr.isr
        ;;
-       tbit.z p6,p7 = r19,IA64_PSR_IC_BIT              // p1=vpsr.ic
+       tbit.z p6,p7 = r19,IA64_PSR_IC_BIT              // p7=vpsr.ic
+       shr r27=r27,IA64_ISR_IR_BIT
        ;;
        (p6) ld8 r26=[r25]
        (p7) mov b0=r28
+       ;;
+       (p6) dep r26=r27,r26,63,1
        mov pr=r31,-2
        br.sptk.many b0             // call pal service
        ;;
index 96c31b4180c349b00b400c73daf670227f957051..0c66dbdd1d728d0cd826b865a0d0ffe0cdd8b2cc 100644 (file)
@@ -5,7 +5,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2007 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2008 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 #include <linux/irq.h>
@@ -375,6 +375,7 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info)
        int cpu = nasid_slice_to_cpuid(nasid, slice);
 #ifdef CONFIG_SMP
        int cpuphys;
+       irq_desc_t *desc;
 #endif
 
        pci_dev_get(pci_dev);
@@ -391,6 +392,12 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info)
 #ifdef CONFIG_SMP
        cpuphys = cpu_physical_id(cpu);
        set_irq_affinity_info(sn_irq_info->irq_irq, cpuphys, 0);
+       desc = irq_to_desc(sn_irq_info->irq_irq);
+       /*
+        * Affinity was set by the PROM, prevent it from
+        * being reset by the request_irq() path.
+        */
+       desc->status |= IRQ_AFFINITY_SET;
 #endif
 }
 
index bb1d249296408d3def799a759ee48e5b0b415378..02c5b8a9fb6061037e8c35551a4881198cf1d4fc 100644 (file)
@@ -200,7 +200,7 @@ static int __cpuinitdata shub_1_1_found;
  * Set flag for enabling shub specific wars
  */
 
-static inline int __init is_shub_1_1(int nasid)
+static inline int __cpuinit is_shub_1_1(int nasid)
 {
        unsigned long id;
        int rev;
@@ -212,7 +212,7 @@ static inline int __init is_shub_1_1(int nasid)
        return rev <= 2;
 }
 
-static void __init sn_check_for_wars(void)
+static void __cpuinit sn_check_for_wars(void)
 {
        int cnode;
 
@@ -512,7 +512,6 @@ static void __init sn_init_pdas(char **cmdline_p)
        for_each_online_node(cnode) {
                nodepdaindr[cnode] =
                    alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
-               memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
                memset(nodepdaindr[cnode]->phys_cpuid, -1,
                    sizeof(nodepdaindr[cnode]->phys_cpuid));
                spin_lock_init(&nodepdaindr[cnode]->ptc_lock);
@@ -521,11 +520,9 @@ static void __init sn_init_pdas(char **cmdline_p)
        /*
         * Allocate & initialize nodepda for TIOs.  For now, put them on node 0.
         */
-       for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++) {
+       for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++)
                nodepdaindr[cnode] =
                    alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
-               memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
-       }
 
        /*
         * Now copy the array of nodepda pointers to each nodepda.
index 8bd61a640fc9dde53b4e92f5e9efe53fbd6d5507..23597beb66c118cc6e569952b605a2e6af3f7825 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:00 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:42 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 CONFIG_AMIGA=y
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -148,19 +138,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_ZORRO=y
@@ -212,7 +204,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -262,13 +253,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -282,19 +274,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -302,20 +297,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -323,8 +318,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -337,9 +332,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -351,16 +346,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -387,6 +382,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -410,19 +406,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -470,21 +455,20 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
-CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=m
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -609,8 +593,12 @@ CONFIG_APNE=m
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_NET_PCI is not set
 # CONFIG_B44 is not set
+# CONFIG_CS89x0 is not set
 # CONFIG_NET_POCKET is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -763,11 +751,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -777,6 +765,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -802,6 +791,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -829,6 +819,8 @@ CONFIG_FB_FM2=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -852,12 +844,19 @@ CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_DMASOUND_PAULA=m
 CONFIG_DMASOUND=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -867,6 +866,8 @@ CONFIG_HIDRAW=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -883,8 +884,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -895,6 +897,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -906,6 +909,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -944,6 +948,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -986,6 +991,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1059,7 +1065,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1067,6 +1079,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -1077,10 +1090,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1154,14 +1169,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index c41b854c028425fda2c4ffda83f892c78038de98..935108d115a05d96210f3e6663426ccc25798034 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:01 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:43 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -148,19 +138,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_HEARTBEAT=y
@@ -210,7 +202,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -260,13 +251,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -280,19 +272,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -300,20 +295,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -321,8 +316,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -335,9 +330,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -349,16 +344,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -385,6 +380,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -408,19 +404,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -458,6 +443,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -540,6 +526,9 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -609,6 +598,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -663,11 +653,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -677,6 +667,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -702,6 +693,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 # CONFIG_FB_CFB_COPYAREA is not set
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -724,6 +716,8 @@ CONFIG_FB_APOLLO=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -750,6 +744,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -758,6 +758,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -773,8 +775,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -785,6 +788,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -796,6 +800,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -834,6 +839,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -877,6 +883,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -949,7 +956,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -957,6 +970,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -967,10 +981,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1044,14 +1060,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 654c5acb9e86ea9fc0a2e748e8c4192231eacc1a..a594a1d47b62bc8e7f125a61c7d71faba5cdc245 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:02 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:44 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 CONFIG_ATARI=y
 # CONFIG_MAC is not set
@@ -148,19 +138,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_STRAM_PROC=y
@@ -208,7 +200,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -258,13 +249,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -278,19 +270,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -298,20 +293,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -319,8 +314,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -333,9 +328,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -347,16 +342,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -383,6 +378,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -406,19 +402,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -462,21 +447,20 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
-CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=m
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -565,12 +549,15 @@ CONFIG_EQUALIZER=m
 CONFIG_VETH=m
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
-CONFIG_MII=m
+CONFIG_MII=y
 CONFIG_ATARILANCE=m
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NET_POCKET is not set
 # CONFIG_NETDEV_1000 is not set
@@ -644,6 +631,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 # CONFIG_MOUSE_SERIAL is not set
 CONFIG_MOUSE_ATARI=m
@@ -706,11 +694,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -720,6 +708,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -745,6 +734,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -768,6 +758,8 @@ CONFIG_FB_ATARI=y
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_ATY is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -790,12 +782,19 @@ CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_DMASOUND_ATARI=m
 CONFIG_DMASOUND=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -805,6 +804,8 @@ CONFIG_HIDRAW=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -821,10 +822,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-CONFIG_EXT4DEV_FS=y
-# CONFIG_EXT4DEV_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
-CONFIG_JBD2=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -835,6 +835,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -846,6 +847,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -884,6 +886,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -925,6 +928,7 @@ CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -998,7 +1002,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1006,6 +1016,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -1016,10 +1027,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1093,14 +1106,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=y
index 2e44af0fe54a16b59eed806776384f8efbf6f406..d3d9814a91de73d659b8df0fe0d5e8a16cc2c42a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:03 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:45 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -151,19 +141,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_PROC_HARDWARE=y
@@ -212,7 +204,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -262,13 +253,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -282,19 +274,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -302,20 +297,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -323,8 +318,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -337,9 +332,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -351,16 +346,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -387,6 +382,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -410,19 +406,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -460,6 +445,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -545,6 +531,9 @@ CONFIG_BVME6000_NET=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -614,6 +603,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -668,11 +658,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -682,6 +672,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -721,6 +712,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -729,6 +726,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -744,8 +743,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -756,6 +756,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -767,6 +768,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -805,6 +807,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -848,6 +851,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -921,7 +925,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -929,6 +939,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -939,10 +950,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1016,14 +1029,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=m
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 3570fc89b089f15f157ea4e1b35c90e33614bf40..5556ef088d04051aef7d625ccc5ad590b4916151 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:04 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:46 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -149,19 +139,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_HEARTBEAT=y
@@ -211,7 +203,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -261,13 +252,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -281,19 +273,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -301,20 +296,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -322,8 +317,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -336,9 +331,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -350,16 +345,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -386,6 +381,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -409,19 +405,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -459,6 +444,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -542,6 +528,9 @@ CONFIG_HPLANCE=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -613,6 +602,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -673,11 +663,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -687,6 +677,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -712,6 +703,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -734,6 +726,8 @@ CONFIG_FB_HP300=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -760,6 +754,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -768,6 +768,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -781,8 +783,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -793,6 +796,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -804,6 +808,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -842,6 +847,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -885,6 +891,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -957,7 +964,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -965,6 +978,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -975,10 +989,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1052,14 +1068,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index db6e8822594a47896154e8ba45b1f2f82f4a57ab..c6de25724a2503e3d7c68512de55ffbd7eb2dfb8 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:06 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:47 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 CONFIG_MAC=y
@@ -150,19 +140,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 # CONFIG_HEARTBEAT is not set
@@ -209,7 +201,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -259,13 +250,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -279,19 +271,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -299,20 +294,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -320,8 +315,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -334,9 +329,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -348,16 +343,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -384,6 +379,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -410,19 +406,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -460,21 +445,20 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
-CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=m
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -581,6 +565,9 @@ CONFIG_MACMACE=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -650,6 +637,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -706,11 +694,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -720,6 +708,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -745,6 +734,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -768,6 +758,8 @@ CONFIG_FB_MAC=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -796,6 +788,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -804,6 +802,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -820,8 +820,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -832,6 +833,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -843,6 +845,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -881,6 +884,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -923,6 +927,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -996,7 +1001,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1004,6 +1015,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -1014,10 +1026,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1091,14 +1105,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 1a806102b999234a669805e231dccc4d599db5ac..70693588031ea615c99b62042322e1dfdbb10ecf 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:07 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:48 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 CONFIG_AMIGA=y
 CONFIG_ATARI=y
 CONFIG_MAC=y
@@ -154,19 +144,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_ZORRO=y
@@ -222,7 +214,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -272,13 +263,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -292,19 +284,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -312,20 +307,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -333,8 +328,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -347,9 +342,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -361,16 +356,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -397,6 +392,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -424,19 +420,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -486,21 +471,20 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
-CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=m
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -629,7 +613,7 @@ CONFIG_VETH=m
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
-CONFIG_MII=m
+CONFIG_MII=y
 CONFIG_ARIADNE=m
 CONFIG_A2065=m
 CONFIG_HYDRA=m
@@ -657,8 +641,12 @@ CONFIG_NE2000=m
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_NET_PCI is not set
 # CONFIG_B44 is not set
+# CONFIG_CS89x0 is not set
 # CONFIG_NET_POCKET is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -735,6 +723,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_INPORT is not set
@@ -832,11 +821,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -846,6 +835,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -871,6 +861,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -905,6 +896,8 @@ CONFIG_FB_HP300=y
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_ATY is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -930,6 +923,7 @@ CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_LOGO_MAC_CLUT224=y
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_DMASOUND_ATARI=m
 CONFIG_DMASOUND_PAULA=m
 CONFIG_DMASOUND_Q40=m
@@ -938,6 +932,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -947,6 +947,8 @@ CONFIG_HIDRAW=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -973,10 +975,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-CONFIG_EXT4DEV_FS=y
-# CONFIG_EXT4DEV_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
-CONFIG_JBD2=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -987,6 +988,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -998,6 +1000,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -1036,6 +1039,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -1079,6 +1083,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1156,7 +1161,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1164,6 +1175,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -1174,10 +1186,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1251,14 +1265,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=y
index cacb5aef6a37e865c76caad27116f08539a30157..52d42715bd0bc5fcbb20fad583227da91547eece 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:08 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:50 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -151,19 +141,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_PROC_HARDWARE=y
@@ -212,7 +204,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -262,13 +253,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -282,19 +274,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -302,20 +297,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -323,8 +318,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -337,9 +332,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -351,16 +346,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -387,6 +382,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -410,19 +406,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -460,6 +445,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -544,6 +530,9 @@ CONFIG_MVME147_NET=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -613,6 +602,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -667,11 +657,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -681,6 +671,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -720,6 +711,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -728,6 +725,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -743,8 +742,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -755,6 +755,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -766,6 +767,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -804,6 +806,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -847,6 +850,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -920,7 +924,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -928,6 +938,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -938,10 +949,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1015,14 +1028,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index a183e25e348d2a93b7b9e0be16f977a64854848a..3403ed2eda796ace98478d3ea55bd981043b02a2 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:09 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:51 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -151,19 +141,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_PROC_HARDWARE=y
@@ -212,7 +204,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -262,13 +253,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -282,19 +274,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -302,20 +297,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -323,8 +318,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -337,9 +332,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -351,16 +346,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -387,6 +382,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -410,19 +406,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -460,6 +445,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -545,6 +531,9 @@ CONFIG_MVME16x_NET=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -614,6 +603,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -668,11 +658,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -682,6 +672,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -721,6 +712,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -729,6 +726,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -745,8 +744,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -757,6 +757,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -768,6 +769,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -806,6 +808,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -849,6 +852,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -922,7 +926,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -930,6 +940,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -940,10 +951,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1017,14 +1030,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 72eaff0776b80ca5dcea68a7911d62054111f86d..3459c594194bb9070c416b54f413d95f5731c856 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:10 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:52 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -148,19 +138,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_HEARTBEAT=y
@@ -209,7 +201,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -259,13 +250,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -279,19 +271,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -299,20 +294,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -320,8 +315,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -334,9 +329,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -348,16 +343,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -384,6 +379,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -407,19 +403,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -458,21 +443,20 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
-CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-CONFIG_BLK_DEV_IDEFLOPPY=m
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -585,8 +569,12 @@ CONFIG_NE2000=m
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_NET_PCI is not set
 # CONFIG_B44 is not set
+# CONFIG_CS89x0 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
 # CONFIG_TR is not set
@@ -656,6 +644,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_INPORT is not set
@@ -717,11 +706,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -731,6 +720,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -756,6 +746,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
@@ -778,6 +769,8 @@ CONFIG_FB_Q40=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -800,12 +793,19 @@ CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_DMASOUND_Q40=m
 CONFIG_DMASOUND=m
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -814,6 +814,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -827,8 +829,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -839,6 +842,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -850,6 +854,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -888,6 +893,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -930,6 +936,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1002,7 +1009,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -1010,6 +1023,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -1020,10 +1034,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1097,14 +1113,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index cb62b96d766ed5493b8bfc9806b31227be91b715..f404917429faefef7258b5b309374f4b7f8bf9d9 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:11 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:53 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 CONFIG_NO_DMA=y
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,10 +105,19 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
+# CONFIG_AMIGA is not set
+# CONFIG_ATARI is not set
+# CONFIG_MAC is not set
+# CONFIG_APOLLO is not set
+# CONFIG_VME is not set
+# CONFIG_HP300 is not set
+# CONFIG_SUN3X is not set
+# CONFIG_Q40 is not set
 CONFIG_SUN3=y
 
 #
@@ -137,19 +136,21 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_PROC_HARDWARE=y
@@ -198,7 +199,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -248,13 +248,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -268,19 +269,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -288,20 +292,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -309,8 +313,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -323,9 +327,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -337,16 +341,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -373,6 +377,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -396,19 +401,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -446,6 +440,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -531,6 +526,9 @@ CONFIG_SUN3_82586=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
 
@@ -599,6 +597,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -654,10 +653,6 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
 
-#
-# Sonics Silicon Backplane
-#
-
 #
 # Multifunction device drivers
 #
@@ -665,6 +660,7 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -690,6 +686,7 @@ CONFIG_GEN_RTC_X=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
@@ -711,6 +708,8 @@ CONFIG_FB=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -737,6 +736,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -744,6 +749,8 @@ CONFIG_HIDRAW=y
 # CONFIG_ACCESSIBILITY is not set
 # CONFIG_RTC_CLASS is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -757,8 +764,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -769,6 +777,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -780,6 +789,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -818,6 +828,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -861,6 +872,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -934,7 +946,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -942,6 +960,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -952,10 +971,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1029,14 +1050,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 04b4363a70503d5fa50948cd678ed3d3f56dcaa2..4d8a1e84e39fc930b6235c243751823272ab8fea 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc6
-# Wed Sep 10 09:02:12 2008
+# Linux kernel version: 2.6.28-rc7
+# Tue Dec  2 20:27:54 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -14,7 +14,6 @@ CONFIG_TIME_LOW_RES=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_NO_IOPORT=y
 # CONFIG_NO_DMA is not set
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_HZ=100
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -67,22 +66,13 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
 # CONFIG_MARKERS is not set
-# CONFIG_HAVE_OPROFILE is not set
-# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
-# CONFIG_HAVE_IOREMAP_PROT is not set
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-# CONFIG_HAVE_ARCH_TRACEHOOK is not set
-# CONFIG_HAVE_DMA_ATTRS is not set
-# CONFIG_USE_GENERIC_SMP_HELPERS is not set
-# CONFIG_HAVE_CLK is not set
-CONFIG_PROC_PAGE_MONITOR=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -115,11 +105,11 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Platform dependent setup
 #
-# CONFIG_SUN3 is not set
 # CONFIG_AMIGA is not set
 # CONFIG_ATARI is not set
 # CONFIG_MAC is not set
@@ -148,19 +138,21 @@ CONFIG_DISCONTIGMEM_MANUAL=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 
 #
 # General setup
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_AOUT=m
 CONFIG_BINFMT_MISC=m
 CONFIG_PROC_HARDWARE=y
@@ -209,7 +201,6 @@ CONFIG_INET_TCP_DIAG=m
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -259,13 +250,14 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 # CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_TPROXY is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_RATEEST=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -279,19 +271,22 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_OWNER=m
 CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
 CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -299,20 +294,20 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -320,8 +315,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
 CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -334,9 +329,9 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
@@ -348,16 +343,16 @@ CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -384,6 +379,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
@@ -407,19 +403,8 @@ CONFIG_NET_CLS_ROUTE=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-CONFIG_WIRELESS_EXT=y
-# CONFIG_WIRELESS_EXT_SYSFS is not set
-# CONFIG_MAC80211 is not set
-CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -457,6 +442,7 @@ CONFIG_ATA_OVER_ETH=m
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -541,6 +527,9 @@ CONFIG_SUN3LANCE=y
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
 # CONFIG_IBM_NEW_EMAC_TAH is not set
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_B44 is not set
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -610,6 +599,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -664,11 +654,11 @@ CONFIG_GEN_RTC_X=y
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
 # Sonics Silicon Backplane
 #
-CONFIG_SSB_POSSIBLE=y
 # CONFIG_SSB is not set
 
 #
@@ -678,6 +668,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
@@ -703,6 +694,7 @@ CONFIG_SSB_POSSIBLE=y
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
@@ -724,6 +716,8 @@ CONFIG_FB=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
@@ -750,6 +744,12 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
 CONFIG_HIDRAW=y
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -758,6 +758,8 @@ CONFIG_HIDRAW=y
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # Character devices
@@ -771,8 +773,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
+CONFIG_JBD2=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
@@ -783,6 +786,7 @@ CONFIG_JFS_FS=m
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
 # CONFIG_XFS_POSIX_ACL is not set
@@ -794,6 +798,7 @@ CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
 # CONFIG_OCFS2_FS_STATS is not set
 # CONFIG_OCFS2_DEBUG_MASKLOG is not set
 # CONFIG_OCFS2_DEBUG_FS is not set
+# CONFIG_OCFS2_COMPAT_JBD is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -832,6 +837,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
@@ -875,6 +881,7 @@ CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -948,7 +955,13 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 
 #
@@ -956,6 +969,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
@@ -966,10 +980,12 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_GF128MUL=m
 CONFIG_CRYPTO_NULL=m
@@ -1043,14 +1059,17 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
-# CONFIG_GENERIC_FIND_FIRST_BIT is not set
-# CONFIG_GENERIC_FIND_NEXT_BIT is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC16=m
 CONFIG_CRC_T10DIF=y
index 765c8e287d2b2b45f2687f607c61ecc1d1096cad..364ca89388072bdef9c9083183b329cec5828af7 100644 (file)
@@ -48,7 +48,7 @@ config RUNTIME_DEBUG
        help
          If you say Y here, some debugging macros will do run-time checking.
          If you say N here, those macros will mostly turn to no-ops.  See
-         include/asm-mips/debug.h for debuging macros.
+         arch/mips/include/asm/debug.h for debugging macros.
          If unsure, say N.
 
 endmenu
index 620980081a308080323d48db08328d8c170d370f..b6698a232ae93e8c65e8247ddc5075f3c260dea7 100644 (file)
@@ -1,63 +1,78 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc4
-# Mon Jun 11 00:23:51 2007
+# Linux kernel version: 2.6.28-rc6
+# Fri Nov 28 17:53:48 2008
 #
 CONFIG_MIPS=y
 
 #
 # Machine selection
 #
-CONFIG_LEMOTE_FULONG=y
 # CONFIG_MACH_ALCHEMY is not set
 # CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+CONFIG_LEMOTE_FULONG=y
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_WR_PPMC is not set
 # CONFIG_MIPS_SIM is not set
+# CONFIG_MACH_EMMA is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
 # CONFIG_PNX8550_JBS is not set
 # CONFIG_PNX8550_STB810 is not set
-# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_MSP is not set
 # CONFIG_PMC_YOSEMITE is not set
-# CONFIG_MARKEINS is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
 # CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
 # CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
 # CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
 # CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
+# CONFIG_WR_PPMC is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
 CONFIG_I8259=y
 # CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_BOOT_ELF32=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
 
 #
 # CPU selection
@@ -75,6 +90,7 @@ CONFIG_CPU_LOONGSON2=y
 # CONFIG_CPU_TX49XX is not set
 # CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
 # CONFIG_CPU_R6000 is not set
 # CONFIG_CPU_NEVADA is not set
 # CONFIG_CPU_R8000 is not set
@@ -101,7 +117,6 @@ CONFIG_BOARD_SCACHE=y
 CONFIG_MIPS_MT_DISABLED=y
 # CONFIG_MIPS_MT_SMP is not set
 # CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_VPE_LOADER is not set
 CONFIG_CPU_HAS_WB=y
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
@@ -109,6 +124,7 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_SYS_SUPPORTS_HIGHMEM=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -117,9 +133,17 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_SPARSEMEM_STATIC=y
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
+CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
@@ -133,37 +157,40 @@ CONFIG_HZ=250
 CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_PREEMPT is not set
 # CONFIG_KEXEC is not set
+CONFIG_SECCOMP=y
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION="lm32"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -175,6 +202,8 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+# CONFIG_PCSPKR_PLATFORM is not set
+# CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
@@ -183,29 +212,33 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -219,19 +252,19 @@ CONFIG_IOSCHED_CFQ=y
 CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
 CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 CONFIG_ISA=y
 CONFIG_MMU=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -239,8 +272,9 @@ CONFIG_MMU=y
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=y
-# CONFIG_BUILD_ELF64 is not set
 CONFIG_MIPS32_COMPAT=y
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
@@ -251,14 +285,12 @@ CONFIG_BINFMT_ELF32=y
 #
 # Power management options
 #
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_PM=y
-# CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
-
-#
-# Networking
-#
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
 CONFIG_NET=y
 
 #
@@ -271,6 +303,7 @@ CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -294,18 +327,17 @@ CONFIG_INET_TUNNEL=m
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
-# CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 
 #
 # Core Netfilter Configuration
@@ -313,53 +345,59 @@ CONFIG_NETFILTER=y
 CONFIG_NETFILTER_NETLINK=m
 CONFIG_NETFILTER_NETLINK_QUEUE=m
 CONFIG_NETFILTER_NETLINK_LOG=m
-# CONFIG_NF_CONNTRACK_ENABLED is not set
 # CONFIG_NF_CONNTRACK is not set
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 # CONFIG_NETFILTER_XT_TARGET_DSCP is not set
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 # CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TRACE=m
 # CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
+CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
 CONFIG_NETFILTER_XT_MATCH_COMMENT=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 # CONFIG_NETFILTER_XT_MATCH_DSCP is not set
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
-# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
-# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
+CONFIG_NETFILTER_XT_MATCH_TIME=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
+# CONFIG_IP_VS is not set
 
 #
 # IP: Netfilter Configuration
 #
+# CONFIG_NF_DEFRAG_IPV4 is not set
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_TOS=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_OWNER=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
 CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_RAW=m
@@ -371,6 +409,7 @@ CONFIG_IP_NF_ARP_MANGLE=m
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
@@ -380,10 +419,6 @@ CONFIG_IP_NF_ARP_MANGLE=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
 
@@ -392,23 +427,25 @@ CONFIG_NET_CLS_ROUTE=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
+CONFIG_PHONET=m
+CONFIG_WIRELESS=y
 # CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 # CONFIG_MAC80211 is not set
 CONFIG_IEEE80211=m
 # CONFIG_IEEE80211_DEBUG is not set
 CONFIG_IEEE80211_CRYPT_WEP=m
 # CONFIG_IEEE80211_CRYPT_CCMP is not set
 # CONFIG_IEEE80211_CRYPT_TKIP is not set
-# CONFIG_IEEE80211_SOFTMAC is not set
 # CONFIG_RFKILL is not set
+CONFIG_NET_9P=m
+# CONFIG_NET_9P_DEBUG is not set
 
 #
 # Device Drivers
@@ -417,14 +454,13 @@ CONFIG_IEEE80211_CRYPT_WEP=m
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=m
 # CONFIG_MTD_DEBUG is not set
@@ -443,6 +479,7 @@ CONFIG_MTD_BLOCK=m
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -482,6 +519,7 @@ CONFIG_MTD_PHYSMAP=m
 CONFIG_MTD_PHYSMAP_START=0x1fc00000
 CONFIG_MTD_PHYSMAP_LEN=0x80000
 CONFIG_MTD_PHYSMAP_BANKWIDTH=1
+# CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -506,21 +544,9 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
 # CONFIG_PNP is not set
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -534,32 +560,28 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 # CONFIG_CDROM_PKTCDVD_WCACHE is not set
 CONFIG_ATA_OVER_ETH=m
-
-#
-# Misc devices
-#
-# CONFIG_PHANTOM is not set
-# CONFIG_SGI_IOC4 is not set
-# CONFIG_TIFM_CORE is not set
-# CONFIG_BLINK is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_IDE_MAX_HWIFS=4
-CONFIG_BLK_DEV_IDE=y
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
+CONFIG_IDE_TIMINGS=y
+CONFIG_IDE_ATAPI=y
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-CONFIG_IDEDISK_MULTI_MODE=y
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
 CONFIG_BLK_DEV_IDESCSI=y
 CONFIG_IDE_TASK_IOCTL=y
 CONFIG_IDE_PROC_FS=y
@@ -568,24 +590,25 @@ CONFIG_IDE_PROC_FS=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+CONFIG_BLK_DEV_IDEDMA_SFF=y
+
+#
+# PCI IDE chipsets support
+#
 CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_IDEPCI_SHARE_IRQ=y
 CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-# CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
@@ -601,17 +624,28 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_TRM290 is not set
 CONFIG_BLK_DEV_VIA82CXXX=y
 # CONFIG_BLK_DEV_TC86C001 is not set
-# CONFIG_IDE_ARM is not set
-# CONFIG_IDE_CHIPSETS is not set
+
+#
+# Other IDE chipsets support
+#
+
+#
+# Note: most of these also require special kernel boot parameters
+#
+# CONFIG_BLK_DEV_4DRIVES is not set
+# CONFIG_BLK_DEV_ALI14XX is not set
+# CONFIG_BLK_DEV_DTC2278 is not set
+# CONFIG_BLK_DEV_HT6560B is not set
+# CONFIG_BLK_DEV_QD65XX is not set
+# CONFIG_BLK_DEV_UMC8672 is not set
 CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
-# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -644,88 +678,30 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_ISCSI_TCP is not set
-# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-# CONFIG_SCSI_3W_9XXX is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AACRAID is not set
-# CONFIG_SCSI_AIC7XXX is not set
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_ARCMSR is not set
-# CONFIG_MEGARAID_NEWGEN is not set
-# CONFIG_MEGARAID_LEGACY is not set
-# CONFIG_MEGARAID_SAS is not set
-# CONFIG_SCSI_HPTIOP is not set
-# CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_DTC3280 is not set
-# CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
-# CONFIG_SCSI_IPS is not set
-# CONFIG_SCSI_INITIO is not set
-# CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_STEX is not set
-# CONFIG_SCSI_SYM53C8XX_2 is not set
-# CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PSI240I is not set
-# CONFIG_SCSI_QLOGIC_FAS is not set
-# CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_QLA_FC is not set
-# CONFIG_SCSI_QLA_ISCSI is not set
-# CONFIG_SCSI_LPFC is not set
-# CONFIG_SCSI_SYM53C416 is not set
-# CONFIG_SCSI_DC395x is not set
-# CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_T128 is not set
-# CONFIG_SCSI_DEBUG is not set
-# CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
-# CONFIG_FIREWIRE is not set
-# CONFIG_IEEE1394 is not set
 
 #
-# I2O device support
+# Enable only one of the two stacks, unless you know what you are doing
 #
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+CONFIG_MACVLAN=m
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+CONFIG_VETH=m
 # CONFIG_ARCNET is not set
 CONFIG_PHYLIB=m
 
@@ -740,29 +716,32 @@ CONFIG_CICADA_PHY=m
 # CONFIG_VITESSE_PHY is not set
 # CONFIG_SMSC_PHY is not set
 # CONFIG_BROADCOM_PHY is not set
-# CONFIG_FIXED_PHY is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
 # CONFIG_NET_VENDOR_RACAL is not set
-
-#
-# Tulip family network device support
-#
 # CONFIG_NET_TULIP is not set
 # CONFIG_AT1700 is not set
 # CONFIG_DEPCA is not set
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
@@ -773,7 +752,6 @@ CONFIG_NET_PCI=y
 # CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_TC35815 is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -785,15 +763,21 @@ CONFIG_8139TOO=y
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -801,20 +785,29 @@ CONFIG_NETDEV_1000=y
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
 # CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_JME is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
+# CONFIG_ENIC is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -822,6 +815,7 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -830,7 +824,6 @@ CONFIG_NETDEV_10000=y
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET_MII is not set
 # CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
@@ -844,25 +837,17 @@ CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
 CONFIG_PPP_MPPE=m
 CONFIG_PPPOE=m
+CONFIG_PPPOL2TP=m
 CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SLHC=m
 CONFIG_SLIP_SMART=y
 CONFIG_SLIP_MODE_SLIP6=y
 CONFIG_NET_FC=y
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -870,6 +855,7 @@ CONFIG_NET_FC=y
 #
 CONFIG_INPUT=y
 CONFIG_INPUT_FF_MEMLESS=y
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -879,7 +865,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -900,9 +885,11 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_LIFEBOOK=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=y
 # CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
@@ -927,10 +914,13 @@ CONFIG_SERIO_LIBPS2=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -951,105 +941,152 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
-CONFIG_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 CONFIG_I2C=m
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_HELPER_AUTO=y
 
 #
-# I2C Algorithms
+# I2C Hardware Bus support
 #
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
-# I2C Hardware Bus support
+# PC SMBus host controller drivers
 #
 # CONFIG_I2C_ALI1535 is not set
 # CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_ELEKTOR is not set
 # CONFIG_I2C_I801 is not set
-# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_ISCH is not set
 # CONFIG_I2C_PIIX4 is not set
 # CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_PROSAVAGE is not set
-# CONFIG_I2C_SAVAGE4 is not set
-# CONFIG_I2C_SIMTEC is not set
 # CONFIG_I2C_SIS5595 is not set
 # CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_STUB is not set
-# CONFIG_I2C_TINY_USB is not set
 # CONFIG_I2C_VIA is not set
 CONFIG_I2C_VIAPRO=m
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Graphics adapter I2C/DDC channel drivers
+#
 # CONFIG_I2C_VOODOO3 is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_ELEKTOR is not set
 # CONFIG_I2C_PCA_ISA is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
 
 #
 # Miscellaneous I2C Chip support
 #
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_AT24 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
-# Dallas's 1-wire bus
+# Sonics Silicon Backplane
 #
-# CONFIG_W1 is not set
-# CONFIG_HWMON is not set
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 CONFIG_VIDEO_DEV=m
-CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
 CONFIG_VIDEO_V4L1_COMPAT=y
-CONFIG_VIDEO_V4L2=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_CUSTOMIZE=y
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_MT2131=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_MEDIA_TUNER_MXL5007T=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DMA_CONTIG=m
 CONFIG_VIDEO_CAPTURE_DRIVERS=y
 # CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
 CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 # CONFIG_VIDEO_VIVI is not set
 # CONFIG_VIDEO_BT848 is not set
@@ -1058,17 +1095,46 @@ CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 # CONFIG_VIDEO_CPIA2 is not set
 # CONFIG_VIDEO_SAA5246A is not set
 # CONFIG_VIDEO_SAA5249 is not set
-# CONFIG_TUNER_3036 is not set
 # CONFIG_VIDEO_STRADIS is not set
 # CONFIG_VIDEO_SAA7134 is not set
 # CONFIG_VIDEO_MXB is not set
-# CONFIG_VIDEO_DPC is not set
 # CONFIG_VIDEO_HEXIUM_ORION is not set
 # CONFIG_VIDEO_HEXIUM_GEMINI is not set
 # CONFIG_VIDEO_CX88 is not set
 # CONFIG_VIDEO_IVTV is not set
 # CONFIG_VIDEO_CAFE_CCIC is not set
+CONFIG_SOC_CAMERA=m
+CONFIG_SOC_CAMERA_MT9M001=m
+CONFIG_SOC_CAMERA_MT9M111=m
+CONFIG_SOC_CAMERA_MT9V022=m
+CONFIG_SOC_CAMERA_PLATFORM=m
+CONFIG_VIDEO_SH_MOBILE_CEU=m
 CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+CONFIG_USB_GSPCA_MARS=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_PAC207=m
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_STK014=m
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_ZC3XX=m
 # CONFIG_VIDEO_PVRUSB2 is not set
 # CONFIG_VIDEO_EM28XX is not set
 # CONFIG_VIDEO_USBVISION is not set
@@ -1079,7 +1145,6 @@ CONFIG_USB_KONICAWC=m
 CONFIG_USB_QUICKCAM_MESSENGER=m
 CONFIG_USB_ET61X251=m
 # CONFIG_VIDEO_OVCAMCHIP is not set
-# CONFIG_USB_W9968CF is not set
 CONFIG_USB_OV511=m
 CONFIG_USB_SE401=m
 CONFIG_USB_SN9C102=m
@@ -1088,6 +1153,8 @@ CONFIG_USB_ZC0301=m
 CONFIG_USB_PWC=m
 # CONFIG_USB_PWC_DEBUG is not set
 # CONFIG_USB_ZR364XX is not set
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
 CONFIG_RADIO_ADAPTERS=y
 # CONFIG_RADIO_CADET is not set
 # CONFIG_RADIO_RTRACK is not set
@@ -1104,33 +1171,30 @@ CONFIG_RADIO_ADAPTERS=y
 # CONFIG_RADIO_TYPHOON is not set
 # CONFIG_RADIO_ZOLTRIX is not set
 # CONFIG_USB_DSBR is not set
-# CONFIG_DVB_CORE is not set
+CONFIG_USB_SI470X=m
+CONFIG_USB_MR800=m
 CONFIG_DAB=y
 # CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
 #
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_LCD_CLASS_DEVICE=m
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 CONFIG_FB_BACKLIGHT=y
@@ -1158,16 +1222,30 @@ CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_FB_S3 is not set
 # CONFIG_FB_SAVAGE is not set
 # CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
 # CONFIG_FB_NEOMAGIC is not set
 # CONFIG_FB_KYRO is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_SMIVGX is not set
 # CONFIG_FB_VT8623 is not set
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_ARK is not set
 # CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=m
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_PLATFORM is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -1176,20 +1254,14 @@ CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
 # CONFIG_LOGO is not set
-
-#
-# Sound
-#
 CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
+CONFIG_SOUND_OSS_CORE=y
 CONFIG_SND=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
@@ -1201,28 +1273,22 @@ CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_PCM_OSS_PLUGINS=y
 CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_RTCTIMER=m
-CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
 # CONFIG_SND_DYNAMIC_MINORS is not set
 CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
+CONFIG_SND_VMASTER=y
 CONFIG_SND_MPU401_UART=m
 CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-
-#
-# PCI devices
-#
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_PCI=y
 # CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALS300 is not set
 # CONFIG_SND_ALI5451 is not set
@@ -1231,10 +1297,12 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
 # CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_OXYGEN is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
 # CONFIG_SND_DARLA20 is not set
@@ -1259,6 +1327,7 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_HDA_INTEL is not set
 # CONFIG_SND_HDSP is not set
 # CONFIG_SND_HDSPM is not set
+# CONFIG_SND_HIFIER is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
@@ -1276,43 +1345,26 @@ CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_TRIDENT is not set
 CONFIG_SND_VIA82XX=m
 # CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VIRTUOSO is not set
 # CONFIG_SND_VX222 is not set
 # CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AC97_POWER_SAVE is not set
-
-#
-# ALSA MIPS devices
-#
-
-#
-# USB devices
-#
+CONFIG_SND_MIPS=y
+CONFIG_SND_USB=y
 # CONFIG_SND_USB_AUDIO is not set
 # CONFIG_SND_USB_CAIAQ is not set
-
-#
-# System on Chip audio support
-#
 # CONFIG_SND_SOC is not set
-
-#
-# Open Sound System
-#
 # CONFIG_SOUND_PRIME is not set
 CONFIG_AC97_BUS=m
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+CONFIG_HIDRAW=y
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=m
-# CONFIG_USB_HIDINPUT_POWERBOOK is not set
-# CONFIG_HID_FF is not set
+CONFIG_HID_PID=y
 CONFIG_USB_HIDDEV=y
 
 #
@@ -1322,13 +1374,39 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_MOUSE is not set
 
 #
-# USB support
-#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=m
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+CONFIG_HID_BRIGHT=m
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DELL=m
+CONFIG_HID_EZKEY=m
+CONFIG_HID_GYRATION=m
+CONFIG_HID_LOGITECH=m
+CONFIG_LOGITECH_FF=y
+CONFIG_LOGIRUMBLEPAD2_FF=y
+CONFIG_HID_MICROSOFT=m
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_PANTHERLORD=m
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+CONFIG_HID_SUNPLUS=m
+# CONFIG_THRUSTMASTER_FF is not set
+CONFIG_ZEROPLUS_FF=m
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
 # CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 
 #
 # Miscellaneous USB options
@@ -1338,35 +1416,46 @@ CONFIG_USB_DEVICEFS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_SUSPEND is not set
 # CONFIG_USB_OTG is not set
+CONFIG_USB_OTG_WHITELIST=y
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+CONFIG_USB_WUSB_CBAF=m
+# CONFIG_USB_WUSB_CBAF_DEBUG is not set
 
 #
 # USB Host Controller Drivers
 #
+CONFIG_USB_C67X00_HCD=m
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_SPLIT_ISO=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
-# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
 # CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_ISP1760_HCD=m
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 CONFIG_USB_UHCI_HCD=m
 # CONFIG_USB_SL811_HCD is not set
+CONFIG_USB_R8A66597_HCD=m
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
 
 #
 # USB Device Class drivers
 #
 CONFIG_USB_ACM=y
 CONFIG_USB_PRINTER=y
+CONFIG_USB_WDM=m
+CONFIG_USB_TMC=m
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -1379,7 +1468,9 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
 # CONFIG_USB_STORAGE_ALAUDA is not set
+CONFIG_USB_STORAGE_ONETOUCH=y
 # CONFIG_USB_STORAGE_KARMA is not set
+CONFIG_USB_STORAGE_CYPRESS_ATACB=y
 CONFIG_USB_LIBUSUAL=y
 
 #
@@ -1387,15 +1478,10 @@ CONFIG_USB_LIBUSUAL=y
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_MON is not set
 
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 # CONFIG_USB_SERIAL is not set
 
 #
@@ -1404,7 +1490,7 @@ CONFIG_USB_LIBUSUAL=y
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
 # CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_AUERSWALD is not set
+CONFIG_USB_SEVSEG=m
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
@@ -1421,56 +1507,75 @@ CONFIG_USB_LIBUSUAL=y
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
+CONFIG_USB_ISIGHTFW=m
+CONFIG_USB_VST=m
 # CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=m
 
 #
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+# RTC interfaces
 #
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# Real Time Clock
+# I2C RTC drivers
 #
-# CONFIG_RTC_CLASS is not set
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
 
 #
-# DMA Engine support
+# SPI RTC drivers
 #
-# CONFIG_DMA_ENGINE is not set
 
 #
-# DMA Clients
+# Platform RTC drivers
 #
+CONFIG_RTC_DRV_CMOS=m
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# DMA Devices
+# on-CPU RTC drivers
 #
+# CONFIG_DMADEVICES is not set
+CONFIG_UIO=m
+CONFIG_UIO_CIF=m
+# CONFIG_UIO_PDRV is not set
+# CONFIG_UIO_PDRV_GENIRQ is not set
+# CONFIG_UIO_SMX is not set
+# CONFIG_UIO_SERCOS3 is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -1478,27 +1583,31 @@ CONFIG_USB_LIBUSUAL=y
 CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 CONFIG_EXT2_FS_XIP=y
-CONFIG_FS_XIP=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4DEV_FS is not set
+CONFIG_EXT4_FS=m
+CONFIG_EXT4DEV_COMPAT=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_FS_XIP=y
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
+CONFIG_FS_MBCACHE=m
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_REISERFS_FS_XATTR is not set
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 CONFIG_AUTOFS_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_FUSE_FS=y
@@ -1530,11 +1639,11 @@ CONFIG_NTFS_RW=y
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1550,25 +1659,23 @@ CONFIG_RAMFS=y
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_OMFS_FS=m
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-CONFIG_NFS_DIRECTIO=y
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -1576,7 +1683,7 @@ CONFIG_NFS_ACL_SUPPORT=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
-# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -1616,10 +1723,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="utf8"
 # CONFIG_NLS_CODEPAGE_437 is not set
@@ -1660,30 +1763,31 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_CROSSCOMPILE=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+CONFIG_DYNAMIC_PRINTK_DEBUG=y
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_CMDLINE=""
 
 #
@@ -1691,64 +1795,113 @@ CONFIG_CMDLINE=""
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_SECURITY_FILE_CAPABILITIES=y
+CONFIG_CRYPTO=y
 
 #
-# Cryptographic options
+# Crypto core or helper
 #
-CONFIG_CRYPTO=y
+CONFIG_CRYPTO_FIPS=y
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_MD4 is not set
 CONFIG_CRYPTO_MD5=m
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
 CONFIG_CRYPTO_SHA1=m
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=m
-# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=m
 # CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_TEA is not set
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=m
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
+CONFIG_CRYPTO_LZO=m
 
 #
-# Hardware crypto devices
+# Random Number Generation
 #
+CONFIG_CRYPTO_ANSI_CPRNG=m
+# CONFIG_CRYPTO_HW is not set
 
 #
 # Library routines
 #
 CONFIG_BITREVERSE=y
 CONFIG_CRC_CCITT=y
-# CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC16=m
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
+CONFIG_CRC7=m
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
+CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_DECOMPRESS=m
 CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
index f719bf5e01aa4b2a64b9c630beba112591f23308..1158228764175bd98dced751c530f25ee7a74332 100644 (file)
@@ -1,30 +1,34 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc2
-# Tue Aug  7 12:39:49 2007
+# Linux kernel version: 2.6.28-rc6
+# Fri Nov 28 15:41:33 2008
 #
 CONFIG_MIPS=y
 
 #
 # Machine selection
 #
-CONFIG_ZONE_DMA=y
 # CONFIG_MACH_ALCHEMY is not set
 # CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
 # CONFIG_LEMOTE_FULONG is not set
 # CONFIG_MIPS_MALTA is not set
 # CONFIG_MIPS_SIM is not set
-# CONFIG_MARKEINS is not set
+# CONFIG_MACH_EMMA is not set
 # CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
 # CONFIG_PNX8550_JBS is not set
 # CONFIG_PNX8550_STB810 is not set
 # CONFIG_PMC_MSP is not set
 # CONFIG_PMC_YOSEMITE is not set
 CONFIG_SGI_IP22=y
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_CRHINE is not set
 # CONFIG_SIBYTE_CARMEL is not set
@@ -35,34 +39,49 @@ CONFIG_SGI_IP22=y
 # CONFIG_SIBYTE_SENTOSA is not set
 # CONFIG_SIBYTE_BIGSUR is not set
 # CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
 # CONFIG_WR_PPMC is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 # CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
 CONFIG_ARC=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_I8259=y
 # CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_ISA_DMA=y
 CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN=y
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_SWAP_IO_SPACE=y
+CONFIG_SGI_HAS_INDYDOG=y
+CONFIG_SGI_HAS_HAL2=y
+CONFIG_SGI_HAS_SEEQ=y
+CONFIG_SGI_HAS_WD93=y
+CONFIG_SGI_HAS_ZILOG=y
+CONFIG_SGI_HAS_I8042=y
+CONFIG_DEFAULT_SGI_PARTITION=y
 CONFIG_ARC32=y
 CONFIG_BOOT_ELF32=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_MIPS_L1_CACHE_SHIFT=7
 CONFIG_ARC_CONSOLE=y
 CONFIG_ARC_PROMLIB=y
 
@@ -82,6 +101,7 @@ CONFIG_ARC_PROMLIB=y
 # CONFIG_CPU_TX49XX is not set
 CONFIG_CPU_R5000=y
 # CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
 # CONFIG_CPU_R6000 is not set
 # CONFIG_CPU_NEVADA is not set
 # CONFIG_CPU_R8000 is not set
@@ -115,18 +135,24 @@ CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=1
-CONFIG_BOUNCE=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
@@ -159,13 +185,20 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -177,6 +210,8 @@ CONFIG_KALLSYMS=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+# CONFIG_PCSPKR_PLATFORM is not set
+# CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
@@ -185,14 +220,21 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -203,6 +245,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -216,6 +259,8 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
@@ -224,29 +269,24 @@ CONFIG_HW_HAS_EISA=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_EISA is not set
 CONFIG_MMU=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+CONFIG_I8253=y
 
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=m
 CONFIG_TRAD_SIGNALS=y
 
 #
 # Power management options
 #
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_PM=y
-# CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
 # CONFIG_SUSPEND is not set
-
-#
-# Networking
-#
 CONFIG_NET=y
 
 #
@@ -259,6 +299,8 @@ CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
 CONFIG_NET_KEY=y
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
@@ -282,42 +324,13 @@ CONFIG_INET_TUNNEL=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=m
 CONFIG_INET_XFRM_MODE_TUNNEL=m
 CONFIG_INET_XFRM_MODE_BEET=m
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
-CONFIG_IP_VS=m
-# CONFIG_IP_VS_DEBUG is not set
-CONFIG_IP_VS_TAB_BITS=12
-
-#
-# IPVS transport protocol load balancing support
-#
-CONFIG_IP_VS_PROTO_TCP=y
-CONFIG_IP_VS_PROTO_UDP=y
-CONFIG_IP_VS_PROTO_ESP=y
-CONFIG_IP_VS_PROTO_AH=y
-
-#
-# IPVS scheduler
-#
-CONFIG_IP_VS_RR=m
-CONFIG_IP_VS_WRR=m
-CONFIG_IP_VS_LC=m
-CONFIG_IP_VS_WLC=m
-CONFIG_IP_VS_LBLC=m
-CONFIG_IP_VS_LBLCR=m
-CONFIG_IP_VS_DH=m
-CONFIG_IP_VS_SH=m
-CONFIG_IP_VS_SED=m
-CONFIG_IP_VS_NQ=m
-
-#
-# IPVS application helper
-#
-CONFIG_IP_VS_FTP=m
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -334,12 +347,16 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=m
 CONFIG_INET6_XFRM_MODE_BEET=m
 CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
 CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
 CONFIG_IPV6_TUNNEL=m
 CONFIG_IPV6_MULTIPLE_TABLES=y
 CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_PIMSM_V2=y
 CONFIG_NETWORK_SECMARK=y
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 
 #
 # Core Netfilter Configuration
@@ -347,12 +364,12 @@ CONFIG_NETFILTER=y
 CONFIG_NETFILTER_NETLINK=m
 CONFIG_NETFILTER_NETLINK_QUEUE=m
 CONFIG_NETFILTER_NETLINK_LOG=m
-CONFIG_NF_CONNTRACK_ENABLED=m
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CT_ACCT=y
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_DCCP=m
 CONFIG_NF_CT_PROTO_GRE=m
 CONFIG_NF_CT_PROTO_SCTP=m
 CONFIG_NF_CT_PROTO_UDPLITE=m
@@ -366,18 +383,22 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_TPROXY=m
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TPROXY=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
 CONFIG_NETFILTER_XT_TARGET_SECMARK=m
-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
 CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
 CONFIG_NETFILTER_XT_MATCH_COMMENT=m
 CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
 CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
@@ -386,39 +407,75 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 CONFIG_NETFILTER_XT_MATCH_DSCP=m
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_POLICY=m
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT=y
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_SOCKET=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_TOS=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_OWNER=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -426,11 +483,13 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
-CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_DCCP=m
 CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
 CONFIG_NF_NAT_FTP=m
 CONFIG_NF_NAT_IRC=m
 CONFIG_NF_NAT_TFTP=m
@@ -439,32 +498,30 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 
 #
-# IPv6: Netfilter Configuration (EXPERIMENTAL)
+# IPv6: Netfilter Configuration
 #
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
-CONFIG_IP6_NF_MATCH_OWNER=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
@@ -479,6 +536,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
@@ -488,12 +546,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_FIFO=y
 
 #
 # Queueing/Scheduling
@@ -502,7 +555,7 @@ CONFIG_NET_SCH_CBQ=m
 CONFIG_NET_SCH_HTB=m
 CONFIG_NET_SCH_HFSC=m
 CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RR=m
+# CONFIG_NET_SCH_MULTIQ is not set
 CONFIG_NET_SCH_RED=m
 CONFIG_NET_SCH_SFQ=m
 CONFIG_NET_SCH_TEQL=m
@@ -526,6 +579,7 @@ CONFIG_NET_CLS_U32=m
 # CONFIG_CLS_U32_MARK is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FLOW=m
 # CONFIG_NET_EMATCH is not set
 CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_POLICE=y
@@ -533,35 +587,28 @@ CONFIG_NET_ACT_GACT=m
 CONFIG_GACT_PROB=y
 CONFIG_NET_ACT_MIRRED=m
 CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_NAT=m
 CONFIG_NET_ACT_PEDIT=m
 CONFIG_NET_ACT_SIMP=m
-CONFIG_NET_CLS_POLICE=y
+CONFIG_NET_ACT_SKBEDIT=m
 # CONFIG_NET_CLS_IND is not set
+CONFIG_NET_SCH_FIFO=y
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
+CONFIG_PHONET=m
 CONFIG_FIB_RULES=y
-
-#
-# Wireless
-#
-CONFIG_CFG80211=m
+# CONFIG_WIRELESS is not set
 CONFIG_WIRELESS_EXT=y
-CONFIG_MAC80211=m
-# CONFIG_MAC80211_DEBUG is not set
 CONFIG_IEEE80211=m
-# CONFIG_IEEE80211_DEBUG is not set
 CONFIG_IEEE80211_CRYPT_WEP=m
-CONFIG_IEEE80211_CRYPT_CCMP=m
-CONFIG_IEEE80211_CRYPT_TKIP=m
-CONFIG_IEEE80211_SOFTMAC=m
-# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
 CONFIG_RFKILL=m
 CONFIG_RFKILL_INPUT=m
 # CONFIG_NET_9P is not set
@@ -588,7 +635,9 @@ CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 # CONFIG_CDROM_PKTCDVD_WCACHE is not set
 CONFIG_ATA_OVER_ETH=m
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -628,20 +677,22 @@ CONFIG_SCSI_SPI_ATTRS=m
 # CONFIG_SCSI_FC_ATTRS is not set
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
 CONFIG_SGIWD93_SCSI=y
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
 CONFIG_NETDEVICES=y
-# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_IFB is not set
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 CONFIG_MACVLAN=m
 CONFIG_EQUALIZER=m
 CONFIG_TUN=m
+CONFIG_VETH=m
 CONFIG_PHYLIB=m
 
 #
@@ -656,11 +707,21 @@ CONFIG_CICADA_PHY=m
 # CONFIG_SMSC_PHY is not set
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
-# CONFIG_FIXED_PHY is not set
+CONFIG_REALTEK_PHY=m
+CONFIG_MDIO_BITBANG=m
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=m
 # CONFIG_AX88796 is not set
+CONFIG_SMC91X=m
 # CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
 CONFIG_SGISEEQ=y
 # CONFIG_NETDEV_1000 is not set
 # CONFIG_NETDEV_10000 is not set
@@ -672,12 +733,12 @@ CONFIG_WLAN_PRE80211=y
 CONFIG_STRIP=m
 CONFIG_WLAN_80211=y
 # CONFIG_LIBERTAS is not set
+# CONFIG_IWLWIFI_LEDS is not set
 CONFIG_HOSTAP=m
 # CONFIG_HOSTAP_FIRMWARE is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -699,7 +760,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -720,6 +780,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
 # CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_PS2_LIFEBOOK is not set
 CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=m
 # CONFIG_MOUSE_VSXXXAA is not set
@@ -742,9 +803,11 @@ CONFIG_SERIO_RAW=m
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -761,6 +824,17 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_THERMAL=m
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
 
@@ -769,47 +843,50 @@ CONFIG_WATCHDOG=y
 #
 # CONFIG_SOFT_WATCHDOG is not set
 CONFIG_INDYDOG=m
-# CONFIG_HW_RANDOM is not set
-# CONFIG_RTC is not set
-# CONFIG_R3964 is not set
-CONFIG_RAW_DRIVER=m
-CONFIG_MAX_RAW_DEVS=256
-# CONFIG_TCG_TPM is not set
-# CONFIG_I2C is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
-# SPI support
+# Sonics Silicon Backplane
 #
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-# CONFIG_HWMON is not set
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
 # Graphics support
 #
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
 
 #
 # Console display driver support
@@ -823,48 +900,77 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
 CONFIG_LOGO_SGI_CLUT224=y
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+CONFIG_HIDRAW=y
+CONFIG_HID_PID=y
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 CONFIG_USB_SUPPORT=y
 # CONFIG_USB_ARCH_HAS_HCD is not set
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 # CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# Enable Host or Gadget support to see Inventra options
 #
 
 #
-# USB Gadget Support
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-# CONFIG_RTC_CLASS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
 
 #
-# DMA Engine support
+# RTC interfaces
 #
-# CONFIG_DMA_ENGINE is not set
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# DMA Clients
+# SPI RTC drivers
 #
 
 #
-# DMA Devices
+# Platform RTC drivers
 #
+# CONFIG_RTC_DRV_CMOS is not set
+CONFIG_RTC_DRV_DS1286=y
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# Userspace I/O
+# on-CPU RTC drivers
 #
+# CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -876,29 +982,33 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
-# CONFIG_EXT4DEV_FS is not set
+CONFIG_EXT4_FS=m
+CONFIG_EXT4DEV_COMPAT=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=m
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 CONFIG_XFS_QUOTA=y
-CONFIG_XFS_SECURITY=y
 # CONFIG_XFS_POSIX_ACL is not set
 # CONFIG_XFS_RT is not set
-# CONFIG_GFS2_FS is not set
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_OCFS2_FS is not set
-CONFIG_MINIX_FS=m
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 CONFIG_QUOTA=y
+CONFIG_QUOTA_NETLINK_INTERFACE=y
+# CONFIG_PRINT_QUOTA_WARNING is not set
 # CONFIG_QFMT_V1 is not set
 CONFIG_QFMT_V2=m
 CONFIG_QUOTACTL=y
-CONFIG_DNOTIFY=y
 CONFIG_AUTOFS_FS=m
 CONFIG_AUTOFS4_FS=m
 CONFIG_FUSE_FS=m
@@ -929,11 +1039,11 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=m
 
 #
@@ -949,27 +1059,25 @@ CONFIG_CONFIGFS_FS=m
 CONFIG_EFS_FS=m
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=m
+CONFIG_OMFS_FS=m
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 CONFIG_UFS_FS=m
 # CONFIG_UFS_FS_WRITE is not set
 # CONFIG_UFS_DEBUG is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 # CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -977,7 +1085,7 @@ CONFIG_NFS_ACL_SUPPORT=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
 CONFIG_SUNRPC_GSS=m
-# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 CONFIG_SMB_FS=m
@@ -986,12 +1094,12 @@ CONFIG_SMB_NLS_REMOTE="cp437"
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
 # CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_UPCALL=y
 # CONFIG_CIFS_XATTR is not set
 # CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 CONFIG_CODA_FS=m
-# CONFIG_CODA_FS_OLD_API is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -1015,10 +1123,6 @@ CONFIG_SGI_PARTITION=y
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_SYSV68_PARTITION is not set
-
-#
-# Native Language Support
-#
 CONFIG_NLS=m
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=m
@@ -1059,30 +1163,32 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-
-#
-# Distributed Lock Manager
-#
 CONFIG_DLM=m
 # CONFIG_DLM_DEBUG is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_CROSSCOMPILE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+CONFIG_DYNAMIC_PRINTK_DEBUG=y
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_CMDLINE=""
 
 #
@@ -1091,46 +1197,97 @@ CONFIG_CMDLINE=""
 CONFIG_KEYS=y
 CONFIG_KEYS_DEBUG_PROC_KEYS=y
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_SECURITY_FILE_CAPABILITIES=y
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_FIPS=y
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ABLKCIPHER=m
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=m
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-CONFIG_CRYPTO_GF128MUL=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_DES=m
-CONFIG_CRYPTO_FCRYPT=m
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-CONFIG_CRYPTO_CAMELLIA=m
-# CONFIG_CRYPTO_TEST is not set
+CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
 # CONFIG_CRYPTO_HW is not set
 
 #
@@ -1139,12 +1296,15 @@ CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_BITREVERSE=m
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC16=m
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_T10DIF=m
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=m
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
+CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_DECOMPRESS=m
 CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
index fe4699df9626c27fc1113c0d6d9e09c36c7277e8..de4c7a0a96ddde228e6b2806ea5f5a48a8758a4c 100644 (file)
@@ -1,71 +1,71 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20
-# Tue Feb 20 21:47:33 2007
+# Linux kernel version: 2.6.28-rc7
+# Wed Dec 10 14:39:08 2008
 #
 CONFIG_MIPS=y
 
 #
 # Machine selection
 #
-CONFIG_ZONE_DMA=y
-# CONFIG_MIPS_MTX1 is not set
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_PB1200 is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-# CONFIG_MIPS_DB1200 is not set
-# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MACH_ALCHEMY is not set
 # CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_LEMOTE_FULONG is not set
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_WR_PPMC is not set
 # CONFIG_MIPS_SIM is not set
-# CONFIG_MOMENCO_JAGUAR_ATX is not set
-# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_MACH_EMMA is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
 # CONFIG_PNX8550_JBS is not set
 # CONFIG_PNX8550_STB810 is not set
-# CONFIG_MACH_VR41XX is not set
+# CONFIG_PMC_MSP is not set
 # CONFIG_PMC_YOSEMITE is not set
-# CONFIG_MARKEINS is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
 CONFIG_SGI_IP32=y
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
 # CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
 # CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
 # CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
+# CONFIG_WR_PPMC is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 # CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
 CONFIG_ARC=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_NO_IOPORT is not set
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_IRQ_CPU=y
 CONFIG_ARC32=y
 CONFIG_BOOT_ELF32=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -75,6 +75,7 @@ CONFIG_ARC_PROMLIB=y
 #
 # CPU selection
 #
+# CONFIG_CPU_LOONGSON2 is not set
 # CONFIG_CPU_MIPS32_R1 is not set
 # CONFIG_CPU_MIPS32_R2 is not set
 # CONFIG_CPU_MIPS64_R1 is not set
@@ -87,6 +88,7 @@ CONFIG_ARC_PROMLIB=y
 # CONFIG_CPU_TX49XX is not set
 CONFIG_CPU_R5000=y
 # CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
 # CONFIG_CPU_R6000 is not set
 # CONFIG_CPU_NEVADA is not set
 # CONFIG_CPU_R8000 is not set
@@ -116,65 +118,73 @@ CONFIG_RM7000_CPU_SCACHE=y
 CONFIG_MIPS_MT_DISABLED=y
 # CONFIG_MIPS_MT_SMP is not set
 # CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_VPE_LOADER is not set
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
-CONFIG_ZONE_DMA_FLAG=1
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_48 is not set
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_128 is not set
-# CONFIG_HZ_250 is not set
+CONFIG_HZ_250=y
 # CONFIG_HZ_256 is not set
-CONFIG_HZ_1000=y
+# CONFIG_HZ_1000 is not set
 # CONFIG_HZ_1024 is not set
 CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_HZ=1000
-# CONFIG_PREEMPT_NONE is not set
-CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_KEXEC is not set
+# CONFIG_SECCOMP is not set
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
-# CONFIG_POSIX_MQUEUE is not set
+CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
-# CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_SYSCTL_SYSCALL=y
@@ -184,27 +194,43 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-
-#
-# Block layer
-#
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -213,59 +239,50 @@ CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_AS is not set
 # CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
 CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
 CONFIG_MMU=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
-
-#
-# PCI Hotplug Support
-#
 # CONFIG_HOTPLUG_PCI is not set
 
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=y
-# CONFIG_BUILD_ELF64 is not set
 CONFIG_MIPS32_COMPAT=y
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_MIPS32_O32=y
-# CONFIG_MIPS32_N32 is not set
+CONFIG_MIPS32_N32=y
 CONFIG_BINFMT_ELF32=y
 
 #
 # Power management options
 #
-CONFIG_PM=y
-# CONFIG_PM_LEGACY is not set
-# CONFIG_PM_DEBUG is not set
-# CONFIG_PM_SYSFS_DEPRECATED is not set
-
-#
-# Networking
-#
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PM is not set
 CONFIG_NET=y
 
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
@@ -273,56 +290,83 @@ CONFIG_XFRM=y
 CONFIG_XFRM_USER=y
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
 CONFIG_NET_KEY=y
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set
+CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_FIB_HASH=y
 CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
 # CONFIG_SYN_COOKIES is not set
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
 CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_DEFAULT_BIC is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
 CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
 CONFIG_NETWORK_SECMARK=y
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
@@ -332,10 +376,6 @@ CONFIG_NETWORK_SECMARK=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -343,15 +383,14 @@ CONFIG_NETWORK_SECMARK=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
-CONFIG_IEEE80211=y
-# CONFIG_IEEE80211_DEBUG is not set
-CONFIG_IEEE80211_CRYPT_WEP=y
-CONFIG_IEEE80211_CRYPT_CCMP=y
-CONFIG_IEEE80211_SOFTMAC=y
-# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
-CONFIG_WIRELESS_EXT=y
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -360,60 +399,40 @@ CONFIG_WIRELESS_EXT=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 CONFIG_CONNECTOR=y
 CONFIG_PROC_EVENTS=y
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
 # CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
-CONFIG_CDROM_PKTCDVD=y
-CONFIG_CDROM_PKTCDVD_BUFFERS=8
-# CONFIG_CDROM_PKTCDVD_WCACHE is not set
-CONFIG_ATA_OVER_ETH=y
-
-#
-# Misc devices
-#
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
 CONFIG_SGI_IOC4=y
 # CONFIG_TIFM_CORE is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HP_ILO is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -421,19 +440,20 @@ CONFIG_SGI_IOC4=y
 #
 CONFIG_RAID_ATTRS=y
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 CONFIG_SCSI_TGT=y
-CONFIG_SCSI_NETLINK=y
+# CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
 #
 CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_ST=y
-CONFIG_CHR_DEV_OSST=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
 CONFIG_BLK_DEV_SR=y
 CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SG=m
 # CONFIG_CHR_DEV_SCH is not set
 
 #
@@ -443,35 +463,36 @@ CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
 #
 CONFIG_SCSI_SPI_ATTRS=y
-CONFIG_SCSI_FC_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 CONFIG_SCSI_SAS_ATTRS=y
 CONFIG_SCSI_SAS_LIBSAS=y
+CONFIG_SCSI_SAS_HOST_SMP=y
 # CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 CONFIG_SCSI_AIC7XXX=y
-CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
 CONFIG_AIC7XXX_DEBUG_ENABLE=y
 CONFIG_AIC7XXX_DEBUG_MASK=0
 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-CONFIG_SCSI_AIC94XX=y
-# CONFIG_AIC94XX_DEBUG is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -482,6 +503,7 @@ CONFIG_SCSI_AIC94XX=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -492,147 +514,81 @@ CONFIG_SCSI_AIC94XX=y
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
+# CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
-# CONFIG_IEEE1394 is not set
 
 #
-# I2O device support
+# Enable only one of the two stacks, unless you know what you are doing
 #
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# ARCnet devices
-#
+# CONFIG_VETH is not set
 # CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
-CONFIG_PHYLIB=y
-
-#
-# MII PHY device drivers
-#
-CONFIG_MARVELL_PHY=y
-CONFIG_DAVICOM_PHY=y
-CONFIG_QSEMI_PHY=y
-CONFIG_LXT_PHY=y
-CONFIG_CICADA_PHY=y
-CONFIG_VITESSE_PHY=y
-CONFIG_SMSC_PHY=y
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_FIXED_PHY is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
+# CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
 CONFIG_SGI_O2MACE_ETH=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
-
-#
-# Tulip family network device support
-#
-# CONFIG_NET_TULIP is not set
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_ULI526X is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 # CONFIG_NET_PCI is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SKGE is not set
-# CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2 is not set
-CONFIG_QLA3XXX=y
-# CONFIG_ATL1 is not set
-
-#
-# Ethernet (10000 Mbit)
-#
-# CONFIG_CHELSIO_T1 is not set
-CONFIG_CHELSIO_T3=y
-# CONFIG_IXGB is not set
-# CONFIG_S2IO is not set
-# CONFIG_MYRI10GE is not set
-CONFIG_NETXEN_NIC=y
-
-#
-# Token Ring devices
-#
+# CONFIG_B44 is not set
+# CONFIG_ATL2 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -640,6 +596,7 @@ CONFIG_NETXEN_NIC=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -649,16 +606,32 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
+CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_EVBUG is not set
 
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -669,8 +642,8 @@ CONFIG_SERIO=y
 # CONFIG_SERIO_I8042 is not set
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_PCIPS2 is not set
-# CONFIG_SERIO_MACEPS2 is not set
-# CONFIG_SERIO_LIBPS2 is not set
+CONFIG_SERIO_MACEPS2=y
+CONFIG_SERIO_LIBPS2=y
 CONFIG_SERIO_RAW=y
 # CONFIG_GAMEPORT is not set
 
@@ -678,10 +651,13 @@ CONFIG_SERIO_RAW=y
 # Character devices
 #
 CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -702,192 +678,304 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_RTC is not set
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
+CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_I5K_AMB is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
 
 #
-# I2C support
+# Watchdog Device Drivers
 #
-# CONFIG_I2C is not set
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_ALIM7101_WDT is not set
 
 #
-# SPI support
+# PCI-based Watchdog Cards
 #
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+CONFIG_SSB_POSSIBLE=y
 
 #
-# Dallas's 1-wire bus
+# Sonics Silicon Backplane
 #
-# CONFIG_W1 is not set
+# CONFIG_SSB is not set
 
 #
-# Hardware Monitoring support
+# Multifunction device drivers
 #
-# CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
 #
-# CONFIG_VIDEO_DEV is not set
 
 #
-# Digital Video Broadcasting Devices
+# Multimedia core support
 #
-# CONFIG_DVB is not set
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=m
 
 #
-# Graphics support
+# Multimedia drivers
 #
-# CONFIG_FIRMWARE_EDID is not set
-# CONFIG_FB is not set
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_VIVI=m
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+CONFIG_DAB=y
 
 #
-# Console display driver support
+# Graphics support
 #
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_UVESA is not set
+CONFIG_FB_GBE=y
+CONFIG_FB_GBE_MEM=4
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Sound
+# Display device support
 #
-# CONFIG_SOUND is not set
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
-# HID Devices
+# Console display driver support
 #
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_LOGO_SGI_CLUT224=y
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
 
 #
-# USB support
-#
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-# CONFIG_USB is not set
-
-#
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-#
-
-#
-# USB Gadget Support
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
+# Special HID drivers
 #
+CONFIG_HID_COMPAT=y
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_UWB is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+# CONFIG_RTC_DEBUG is not set
 
 #
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+# RTC interfaces
 #
+# CONFIG_RTC_INTF_SYSFS is not set
+# CONFIG_RTC_INTF_PROC is not set
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# Real Time Clock
+# SPI RTC drivers
 #
-# CONFIG_RTC_CLASS is not set
 
 #
-# DMA Engine support
+# Platform RTC drivers
 #
-# CONFIG_DMA_ENGINE is not set
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Auxiliary Display support
-#
-
-#
-# Virtualization
+# on-CPU RTC drivers
 #
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
 #
 CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
 # CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4DEV_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-CONFIG_FUSE_FS=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
 CONFIG_GENERIC_ACL=y
 
 #
 # CD-ROM/DVD Filesystems
 #
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
 #
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -896,11 +984,11 @@ CONFIG_GENERIC_ACL=y
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=y
 
 #
@@ -916,33 +1004,42 @@ CONFIG_CONFIGFS_FS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
@@ -953,45 +1050,83 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_AMIGA_PARTITION is not set
 # CONFIG_ATARI_PARTITION is not set
 # CONFIG_MAC_PARTITION is not set
-# CONFIG_MSDOS_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
-
-#
-# Native Language Support
-#
-# CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
-CONFIG_DLM=y
-CONFIG_DLM_TCP=y
-# CONFIG_DLM_SCTP is not set
-# CONFIG_DLM_DEBUG is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+# CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
-# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_CROSSCOMPILE=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_CMDLINE=""
 
 #
@@ -1000,51 +1135,99 @@ CONFIG_CMDLINE=""
 CONFIG_KEYS=y
 CONFIG_KEYS_DEBUG_PROC_KEYS=y
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
 
 #
-# Cryptographic options
+# Crypto core or helper
 #
-CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=y
+CONFIG_CRYPTO_NULL=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=y
+CONFIG_CRYPTO_PCBC=y
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=y
-CONFIG_CRYPTO_NULL=y
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 CONFIG_CRYPTO_SHA1=y
 CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_WP512=y
 CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_GF128MUL=y
-CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_DES=y
-CONFIG_CRYPTO_FCRYPT=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_TWOFISH=y
-CONFIG_CRYPTO_TWOFISH_COMMON=y
-CONFIG_CRYPTO_SERPENT=y
+CONFIG_CRYPTO_WP512=y
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=y
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=y
+CONFIG_CRYPTO_CAMELLIA=y
 CONFIG_CRYPTO_CAST5=y
 CONFIG_CRYPTO_CAST6=y
-CONFIG_CRYPTO_TEA=y
-CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=y
 CONFIG_CRYPTO_KHAZAD=y
-CONFIG_CRYPTO_ANUBIS=y
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=y
+CONFIG_CRYPTO_TEA=y
+CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_TWOFISH_COMMON=y
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_MICHAEL_MIC=y
-CONFIG_CRYPTO_CRC32C=y
-CONFIG_CRYPTO_CAMELLIA=y
+# CONFIG_CRYPTO_LZO is not set
 
 #
-# Hardware crypto devices
+# Random Number Generation
 #
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
@@ -1052,10 +1235,15 @@ CONFIG_CRYPTO_CAMELLIA=y
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=y
+CONFIG_AUDIT_GENERIC=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 74daa0cf87e6800cea3a7c3e71b7bf8b9801e5d5..1ecdd3b65dc7bc7f9e11c1e29aa09bc514a55da7 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc2
-# Tue Aug  7 12:59:29 2007
+# Linux kernel version: 2.6.28-rc6
+# Mon Dec  1 08:08:19 2008
 #
 CONFIG_MIPS=y
 
@@ -11,20 +11,25 @@ CONFIG_MIPS=y
 CONFIG_ZONE_DMA=y
 # CONFIG_MACH_ALCHEMY is not set
 # CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
 # CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
 # CONFIG_LEMOTE_FULONG is not set
 CONFIG_MIPS_MALTA=y
 # CONFIG_MIPS_SIM is not set
-# CONFIG_MARKEINS is not set
+# CONFIG_MACH_EMMA is not set
 # CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
 # CONFIG_PNX8550_JBS is not set
 # CONFIG_PNX8550_STB810 is not set
 # CONFIG_PMC_MSP is not set
 # CONFIG_PMC_YOSEMITE is not set
 # CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_CRHINE is not set
 # CONFIG_SIBYTE_CARMEL is not set
@@ -35,13 +40,14 @@ CONFIG_MIPS_MALTA=y
 # CONFIG_SIBYTE_SENTOSA is not set
 # CONFIG_SIBYTE_BIGSUR is not set
 # CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
 # CONFIG_WR_PPMC is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
@@ -51,21 +57,26 @@ CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 # CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_BOOT_RAW=y
 CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NEED_PCI_MAP_STATE=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_HOTPLUG_CPU is not set
 CONFIG_I8259=y
 CONFIG_MIPS_BONITO64=y
 CONFIG_MIPS_MSC=y
 # CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_ISA_DMA=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
 CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
+CONFIG_IRQ_GIC=y
+CONFIG_MIPS_BOARDS_GEN=y
 CONFIG_PCI_GT64XXX_PCI0=y
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_BOOT_ELF32=y
@@ -74,10 +85,6 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
 #
 # CPU selection
 #
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_CPU_LOONGSON2 is not set
 # CONFIG_CPU_MIPS32_R1 is not set
 CONFIG_CPU_MIPS32_R2=y
@@ -91,6 +98,7 @@ CONFIG_CPU_MIPS32_R2=y
 # CONFIG_CPU_TX49XX is not set
 # CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
 # CONFIG_CPU_R6000 is not set
 # CONFIG_CPU_NEVADA is not set
 # CONFIG_CPU_R8000 is not set
@@ -108,6 +116,7 @@ CONFIG_CPU_MIPSR2=y
 CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
 CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_HARDWARE_WATCHPOINTS=y
 
 #
 # Kernel type
@@ -125,6 +134,8 @@ CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_MIPS_MT_SMP=y
 # CONFIG_MIPS_MT_SMTC is not set
 CONFIG_MIPS_MT=y
+# CONFIG_SCHED_SMT is not set
+CONFIG_SYS_SUPPORTS_SCHED_SMT=y
 CONFIG_SYS_SUPPORTS_MULTITHREADING=y
 CONFIG_MIPS_MT_FPAFF=y
 # CONFIG_MIPS_VPE_LOADER is not set
@@ -132,7 +143,6 @@ CONFIG_CPU_HAS_LLSC=y
 # CONFIG_CPU_HAS_SMARTMIPS is not set
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_MIPSR2_IRQ_EI=y
-CONFIG_CPU_MIPSR2_SRS=y
 CONFIG_CPU_HAS_SYNC=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
@@ -140,22 +150,30 @@ CONFIG_IRQ_PER_CPU=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_SYS_SUPPORTS_SMARTMIPS=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
 CONFIG_SMP=y
+CONFIG_SMP_UP=y
 CONFIG_SYS_SUPPORTS_SMP=y
 CONFIG_NR_CPUS_DEFAULT_2=y
 CONFIG_NR_CPUS=2
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_48 is not set
 CONFIG_HZ_100=y
 # CONFIG_HZ_128 is not set
@@ -168,7 +186,6 @@ CONFIG_HZ=100
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_BKL=y
 # CONFIG_KEXEC is not set
 CONFIG_SECCOMP=y
 CONFIG_LOCKDEP_SUPPORT=y
@@ -189,13 +206,19 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=15
-# CONFIG_CPUSETS is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -207,6 +230,8 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
@@ -215,14 +240,23 @@ CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
+CONFIG_AIO=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -234,6 +268,7 @@ CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
 
 #
 # IO Schedulers
@@ -247,19 +282,19 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
 CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
 # CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 CONFIG_MMU=y
 CONFIG_I8253=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 
@@ -267,6 +302,8 @@ CONFIG_I8253=y
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
 CONFIG_TRAD_SIGNALS=y
 
@@ -274,12 +311,7 @@ CONFIG_TRAD_SIGNALS=y
 # Power management options
 #
 CONFIG_PM=y
-# CONFIG_PM_LEGACY is not set
 # CONFIG_PM_DEBUG is not set
-
-#
-# Networking
-#
 CONFIG_NET=y
 
 #
@@ -292,6 +324,8 @@ CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
 CONFIG_NET_KEY=y
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
@@ -323,42 +357,13 @@ CONFIG_INET_TUNNEL=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=m
 CONFIG_INET_XFRM_MODE_TUNNEL=m
 CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=m
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
-CONFIG_IP_VS=m
-# CONFIG_IP_VS_DEBUG is not set
-CONFIG_IP_VS_TAB_BITS=12
-
-#
-# IPVS transport protocol load balancing support
-#
-CONFIG_IP_VS_PROTO_TCP=y
-CONFIG_IP_VS_PROTO_UDP=y
-CONFIG_IP_VS_PROTO_ESP=y
-CONFIG_IP_VS_PROTO_AH=y
-
-#
-# IPVS scheduler
-#
-CONFIG_IP_VS_RR=m
-CONFIG_IP_VS_WRR=m
-CONFIG_IP_VS_LC=m
-CONFIG_IP_VS_WLC=m
-CONFIG_IP_VS_LBLC=m
-CONFIG_IP_VS_LBLCR=m
-CONFIG_IP_VS_DH=m
-CONFIG_IP_VS_SH=m
-CONFIG_IP_VS_SED=m
-CONFIG_IP_VS_NQ=m
-
-#
-# IPVS application helper
-#
-CONFIG_IP_VS_FTP=m
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -375,11 +380,15 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=m
 CONFIG_INET6_XFRM_MODE_BEET=m
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
 CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
 CONFIG_IPV6_TUNNEL=m
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_PIMSM_V2=y
 CONFIG_NETWORK_SECMARK=y
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 CONFIG_BRIDGE_NETFILTER=y
 
 #
@@ -388,12 +397,12 @@ CONFIG_BRIDGE_NETFILTER=y
 CONFIG_NETFILTER_NETLINK=m
 CONFIG_NETFILTER_NETLINK_QUEUE=m
 CONFIG_NETFILTER_NETLINK_LOG=m
-CONFIG_NF_CONNTRACK_ENABLED=m
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CT_ACCT=y
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CT_PROTO_DCCP=m
 CONFIG_NF_CT_PROTO_GRE=m
 CONFIG_NF_CT_PROTO_SCTP=m
 CONFIG_NF_CT_PROTO_UDPLITE=m
@@ -407,18 +416,22 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_TPROXY=m
 CONFIG_NETFILTER_XTABLES=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+# CONFIG_NETFILTER_XT_TARGET_CONNSECMARK is not set
 # CONFIG_NETFILTER_XT_TARGET_DSCP is not set
 CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
 CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TPROXY=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
 CONFIG_NETFILTER_XT_TARGET_SECMARK=m
-# CONFIG_NETFILTER_XT_TARGET_CONNSECMARK is not set
 CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
 CONFIG_NETFILTER_XT_MATCH_COMMENT=m
 CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
 CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
@@ -427,40 +440,76 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
 CONFIG_NETFILTER_XT_MATCH_DCCP=m
 # CONFIG_NETFILTER_XT_MATCH_DSCP is not set
 CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
 CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_POLICY=m
 CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
 # CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
 CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
 CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
 CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_SOCKET=m
 CONFIG_NETFILTER_XT_MATCH_STATE=m
 CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
 CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
 
 #
 # IP: Netfilter Configuration
 #
+CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
 CONFIG_NF_CONNTRACK_PROC_COMPAT=y
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_TOS=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_OWNER=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
@@ -468,11 +517,13 @@ CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_NF_NAT=m
 CONFIG_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
-CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_DCCP=m
 CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
 CONFIG_NF_NAT_FTP=m
 CONFIG_NF_NAT_IRC=m
 CONFIG_NF_NAT_TFTP=m
@@ -481,40 +532,34 @@ CONFIG_NF_NAT_PPTP=m
 CONFIG_NF_NAT_H323=m
 CONFIG_NF_NAT_SIP=m
 CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 
 #
-# IPv6: Netfilter Configuration (EXPERIMENTAL)
+# IPv6: Netfilter Configuration
 #
 CONFIG_NF_CONNTRACK_IPV6=m
 CONFIG_IP6_NF_QUEUE=m
 CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
-CONFIG_IP6_NF_MATCH_OWNER=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_HL=m
 CONFIG_IP6_NF_RAW=m
-
-#
-# Bridge: Netfilter Configuration
-#
 CONFIG_BRIDGE_NF_EBTABLES=m
 CONFIG_BRIDGE_EBT_BROUTE=m
 CONFIG_BRIDGE_EBT_T_FILTER=m
@@ -523,6 +568,7 @@ CONFIG_BRIDGE_EBT_802_3=m
 CONFIG_BRIDGE_EBT_AMONG=m
 CONFIG_BRIDGE_EBT_ARP=m
 CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_IP6=m
 CONFIG_BRIDGE_EBT_LIMIT=m
 CONFIG_BRIDGE_EBT_MARK=m
 CONFIG_BRIDGE_EBT_PKTTYPE=m
@@ -535,6 +581,7 @@ CONFIG_BRIDGE_EBT_REDIRECT=m
 CONFIG_BRIDGE_EBT_SNAT=m
 CONFIG_BRIDGE_EBT_LOG=m
 CONFIG_BRIDGE_EBT_ULOG=m
+CONFIG_BRIDGE_EBT_NFLOG=m
 # CONFIG_IP_DCCP is not set
 CONFIG_IP_SCTP=m
 # CONFIG_SCTP_DBG_MSG is not set
@@ -544,8 +591,12 @@ CONFIG_IP_SCTP=m
 CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
+CONFIG_STP=m
+CONFIG_GARP=m
 CONFIG_BRIDGE=m
+# CONFIG_NET_DSA is not set
 CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
 # CONFIG_DECNET is not set
 CONFIG_LLC=m
 # CONFIG_LLC2 is not set
@@ -559,12 +610,7 @@ CONFIG_IPDDP_DECAP=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_FIFO=y
 
 #
 # Queueing/Scheduling
@@ -573,7 +619,7 @@ CONFIG_NET_SCH_CBQ=m
 CONFIG_NET_SCH_HTB=m
 CONFIG_NET_SCH_HFSC=m
 CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RR=m
+# CONFIG_NET_SCH_MULTIQ is not set
 CONFIG_NET_SCH_RED=m
 CONFIG_NET_SCH_SFQ=m
 CONFIG_NET_SCH_TEQL=m
@@ -597,6 +643,7 @@ CONFIG_NET_CLS_U32=m
 # CONFIG_CLS_U32_MARK is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FLOW=m
 # CONFIG_NET_EMATCH is not set
 CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_POLICE=y
@@ -604,37 +651,51 @@ CONFIG_NET_ACT_GACT=m
 CONFIG_GACT_PROB=y
 CONFIG_NET_ACT_MIRRED=m
 CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_NAT=m
 CONFIG_NET_ACT_PEDIT=m
 CONFIG_NET_ACT_SIMP=m
-CONFIG_NET_CLS_POLICE=y
+CONFIG_NET_ACT_SKBEDIT=m
 CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
+CONFIG_PHONET=m
 CONFIG_FIB_RULES=y
-
-#
-# Wireless
-#
+CONFIG_WIRELESS=y
 CONFIG_CFG80211=m
+CONFIG_NL80211=y
+CONFIG_WIRELESS_OLD_REGULATORY=y
 CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
 CONFIG_MAC80211=m
-# CONFIG_MAC80211_DEBUG is not set
+
+#
+# Rate control algorithm selection
+#
+CONFIG_MAC80211_RC_PID=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+CONFIG_MAC80211_MESH=y
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUG_MENU is not set
 CONFIG_IEEE80211=m
 # CONFIG_IEEE80211_DEBUG is not set
 CONFIG_IEEE80211_CRYPT_WEP=m
 CONFIG_IEEE80211_CRYPT_CCMP=m
 CONFIG_IEEE80211_CRYPT_TKIP=m
-CONFIG_IEEE80211_SOFTMAC=m
-# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
 CONFIG_RFKILL=m
 CONFIG_RFKILL_INPUT=m
+CONFIG_RFKILL_LEDS=y
 # CONFIG_NET_9P is not set
 
 #
@@ -644,9 +705,12 @@ CONFIG_RFKILL_INPUT=m
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_SYS_HYPERVISOR is not set
 CONFIG_CONNECTOR=m
 CONFIG_MTD=y
@@ -655,6 +719,7 @@ CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
 # CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
 
 #
 # User Modules And Translation Layers
@@ -667,6 +732,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+CONFIG_MTD_OOPS=m
 
 #
 # RAM/ROM/Flash chip drivers
@@ -701,6 +767,7 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_START=0x0
 CONFIG_MTD_PHYSMAP_LEN=0x0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=0
+# CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -748,25 +815,26 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 # CONFIG_CDROM_PKTCDVD_WCACHE is not set
 CONFIG_ATA_OVER_ETH=m
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 CONFIG_IDE=y
-CONFIG_IDE_MAX_HWIFS=4
-CONFIG_BLK_DEV_IDE=y
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
 #
 # CONFIG_BLK_DEV_IDE_SATA is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_PROC_FS=y
@@ -775,24 +843,25 @@ CONFIG_IDE_PROC_FS=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+CONFIG_BLK_DEV_IDEDMA_SFF=y
+
+#
+# PCI IDE chipsets support
+#
 CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-# CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
@@ -808,10 +877,7 @@ CONFIG_BLK_DEV_IT8213=m
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
 CONFIG_BLK_DEV_TC86C001=m
-# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_IVB is not set
-# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
@@ -848,8 +914,10 @@ CONFIG_SCSI_WAIT_SCAN=m
 #
 CONFIG_SCSI_SPI_ATTRS=m
 CONFIG_SCSI_FC_ATTRS=m
+# CONFIG_SCSI_FC_TGT_ATTRS is not set
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
 CONFIG_BLK_DEV_3W_XXXX_RAID=m
@@ -866,6 +934,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
 # CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -876,6 +945,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -887,6 +957,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
 # CONFIG_ATA is not set
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=m
@@ -905,32 +976,28 @@ CONFIG_DM_SNAPSHOT=m
 CONFIG_DM_MIRROR=m
 CONFIG_DM_ZERO=m
 CONFIG_DM_MULTIPATH=m
-CONFIG_DM_MULTIPATH_EMC=m
-CONFIG_DM_MULTIPATH_RDAC=m
 # CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+# CONFIG_FUSION is not set
 
 #
-# Fusion MPT device support
+# IEEE 1394 (FireWire) support
 #
-# CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
-# IEEE 1394 (FireWire) support
+# Enable only one of the two stacks, unless you know what you are doing
 #
 # CONFIG_FIREWIRE is not set
 # CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
 CONFIG_NETDEVICES=y
-CONFIG_NETDEVICES_MULTIQUEUE=y
 CONFIG_IFB=m
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 CONFIG_MACVLAN=m
 CONFIG_EQUALIZER=m
 CONFIG_TUN=m
+CONFIG_VETH=m
 # CONFIG_ARCNET is not set
 CONFIG_PHYLIB=m
 
@@ -946,26 +1013,34 @@ CONFIG_VITESSE_PHY=m
 CONFIG_SMSC_PHY=m
 CONFIG_BROADCOM_PHY=m
 CONFIG_ICPLUS_PHY=m
-# CONFIG_FIXED_PHY is not set
+CONFIG_REALTEK_PHY=m
+CONFIG_MDIO_BITBANG=m
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 CONFIG_AX88796=m
+# CONFIG_AX88796_93CX6 is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
 CONFIG_TC35815=m
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
@@ -973,16 +1048,21 @@ CONFIG_TC35815=m
 # CONFIG_NE2K_PCI is not set
 # CONFIG_8139CP is not set
 # CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
 CONFIG_NETDEV_1000=y
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -995,14 +1075,24 @@ CONFIG_NETDEV_1000=y
 # CONFIG_BNX2 is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_JME is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 CONFIG_CHELSIO_T3=m
+# CONFIG_ENIC is not set
+# CONFIG_IXGBE is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 CONFIG_NETXEN_NIC=m
+# CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -1022,6 +1112,7 @@ CONFIG_IPW2200_QOS=y
 # CONFIG_IPW2200_DEBUG is not set
 CONFIG_LIBERTAS=m
 # CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
 CONFIG_HERMES=m
 CONFIG_PLX_HERMES=m
 CONFIG_TMD_HERMES=m
@@ -1030,25 +1121,30 @@ CONFIG_PCI_HERMES=m
 CONFIG_ATMEL=m
 CONFIG_PCI_ATMEL=m
 CONFIG_PRISM54=m
+# CONFIG_RTL8180 is not set
+# CONFIG_ADM8211 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_ATH5K is not set
+# CONFIG_ATH9K is not set
+# CONFIG_IWLCORE is not set
+# CONFIG_IWLWIFI_LEDS is not set
+# CONFIG_IWLAGN is not set
+# CONFIG_IWL3945 is not set
 CONFIG_HOSTAP=m
 CONFIG_HOSTAP_FIRMWARE=y
 CONFIG_HOSTAP_FIRMWARE_NVRAM=y
 CONFIG_HOSTAP_PLX=m
 CONFIG_HOSTAP_PCI=m
-CONFIG_BCM43XX=m
-CONFIG_BCM43XX_DEBUG=y
-CONFIG_BCM43XX_DMA=y
-CONFIG_BCM43XX_PIO=y
-CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
-# CONFIG_BCM43XX_DMA_MODE is not set
-# CONFIG_BCM43XX_PIO_MODE is not set
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_RT2X00 is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -1070,7 +1166,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -1099,10 +1194,13 @@ CONFIG_SERIO_SERPORT=y
 # Character devices
 #
 CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -1124,101 +1222,165 @@ CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=m
-CONFIG_RTC=y
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
+# CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
 # Graphics support
 #
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
-
-#
-# Sound
-#
 # CONFIG_SOUND is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=m
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# Enable Host or Gadget support to see Inventra options
 #
 
 #
-# USB Gadget Support
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 # CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
 # CONFIG_MMC is not set
-# CONFIG_NEW_LEDS is not set
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
 
 #
-# DMA Engine support
+# RTC interfaces
 #
-# CONFIG_DMA_ENGINE is not set
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# DMA Clients
+# SPI RTC drivers
 #
 
 #
-# DMA Devices
+# Platform RTC drivers
 #
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# Userspace I/O
+# on-CPU RTC drivers
 #
+# CONFIG_DMADEVICES is not set
 CONFIG_UIO=m
 CONFIG_UIO_CIF=m
+# CONFIG_UIO_PDRV is not set
+# CONFIG_UIO_PDRV_GENIRQ is not set
+# CONFIG_UIO_SMX is not set
+# CONFIG_UIO_SERCOS3 is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -1230,9 +1392,8 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
-# CONFIG_EXT4DEV_FS is not set
+# CONFIG_EXT4_FS is not set
 CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
@@ -1246,22 +1407,22 @@ CONFIG_JFS_SECURITY=y
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
 CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
 CONFIG_XFS_FS=m
 CONFIG_XFS_QUOTA=y
-CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
-# CONFIG_GFS2_FS is not set
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_OCFS2_FS is not set
-CONFIG_MINIX_FS=m
-CONFIG_ROMFS_FS=m
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
 # CONFIG_QFMT_V1 is not set
 CONFIG_QFMT_V2=y
 CONFIG_QUOTACTL=y
-CONFIG_DNOTIFY=y
 CONFIG_AUTOFS_FS=y
 # CONFIG_AUTOFS4_FS is not set
 CONFIG_FUSE_FS=m
@@ -1291,11 +1452,11 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1312,46 +1473,48 @@ CONFIG_EFS_FS=m
 CONFIG_JFFS2_FS=m
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
 # CONFIG_JFFS2_SUMMARY is not set
 CONFIG_JFFS2_FS_XATTR=y
 CONFIG_JFFS2_FS_POSIX_ACL=y
 CONFIG_JFFS2_FS_SECURITY=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
 CONFIG_JFFS2_RTIME=y
 CONFIG_JFFS2_RUBIN=y
 # CONFIG_JFFS2_CMODE_NONE is not set
 CONFIG_JFFS2_CMODE_PRIORITY=y
 # CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+# CONFIG_UBIFS_FS is not set
 CONFIG_CRAMFS=m
 CONFIG_VXFS_FS=m
+CONFIG_MINIX_FS=m
+# CONFIG_OMFS_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=m
 CONFIG_SYSV_FS=m
 CONFIG_UFS_FS=m
 # CONFIG_UFS_FS_WRITE is not set
 # CONFIG_UFS_DEBUG is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
 # CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
+CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V3_ACL is not set
 # CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_SUNRPC_REGISTER_V4 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1365,10 +1528,6 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=m
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=m
@@ -1409,29 +1568,30 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
 #
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_CROSSCOMPILE=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_CMDLINE=""
 
 #
@@ -1439,51 +1599,103 @@ CONFIG_CMDLINE=""
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
 CONFIG_ASYNC_MEMCPY=m
 CONFIG_ASYNC_XOR=m
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ABLKCIPHER=m
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=m
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-CONFIG_CRYPTO_GF128MUL=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_LRW=m
-CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_DES=m
-CONFIG_CRYPTO_FCRYPT=m
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-CONFIG_CRYPTO_CAMELLIA=m
-# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
@@ -1491,7 +1703,8 @@ CONFIG_CRYPTO_HW=y
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC16=m
-# CONFIG_CRC_ITU_T is not set
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
index 7a881755800f94a4be165b989a9f2f54fb6ffaa1..6c8342ae74db88cd3187d1964274aa03c6031165 100644 (file)
        mtc0    \reg, CP0_TCSTATUS
        _ehb
        .endm
+#elif defined(CONFIG_CPU_MIPSR2)
+       .macro  local_irq_enable reg=t0
+       ei
+       irq_enable_hazard
+       .endm
+
+       .macro  local_irq_disable reg=t0
+       di
+       irq_disable_hazard
+       .endm
 #else
        .macro  local_irq_enable reg=t0
        mfc0    \reg, CP0_STATUS
index 2988d29a0867f4c0ce187040e710e3c87344030d..33790b9e0cc0d46ee41f0ec8d3f3dbf181c8a9fc 100644 (file)
@@ -50,9 +50,8 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
 {
        __asm__(
-       "       dsbh    %0, %1                  \n"
-       "       dshd    %0, %0                  \n"
-       "       drotr   %0, %0, 32              \n"
+       "       dsbh    %0, %1\n"
+       "       dshd    %0, %0"
        : "=r" (x)
        : "r" (x));
 
index a8eac1697b3ddcf05dccc71d42267c549cc40904..d58f128aa747be974ac10ffd5fb1749d3292f505 100644 (file)
@@ -232,7 +232,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  */
 #ifdef __MIPSEB__
 #define ELF_DATA       ELFDATA2MSB
-#elif __MIPSEL__
+#elif defined(__MIPSEL__)
 #define ELF_DATA       ELFDATA2LSB
 #endif
 #define ELF_ARCH       EM_MIPS
index 5510c53b7feb7f5b7d2e721b70c763d055f8ef0d..053e4634acee61b78ca8e3d4cd2fded4c4e2aa06 100644 (file)
@@ -79,6 +79,11 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
        /* We don't do dynamic PCI IRQ allocation */
 }
 
+#define HAVE_PCI_MMAP
+
+extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+       enum pci_mmap_state mmap_state, int write_combine);
+
 /*
  * Dynamic DMA mapping stuff.
  * MIPS has everything mapped statically.
index 759f68066b5d529991dea584758d46c26ef1887b..d0916a55cd775f09f54826eb9358c626ba19dd7d 100644 (file)
@@ -262,14 +262,11 @@ bad_alignment:
        LEAF(sys_syscall)
        subu    t0, a0, __NR_O32_Linux  # check syscall number
        sltiu   v0, t0, __NR_O32_Linux_syscalls + 1
+       beqz    t0, einval              # do not recurse
        sll     t1, t0, 3
        beqz    v0, einval
-
        lw      t2, sys_call_table(t1)          # syscall routine
 
-       li      v1, 4000 - __NR_O32_Linux       # index of sys_syscall
-       beq     t0, v1, einval                  # do not recurse
-
        /* Some syscalls like execve get their arguments from struct pt_regs
           and claim zero arguments in the syscall table. Thus we have to
           assume the worst case and shuffle around all potential arguments.
@@ -627,7 +624,7 @@ einval:     li      v0, -ENOSYS
        sys     sys_pselect6            6
        sys     sys_ppoll               5
        sys     sys_unshare             1
-       sys     sys_splice              4
+       sys     sys_splice              6
        sys     sys_sync_file_range     7       /* 4305 */
        sys     sys_tee                 4
        sys     sys_vmsplice            4
index e266b3aa6560fa8de6e3b0fd607bee6a714685a8..30f3b6317a83f1ec7d753cdb49b96d1aedce1186 100644 (file)
@@ -390,7 +390,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_splice
        PTR     sys_sync_file_range
        PTR     sys_tee
-       PTR     sys_vmsplice                    /* 6270 */
+       PTR     compat_sys_vmsplice             /* 6270 */
        PTR     sys_move_pages
        PTR     compat_sys_set_robust_list
        PTR     compat_sys_get_robust_list
index 6c7ef8313ebd702dde4997d225f06189fdb560a0..fefef4af8595493ec3c5414f3fb0fcaff14869b1 100644 (file)
@@ -174,14 +174,12 @@ not_o32_scall:
        END(handle_sys)
 
 LEAF(sys32_syscall)
-       sltu    v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1
+       subu    t0, a0, __NR_O32_Linux  # check syscall number
+       sltiu   v0, t0, __NR_O32_Linux_syscalls + 1
+       beqz    t0, einval              # do not recurse
+       dsll    t1, t0, 3
        beqz    v0, einval
-
-       dsll    v0, a0, 3
-       ld      t2, (sys_call_table - (__NR_O32_Linux * 8))(v0)
-
-       li      v1, 4000                # indirect syscall number
-       beq     a0, v1, einval          # do not recurse
+       ld      t2, sys_call_table(t1)          # syscall routine
 
        move    a0, a1                  # shift argument registers
        move    a1, a2
@@ -198,7 +196,7 @@ LEAF(sys32_syscall)
        jr      t2
        /* Unreached */
 
-einval:        li      v0, -EINVAL
+einval:        li      v0, -ENOSYS
        jr      ra
        END(sys32_syscall)
 
@@ -512,7 +510,7 @@ sys_call_table:
        PTR     sys_splice
        PTR     sys32_sync_file_range           /* 4305 */
        PTR     sys_tee
-       PTR     sys_vmsplice
+       PTR     compat_sys_vmsplice
        PTR     compat_sys_move_pages
        PTR     compat_sys_set_robust_list
        PTR     compat_sys_get_robust_list      /* 4310 */
index 972b2d2b8401b6dd7bd4922690205c6b8f3a5cdf..a1b3da6bad5cb17c577712ac4bf83f439b5d7292 100644 (file)
@@ -1134,7 +1134,7 @@ static int vpe_release(struct inode *inode, struct file *filp)
 
        /* It's good to be able to run the SP and if it chokes have a look at
           the /dev/rt?. But if we reset the pointer to the shared struct we
-          loose what has happened. So perhaps if garbage is sent to the vpe
+          lose what has happened. So perhaps if garbage is sent to the vpe
           device, use it as a trigger for the reset. Hopefully a nice
           executable will be along shortly. */
        if (ret < 0)
index 5b98d0e731c2238ae0f8ff64d3a3d139aa4ef562..e6708b3ad343f478e15a7d1102a90df2c7f61841 100644 (file)
@@ -111,6 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
 void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
        dma_addr_t dma_handle)
 {
+       plat_unmap_dma_mem(dma_handle);
        free_pages((unsigned long) vaddr, get_order(size));
 }
 
@@ -121,6 +122,8 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 {
        unsigned long addr = (unsigned long) vaddr;
 
+       plat_unmap_dma_mem(dma_handle);
+
        if (!plat_device_is_coherent(dev))
                addr = CAC_ADDR(addr);
 
index cef2db8d22253185d8d66402e4e300422fcd4645..32e847808df166cf6469a4d919b2763dd7bde8da 100644 (file)
@@ -7,9 +7,8 @@
 #
 obj-y                          := malta-amon.o malta-cmdline.o \
                                   malta-display.o malta-init.o malta-int.o \
-                                  malta-memory.o malta-mtd.o \
-                                  malta-platform.o malta-reset.o \
-                                  malta-setup.o malta-time.o
+                                  malta-memory.o malta-platform.o \
+                                  malta-reset.o malta-setup.o malta-time.o
 
 obj-$(CONFIG_EARLY_PRINTK)     += malta-console.o
 obj-$(CONFIG_PCI)              += malta-pci.o
diff --git a/arch/mips/mti-malta/malta-mtd.c b/arch/mips/mti-malta/malta-mtd.c
deleted file mode 100644 (file)
index 8ad9bdf..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2006 MIPS Technologies, Inc.
- *     written by Ralf Baechle <ralf@linux-mips.org>
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <mtd/mtd-abi.h>
-
-static struct mtd_partition malta_mtd_partitions[] = {
-       {
-               .name =         "YAMON",
-               .offset =       0x0,
-               .size =         0x100000,
-               .mask_flags =   MTD_WRITEABLE
-       }, {
-               .name =         "User FS",
-               .offset =       0x100000,
-               .size =         0x2e0000
-       }, {
-               .name =         "Board Config",
-               .offset =       0x3e0000,
-               .size =         0x020000,
-               .mask_flags =   MTD_WRITEABLE
-       }
-};
-
-static struct physmap_flash_data malta_flash_data = {
-       .width          = 4,
-       .nr_parts       = ARRAY_SIZE(malta_mtd_partitions),
-       .parts          = malta_mtd_partitions
-};
-
-static struct resource malta_flash_resource = {
-       .start          = 0x1e000000,
-       .end            = 0x1e3fffff,
-       .flags          = IORESOURCE_MEM
-};
-
-static struct platform_device malta_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &malta_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &malta_flash_resource,
-};
-
-static int __init malta_mtd_init(void)
-{
-       platform_device_register(&malta_flash);
-
-       return 0;
-}
-
-module_init(malta_mtd_init)
index 83b9bab3cd3f72c837096a4fa8ef73d0dc26db78..72e32a7715beff770347237d6944472184853cf4 100644 (file)
@@ -3,10 +3,14 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2007 MIPS Technologies, Inc.
+ * Copyright (C) 2006, 07 MIPS Technologies, Inc.
  *   written by Ralf Baechle (ralf@linux-mips.org)
+ *     written by Ralf Baechle <ralf@linux-mips.org>
  *
- * Probe driver for the Malta's UART ports:
+ * Copyright (C) 2008 Wind River Systems, Inc.
+ *   updated by Tiejun Chen <tiejun.chen@windriver.com>
+ *
+ * 1. Probe driver for the Malta's UART ports:
  *
  *   o 2 ports in the SMC SuperIO
  *   o 1 port in the CBUS UART, a discrete 16550 which normally is only used
  *
  * We don't use 8250_platform.c on Malta as it would result in the CBUS
  * UART becoming ttyS0.
+ *
+ * 2. Register RTC-CMOS platform device on Malta.
  */
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/serial_8250.h>
+#include <linux/mc146818rtc.h>
+#include <linux/module.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/platform_device.h>
+#include <mtd/mtd-abi.h>
 
 #define SMC_PORT(base, int)                                            \
 {                                                                      \
@@ -45,21 +56,93 @@ static struct plat_serial8250_port uart8250_data[] = {
        { },
 };
 
-static struct platform_device uart8250_device = {
+static struct platform_device malta_uart8250_device = {
        .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM2,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = uart8250_data,
        },
 };
 
-static int __init uart8250_init(void)
+struct resource malta_rtc_resources[] = {
+       {
+               .start  = RTC_PORT(0),
+               .end    = RTC_PORT(7),
+               .flags  = IORESOURCE_IO,
+       }, {
+               .start  = RTC_IRQ,
+               .end    = RTC_IRQ,
+               .flags  = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device malta_rtc_device = {
+       .name           = "rtc_cmos",
+       .id             = -1,
+       .resource       = malta_rtc_resources,
+       .num_resources  = ARRAY_SIZE(malta_rtc_resources),
+};
+
+static struct mtd_partition malta_mtd_partitions[] = {
+       {
+               .name =         "YAMON",
+               .offset =       0x0,
+               .size =         0x100000,
+               .mask_flags =   MTD_WRITEABLE
+       }, {
+               .name =         "User FS",
+               .offset =       0x100000,
+               .size =         0x2e0000
+       }, {
+               .name =         "Board Config",
+               .offset =       0x3e0000,
+               .size =         0x020000,
+               .mask_flags =   MTD_WRITEABLE
+       }
+};
+
+static struct physmap_flash_data malta_flash_data = {
+       .width          = 4,
+       .nr_parts       = ARRAY_SIZE(malta_mtd_partitions),
+       .parts          = malta_mtd_partitions
+};
+
+static struct resource malta_flash_resource = {
+       .start          = 0x1e000000,
+       .end            = 0x1e3fffff,
+       .flags          = IORESOURCE_MEM
+};
+
+static struct platform_device malta_flash_device = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &malta_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &malta_flash_resource,
+};
+
+static struct platform_device *malta_devices[] __initdata = {
+       &malta_uart8250_device,
+       &malta_rtc_device,
+       &malta_flash_device,
+};
+
+static int __init malta_add_devices(void)
 {
-       return platform_device_register(&uart8250_device);
-}
+       int err;
 
-module_init(uart8250_init);
+       err = platform_add_devices(malta_devices, ARRAY_SIZE(malta_devices));
+       if (err)
+               return err;
+
+       /*
+        * Set RTC to BCD mode to support current alarm code.
+        */
+       CMOS_WRITE(CMOS_READ(RTC_CONTROL) & ~RTC_DM_BINARY, RTC_CONTROL);
+
+       return 0;
+}
 
-MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("8250 UART probe driver for the Malta CBUS UART");
+device_initcall(malta_add_devices);
index a377e9d2d029be681072a265908ba7f0f9a2dd17..62cae740e250f9d6d42df81897bf3dabe735ede9 100644 (file)
@@ -354,6 +354,30 @@ EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
 #endif
 
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+                       enum pci_mmap_state mmap_state, int write_combine)
+{
+       unsigned long prot;
+
+       /*
+        * I/O space can be accessed via normal processor loads and stores on
+        * this platform but for now we elect not to do this and portable
+        * drivers should not do this anyway.
+        */
+       if (mmap_state == pci_mmap_io)
+               return -EINVAL;
+
+       /*
+        * Ignore write-combine; for now only return uncached mappings.
+        */
+       prot = pgprot_val(vma->vm_page_prot);
+       prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
+       vma->vm_page_prot = __pgprot(prot);
+
+       return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+               vma->vm_end - vma->vm_start, vma->vm_page_prot);
+}
+
 char * (*pcibios_plat_setup)(char *str) __devinitdata;
 
 char *__devinit pcibios_setup(char *str)
index b7cbb1487af462cf8d8a626a718e39d5dfa19014..62fba8aa9b6e1ae84aa8cc1583d57a8e628f16d6 100644 (file)
@@ -180,6 +180,7 @@ ENTRY(resume_userspace)
 
 #ifdef CONFIG_PREEMPT
 ENTRY(resume_kernel)
+       __cli
        mov     (TI_preempt_count,a2),d0        # non-zero preempt_count ?
        cmp     0,d0
        bne     restore_all
@@ -190,7 +191,7 @@ need_resched:
        mov     (REG_EPSW,fp),d0
        and     EPSW_IM,d0
        cmp     EPSW_IM_7,d0            # interrupts off (exception path) ?
-       beq     restore_all
+       bne     restore_all
        call    preempt_schedule_irq[],0
        jmp     need_resched
 #endif
index 9a6d4e8ebe7396f058ccc740d48dfc3a0e14f979..11584c51acd93669dfe587cd2983ca81663397b5 100644 (file)
@@ -99,6 +99,7 @@ int gdbstub_io_rx_char(unsigned char *_ch, int nonblock)
  try_again:
        /* pull chars out of the buffer */
        ix = gdbstub_rx_outp;
+       barrier();
        if (ix == gdbstub_rx_inp) {
                if (nonblock)
                        return -EAGAIN;
@@ -110,6 +111,7 @@ int gdbstub_io_rx_char(unsigned char *_ch, int nonblock)
 
        ch = gdbstub_rx_buffer[ix++];
        st = gdbstub_rx_buffer[ix++];
+       barrier();
        gdbstub_rx_outp = ix & 0x00000fff;
 
        if (st & UART_LSR_BI) {
index aa07d0cd19052b483f002bb27a166e7defd75646..59b9c4bf9583a67e8e1467576d6e7fc49125eca7 100644 (file)
@@ -566,6 +566,11 @@ static void mn10300_serial_transmit_interrupt(struct mn10300_serial_port *port)
 {
        _enter("%s", port->name);
 
+       if (!port->uart.info || !port->uart.info->port.tty) {
+               mn10300_serial_dis_tx_intr(port);
+               return;
+       }
+
        if (uart_tx_stopped(&port->uart) ||
            uart_circ_empty(&port->uart.info->xmit))
                mn10300_serial_dis_tx_intr(port);
index 8fa36893df7af1f5f20bcfc379d88d40a1f61a49..6b287f2e8e843f885c9a856df8527f862e9147a1 100644 (file)
@@ -1,6 +1,6 @@
 /* MN10300 Kernel module helper routines
  *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
+ * Copyright (C) 2007, 2008 Red Hat, Inc. All Rights Reserved.
  * Written by Mark Salter (msalter@redhat.com)
  * - Derived from arch/i386/kernel/module.c
  *
@@ -64,21 +64,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
        return 0;
 }
 
-static uint32_t reloc_get16(uint8_t *p)
-{
-       return p[0] | (p[1] << 8);
-}
-
-static uint32_t reloc_get24(uint8_t *p)
-{
-       return reloc_get16(p) | (p[2] << 16);
-}
-
-static uint32_t reloc_get32(uint8_t *p)
-{
-       return reloc_get16(p) | (reloc_get16(p+2) << 16);
-}
-
 static void reloc_put16(uint8_t *p, uint32_t val)
 {
        p[0] = val & 0xff;
@@ -144,25 +129,19 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
                relocation = sym->st_value + rel[i].r_addend;
 
                switch (ELF32_R_TYPE(rel[i].r_info)) {
-                       /* for the first four relocation types, we add the
-                        * adjustment into the value at the location given */
+                       /* for the first four relocation types, we simply
+                        * store the adjustment at the location given */
                case R_MN10300_32:
-                       value = reloc_get32(location);
-                       value += relocation;
-                       reloc_put32(location, value);
+                       reloc_put32(location, relocation);
                        break;
                case R_MN10300_24:
-                       value = reloc_get24(location);
-                       value += relocation;
-                       reloc_put24(location, value);
+                       reloc_put24(location, relocation);
                        break;
                case R_MN10300_16:
-                       value = reloc_get16(location);
-                       value += relocation;
-                       reloc_put16(location, value);
+                       reloc_put16(location, relocation);
                        break;
                case R_MN10300_8:
-                       *location += relocation;
+                       *location = relocation;
                        break;
 
                        /* for the next three relocation types, we write the
index 017121ce896f345b63af32afe8f6a9aee1aaa7e3..e1d88ab51008896ce6fa423d6e8e1fd1ce5b3672 100644 (file)
@@ -161,7 +161,7 @@ void __init setup_arch(char **cmdline_p)
           reserve the page it is occupying. */
        if (CONFIG_INTERRUPT_VECTOR_BASE >= CONFIG_KERNEL_RAM_BASE_ADDRESS &&
            CONFIG_INTERRUPT_VECTOR_BASE < memory_end)
-               reserve_bootmem(CONFIG_INTERRUPT_VECTOR_BASE, 1,
+               reserve_bootmem(CONFIG_INTERRUPT_VECTOR_BASE, PAGE_SIZE,
                                BOOTMEM_DEFAULT);
 
        reserve_bootmem(PAGE_ALIGN(PFN_PHYS(free_pfn)), bootmap_size,
index a3e80f444f55a880b644fcdcfc109a5150fa151c..b8259668f7dcfb8b11c4fbcc2c05050d80263921 100644 (file)
@@ -11,6 +11,7 @@
 #define __VMLINUX_LDS__
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/thread_info.h>
+#include <asm/page.h>
 
 OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
 OUTPUT_ARCH(mn10300)
@@ -55,13 +56,13 @@ SECTIONS
        CONSTRUCTORS
        }
 
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   __nosave_begin = .;
   .data_nosave : { *(.data.nosave) }
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   __nosave_end = .;
 
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   .data.page_aligned : { *(.data.idt) }
 
   . = ALIGN(32);
@@ -78,7 +79,7 @@ SECTIONS
   .data.init_task : { *(.data.init_task) }
 
   /* might get freed after init */
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
        __smp_locks = .;
        *(.smp_locks)
@@ -86,7 +87,7 @@ SECTIONS
   }
 
   /* will be freed after init */
-  . = ALIGN(4096);             /* Init code and data */
+  . = ALIGN(PAGE_SIZE);                /* Init code and data */
   __init_begin = .;
   .init.text : {
        _sinittext = .;
@@ -120,17 +121,14 @@ SECTIONS
   .exit.data : { *(.exit.data) }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
   __initramfs_end = .;
 #endif
 
-  . = ALIGN(32);
-  __per_cpu_start = .;
-  .data.percpu  : { *(.data.percpu) }
-  __per_cpu_end = .;
-  . = ALIGN(4096);
+  PERCPU(32)
+  . = ALIGN(PAGE_SIZE);
   __init_end = .;
   /* freed after init ends here */
 
@@ -145,7 +143,7 @@ SECTIONS
   _end = . ;
 
   /* This is where the kernel creates the early boot page tables */
-  . = ALIGN(4096);
+  . = ALIGN(PAGE_SIZE);
   pg0 = .;
 
   /* Sections to be discarded */
index b72ec66db699e56f0985ebd6d88d82a7ceb14411..1f6fd4fc05b91b518f4f574b3ada13ddd24b285a 100644 (file)
@@ -44,9 +44,12 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 {
        BUG_ON(mm == &init_mm); /* Should never happen */
 
-#ifdef CONFIG_SMP
+#if 1 || defined(CONFIG_SMP)
        flush_tlb_all();
 #else
+       /* FIXME: currently broken, causing space id and protection ids
+        *  to go out of sync, resulting in faults on userspace accesses.
+        */
        if (mm) {
                if (mm->context != 0)
                        free_sid(mm->context);
index 8fc6d72849ae435c095ec75a94acb677f0815d5e..3d3daa674299038072e3d8e7f2d36f3181b5cb1f 100644 (file)
@@ -41,6 +41,7 @@ $(obj)/4xx.o: BOOTCFLAGS += -mcpu=405
 $(obj)/ebony.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
+$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
 $(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405
 
index 2c9d54a35bc312e8286812a67507e7a71e9f9141..4bdbaf4993a185c176000890f1c999108f6b2f11 100644 (file)
                                interrupts = <18 0x8>;
                                interrupt-parent = <&ipic>;
                        };
+
+                       mcu_pio: mcu@a {
+                               #gpio-cells = <2>;
+                               compatible = "fsl,mc9s08qg8-mpc8349emitx",
+                                            "fsl,mcu-mpc8349emitx";
+                               reg = <0x0a>;
+                               gpio-controller;
+                       };
                };
 
                spi@7000 {
                                interrupt-parent = <&ipic>;
                                interrupts = <71 8>;
                        };
-
-                       mcu_pio: mcu@a {
-                               #gpio-cells = <2>;
-                               compatible = "fsl,mc9s08qg8-mpc8349emitx",
-                                            "fsl,mcu-mpc8349emitx";
-                               reg = <0x0a>;
-                               gpio-controller;
-                       };
                };
 
                usb@22000 {
index e55ff7c47a366878a63e3546835031f5098f34a5..07a674f5344e9f5cc876deb0ca63c3b9e45ebe14 100644 (file)
@@ -723,7 +723,7 @@ CONFIG_CICADA_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
-# CONFIG_FIXED_PHY is not set
+CONFIG_FIXED_PHY=y
 # CONFIG_MDIO_BITBANG is not set
 # CONFIG_NET_ETHERNET is not set
 CONFIG_NETDEV_1000=y
index 15eb30c9b3f99b6f076b0769f3ffad08edebf33c..d582014b0a38e8c49283bccdd12d6daad58c94b0 100644 (file)
@@ -682,7 +682,7 @@ CONFIG_VITESSE_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 CONFIG_ICPLUS_PHY=y
 # CONFIG_REALTEK_PHY is not set
-# CONFIG_FIXED_PHY is not set
+CONFIG_FIXED_PHY=y
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
index 8931ba729d2b519ec4d4efb1d0851301d96e1d3a..bb62ad876de32750c70cc7ecd91adcb9f0539d5a 100644 (file)
@@ -104,4 +104,6 @@ static inline void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid)
        }
 }
 
+extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
+
 #endif /* __POWERPC_KVM_PPC_H__ */
index 31c18b52affb878031c69fda37421ff5e53c391f..10b4ab1008afe66914f4a5115868b4c2ef6cf038 100644 (file)
@@ -40,6 +40,7 @@ _GLOBAL(__setup_cpu_460gt)
        mtlr    r4
        blr
 
+_GLOBAL(__setup_cpu_440x5)
 _GLOBAL(__setup_cpu_440gx)
 _GLOBAL(__setup_cpu_440spe)
        b       __fixup_440A_mcheck
index b1eb834bc0fcd00ba563ca8d60287d912a9fdc80..7e8719504f39d65bf50e822289c602470f569713 100644 (file)
@@ -39,6 +39,7 @@ extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_440x5(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
@@ -1500,6 +1501,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_user_features      = COMMON_USER_BOOKE,
                .icache_bsize           = 32,
                .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_440x5,
+               .machine_check          = machine_check_440A,
                .platform               = "ppc440",
        },
        { /* 460EX */
index 1562daf8839a95d62c75e58e7af7b156787845bf..3a6eaa876ee1169026837a52fcb119a95def9bd3 100644 (file)
@@ -75,6 +75,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
        for_each_sg(sgl, sg, nents, i) {
                sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
                sg->dma_length = sg->length;
+               __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction);
        }
 
        return nents;
index bdc8b0e860e5e1b25cc3dafe23455ec1a738812b..5c33bc14bd9fe161a75d7c12bc6809e77cba5a93 100644 (file)
@@ -479,17 +479,20 @@ _GLOBAL(_tlbil_pid)
  * (no broadcast)
  */
 _GLOBAL(_tlbil_va)
+       mfmsr   r10
+       wrteei  0
        slwi    r4,r4,16
        mtspr   SPRN_MAS6,r4            /* assume AS=0 for now */
        tlbsx   0,r3
        mfspr   r4,SPRN_MAS1            /* check valid */
        andis.  r3,r4,MAS1_VALID@h
-       beqlr
+       beq     1f
        rlwinm  r4,r4,0,1,31
        mtspr   SPRN_MAS1,r4
        tlbwe
        msync
        isync
+1:     wrtee   r10
        blr
 #endif /* CONFIG_FSL_BOOKE */
 
index 2e227a412bc240f2bc889b0c7c1fe2e17a7bdd8c..ad72c6f9811f62ed05695ca23221bd2d9b87f31a 100644 (file)
@@ -124,6 +124,14 @@ static void kvmppc_44x_shadow_release(struct kvm_vcpu *vcpu,
        }
 }
 
+void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu)
+{
+       int i;
+
+       for (i = 0; i <= tlb_44x_hwater; i++)
+               kvmppc_44x_shadow_release(vcpu, i);
+}
+
 void kvmppc_tlbe_set_modified(struct kvm_vcpu *vcpu, unsigned int i)
 {
     vcpu->arch.shadow_tlb_mod[i] = 1;
index 90a6fc422b238ccbd38becc6d36546c0a7ca0cd0..fda9baada132b1c5348dfec8b84ba99d8bc24dc1 100644 (file)
@@ -238,6 +238,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
 
 void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
 {
+       kvmppc_core_destroy_mmu(vcpu);
 }
 
 /* Note: clearing MSR[DE] just means that the debug interrupt will not be
index 29b2941cada0b67ac5be0248c2a1321179bf19a6..45907c1dae66da343344b5e1cfe9c682afc409ff 100644 (file)
@@ -556,6 +556,7 @@ unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, co
                be = blk->start + blk->size;
                if (s >= bs && e <= be)
                        break;
+               blk = NULL;
        }
 
        if (blk == NULL)
index 7bbf4e4ed4306b3a395906b6307808df326fb7cf..f0c3b88d50fa5a5f98847bd1914be1881885af9d 100644 (file)
@@ -507,6 +507,9 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
 {
        struct hstate *hstate = hstate_file(file);
        int mmu_psize = shift_to_mmu_psize(huge_page_shift(hstate));
+
+       if (!mmu_huge_psizes[mmu_psize])
+               return -EINVAL;
        return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0);
 }
 
index a8397bbad3d4d54a5cd50ae9ee201118c767d1d4..cf81049e1e51a0ce98d0ebdf9b7a74d5901de211 100644 (file)
@@ -901,10 +901,17 @@ static void mark_reserved_regions_for_nid(int nid)
                        if (end_pfn > node_ar.end_pfn)
                                reserve_size = (node_ar.end_pfn << PAGE_SHIFT)
                                        - (start_pfn << PAGE_SHIFT);
-                       dbg("reserve_bootmem %lx %lx nid=%d\n", physbase,
-                               reserve_size, node_ar.nid);
-                       reserve_bootmem_node(NODE_DATA(node_ar.nid), physbase,
-                                               reserve_size, BOOTMEM_DEFAULT);
+                       /*
+                        * Only worry about *this* node, others may not
+                        * yet have valid NODE_DATA().
+                        */
+                       if (node_ar.nid == nid) {
+                               dbg("reserve_bootmem %lx %lx nid=%d\n",
+                                       physbase, reserve_size, node_ar.nid);
+                               reserve_bootmem_node(NODE_DATA(node_ar.nid),
+                                               physbase, reserve_size,
+                                               BOOTMEM_DEFAULT);
+                       }
                        /*
                         * if reserved region is contained in the active region
                         * then done.
@@ -929,7 +936,6 @@ static void mark_reserved_regions_for_nid(int nid)
 void __init do_init_bootmem(void)
 {
        int nid;
-       unsigned int i;
 
        min_low_pfn = 0;
        max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
index 442cf36aa172920b355710e65a68624d43293d33..0ce45c2b42f8eb67a1ea5156fcf476bdb3f3924a 100644 (file)
@@ -413,6 +413,9 @@ static int axon_msi_probe(struct of_device *device,
                        MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE |
                        MSIC_CTRL_FIFO_SIZE);
 
+       msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG)
+                               & MSIC_FIFO_SIZE_MASK;
+
        device->dev.platform_data = msic;
 
        ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
index b24e1d0855573df690aaf6f9022266ad98b95604..1890fb085cded9bdcc66c61214a4058b579c98e6 100644 (file)
@@ -600,7 +600,7 @@ static int irq_choose_cpu(unsigned int virt_irq)
                cpuid = first_cpu(tmp);
        }
 
-       return cpuid;
+       return get_hard_smp_processor_id(cpuid);
 }
 #else
 static int irq_choose_cpu(unsigned int virt_irq)
index 170392687ce042f64c69ea7f4fe85d863025b768..2a01b9e02801f14afd348162f31679237cbd340a 100644 (file)
@@ -237,6 +237,11 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
        u8 order_code;
        int rc;
 
+       /* sigp in userspace can exit */
+       if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+               return kvm_s390_inject_program_int(vcpu,
+                                                  PGM_PRIVILEGED_OPERATION);
+
        order_code = disp2;
        if (base2)
                order_code += vcpu->arch.guest_gprs[base2];
index 80119b3398e7f2acb1f2a1091c247cb8193e947e..5c9cbfc14c4d5ad9ad06bf18f3a4b2f523eebd0b 100644 (file)
@@ -55,6 +55,8 @@ config GENERIC_HARDIRQS
 
 config GENERIC_HARDIRQS_NO__DO_IRQ
        def_bool y
+       depends on SUPERH32 && (!SH_DREAMCAST && !SH_SH4202_MICRODEV && \
+                               !SH_7751_SYSTEMH && !HD64461)
 
 config GENERIC_IRQ_PROBE
        def_bool y
index 68b98a7e6454952500e54cd6728eb688813836a2..9cf4ae0cd7ba7b2a173c5c30039365a06f0a1db1 100644 (file)
@@ -98,6 +98,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/fls.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/lock.h>
index d409c4f21a5cdea420e75fef24a2ceec1cb0e834..4cef450167dd6ae697e7e429078979f2277f92fd 100644 (file)
@@ -62,6 +62,8 @@ struct sparc_stackf {
 
 #ifdef __KERNEL__
 
+#include <asm/system.h>
+
 static inline bool pt_regs_is_syscall(struct pt_regs *regs)
 {
        return (regs->psr & PSR_SYSCALL);
@@ -72,6 +74,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
        return (regs->psr &= ~PSR_SYSCALL);
 }
 
+#define arch_ptrace_stop_needed(exit_code, info) \
+({     flush_user_windows(); \
+       current_thread_info()->w_saved != 0;    \
+})
+
+#define arch_ptrace_stop(exit_code, info) \
+       synchronize_user_stack()
+
 #define user_mode(regs) (!((regs)->psr & PSR_PS))
 #define instruction_pointer(regs) ((regs)->pc)
 #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
index 84e969f06afe318d986a9890d130cbf26759b704..cd6fbfc2043533636dd16fec2918cf0a07124be1 100644 (file)
@@ -114,6 +114,7 @@ struct sparc_trapf {
 #ifdef __KERNEL__
 
 #include <linux/threads.h>
+#include <asm/system.h>
 
 static inline int pt_regs_trap_type(struct pt_regs *regs)
 {
@@ -130,6 +131,14 @@ static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
        return (regs->tstate &= ~TSTATE_SYSCALL);
 }
 
+#define arch_ptrace_stop_needed(exit_code, info) \
+({     flush_user_windows(); \
+       get_thread_wsaved() != 0; \
+})
+
+#define arch_ptrace_stop(exit_code, info) \
+       synchronize_user_stack()
+
 struct global_reg_snapshot {
        unsigned long           tstate;
        unsigned long           tpc;
index f43adbc773caca890f96a214647a7f63ee225531..a941c610e7ce0cdf8c38c38c5e3d46c32419114f 100644 (file)
@@ -1014,7 +1014,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
 
        case PTRACE_SETFPREGS64:
-               ret = copy_regset_to_user(child, view, REGSET_FP,
+               ret = copy_regset_from_user(child, view, REGSET_FP,
                                          0 * sizeof(u64),
                                          33 * sizeof(u64),
                                          fps);
index 9e05cb5cb855ba5d0f2d3367d6e0a4e5023fe663..b956fd71c131143e4240ebea47548ab110c747a0 100644 (file)
 #define VIS_OPF_SHIFT  5
 #define VIS_OPF_MASK   (0x1ff << VIS_OPF_SHIFT)
 
-#define RS1(INSN)      (((INSN) >> 24) & 0x1f)
+#define RS1(INSN)      (((INSN) >> 14) & 0x1f)
 #define RS2(INSN)      (((INSN) >>  0) & 0x1f)
 #define RD(INSN)       (((INSN) >> 25) & 0x1f)
 
@@ -445,7 +445,7 @@ static void pdist(struct pt_regs *regs, unsigned int insn)
        unsigned long i;
 
        rs1 = fpd_regval(f, RS1(insn));
-       rs2 = fpd_regval(f, RS1(insn));
+       rs2 = fpd_regval(f, RS2(insn));
        rd = fpd_regaddr(f, RD(insn));
 
        rd_val = *rd;
@@ -807,6 +807,8 @@ int vis_emul(struct pt_regs *regs, unsigned int insn)
        if (get_user(insn, (u32 __user *) pc))
                return -EFAULT;
 
+       save_and_clear_fpu();
+
        opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
        switch (opf) {
        default:
index 19d1fdb17d0e8b4f5b3ac6ce0a72fe7c11c65a6b..05a361b0a1a40e6d87ad6c86d59ab464fd48e4c5 100644 (file)
@@ -24,7 +24,7 @@ static unsigned long compute_size(unsigned long start, unsigned long size, unsig
        if (fault_addr < start || fault_addr >= end) {
                *offset = 0;
        } else {
-               *offset = start - fault_addr;
+               *offset = fault_addr - start;
                size = end - fault_addr;
        }
        return size;
index 19d579d74d27f18ae67bb1b5c9adcf93f963a288..8f44ebb0dec82286e85838369d8fdfd9de929ae6 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/slab.h>
 #include <linux/syscalls.h>
 #include <linux/utsname.h>
+#include <linux/socket.h>
+#include <linux/un.h>
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
 #include <asm/uaccess.h>
@@ -785,7 +787,7 @@ static int __init mconsole_init(void)
        /* long to avoid size mismatch warnings from gcc */
        long sock;
        int err;
-       char file[256];
+       char file[UNIX_PATH_MAX];
 
        if (umid_file_name("mconsole", file, sizeof(file)))
                return -1;
index b815664fe3700b77aa031fab7711be4128c858d1..8e99073b9e0f2cad52d1346fd7a525c835681b1a 100644 (file)
@@ -520,6 +520,7 @@ config X86_PTRACE_BTS
        bool "Branch Trace Store"
        default y
        depends on X86_DEBUGCTLMSR
+       depends on BROKEN
        help
          This adds a ptrace interface to the hardware's branch trace store.
 
index 1a30c0440c6bb4c907b400313c7bbd1865bb9298..ac302a2fa3397f3ae9a65a4553a2731706b34e18 100644 (file)
@@ -251,13 +251,6 @@ struct amd_iommu {
        /* Pointer to PCI device of this IOMMU */
        struct pci_dev *dev;
 
-       /*
-        * Capability pointer. There could be more than one IOMMU per PCI
-        * device function if there are more than one AMD IOMMU capability
-        * pointers.
-        */
-       u16 cap_ptr;
-
        /* physical address of MMIO space */
        u64 mmio_phys;
        /* virtual address of MMIO space */
@@ -266,6 +259,13 @@ struct amd_iommu {
        /* capabilities of that IOMMU read from ACPI */
        u32 cap;
 
+       /*
+        * Capability pointer. There could be more than one IOMMU per PCI
+        * device function if there are more than one AMD IOMMU capability
+        * pointers.
+        */
+       u16 cap_ptr;
+
        /* pci domain of this IOMMU */
        u16 pci_seg;
 
@@ -284,19 +284,19 @@ struct amd_iommu {
        /* size of command buffer */
        u32 cmd_buf_size;
 
-       /* event buffer virtual address */
-       u8 *evt_buf;
        /* size of event buffer */
        u32 evt_buf_size;
+       /* event buffer virtual address */
+       u8 *evt_buf;
        /* MSI number for event interrupt */
        u16 evt_msi_num;
 
-       /* if one, we need to send a completion wait command */
-       int need_sync;
-
        /* true if interrupts for this IOMMU are already enabled */
        bool int_enabled;
 
+       /* if one, we need to send a completion wait command */
+       int need_sync;
+
        /* default dma_ops domain for that IOMMU */
        struct dma_ops_domain *default_dom;
 };
index 7f225a4b2a26aedd2995d8c68c75df6962f19778..097794ff6b796a2f955ddc7a8eef96a249c8b94f 100644 (file)
@@ -71,15 +71,13 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
 /* Make sure we keep the same behaviour */
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
-#ifdef CONFIG_X86_32
-       return 0;
-#else
+#ifdef CONFIG_X86_64
        struct dma_mapping_ops *ops = get_dma_ops(dev);
        if (ops->mapping_error)
                return ops->mapping_error(dev, dma_addr);
 
-       return (dma_addr == bad_dma_address);
 #endif
+       return (dma_addr == bad_dma_address);
 }
 
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
index 4850e4b02b61b255c14db559feb136e80a2f32c9..ff386ff50ed766d5d8c4e661d9ef2c3acef3162f 100644 (file)
@@ -239,7 +239,7 @@ struct pci_bus;
 void set_pci_bus_resources_arch_default(struct pci_bus *b);
 
 #ifdef CONFIG_SMP
-#define mc_capable()                   (boot_cpu_data.x86_max_cores > 1)
+#define mc_capable()   (cpus_weight(per_cpu(cpu_core_map, 0)) != nr_cpu_ids)
 #define smt_capable()                  (smp_num_siblings > 1)
 #endif
 
index b7c0dea119fed8f8ea62e520ecf1e504e65e05f0..61e08c0a290785c5527d9faf607c0c2ab2e384e2 100644 (file)
@@ -223,9 +223,15 @@ struct pci_header {
 } __attribute__((packed));
 
 /* Function prototypes for bootstrapping */
+#ifdef CONFIG_VMI
 extern void vmi_init(void);
+extern void vmi_activate(void);
 extern void vmi_bringup(void);
-extern void vmi_apply_boot_page_allocations(void);
+#else
+static inline void vmi_init(void) {}
+static inline void vmi_activate(void) {}
+static inline void vmi_bringup(void) {}
+#endif
 
 /* State needed to start an application processor in an SMP system. */
 struct vmi_ap_state {
index e4899e0e878740726bfa7ea56e655c53a6b88f37..0a60d60ed036b264e6d4c05174dfc3b464574852 100644 (file)
@@ -187,6 +187,8 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
 
        spin_lock_irqsave(&iommu->lock, flags);
        ret = __iommu_queue_command(iommu, cmd);
+       if (!ret)
+               iommu->need_sync = 1;
        spin_unlock_irqrestore(&iommu->lock, flags);
 
        return ret;
@@ -210,10 +212,13 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
        cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
        CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
 
-       iommu->need_sync = 0;
-
        spin_lock_irqsave(&iommu->lock, flags);
 
+       if (!iommu->need_sync)
+               goto out;
+
+       iommu->need_sync = 0;
+
        ret = __iommu_queue_command(iommu, &cmd);
 
        if (ret)
@@ -230,8 +235,9 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
        status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
        writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
 
-       if (unlikely((i == EXIT_LOOP_COUNT) && printk_ratelimit()))
-               printk(KERN_WARNING "AMD IOMMU: Completion wait loop failed\n");
+       if (unlikely(i == EXIT_LOOP_COUNT))
+               panic("AMD IOMMU: Completion wait loop failed\n");
+
 out:
        spin_unlock_irqrestore(&iommu->lock, flags);
 
@@ -254,8 +260,6 @@ static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid)
 
        ret = iommu_queue_command(iommu, &cmd);
 
-       iommu->need_sync = 1;
-
        return ret;
 }
 
@@ -281,8 +285,6 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
 
        ret = iommu_queue_command(iommu, &cmd);
 
-       iommu->need_sync = 1;
-
        return ret;
 }
 
@@ -343,7 +345,7 @@ static int iommu_map(struct protection_domain *dom,
        u64 __pte, *pte, *page;
 
        bus_addr  = PAGE_ALIGN(bus_addr);
-       phys_addr = PAGE_ALIGN(bus_addr);
+       phys_addr = PAGE_ALIGN(phys_addr);
 
        /* only support 512GB address spaces for now */
        if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK))
@@ -599,7 +601,7 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom)
                        continue;
 
                p2 = IOMMU_PTE_PAGE(p1[i]);
-               for (j = 0; j < 512; ++i) {
+               for (j = 0; j < 512; ++j) {
                        if (!IOMMU_PTE_PRESENT(p2[j]))
                                continue;
                        p3 = IOMMU_PTE_PAGE(p2[j]);
@@ -762,8 +764,6 @@ static void set_device_domain(struct amd_iommu *iommu,
        write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
 
        iommu_queue_inv_dev_entry(iommu, devid);
-
-       iommu->need_sync = 1;
 }
 
 /*****************************************************************************
@@ -858,6 +858,9 @@ static int get_device_resources(struct device *dev,
                print_devid(_bdf, 1);
        }
 
+       if (domain_for_device(_bdf) == NULL)
+               set_device_domain(*iommu, *domain, _bdf);
+
        return 1;
 }
 
@@ -908,7 +911,7 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
        if (address >= dom->aperture_size)
                return;
 
-       WARN_ON(address & 0xfffULL || address > dom->aperture_size);
+       WARN_ON(address & ~PAGE_MASK || address >= dom->aperture_size);
 
        pte  = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)];
        pte += IOMMU_PTE_L0_INDEX(address);
@@ -920,8 +923,8 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
 
 /*
  * This function contains common code for mapping of a physically
- * contiguous memory region into DMA address space. It is uses by all
- * mapping functions provided by this IOMMU driver.
+ * contiguous memory region into DMA address space. It is used by all
+ * mapping functions provided with this IOMMU driver.
  * Must be called with the domain lock held.
  */
 static dma_addr_t __map_single(struct device *dev,
@@ -981,7 +984,8 @@ static void __unmap_single(struct amd_iommu *iommu,
        dma_addr_t i, start;
        unsigned int pages;
 
-       if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size))
+       if ((dma_addr == bad_dma_address) ||
+           (dma_addr + size > dma_dom->aperture_size))
                return;
 
        pages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
@@ -1031,8 +1035,7 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
        if (addr == bad_dma_address)
                goto out;
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
 out:
        spin_unlock_irqrestore(&domain->lock, flags);
@@ -1060,8 +1063,7 @@ static void unmap_single(struct device *dev, dma_addr_t dma_addr,
 
        __unmap_single(iommu, domain->priv, dma_addr, size, dir);
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
        spin_unlock_irqrestore(&domain->lock, flags);
 }
@@ -1127,8 +1129,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
                        goto unmap;
        }
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
 out:
        spin_unlock_irqrestore(&domain->lock, flags);
@@ -1173,8 +1174,7 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
                s->dma_address = s->dma_length = 0;
        }
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
        spin_unlock_irqrestore(&domain->lock, flags);
 }
@@ -1225,8 +1225,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
                goto out;
        }
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
 out:
        spin_unlock_irqrestore(&domain->lock, flags);
@@ -1257,8 +1256,7 @@ static void free_coherent(struct device *dev, size_t size,
 
        __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
 
-       if (unlikely(iommu->need_sync))
-               iommu_completion_wait(iommu);
+       iommu_completion_wait(iommu);
 
        spin_unlock_irqrestore(&domain->lock, flags);
 
index 30ae2701b3df1b8976400d5996ed72a4a98baeea..c6cc22815d35f232dd21fae7d2718a3c161b373c 100644 (file)
@@ -427,6 +427,10 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu)
        memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,
                        &entry, sizeof(entry));
 
+       /* set head and tail to zero manually */
+       writel(0x00, iommu->mmio_base + MMIO_CMD_HEAD_OFFSET);
+       writel(0x00, iommu->mmio_base + MMIO_CMD_TAIL_OFFSET);
+
        iommu_feature_enable(iommu, CONTROL_CMDBUF_EN);
 
        return cmd_buf;
@@ -1074,7 +1078,8 @@ int __init amd_iommu_init(void)
                goto free;
 
        /* IOMMU rlookup table - find the IOMMU for a specific device */
-       amd_iommu_rlookup_table = (void *)__get_free_pages(GFP_KERNEL,
+       amd_iommu_rlookup_table = (void *)__get_free_pages(
+                       GFP_KERNEL | __GFP_ZERO,
                        get_order(rlookup_table_size));
        if (amd_iommu_rlookup_table == NULL)
                goto free;
index 4b031a4ac8562d3ed69f14f0d750dfe8519a057e..1c838032fd3732fde9bff776cbb63a2821115d60 100644 (file)
@@ -510,12 +510,9 @@ static void __cpuinit mce_cpu_features(struct cpuinfo_x86 *c)
  */
 void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
 {
-       static cpumask_t mce_cpus = CPU_MASK_NONE;
-
        mce_cpu_quirks(c);
 
        if (mce_dont_init ||
-           cpu_test_and_set(smp_processor_id(), mce_cpus) ||
            !mce_available(c))
                return;
 
index 82fb2809ce32208eacd7231c38597938031d4036..c4b5b24e0217c585cbb8d0f8011a8b6c87229a6f 100644 (file)
@@ -272,13 +272,18 @@ static struct attribute_group mc_attr_group = {
        .name = "microcode",
 };
 
-static void microcode_fini_cpu(int cpu)
+static void __microcode_fini_cpu(int cpu)
 {
        struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
 
-       mutex_lock(&microcode_mutex);
        microcode_ops->microcode_fini_cpu(cpu);
        uci->valid = 0;
+}
+
+static void microcode_fini_cpu(int cpu)
+{
+       mutex_lock(&microcode_mutex);
+       __microcode_fini_cpu(cpu);
        mutex_unlock(&microcode_mutex);
 }
 
@@ -306,12 +311,16 @@ static int microcode_resume_cpu(int cpu)
         * to this cpu (a bit of paranoia):
         */
        if (microcode_ops->collect_cpu_info(cpu, &nsig)) {
-               microcode_fini_cpu(cpu);
+               __microcode_fini_cpu(cpu);
+               printk(KERN_ERR "failed to collect_cpu_info for resuming cpu #%d\n",
+                               cpu);
                return -1;
        }
 
-       if (memcmp(&nsig, &uci->cpu_sig, sizeof(nsig))) {
-               microcode_fini_cpu(cpu);
+       if ((nsig.sig != uci->cpu_sig.sig) || (nsig.pf != uci->cpu_sig.pf)) {
+               __microcode_fini_cpu(cpu);
+               printk(KERN_ERR "cached ucode doesn't match the resuming cpu #%d\n",
+                               cpu);
                /* Should we look for a new ucode here? */
                return 1;
        }
index 622dc4a217848d1c8d16941796a4f82f868fc967..a8e62792d171c6c63645582441b3d9482fffcbac 100644 (file)
@@ -155,6 +155,7 @@ static DEFINE_SPINLOCK(microcode_update_lock);
 static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
 {
        struct cpuinfo_x86 *c = &cpu_data(cpu_num);
+       unsigned long flags;
        unsigned int val[2];
 
        memset(csig, 0, sizeof(*csig));
@@ -174,11 +175,16 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
                csig->pf = 1 << ((val[1] >> 18) & 7);
        }
 
+       /* serialize access to the physical write to MSR 0x79 */
+       spin_lock_irqsave(&microcode_update_lock, flags);
+
        wrmsr(MSR_IA32_UCODE_REV, 0, 0);
        /* see notes above for revision 1.07.  Apparent chip bug */
        sync_core();
        /* get the current revision from MSR 0x8B */
        rdmsr(MSR_IA32_UCODE_REV, val[0], csig->rev);
+       spin_unlock_irqrestore(&microcode_update_lock, flags);
+
        pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n",
                        csig->sig, csig->pf, csig->rev);
 
index f98f4e1dba0963ddc4908074a7a16e3249703677..0f4c1fd5a1f434259afd90480b5af527b326b855 100644 (file)
@@ -604,6 +604,9 @@ static void __init __get_smp_config(unsigned int early)
                printk(KERN_INFO "Using ACPI for processor (LAPIC) "
                       "configuration information\n");
 
+       if (!mpf)
+               return;
+
        printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
               mpf->mpf_specification);
 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
index 0e9f1982b1dd1aca8c60025f3ff691b311ee8390..95777b0faa7388f9c236bb093fae1a4934bb91c0 100644 (file)
@@ -7,7 +7,8 @@
 
 #include <asm/paravirt.h>
 
-static void default_spin_lock_flags(struct raw_spinlock *lock, unsigned long flags)
+static inline void
+default_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
 {
        __raw_spin_lock(lock);
 }
index a42b02b4df68855714b4ea2f7f3e580e0327e7b3..a35eaa379ff632fb142367df58a8fdeaaad81267 100644 (file)
@@ -123,6 +123,8 @@ static void free_iommu(unsigned long offset, int size)
 
        spin_lock_irqsave(&iommu_bitmap_lock, flags);
        iommu_area_free(iommu_gart_bitmap, offset, size);
+       if (offset >= next_bit)
+               next_bit = offset + size;
        spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
 }
 
@@ -743,10 +745,8 @@ void __init gart_iommu_init(void)
        unsigned long scratch;
        long i;
 
-       if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) {
-               printk(KERN_INFO "PCI-GART: No AMD GART found.\n");
+       if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0)
                return;
-       }
 
 #ifndef CONFIG_AGP_AMD64
        no_agp = 1;
index 9d5674f7b6ccbfbdef7f5ad16901f9dc9dc08ad0..bdec76e5559433d77366b85535f0563451614501 100644 (file)
@@ -794,6 +794,9 @@ void __init setup_arch(char **cmdline_p)
        printk(KERN_INFO "Command line: %s\n", boot_command_line);
 #endif
 
+       /* VMI may relocate the fixmap; do this before touching ioremap area */
+       vmi_init();
+
        early_cpu_init();
        early_ioremap_init();
 
@@ -880,13 +883,8 @@ void __init setup_arch(char **cmdline_p)
        check_efer();
 #endif
 
-#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
-       /*
-        * Must be before kernel pagetables are setup
-        * or fixmap area is touched.
-        */
-       vmi_init();
-#endif
+       /* Must be before kernel pagetables are setup */
+       vmi_activate();
 
        /* after early param, so could get panic from serial */
        reserve_early_setup_data();
index 7b1093397319766b2e4848a5a883b0dc35f49804..f71f96fc9e62ea8e4f027a78cb3aafcd96fdbf99 100644 (file)
@@ -294,9 +294,7 @@ static void __cpuinit start_secondary(void *unused)
         * fragile that we want to limit the things done here to the
         * most necessary things.
         */
-#ifdef CONFIG_VMI
        vmi_bringup();
-#endif
        cpu_init();
        preempt_disable();
        smp_callin();
index 8b6c393ab9fd14f06b86d9deb656b3643d9006f3..22fd6577156a9ac81453792185e3cc0a317d96d2 100644 (file)
@@ -960,8 +960,6 @@ static inline int __init activate_vmi(void)
 
 void __init vmi_init(void)
 {
-       unsigned long flags;
-
        if (!vmi_rom)
                probe_vmi_rom();
        else
@@ -973,13 +971,21 @@ void __init vmi_init(void)
 
        reserve_top_address(-vmi_rom->virtual_top);
 
-       local_irq_save(flags);
-       activate_vmi();
-
 #ifdef CONFIG_X86_IO_APIC
        /* This is virtual hardware; timer routing is wired correctly */
        no_timer_check = 1;
 #endif
+}
+
+void vmi_activate(void)
+{
+       unsigned long flags;
+
+       if (!vmi_rom)
+               return;
+
+       local_irq_save(flags);
+       activate_vmi();
        local_irq_restore(flags & X86_EFLAGS_IF);
 }
 
index f1983d9477cd163bc13de766f1edd8ffee4c720b..410ddbc1aa2eb0fc2dfa45de560c829df364aa81 100644 (file)
@@ -1038,13 +1038,13 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
        }
 
        rmap_write_protect(vcpu->kvm, sp->gfn);
+       kvm_unlink_unsync_page(vcpu->kvm, sp);
        if (vcpu->arch.mmu.sync_page(vcpu, sp)) {
                kvm_mmu_zap_page(vcpu->kvm, sp);
                return 1;
        }
 
        kvm_mmu_flush_tlb(vcpu);
-       kvm_unlink_unsync_page(vcpu->kvm, sp);
        return 0;
 }
 
index 613ec9aa674afe06cd76c99b8ebc06eaa3f91f32..84eee43bbe742b005bd1825b0cdac24ba5efffbb 100644 (file)
@@ -331,6 +331,7 @@ static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw,
                r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2],
                                          &curr_pte, sizeof(curr_pte));
                if (r || curr_pte != gw->ptes[level - 2]) {
+                       kvm_mmu_put_page(shadow_page, sptep);
                        kvm_release_pfn_clean(sw->pfn);
                        sw->sptep = NULL;
                        return 1;
index d06b4dc0e2eac49c3d1df9d78ec4b6d6ad975c4f..a4018b01e1f973bad1619d6ca16e0e67e29aceab 100644 (file)
@@ -3149,7 +3149,9 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
 
        if (cpu_has_virtual_nmis()) {
                if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
-                       if (vmx_nmi_enabled(vcpu)) {
+                       if (vcpu->arch.interrupt.pending) {
+                               enable_nmi_window(vcpu);
+                       } else if (vmx_nmi_enabled(vcpu)) {
                                vcpu->arch.nmi_pending = false;
                                vcpu->arch.nmi_injected = true;
                        } else {
index 022cd41ea9b4106e5884277096e80e9088a7c7a9..202864ad49a7e5bf2a6574922d7cd938dd023fd9 100644 (file)
@@ -401,14 +401,13 @@ static int __init ppro_init(char **cpu_type)
                *cpu_type = "i386/pii";
                break;
        case 6 ... 8:
+       case 10 ... 11:
                *cpu_type = "i386/piii";
                break;
        case 9:
+       case 13:
                *cpu_type = "i386/p6_mobile";
                break;
-       case 10 ... 13:
-               *cpu_type = "i386/p6";
-               break;
        case 14:
                *cpu_type = "i386/core";
                break;
index 716d26f0e5d47b74ae43abb862d7d296c17ef609..e9f80c744cf3409d72f77dd9044ec1dd90534609 100644 (file)
@@ -156,6 +156,8 @@ static void ppro_start(struct op_msrs const * const msrs)
        unsigned int low, high;
        int i;
 
+       if (!reset_value)
+               return;
        for (i = 0; i < num_counters; ++i) {
                if (reset_value[i]) {
                        CTRL_READ(low, high, msrs, i);
@@ -171,6 +173,8 @@ static void ppro_stop(struct op_msrs const * const msrs)
        unsigned int low, high;
        int i;
 
+       if (!reset_value)
+               return;
        for (i = 0; i < num_counters; ++i) {
                if (!reset_value[i])
                        continue;
index 5c99ff8d2db8937cffb50ab1d768e52fd49ff9f3..6e72d661ae425daa62f8b7999acc8f825e2a12e9 100644 (file)
@@ -161,7 +161,7 @@ static inline struct request *start_ordered(struct request_queue *q,
        /*
         * Prep proxy barrier request.
         */
-       blkdev_dequeue_request(rq);
+       elv_dequeue_request(q, rq);
        q->orig_bar_rq = rq;
        rq = &q->bar_rq;
        blk_rq_init(q, rq);
@@ -219,7 +219,7 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp)
                         * This can happen when the queue switches to
                         * ORDERED_NONE while this request is on it.
                         */
-                       blkdev_dequeue_request(rq);
+                       elv_dequeue_request(q, rq);
                        if (__blk_end_request(rq, -EOPNOTSUPP,
                                              blk_rq_bytes(rq)))
                                BUG();
index 10e8a64a5a5b1b213cbc2886755b22dedce76313..c36aa98fafa3e4ed94adcf3e462945d59b0c1fcd 100644 (file)
@@ -592,7 +592,7 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
                                   1 << QUEUE_FLAG_STACKABLE);
        q->queue_lock           = lock;
 
-       blk_queue_segment_boundary(q, 0xffffffff);
+       blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK);
 
        blk_queue_make_request(q, __make_request);
        blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE);
@@ -1636,6 +1636,28 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq)
 }
 EXPORT_SYMBOL_GPL(blk_insert_cloned_request);
 
+/**
+ * blkdev_dequeue_request - dequeue request and start timeout timer
+ * @req: request to dequeue
+ *
+ * Dequeue @req and start timeout timer on it.  This hands off the
+ * request to the driver.
+ *
+ * Block internal functions which don't want to start timer should
+ * call elv_dequeue_request().
+ */
+void blkdev_dequeue_request(struct request *req)
+{
+       elv_dequeue_request(req->q, req);
+
+       /*
+        * We are now handing the request to the hardware, add the
+        * timeout handler.
+        */
+       blk_add_timer(req);
+}
+EXPORT_SYMBOL(blkdev_dequeue_request);
+
 /**
  * __end_that_request_first - end I/O on a request
  * @req:      the request being processed
@@ -1774,7 +1796,7 @@ static void end_that_request_last(struct request *req, int error)
                blk_queue_end_tag(req->q, req);
 
        if (blk_queued_rq(req))
-               blkdev_dequeue_request(req);
+               elv_dequeue_request(req->q, req);
 
        if (unlikely(laptop_mode) && blk_fs_request(req))
                laptop_io_completion();
index 0f4b4b88181178b0344127df63af79f7d95da915..2990447f45e913f7aa968ddc3979ea7b1a027a80 100644 (file)
@@ -224,7 +224,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
                 */
                bio_get(bio);
                bio_endio(bio, 0);
-               bio_unmap_user(bio);
+               __blk_rq_unmap_user(bio);
                return -EINVAL;
        }
 
index 41392fbe19ff9615253278fdf48e63369ad7e856..afa55e14e27896837cb026ce706438520ea848aa 100644 (file)
@@ -125,6 +125,9 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
        q->nr_requests = BLKDEV_MAX_RQ;
        blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
        blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
+       blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK);
+       blk_queue_max_segment_size(q, MAX_SEGMENT_SIZE);
+
        q->make_request_fn = mfn;
        q->backing_dev_info.ra_pages =
                        (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
@@ -314,6 +317,7 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
        /* zero is "infinity" */
        t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
        t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
+       t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask, b->seg_boundary_mask);
 
        t->max_phys_segments = min(t->max_phys_segments, b->max_phys_segments);
        t->max_hw_segments = min(t->max_hw_segments, b->max_hw_segments);
index e8bd2475682ab4c2d29f8f205e57b62427b7cfe2..e73e50daf3d0a36df8977cad29b550e3139fbef0 100644 (file)
@@ -202,6 +202,8 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
                rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
+       if (rq->timeout < BLK_MIN_SG_TIMEOUT)
+               rq->timeout = BLK_MIN_SG_TIMEOUT;
 
        return 0;
 }
index 3d3e7a46f38c43319a2fcbed71e99a5da9af8e68..67eb93cff699ba2a4dc9231f73c0d4d46d9fc443 100644 (file)
@@ -677,6 +677,29 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
        case DVD_WRITE_STRUCT:
        case DVD_AUTH:
                arg = (unsigned long)compat_ptr(arg);
+       /* These intepret arg as an unsigned long, not as a pointer,
+        * so we must not do compat_ptr() conversion. */
+       case HDIO_SET_MULTCOUNT:
+       case HDIO_SET_UNMASKINTR:
+       case HDIO_SET_KEEPSETTINGS:
+       case HDIO_SET_32BIT:
+       case HDIO_SET_NOWERR:
+       case HDIO_SET_DMA:
+       case HDIO_SET_PIO_MODE:
+       case HDIO_SET_NICE:
+       case HDIO_SET_WCACHE:
+       case HDIO_SET_ACOUSTIC:
+       case HDIO_SET_BUSSTATE:
+       case HDIO_SET_ADDRESS:
+       case CDROMEJECT_SW:
+       case CDROM_SET_OPTIONS:
+       case CDROM_CLEAR_OPTIONS:
+       case CDROM_SELECT_SPEED:
+       case CDROM_SELECT_DISC:
+       case CDROM_MEDIA_CHANGED:
+       case CDROM_DRIVE_STATUS:
+       case CDROM_LOCKDOOR:
+       case CDROM_DEBUG:
                break;
        default:
                /* unknown ioctl number */
@@ -699,8 +722,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
        struct backing_dev_info *bdi;
        loff_t size;
 
+       /*
+        * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have
+        * to updated it before every ioctl.
+        */
        if (file->f_flags & O_NDELAY)
-               mode |= FMODE_NDELAY_NOW;
+               mode |= FMODE_NDELAY;
+       else
+               mode &= ~FMODE_NDELAY;
 
        switch (cmd) {
        case HDIO_GETGEO:
index 9ac82dde99dddcd5434659f65a1e81c2a166b639..a6951f76ba0c3fa3e9a0c9f8ff58a108e63dc85c 100644 (file)
@@ -844,14 +844,7 @@ void elv_dequeue_request(struct request_queue *q, struct request *rq)
         */
        if (blk_account_rq(rq))
                q->in_flight++;
-
-       /*
-        * We are now handing the request to the hardware, add the
-        * timeout handler.
-        */
-       blk_add_timer(rq);
 }
-EXPORT_SYMBOL(elv_dequeue_request);
 
 int elv_queue_empty(struct request_queue *q)
 {
index 27549e470da54d858e3bccd99946e2db2a311fa6..2f7feda61e35fc3cfd8dc74264300baeeaa56826 100644 (file)
@@ -1102,6 +1102,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
                        kfree(disk);
                        return NULL;
                }
+               disk->node_id = node_id;
                if (disk_expand_part_tbl(disk, 0)) {
                        free_part_stats(&disk->part0);
                        kfree(disk);
@@ -1116,7 +1117,6 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
                device_initialize(disk_to_dev(disk));
                INIT_WORK(&disk->async_notify,
                        media_change_notify_thread);
-               disk->node_id = node_id;
        }
        return disk;
 }
index 5963cf91a3a0c4f67dc709f9a6b98fdd87235f53..d0bb92cbefb9d698fc4756ec9041aeb2f5794005 100644 (file)
@@ -208,6 +208,8 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
                rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
+       if (rq->timeout < BLK_MIN_SG_TIMEOUT)
+               rq->timeout = BLK_MIN_SG_TIMEOUT;
 
        return 0;
 }
index 39dbd8e4dde13c2769a1acb71c8d9937f12b3499..dc20a34ba5efaf9922cf225f1ec18a962b5f1024 100644 (file)
@@ -31,35 +31,63 @@ config CRYPTO_FIPS
 
 config CRYPTO_ALGAPI
        tristate
+       select CRYPTO_ALGAPI2
        help
          This option provides the API for cryptographic algorithms.
 
+config CRYPTO_ALGAPI2
+       tristate
+
 config CRYPTO_AEAD
        tristate
+       select CRYPTO_AEAD2
        select CRYPTO_ALGAPI
 
+config CRYPTO_AEAD2
+       tristate
+       select CRYPTO_ALGAPI2
+
 config CRYPTO_BLKCIPHER
        tristate
+       select CRYPTO_BLKCIPHER2
        select CRYPTO_ALGAPI
-       select CRYPTO_RNG
+
+config CRYPTO_BLKCIPHER2
+       tristate
+       select CRYPTO_ALGAPI2
+       select CRYPTO_RNG2
 
 config CRYPTO_HASH
        tristate
+       select CRYPTO_HASH2
        select CRYPTO_ALGAPI
 
+config CRYPTO_HASH2
+       tristate
+       select CRYPTO_ALGAPI2
+
 config CRYPTO_RNG
        tristate
+       select CRYPTO_RNG2
        select CRYPTO_ALGAPI
 
+config CRYPTO_RNG2
+       tristate
+       select CRYPTO_ALGAPI2
+
 config CRYPTO_MANAGER
        tristate "Cryptographic algorithm manager"
-       select CRYPTO_AEAD
-       select CRYPTO_HASH
-       select CRYPTO_BLKCIPHER
+       select CRYPTO_MANAGER2
        help
          Create default cryptographic template instantiations such as
          cbc(aes).
 
+config CRYPTO_MANAGER2
+       def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
+       select CRYPTO_AEAD2
+       select CRYPTO_HASH2
+       select CRYPTO_BLKCIPHER2
+
 config CRYPTO_GF128MUL
        tristate "GF(2^128) multiplication functions (EXPERIMENTAL)"
        depends on EXPERIMENTAL
index 5862b807334e5c0f46fbad14bf01e058fe4e9939..cd4a4ed078ff1252642dba2fc87093fa97eedb18 100644 (file)
@@ -9,24 +9,24 @@ obj-$(CONFIG_CRYPTO_FIPS) += fips.o
 
 crypto_algapi-$(CONFIG_PROC_FS) += proc.o
 crypto_algapi-objs := algapi.o scatterwalk.o $(crypto_algapi-y)
-obj-$(CONFIG_CRYPTO_ALGAPI) += crypto_algapi.o
+obj-$(CONFIG_CRYPTO_ALGAPI2) += crypto_algapi.o
 
-obj-$(CONFIG_CRYPTO_AEAD) += aead.o
+obj-$(CONFIG_CRYPTO_AEAD2) += aead.o
 
 crypto_blkcipher-objs := ablkcipher.o
 crypto_blkcipher-objs += blkcipher.o
-obj-$(CONFIG_CRYPTO_BLKCIPHER) += crypto_blkcipher.o
-obj-$(CONFIG_CRYPTO_BLKCIPHER) += chainiv.o
-obj-$(CONFIG_CRYPTO_BLKCIPHER) += eseqiv.o
+obj-$(CONFIG_CRYPTO_BLKCIPHER2) += crypto_blkcipher.o
+obj-$(CONFIG_CRYPTO_BLKCIPHER2) += chainiv.o
+obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o
 obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
 
 crypto_hash-objs := hash.o
 crypto_hash-objs += ahash.o
-obj-$(CONFIG_CRYPTO_HASH) += crypto_hash.o
+obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o
 
 cryptomgr-objs := algboss.o testmgr.o
 
-obj-$(CONFIG_CRYPTO_MANAGER) += cryptomgr.o
+obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
 obj-$(CONFIG_CRYPTO_HMAC) += hmac.o
 obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
 obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
@@ -73,8 +73,8 @@ obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
 obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
 obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o
 obj-$(CONFIG_CRYPTO_LZO) += lzo.o
-obj-$(CONFIG_CRYPTO_RNG) += rng.o
-obj-$(CONFIG_CRYPTO_RNG) += krng.o
+obj-$(CONFIG_CRYPTO_RNG2) += rng.o
+obj-$(CONFIG_CRYPTO_RNG2) += krng.o
 obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
 obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
 
index c029d3eb9ef0a76ed248deb4a40e47511ba12afe..595b78672b36ad90e27cf50ed28126bb43970fb5 100644 (file)
@@ -53,10 +53,17 @@ do_async_xor(struct dma_chan *chan, struct page *dest, struct page **src_list,
        int xor_src_cnt;
        dma_addr_t dma_dest;
 
-       dma_dest = dma_map_page(dma->dev, dest, offset, len, DMA_FROM_DEVICE);
-       for (i = 0; i < src_cnt; i++)
+       /* map the dest bidrectional in case it is re-used as a source */
+       dma_dest = dma_map_page(dma->dev, dest, offset, len, DMA_BIDIRECTIONAL);
+       for (i = 0; i < src_cnt; i++) {
+               /* only map the dest once */
+               if (unlikely(src_list[i] == dest)) {
+                       dma_src[i] = dma_dest;
+                       continue;
+               }
                dma_src[i] = dma_map_page(dma->dev, src_list[i], offset,
                                          len, DMA_TO_DEVICE);
+       }
 
        while (src_cnt) {
                async_flags = flags;
index a0a178dd189c3259fcc82f323b6c4011fe1442a4..1423b0c0cd2eecc6e3c7b2f5c78746cee5fac4eb 100644 (file)
@@ -174,15 +174,6 @@ static int acpi_battery_get_property(struct power_supply *psy,
                break;
        case POWER_SUPPLY_PROP_CURRENT_NOW:
                val->intval = battery->current_now * 1000;
-               /* if power units are mW, convert to mA by
-                  dividing by current voltage (mV/1000) */
-               if (!battery->power_unit) {
-                       if (battery->voltage_now) {
-                               val->intval /= battery->voltage_now;
-                               val->intval *= 1000;
-                       } else
-                               val->intval = -1;
-               }
                break;
        case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
        case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
index 7edf6d913c1318fded1fd4cf6a448b2f799a0849..765fd1c56cd66bc445ab5228f562177b9eb469e1 100644 (file)
@@ -688,14 +688,6 @@ void __init acpi_early_init(void)
        if (acpi_disabled)
                return;
 
-       /*
-        * ACPI CA initializes acpi_dbg_level to non-zero, which means
-        * we get debug output merely by turning on CONFIG_ACPI_DEBUG.
-        * Turn it off so we don't get output unless the user specifies
-        * acpi.debug_level.
-        */
-       acpi_dbg_level = 0;
-
        printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
 
        /* enable workarounds, unless strict ACPI spec. compliance */
index 25f531d892deacbb5082b0696f0ba460c48a5494..40e60fc2e596daead5c656396aa84fca0587868b 100644 (file)
@@ -824,32 +824,36 @@ static int __init toshiba_acpi_init(void)
                        toshiba_acpi_exit();
                        return -ENOMEM;
                }
-       }
 
-       /* Register input device for kill switch */
-       toshiba_acpi.poll_dev = input_allocate_polled_device();
-       if (!toshiba_acpi.poll_dev) {
-               printk(MY_ERR "unable to allocate kill-switch input device\n");
-               toshiba_acpi_exit();
-               return -ENOMEM;
-       }
-       toshiba_acpi.poll_dev->private = &toshiba_acpi;
-       toshiba_acpi.poll_dev->poll = bt_poll_rfkill;
-       toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */
-
-       toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name;
-       toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST;
-       toshiba_acpi.poll_dev->input->id.vendor = 0x0930; /* Toshiba USB ID */
-       set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit);
-       set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit);
-       input_report_switch(toshiba_acpi.poll_dev->input, SW_RFKILL_ALL, TRUE);
-       input_sync(toshiba_acpi.poll_dev->input);
-
-       ret = input_register_polled_device(toshiba_acpi.poll_dev);
-       if (ret) {
-               printk(MY_ERR "unable to register kill-switch input device\n");
-               toshiba_acpi_exit();
-               return ret;
+               /* Register input device for kill switch */
+               toshiba_acpi.poll_dev = input_allocate_polled_device();
+               if (!toshiba_acpi.poll_dev) {
+                       printk(MY_ERR
+                              "unable to allocate kill-switch input device\n");
+                       toshiba_acpi_exit();
+                       return -ENOMEM;
+               }
+               toshiba_acpi.poll_dev->private = &toshiba_acpi;
+               toshiba_acpi.poll_dev->poll = bt_poll_rfkill;
+               toshiba_acpi.poll_dev->poll_interval = 1000; /* msecs */
+
+               toshiba_acpi.poll_dev->input->name = toshiba_acpi.rfk_name;
+               toshiba_acpi.poll_dev->input->id.bustype = BUS_HOST;
+               /* Toshiba USB ID */
+               toshiba_acpi.poll_dev->input->id.vendor = 0x0930;
+               set_bit(EV_SW, toshiba_acpi.poll_dev->input->evbit);
+               set_bit(SW_RFKILL_ALL, toshiba_acpi.poll_dev->input->swbit);
+               input_report_switch(toshiba_acpi.poll_dev->input,
+                                   SW_RFKILL_ALL, TRUE);
+               input_sync(toshiba_acpi.poll_dev->input);
+
+               ret = input_register_polled_device(toshiba_acpi.poll_dev);
+               if (ret) {
+                       printk(MY_ERR
+                              "unable to register kill-switch input device\n");
+                       toshiba_acpi_exit();
+                       return ret;
+               }
        }
 
        return 0;
index 670551b95e56e44fecfc075d9cbd5255a2aebc55..17ed5ac840f7be1d65c37acb967a29e4e9bc4965 100644 (file)
@@ -64,7 +64,7 @@ u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
 
 /* Debug switch - layer (component) mask */
 
-u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
+u32 acpi_dbg_layer = 0;
 u32 acpi_gbl_nesting_level = 0;
 
 /* Debugger globals */
index 78fbec8ceda0452c83b715e1d86bc593be8eb3cf..421b7c71e72db447a7c3b09abe183908399ac34a 100644 (file)
@@ -153,7 +153,7 @@ config SATA_PROMISE
          If unsure, say N.
 
 config SATA_SX4
-       tristate "Promise SATA SX4 support"
+       tristate "Promise SATA SX4 support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for Promise Serial ATA SX4.
@@ -219,8 +219,8 @@ config PATA_ACPI
          otherwise unsupported hardware.
 
 config PATA_ALI
-       tristate "ALi PATA support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "ALi PATA support"
+       depends on PCI
        help
          This option enables support for the ALi ATA interfaces
          found on the many ALi chipsets.
@@ -263,7 +263,7 @@ config PATA_ATIIXP
          If unsure, say N.
 
 config PATA_CMD640_PCI
-       tristate "CMD640 PCI PATA support (Very Experimental)"
+       tristate "CMD640 PCI PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the CMD640 PCI IDE
@@ -291,8 +291,8 @@ config PATA_CS5520
          If unsure, say N.
 
 config PATA_CS5530
-       tristate "CS5530 PATA support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "CS5530 PATA support"
+       depends on PCI
        help
          This option enables support for the Cyrix/NatSemi/AMD CS5530
          companion chip used with the MediaGX/Geode processor family.
@@ -309,8 +309,8 @@ config PATA_CS5535
          If unsure, say N.
 
 config PATA_CS5536
-       tristate "CS5536 PATA support (Experimental)"
-       depends on PCI && X86 && !X86_64 && EXPERIMENTAL
+       tristate "CS5536 PATA support"
+       depends on PCI && X86 && !X86_64
        help
          This option enables support for the AMD CS5536
          companion chip used with the Geode LX processor family.
@@ -363,7 +363,7 @@ config PATA_HPT37X
          If unsure, say N.
 
 config PATA_HPT3X2N
-       tristate "HPT 372N/302N PATA support (Very Experimental)"
+       tristate "HPT 372N/302N PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the N variant HPT PATA
@@ -389,8 +389,8 @@ config PATA_HPT3X3_DMA
          problems with DMA on this chipset.
 
 config PATA_ISAPNP
-       tristate "ISA Plug and Play PATA support (Experimental)"
-       depends on EXPERIMENTAL && ISAPNP
+       tristate "ISA Plug and Play PATA support"
+       depends on ISAPNP
        help
          This option enables support for ISA plug & play ATA
          controllers such as those found on old soundcards.
@@ -498,8 +498,8 @@ config PATA_NINJA32
          If unsure, say N.
 
 config PATA_NS87410
-       tristate "Nat Semi NS87410 PATA support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "Nat Semi NS87410 PATA support"
+       depends on PCI
        help
          This option enables support for the National Semiconductor
          NS87410 PCI-IDE controller.
@@ -507,8 +507,8 @@ config PATA_NS87410
          If unsure, say N.
 
 config PATA_NS87415
-       tristate "Nat Semi NS87415 PATA support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "Nat Semi NS87415 PATA support"
+       depends on PCI
        help
          This option enables support for the National Semiconductor
          NS87415 PCI-IDE controller.
@@ -544,8 +544,8 @@ config PATA_PCMCIA
          If unsure, say N.
 
 config PATA_PDC_OLD
-       tristate "Older Promise PATA controller support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "Older Promise PATA controller support"
+       depends on PCI
        help
          This option enables support for the Promise 20246, 20262, 20263,
          20265 and 20267 adapters.
@@ -559,7 +559,7 @@ config PATA_QDI
          Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
 
 config PATA_RADISYS
-       tristate "RADISYS 82600 PATA support (Very Experimental)"
+       tristate "RADISYS 82600 PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the RADISYS 82600
@@ -586,8 +586,8 @@ config PATA_RZ1000
          If unsure, say N.
 
 config PATA_SC1200
-       tristate "SC1200 PATA support (Very Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "SC1200 PATA support"
+       depends on PCI
        help
          This option enables support for the NatSemi/AMD SC1200 SoC
          companion chip used with the Geode processor family.
@@ -620,8 +620,8 @@ config PATA_SIL680
          If unsure, say N.
 
 config PATA_SIS
-       tristate "SiS PATA support (Experimental)"
-       depends on PCI && EXPERIMENTAL
+       tristate "SiS PATA support"
+       depends on PCI
        help
          This option enables support for SiS PATA controllers
 
index d6d97d8f3fa4b6cab0d3df24d872577eeaa72952..c11936e13dd3ccd39952b35b242e42dd5e0d1078 100644 (file)
@@ -1072,7 +1072,14 @@ static int piix_broken_suspend(void)
         * matching is necessary because dmi_system_id.matches is
         * limited to four entries.
         */
-       if (!strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
+       if (dmi_get_system_info(DMI_SYS_VENDOR) &&
+           dmi_get_system_info(DMI_PRODUCT_NAME) &&
+           dmi_get_system_info(DMI_PRODUCT_VERSION) &&
+           dmi_get_system_info(DMI_PRODUCT_SERIAL) &&
+           dmi_get_system_info(DMI_BOARD_VENDOR) &&
+           dmi_get_system_info(DMI_BOARD_NAME) &&
+           dmi_get_system_info(DMI_BOARD_VERSION) &&
+           !strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
            !strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") &&
            !strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") &&
            !strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") &&
index 5e2eb740df46cff3ddb41d434b4e41a3c67cbb8b..bc6695e3c8482927e5b6de7ae4017c9884bea4a8 100644 (file)
@@ -4050,17 +4050,70 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
        { "ST3160023AS",        "3.42",         ATA_HORKAGE_NONCQ },
 
        /* Seagate NCQ + FLUSH CACHE firmware bug */
-       { "ST31500341AS",       "9JU138",       ATA_HORKAGE_NONCQ |
+       { "ST31500341AS",       "SD15",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
-       { "ST31000333AS",       "9FZ136",       ATA_HORKAGE_NONCQ |
+       { "ST31500341AS",       "SD16",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
-       { "ST3640623AS",        "9FZ164",       ATA_HORKAGE_NONCQ |
+       { "ST31500341AS",       "SD17",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
-       { "ST3640323AS",        "9FZ134",       ATA_HORKAGE_NONCQ |
+       { "ST31500341AS",       "SD18",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
-       { "ST3320813AS",        "9FZ182",       ATA_HORKAGE_NONCQ |
+       { "ST31500341AS",       "SD19",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
-       { "ST3320613AS",        "9FZ162",       ATA_HORKAGE_NONCQ |
+
+       { "ST31000333AS",       "SD15",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST31000333AS",       "SD16",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST31000333AS",       "SD17",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST31000333AS",       "SD18",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST31000333AS",       "SD19",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+
+       { "ST3640623AS",        "SD15",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640623AS",        "SD16",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640623AS",        "SD17",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640623AS",        "SD18",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640623AS",        "SD19",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+
+       { "ST3640323AS",        "SD15",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640323AS",        "SD16",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640323AS",        "SD17",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640323AS",        "SD18",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3640323AS",        "SD19",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+
+       { "ST3320813AS",        "SD15",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320813AS",        "SD16",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320813AS",        "SD17",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320813AS",        "SD18",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320813AS",        "SD19",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+
+       { "ST3320613AS",        "SD15",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320613AS",        "SD16",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320613AS",        "SD17",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320613AS",        "SD18",         ATA_HORKAGE_NONCQ |
+                                               ATA_HORKAGE_FIRMWARE_WARN },
+       { "ST3320613AS",        "SD19",         ATA_HORKAGE_NONCQ |
                                                ATA_HORKAGE_FIRMWARE_WARN },
 
        /* Blacklist entries taken from Silicon Image 3124/3132
index f2b83eabc7c7cd2bb59ba198df4f5c85b7b20355..e0c4f05d7d579a807becb30af2bf44b3a9ea7260 100644 (file)
@@ -183,7 +183,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
                        mask &= ~(0xF8 << ATA_SHIFT_UDMA);
                if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
                        mask &= ~(0xF0 << ATA_SHIFT_UDMA);
-       }
+       } else if (adev->class == ATA_DEV_ATAPI)
+               mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
+
        return ata_bmdma_mode_filter(adev, mask);
 }
 
@@ -211,11 +213,15 @@ static u32 hpt36x_find_mode(struct ata_port *ap, int speed)
 
 static int hpt36x_cable_detect(struct ata_port *ap)
 {
-       u8 ata66;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
+       u8 ata66;
 
+       /*
+        * Each channel of pata_hpt366 occupies separate PCI function
+        * as the primary channel and bit1 indicates the cable type.
+        */
        pci_read_config_byte(pdev, 0x5A, &ata66);
-       if (ata66 & (1 << ap->port_no))
+       if (ata66 & 2)
                return ATA_CBL_PATA40;
        return ATA_CBL_PATA80;
 }
@@ -382,10 +388,10 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        /* PCI clocking determines the ATA timing values to use */
        /* info_hpt366 is safe against re-entry so we can scribble on it */
        switch((reg1 & 0x700) >> 8) {
-               case 5:
+               case 9:
                        hpriv = &hpt366_40;
                        break;
-               case 9:
+               case 5:
                        hpriv = &hpt366_25;
                        break;
                default:
index 4e466eae8b462e31d82f7404d25f43a3b9cfd5cb..4dd9a3b031e4dc4fc932cea32b9cd6fc6b42d063 100644 (file)
@@ -44,7 +44,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_ninja32"
-#define DRV_VERSION "0.1.1"
+#define DRV_VERSION "0.1.3"
 
 
 /**
@@ -130,7 +130,8 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                return rc;
        pci_set_master(dev);
 
-       /* Set up the register mappings */
+       /* Set up the register mappings. We use the I/O mapping as only the
+          older chips also have MMIO on BAR 1 */
        base = host->iomap[0];
        if (!base)
                return -ENOMEM;
@@ -167,8 +168,12 @@ static int ninja32_reinit_one(struct pci_dev *pdev)
 #endif
 
 static const struct pci_device_id ninja32[] = {
+       { 0x10FC, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0x1145, 0x8008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0x1145, 0xf008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        { 0x1145, 0xf021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        { 0x1145, 0xf024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0x1145, 0xf02C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        { },
 };
 
index d34236611752d8c8c3cddc2ca868cee655051c26..e4be55e047f61c3608bb9a0ae02027555475eb2c 100644 (file)
@@ -56,7 +56,6 @@ static const struct sis_laptop sis_laptop[] = {
        { 0x5513, 0x1043, 0x1107 },     /* ASUS A6K */
        { 0x5513, 0x1734, 0x105F },     /* FSC Amilo A1630 */
        { 0x5513, 0x1071, 0x8640 },     /* EasyNote K5305 */
-       { 0x5513, 0x1039, 0x5513 },     /* Targa Visionary 1000 */
        /* end marker */
        { 0, }
 };
index 615412364e9930aa042b682e503d3816f2498b8e..6b969f8c684fad8d963c707cc85fcd139fb766ce 100644 (file)
@@ -2705,7 +2705,7 @@ static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_
 
        /* XXX DEV_LABEL is a guess */
        if (!request_region(iobase, HRZ_IO_EXTENT, DEV_LABEL)) {
-               return -EINVAL;
+               err = -EINVAL;
                goto out_disable;
        }
 
index 9364dc554257e5af44a3a4a2aff7fc3f6598fa27..9f7c543cc04b265344b0e37443c4349147e88574 100644 (file)
@@ -1693,6 +1693,11 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
        for (i = 0; i <= h->highest_lun; i++) {
                int j;
                drv_found = 0;
+
+               /* skip holes in the array from already deleted drives */
+               if (h->drv[i].raid_level == -1)
+                       continue;
+
                for (j = 0; j < num_luns; j++) {
                        memcpy(&lunid, &ld_buff->LUN[j][0], 4);
                        lunid = le32_to_cpu(lunid);
index f20bf359b84f20e7ff10f7081f54b37371e12f18..dc7a8c352da2e7c5b44a3d9a4e7a02bfd029d0c2 100644 (file)
@@ -302,7 +302,7 @@ static struct kobj_type kobj_pkt_type_wqueue = {
 static void pkt_sysfs_dev_new(struct pktcdvd_device *pd)
 {
        if (class_pktcdvd) {
-               pd->dev = device_create(class_pktcdvd, NULL, pd->pkt_dev, NULL,
+               pd->dev = device_create(class_pktcdvd, NULL, MKDEV(0, 0), NULL,
                                        "%s", pd->name);
                if (IS_ERR(pd->dev))
                        pd->dev = NULL;
@@ -2790,7 +2790,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
        return 0;
 
 out_mem:
-       blkdev_put(bdev, FMODE_READ|FMODE_WRITE);
+       blkdev_put(bdev, FMODE_READ | FMODE_NDELAY);
        /* This is safe: open() is still holding a reference. */
        module_put(THIS_MODULE);
        return ret;
@@ -2975,7 +2975,7 @@ static int pkt_remove_dev(dev_t pkt_dev)
        pkt_debugfs_dev_remove(pd);
        pkt_sysfs_dev_remove(pd);
 
-       blkdev_put(pd->bdev, FMODE_READ|FMODE_WRITE);
+       blkdev_put(pd->bdev, FMODE_READ | FMODE_NDELAY);
 
        remove_proc_entry(pd->name, pkt_proc);
        DPRINTK(DRIVER_NAME": writer %s unmapped\n", pd->name);
index d16b02423d6192f43ad8121776ca419f08cc01c2..7d2e91cccb13e99068a4499bc469ef9bc032c67b 100644 (file)
@@ -2081,10 +2081,6 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
        if (!q)
                return -ENXIO;
 
-       rq = blk_get_request(q, READ, GFP_KERNEL);
-       if (!rq)
-               return -ENOMEM;
-
        cdi->last_sense = 0;
 
        while (nframes) {
@@ -2096,9 +2092,17 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 
                len = nr * CD_FRAMESIZE_RAW;
 
+               rq = blk_get_request(q, READ, GFP_KERNEL);
+               if (!rq) {
+                       ret = -ENOMEM;
+                       break;
+               }
+
                ret = blk_rq_map_user(q, rq, NULL, ubuf, len, GFP_KERNEL);
-               if (ret)
+               if (ret) {
+                       blk_put_request(rq);
                        break;
+               }
 
                rq->cmd[0] = GPCMD_READ_CD;
                rq->cmd[1] = 1 << 2;
@@ -2124,6 +2128,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 
                if (blk_rq_unmap_user(bio))
                        ret = -EFAULT;
+               blk_put_request(rq);
 
                if (ret)
                        break;
@@ -2133,7 +2138,6 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
                ubuf += len;
        }
 
-       blk_put_request(rq);
        return ret;
 }
 
index 1f06889a96b97e033bdaa294dece945eb8310cc4..bc6163484f62573389fcdcc0388f62270e6bbf53 100644 (file)
@@ -27,7 +27,7 @@
 0x0c   U+2640
 0x0d   U+266a
 0x0e   U+266b
-0x0f   U+263c
+0x0f   U+263c U+00a4
 0x10   U+25b6 U+25ba
 0x11   U+25c0 U+25c4
 0x12   U+2195
@@ -55,7 +55,7 @@
 0x24   U+0024
 0x25   U+0025
 0x26   U+0026
-0x27   U+0027
+0x27   U+0027 U+00b4
 0x28   U+0028
 0x29   U+0029
 0x2a   U+002a
@@ -84,7 +84,7 @@
 0x41   U+0041 U+00c0 U+00c1 U+00c2 U+00c3
 0x42   U+0042
 0x43   U+0043 U+00a9
-0x44   U+0044
+0x44   U+0044 U+00d0
 0x45   U+0045 U+00c8 U+00ca U+00cb
 0x46   U+0046
 0x47   U+0047
 0x79   U+0079 U+00fd
 0x7a   U+007a
 0x7b   U+007b
-0x7c   U+007c U+00a5
+0x7c   U+007c U+00a6
 0x7d   U+007d
 0x7e   U+007e
 #
 0xe8   U+03a6 U+00d8
 0xe9   U+0398
 0xea   U+03a9 U+2126
-0xeb   U+03b4
+0xeb   U+03b4 U+00f0
 0xec   U+221e
 0xed   U+03c6 U+00f8
-0xee   U+03b5
+0xee   U+03b5 U+2208
 0xef   U+2229
 0xf0   U+2261
 0xf1   U+00b1
index 3b23270eaa65385f56a2cef7652aeb2ccea77055..a8f15e6be594237f150b1b3e92ad1b9a7d468ae1 100644 (file)
@@ -418,7 +418,7 @@ static irqreturn_t cd2401_rxerr_interrupt(int irq, void *dev_id)
                                                             TTY_OVERRUN);
                                        /*
                                           If the flip buffer itself is
-                                          overflowing, we still loose
+                                          overflowing, we still lose
                                           the next incoming character.
                                         */
                                        if (tty_buffer_request_room(tty, 1) !=
index a5af6072e2b34760ade3cf63b879dd16f4015957..008176edbd64511148ac5e1e40d21d3fbf1883d5 100644 (file)
@@ -2274,7 +2274,7 @@ rescan_last_byte:
                                    continue; /* nothing to display */
                                }
                                /* Glyph not found */
-                               if ((!(vc->vc_utf && !vc->vc_disp_ctrl) || c < 128) && !(c & ~charmask)) {
+                               if ((!(vc->vc_utf && !vc->vc_disp_ctrl) && c < 128) && !(c & ~charmask)) {
                                    /* In legacy mode use the glyph we get by a 1:1 mapping.
                                       This would make absolutely no sense with Unicode in mind,
                                       but do this for ASCII characters since a font may lack
index aa7f7962a9a0e678b0e3cdfdd9da1058c3798d14..05d897764f027489a346774cedc0ded600f28d2c 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2003-2008 Xilinx Inc.
  *     All rights reserved.
  *
index 8b0252bf06e221ea89a0b9b6b3f89f0eda301722..d4f419ee87abbfc6fb0d41fd98ab8665524514cf 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2003-2008 Xilinx Inc.
  *     All rights reserved.
  *
index 776b505284783cc0f128763a65925c9dbbd622e1..02225eb19cf6bd2e6d99085b6edea7aa4801c30b 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2007-2008 Xilinx Inc.
  *     All rights reserved.
  *
index 62bda453c90b8a6101e91d11f00ec24406ab48b4..4c9dd9a3b62ac4b0266389141a4f66b9e2e34fd6 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2007-2008 Xilinx Inc.
  *     All rights reserved.
  *
index d16131949097696cc8a72d2d07ae6a393094ebb7..f40ab699860f4645a693f76a239473812e767493 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2002 Xilinx Inc., Systems Engineering Group
  *     (c) Copyright 2004 Xilinx Inc., Systems Engineering Group
  *     (c) Copyright 2007-2008 Xilinx Inc.
index 24d0d9b938fb39e485c56d9e74d1d9ff6effa5e6..8cca11981c5ff73036eaaeb915fbcf0a050a87c5 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2003-2007 Xilinx Inc.
  *     All rights reserved.
  *
index 5317e08221ecb2a34e699c77bac4f72a505f59e6..657996517374f30f51f10257dd0ef0ee40ae66b9 100644 (file)
@@ -388,7 +388,10 @@ int dma_async_device_register(struct dma_device *device)
 
        init_completion(&device->done);
        kref_init(&device->refcount);
+
+       mutex_lock(&dma_list_mutex);
        device->dev_id = id++;
+       mutex_unlock(&dma_list_mutex);
 
        /* represent channels in sysfs. Probably want devs too */
        list_for_each_entry(chan, &device->channels, device_node) {
index ecd743f7cc617b9921b7d08e553da0264d8c401c..6607fdd00b1cd3a31655cc6b53fca580919f3354 100644 (file)
@@ -1341,10 +1341,12 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan)
  */
 #define IOAT_TEST_SIZE 2000
 
+DECLARE_COMPLETION(test_completion);
 static void ioat_dma_test_callback(void *dma_async_param)
 {
        printk(KERN_ERR "ioatdma: ioat_dma_test_callback(%p)\n",
                dma_async_param);
+       complete(&test_completion);
 }
 
 /**
@@ -1410,7 +1412,8 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
                goto free_resources;
        }
        device->common.device_issue_pending(dma_chan);
-       msleep(1);
+
+       wait_for_completion_timeout(&test_completion, msecs_to_jiffies(3000));
 
        if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL)
                                        != DMA_SUCCESS) {
index c7a9306d951d2c61f622c601ef2d49af422b679e..6be3172622009ff67ec502b049f167d6ccebe1cd 100644 (file)
@@ -85,18 +85,28 @@ iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
                        enum dma_ctrl_flags flags = desc->async_tx.flags;
                        u32 src_cnt;
                        dma_addr_t addr;
+                       dma_addr_t dest;
 
+                       src_cnt = unmap->unmap_src_cnt;
+                       dest = iop_desc_get_dest_addr(unmap, iop_chan);
                        if (!(flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
-                               addr = iop_desc_get_dest_addr(unmap, iop_chan);
-                               dma_unmap_page(dev, addr, len, DMA_FROM_DEVICE);
+                               enum dma_data_direction dir;
+
+                               if (src_cnt > 1) /* is xor? */
+                                       dir = DMA_BIDIRECTIONAL;
+                               else
+                                       dir = DMA_FROM_DEVICE;
+
+                               dma_unmap_page(dev, dest, len, dir);
                        }
 
                        if (!(flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
-                               src_cnt = unmap->unmap_src_cnt;
                                while (src_cnt--) {
                                        addr = iop_desc_get_src_addr(unmap,
                                                                     iop_chan,
                                                                     src_cnt);
+                                       if (addr == dest)
+                                               continue;
                                        dma_unmap_page(dev, addr, len,
                                                       DMA_TO_DEVICE);
                                }
index 0328da020a1084e6c7f0fcfd0e729a00e079702d..bcda17426411ea6f4c311aa5b077a1e91e906b63 100644 (file)
@@ -311,17 +311,26 @@ mv_xor_run_tx_complete_actions(struct mv_xor_desc_slot *desc,
                        enum dma_ctrl_flags flags = desc->async_tx.flags;
                        u32 src_cnt;
                        dma_addr_t addr;
+                       dma_addr_t dest;
 
+                       src_cnt = unmap->unmap_src_cnt;
+                       dest = mv_desc_get_dest_addr(unmap);
                        if (!(flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
-                               addr = mv_desc_get_dest_addr(unmap);
-                               dma_unmap_page(dev, addr, len, DMA_FROM_DEVICE);
+                               enum dma_data_direction dir;
+
+                               if (src_cnt > 1) /* is xor ? */
+                                       dir = DMA_BIDIRECTIONAL;
+                               else
+                                       dir = DMA_FROM_DEVICE;
+                               dma_unmap_page(dev, dest, len, dir);
                        }
 
                        if (!(flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
-                               src_cnt = unmap->unmap_src_cnt;
                                while (src_cnt--) {
                                        addr = mv_desc_get_src_addr(unmap,
                                                                    src_cnt);
+                                       if (addr == dest)
+                                               continue;
                                        dma_unmap_page(dev, addr, len,
                                                       DMA_TO_DEVICE);
                                }
index 5fcd3d89c75d91cda65acd42fe34be8d987e9c67..4041e91432837b2d2cc9b898e10f04f20cc778ce 100644 (file)
@@ -394,6 +394,12 @@ static void edac_device_workq_function(struct work_struct *work_req)
 
        mutex_lock(&device_ctls_mutex);
 
+       /* If we are being removed, bail out immediately */
+       if (edac_dev->op_state == OP_OFFLINE) {
+               mutex_unlock(&device_ctls_mutex);
+               return;
+       }
+
        /* Only poll controllers that are running polled and have a check */
        if ((edac_dev->op_state == OP_RUNNING_POLL) &&
                (edac_dev->edac_check != NULL)) {
@@ -585,14 +591,14 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev)
        /* mark this instance as OFFLINE */
        edac_dev->op_state = OP_OFFLINE;
 
-       /* clear workq processing on this instance */
-       edac_device_workq_teardown(edac_dev);
-
        /* deregister from global list */
        del_edac_device_from_global_list(edac_dev);
 
        mutex_unlock(&device_ctls_mutex);
 
+       /* clear workq processing on this instance */
+       edac_device_workq_teardown(edac_dev);
+
        /* Tear down the sysfs entries for this instance */
        edac_device_remove_sysfs(edac_dev);
 
index 46610b090415544306a292a02a4d62f63033d901..ab9c01e462ef64a197c72250fed471b361477f02 100644 (file)
@@ -974,6 +974,7 @@ at_context_queue_packet(struct context *ctx, struct fw_packet *packet)
                        packet->ack = RCODE_SEND_ERROR;
                        return -1;
                }
+               packet->payload_bus = payload_bus;
 
                d[2].req_count    = cpu_to_le16(packet->payload_length);
                d[2].data_address = cpu_to_le32(payload_bus);
@@ -1025,7 +1026,6 @@ static int handle_at_packet(struct context *context,
        struct driver_data *driver_data;
        struct fw_packet *packet;
        struct fw_ohci *ohci = context->ohci;
-       dma_addr_t payload_bus;
        int evt;
 
        if (last->transfer_status == 0)
@@ -1038,9 +1038,8 @@ static int handle_at_packet(struct context *context,
                /* This packet was cancelled, just continue. */
                return 1;
 
-       payload_bus = le32_to_cpu(last->data_address);
-       if (payload_bus != 0)
-               dma_unmap_single(ohci->card.device, payload_bus,
+       if (packet->payload_bus)
+               dma_unmap_single(ohci->card.device, packet->payload_bus,
                                 packet->payload_length, DMA_TO_DEVICE);
 
        evt = le16_to_cpu(last->transfer_status) & 0x1f;
@@ -1697,6 +1696,10 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
        if (packet->ack != 0)
                goto out;
 
+       if (packet->payload_bus)
+               dma_unmap_single(ohci->card.device, packet->payload_bus,
+                                packet->payload_length, DMA_TO_DEVICE);
+
        log_ar_at_event('T', packet->speed, packet->header, 0x20);
        driver_data->packet = NULL;
        packet->ack = RCODE_CANCELLED;
index 022ac4fabb6740d3fec872142e9d65d1bc001a96..2884f876397b872085925353997276e24e6c4a83 100644 (file)
@@ -207,6 +207,7 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
        packet->speed = speed;
        packet->generation = generation;
        packet->ack = 0;
+       packet->payload_bus = 0;
 }
 
 /**
@@ -581,6 +582,8 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
                BUG();
                return;
        }
+
+       response->payload_bus = 0;
 }
 EXPORT_SYMBOL(fw_fill_response);
 
index aed7dbb17cdaebb47a695a8b88a019ccf610d614..839466f0a795c57fe2df325a3b1d8e3a8813d1dd 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/list.h>
 #include <linux/spinlock_types.h>
 #include <linux/timer.h>
+#include <linux/types.h>
 #include <linux/workqueue.h>
 
 #define TCODE_IS_READ_REQUEST(tcode)   (((tcode) & ~1) == 4)
@@ -153,6 +154,7 @@ struct fw_packet {
        size_t header_length;
        void *payload;
        size_t payload_length;
+       dma_addr_t payload_bus;
        u32 timestamp;
 
        /*
index ba89b42f790abb693a0b355e9ee918f0f1339c81..afa8a12cd00902c1c34ea4f4ba83e55c3b7a74e2 100644 (file)
@@ -717,7 +717,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
                value = dev->pci_device;
                break;
        case I915_PARAM_HAS_GEM:
-               value = 1;
+               value = dev_priv->has_gem;
                break;
        default:
                DRM_ERROR("Unknown parameter %d\n", param->param);
@@ -830,6 +830,14 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 
        dev_priv->regs = ioremap(base, size);
 
+#ifdef CONFIG_HIGHMEM64G
+       /* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
+       dev_priv->has_gem = 0;
+#else
+       /* enable GEM by default */
+       dev_priv->has_gem = 1;
+#endif
+
        i915_gem_load(dev);
 
        /* Init HWS */
@@ -847,9 +855,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
         * and the registers being closely associated.
         *
         * According to chipset errata, on the 965GM, MSI interrupts may
-        * be lost or delayed
+        * be lost or delayed, but we use them anyways to avoid
+        * stuck interrupts on some machines.
         */
-       if (!IS_I945G(dev) && !IS_I945GM(dev) && !IS_I965GM(dev))
+       if (!IS_I945G(dev) && !IS_I945GM(dev))
                pci_enable_msi(dev->pdev);
 
        intel_opregion_init(dev);
index 0a4f39b9a0ec1623b79fa4073b8580efb203caa0..b3cc4731aa7c07b43d2d9825068f3e8a70ce34bd 100644 (file)
@@ -106,6 +106,8 @@ struct intel_opregion {
 typedef struct drm_i915_private {
        struct drm_device *dev;
 
+       int has_gem;
+
        void __iomem *regs;
        drm_local_map_t *sarea;
 
@@ -244,6 +246,10 @@ typedef struct drm_i915_private {
                 * List of objects currently involved in rendering from the
                 * ringbuffer.
                 *
+                * Includes buffers having the contents of their GPU caches
+                * flushed, not necessarily primitives.  last_rendering_seqno
+                * represents when the rendering involved will be completed.
+                *
                 * A reference is held on the buffer while on this list.
                 */
                struct list_head active_list;
@@ -253,6 +259,8 @@ typedef struct drm_i915_private {
                 * still have a write_domain which needs to be flushed before
                 * unbinding.
                 *
+                * last_rendering_seqno is 0 while an object is in this list.
+                *
                 * A reference is held on the buffer while on this list.
                 */
                struct list_head flushing_list;
@@ -261,6 +269,8 @@ typedef struct drm_i915_private {
                 * LRU list of objects which are not in the ringbuffer and
                 * are ready to unbind, but are still in the GTT.
                 *
+                * last_rendering_seqno is 0 while an object is in this list.
+                *
                 * A reference is not held on the buffer while on this list,
                 * as merely being GTT-bound shouldn't prevent its being
                 * freed, and we'll pull it off the list in the free path.
@@ -371,8 +381,8 @@ struct drm_i915_gem_object {
        uint32_t agp_type;
 
        /**
-        * Flagging of which individual pages are valid in GEM_DOMAIN_CPU when
-        * GEM_DOMAIN_CPU is not in the object's read domain.
+        * If present, while GEM_DOMAIN_CPU is in the read domain this array
+        * flags which individual pages are valid.
         */
        uint8_t *page_cpu_valid;
 };
@@ -394,9 +404,6 @@ struct drm_i915_gem_request {
        /** Time at which this request was emitted, in jiffies. */
        unsigned long emitted_jiffies;
 
-       /** Cache domains that were flushed at the start of the request. */
-       uint32_t flush_domains;
-
        struct list_head list;
 };
 
index d58ddef468f8124c29f6af32412ee2ba31f9873e..24fe8c10b4b22c6bac1cfa17d79d55f02dd59179 100644 (file)
 
 #define I915_GEM_GPU_DOMAINS   (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT))
 
-static int
-i915_gem_object_set_domain(struct drm_gem_object *obj,
-                           uint32_t read_domains,
-                           uint32_t write_domain);
-static int
-i915_gem_object_set_domain_range(struct drm_gem_object *obj,
-                                uint64_t offset,
-                                uint64_t size,
-                                uint32_t read_domains,
-                                uint32_t write_domain);
-static int
-i915_gem_set_domain(struct drm_gem_object *obj,
-                   struct drm_file *file_priv,
-                   uint32_t read_domains,
-                   uint32_t write_domain);
+static void
+i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
+                                 uint32_t read_domains,
+                                 uint32_t write_domain);
+static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj);
+static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj);
+static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj);
+static int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
+                                            int write);
+static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj,
+                                            int write);
+static int i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj,
+                                                    uint64_t offset,
+                                                    uint64_t size);
+static void i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj);
 static int i915_gem_object_get_page_list(struct drm_gem_object *obj);
 static void i915_gem_object_free_page_list(struct drm_gem_object *obj);
 static int i915_gem_object_wait_rendering(struct drm_gem_object *obj);
@@ -162,8 +162,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
 
        mutex_lock(&dev->struct_mutex);
 
-       ret = i915_gem_object_set_domain_range(obj, args->offset, args->size,
-                                              I915_GEM_DOMAIN_CPU, 0);
+       ret = i915_gem_object_set_cpu_read_domain_range(obj, args->offset,
+                                                       args->size);
        if (ret != 0) {
                drm_gem_object_unreference(obj);
                mutex_unlock(&dev->struct_mutex);
@@ -260,8 +260,7 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
                mutex_unlock(&dev->struct_mutex);
                return ret;
        }
-       ret = i915_gem_set_domain(obj, file_priv,
-                                 I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+       ret = i915_gem_object_set_to_gtt_domain(obj, 1);
        if (ret)
                goto fail;
 
@@ -320,8 +319,7 @@ i915_gem_shmem_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
 
        mutex_lock(&dev->struct_mutex);
 
-       ret = i915_gem_set_domain(obj, file_priv,
-                                 I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+       ret = i915_gem_object_set_to_cpu_domain(obj, 1);
        if (ret) {
                mutex_unlock(&dev->struct_mutex);
                return ret;
@@ -397,7 +395,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
 }
 
 /**
- * Called when user space prepares to use an object
+ * Called when user space prepares to use an object with the CPU, either
+ * through the mmap ioctl's mapping or a GTT mapping.
  */
 int
 i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
@@ -405,11 +404,26 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
 {
        struct drm_i915_gem_set_domain *args = data;
        struct drm_gem_object *obj;
+       uint32_t read_domains = args->read_domains;
+       uint32_t write_domain = args->write_domain;
        int ret;
 
        if (!(dev->driver->driver_features & DRIVER_GEM))
                return -ENODEV;
 
+       /* Only handle setting domains to types used by the CPU. */
+       if (write_domain & ~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT))
+               return -EINVAL;
+
+       if (read_domains & ~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT))
+               return -EINVAL;
+
+       /* Having something in the write domain implies it's in the read
+        * domain, and only that read domain.  Enforce that in the request.
+        */
+       if (write_domain != 0 && read_domains != write_domain)
+               return -EINVAL;
+
        obj = drm_gem_object_lookup(dev, file_priv, args->handle);
        if (obj == NULL)
                return -EBADF;
@@ -417,10 +431,21 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
        mutex_lock(&dev->struct_mutex);
 #if WATCH_BUF
        DRM_INFO("set_domain_ioctl %p(%d), %08x %08x\n",
-                obj, obj->size, args->read_domains, args->write_domain);
+                obj, obj->size, read_domains, write_domain);
 #endif
-       ret = i915_gem_set_domain(obj, file_priv,
-                                 args->read_domains, args->write_domain);
+       if (read_domains & I915_GEM_DOMAIN_GTT) {
+               ret = i915_gem_object_set_to_gtt_domain(obj, write_domain != 0);
+
+               /* Silently promote "you're not bound, there was nothing to do"
+                * to success, since the client was just asking us to
+                * make sure everything was done.
+                */
+               if (ret == -EINVAL)
+                       ret = 0;
+       } else {
+               ret = i915_gem_object_set_to_cpu_domain(obj, write_domain != 0);
+       }
+
        drm_gem_object_unreference(obj);
        mutex_unlock(&dev->struct_mutex);
        return ret;
@@ -455,10 +480,9 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
        obj_priv = obj->driver_private;
 
        /* Pinned buffers may be scanout, so flush the cache */
-       if ((obj->write_domain & I915_GEM_DOMAIN_CPU) && obj_priv->pin_count) {
-               i915_gem_clflush_object(obj);
-               drm_agp_chipset_flush(dev);
-       }
+       if (obj_priv->pin_count)
+               i915_gem_object_flush_cpu_write_domain(obj);
+
        drm_gem_object_unreference(obj);
        mutex_unlock(&dev->struct_mutex);
        return ret;
@@ -532,7 +556,7 @@ i915_gem_object_free_page_list(struct drm_gem_object *obj)
 }
 
 static void
-i915_gem_object_move_to_active(struct drm_gem_object *obj)
+i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno)
 {
        struct drm_device *dev = obj->dev;
        drm_i915_private_t *dev_priv = dev->dev_private;
@@ -546,8 +570,20 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj)
        /* Move from whatever list we were on to the tail of execution. */
        list_move_tail(&obj_priv->list,
                       &dev_priv->mm.active_list);
+       obj_priv->last_rendering_seqno = seqno;
 }
 
+static void
+i915_gem_object_move_to_flushing(struct drm_gem_object *obj)
+{
+       struct drm_device *dev = obj->dev;
+       drm_i915_private_t *dev_priv = dev->dev_private;
+       struct drm_i915_gem_object *obj_priv = obj->driver_private;
+
+       BUG_ON(!obj_priv->active);
+       list_move_tail(&obj_priv->list, &dev_priv->mm.flushing_list);
+       obj_priv->last_rendering_seqno = 0;
+}
 
 static void
 i915_gem_object_move_to_inactive(struct drm_gem_object *obj)
@@ -562,6 +598,7 @@ i915_gem_object_move_to_inactive(struct drm_gem_object *obj)
        else
                list_move_tail(&obj_priv->list, &dev_priv->mm.inactive_list);
 
+       obj_priv->last_rendering_seqno = 0;
        if (obj_priv->active) {
                obj_priv->active = 0;
                drm_gem_object_unreference(obj);
@@ -610,10 +647,28 @@ i915_add_request(struct drm_device *dev, uint32_t flush_domains)
 
        request->seqno = seqno;
        request->emitted_jiffies = jiffies;
-       request->flush_domains = flush_domains;
        was_empty = list_empty(&dev_priv->mm.request_list);
        list_add_tail(&request->list, &dev_priv->mm.request_list);
 
+       /* Associate any objects on the flushing list matching the write
+        * domain we're flushing with our flush.
+        */
+       if (flush_domains != 0) {
+               struct drm_i915_gem_object *obj_priv, *next;
+
+               list_for_each_entry_safe(obj_priv, next,
+                                        &dev_priv->mm.flushing_list, list) {
+                       struct drm_gem_object *obj = obj_priv->obj;
+
+                       if ((obj->write_domain & flush_domains) ==
+                           obj->write_domain) {
+                               obj->write_domain = 0;
+                               i915_gem_object_move_to_active(obj, seqno);
+                       }
+               }
+
+       }
+
        if (was_empty && !dev_priv->mm.suspended)
                schedule_delayed_work(&dev_priv->mm.retire_work, HZ);
        return seqno;
@@ -676,30 +731,10 @@ i915_gem_retire_request(struct drm_device *dev,
                         __func__, request->seqno, obj);
 #endif
 
-               if (obj->write_domain != 0) {
-                       list_move_tail(&obj_priv->list,
-                                      &dev_priv->mm.flushing_list);
-               } else {
+               if (obj->write_domain != 0)
+                       i915_gem_object_move_to_flushing(obj);
+               else
                        i915_gem_object_move_to_inactive(obj);
-               }
-       }
-
-       if (request->flush_domains != 0) {
-               struct drm_i915_gem_object *obj_priv, *next;
-
-               /* Clear the write domain and activity from any buffers
-                * that are just waiting for a flush matching the one retired.
-                */
-               list_for_each_entry_safe(obj_priv, next,
-                                        &dev_priv->mm.flushing_list, list) {
-                       struct drm_gem_object *obj = obj_priv->obj;
-
-                       if (obj->write_domain & request->flush_domains) {
-                               obj->write_domain = 0;
-                               i915_gem_object_move_to_inactive(obj);
-                       }
-               }
-
        }
 }
 
@@ -892,25 +927,10 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj)
        struct drm_i915_gem_object *obj_priv = obj->driver_private;
        int ret;
 
-       /* If there are writes queued to the buffer, flush and
-        * create a new seqno to wait for.
+       /* This function only exists to support waiting for existing rendering,
+        * not for emitting required flushes.
         */
-       if (obj->write_domain & ~(I915_GEM_DOMAIN_CPU|I915_GEM_DOMAIN_GTT)) {
-               uint32_t write_domain = obj->write_domain;
-#if WATCH_BUF
-               DRM_INFO("%s: flushing object %p from write domain %08x\n",
-                         __func__, obj, write_domain);
-#endif
-               i915_gem_flush(dev, 0, write_domain);
-
-               i915_gem_object_move_to_active(obj);
-               obj_priv->last_rendering_seqno = i915_add_request(dev,
-                                                                 write_domain);
-               BUG_ON(obj_priv->last_rendering_seqno == 0);
-#if WATCH_LRU
-               DRM_INFO("%s: flush moves to exec list %p\n", __func__, obj);
-#endif
-       }
+       BUG_ON((obj->write_domain & I915_GEM_GPU_DOMAINS) != 0);
 
        /* If there is rendering queued on the buffer being evicted, wait for
         * it.
@@ -950,24 +970,16 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
                return -EINVAL;
        }
 
-       /* Wait for any rendering to complete
-        */
-       ret = i915_gem_object_wait_rendering(obj);
-       if (ret) {
-               DRM_ERROR("wait_rendering failed: %d\n", ret);
-               return ret;
-       }
-
        /* Move the object to the CPU domain to ensure that
         * any possible CPU writes while it's not in the GTT
         * are flushed when we go to remap it. This will
         * also ensure that all pending GPU writes are finished
         * before we unbind.
         */
-       ret = i915_gem_object_set_domain(obj, I915_GEM_DOMAIN_CPU,
-                                        I915_GEM_DOMAIN_CPU);
+       ret = i915_gem_object_set_to_cpu_domain(obj, 1);
        if (ret) {
-               DRM_ERROR("set_domain failed: %d\n", ret);
+               if (ret != -ERESTARTSYS)
+                       DRM_ERROR("set_domain failed: %d\n", ret);
                return ret;
        }
 
@@ -1082,6 +1094,21 @@ i915_gem_evict_something(struct drm_device *dev)
        return ret;
 }
 
+static int
+i915_gem_evict_everything(struct drm_device *dev)
+{
+       int ret;
+
+       for (;;) {
+               ret = i915_gem_evict_something(dev);
+               if (ret != 0)
+                       break;
+       }
+       if (ret == -ENOMEM)
+               return 0;
+       return ret;
+}
+
 static int
 i915_gem_object_get_page_list(struct drm_gem_object *obj)
 {
@@ -1168,7 +1195,8 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
 
                ret = i915_gem_evict_something(dev);
                if (ret != 0) {
-                       DRM_ERROR("Failed to evict a buffer %d\n", ret);
+                       if (ret != -ERESTARTSYS)
+                               DRM_ERROR("Failed to evict a buffer %d\n", ret);
                        return ret;
                }
                goto search_free;
@@ -1228,6 +1256,143 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
        drm_clflush_pages(obj_priv->page_list, obj->size / PAGE_SIZE);
 }
 
+/** Flushes any GPU write domain for the object if it's dirty. */
+static void
+i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj)
+{
+       struct drm_device *dev = obj->dev;
+       uint32_t seqno;
+
+       if ((obj->write_domain & I915_GEM_GPU_DOMAINS) == 0)
+               return;
+
+       /* Queue the GPU write cache flushing we need. */
+       i915_gem_flush(dev, 0, obj->write_domain);
+       seqno = i915_add_request(dev, obj->write_domain);
+       obj->write_domain = 0;
+       i915_gem_object_move_to_active(obj, seqno);
+}
+
+/** Flushes the GTT write domain for the object if it's dirty. */
+static void
+i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj)
+{
+       if (obj->write_domain != I915_GEM_DOMAIN_GTT)
+               return;
+
+       /* No actual flushing is required for the GTT write domain.   Writes
+        * to it immediately go to main memory as far as we know, so there's
+        * no chipset flush.  It also doesn't land in render cache.
+        */
+       obj->write_domain = 0;
+}
+
+/** Flushes the CPU write domain for the object if it's dirty. */
+static void
+i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj)
+{
+       struct drm_device *dev = obj->dev;
+
+       if (obj->write_domain != I915_GEM_DOMAIN_CPU)
+               return;
+
+       i915_gem_clflush_object(obj);
+       drm_agp_chipset_flush(dev);
+       obj->write_domain = 0;
+}
+
+/**
+ * Moves a single object to the GTT read, and possibly write domain.
+ *
+ * This function returns when the move is complete, including waiting on
+ * flushes to occur.
+ */
+static int
+i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write)
+{
+       struct drm_i915_gem_object *obj_priv = obj->driver_private;
+       int ret;
+
+       /* Not valid to be called on unbound objects. */
+       if (obj_priv->gtt_space == NULL)
+               return -EINVAL;
+
+       i915_gem_object_flush_gpu_write_domain(obj);
+       /* Wait on any GPU rendering and flushing to occur. */
+       ret = i915_gem_object_wait_rendering(obj);
+       if (ret != 0)
+               return ret;
+
+       /* If we're writing through the GTT domain, then CPU and GPU caches
+        * will need to be invalidated at next use.
+        */
+       if (write)
+               obj->read_domains &= I915_GEM_DOMAIN_GTT;
+
+       i915_gem_object_flush_cpu_write_domain(obj);
+
+       /* It should now be out of any other write domains, and we can update
+        * the domain values for our changes.
+        */
+       BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_GTT) != 0);
+       obj->read_domains |= I915_GEM_DOMAIN_GTT;
+       if (write) {
+               obj->write_domain = I915_GEM_DOMAIN_GTT;
+               obj_priv->dirty = 1;
+       }
+
+       return 0;
+}
+
+/**
+ * Moves a single object to the CPU read, and possibly write domain.
+ *
+ * This function returns when the move is complete, including waiting on
+ * flushes to occur.
+ */
+static int
+i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write)
+{
+       struct drm_device *dev = obj->dev;
+       int ret;
+
+       i915_gem_object_flush_gpu_write_domain(obj);
+       /* Wait on any GPU rendering and flushing to occur. */
+       ret = i915_gem_object_wait_rendering(obj);
+       if (ret != 0)
+               return ret;
+
+       i915_gem_object_flush_gtt_write_domain(obj);
+
+       /* If we have a partially-valid cache of the object in the CPU,
+        * finish invalidating it and free the per-page flags.
+        */
+       i915_gem_object_set_to_full_cpu_read_domain(obj);
+
+       /* Flush the CPU cache if it's still invalid. */
+       if ((obj->read_domains & I915_GEM_DOMAIN_CPU) == 0) {
+               i915_gem_clflush_object(obj);
+               drm_agp_chipset_flush(dev);
+
+               obj->read_domains |= I915_GEM_DOMAIN_CPU;
+       }
+
+       /* It should now be out of any other write domains, and we can update
+        * the domain values for our changes.
+        */
+       BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_CPU) != 0);
+
+       /* If we're writing through the CPU, then the GPU read domains will
+        * need to be invalidated at next use.
+        */
+       if (write) {
+               obj->read_domains &= I915_GEM_DOMAIN_CPU;
+               obj->write_domain = I915_GEM_DOMAIN_CPU;
+       }
+
+       return 0;
+}
+
 /*
  * Set the next domain for the specified object. This
  * may not actually perform the necessary flushing/invaliding though,
@@ -1339,16 +1504,18 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
  *             MI_FLUSH
  *             drm_agp_chipset_flush
  */
-static int
-i915_gem_object_set_domain(struct drm_gem_object *obj,
-                           uint32_t read_domains,
-                           uint32_t write_domain)
+static void
+i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
+                                 uint32_t read_domains,
+                                 uint32_t write_domain)
 {
        struct drm_device               *dev = obj->dev;
        struct drm_i915_gem_object      *obj_priv = obj->driver_private;
        uint32_t                        invalidate_domains = 0;
        uint32_t                        flush_domains = 0;
-       int                             ret;
+
+       BUG_ON(read_domains & I915_GEM_DOMAIN_CPU);
+       BUG_ON(write_domain == I915_GEM_DOMAIN_CPU);
 
 #if WATCH_BUF
        DRM_INFO("%s: object %p read %08x -> %08x write %08x -> %08x\n",
@@ -1385,34 +1552,11 @@ i915_gem_object_set_domain(struct drm_gem_object *obj,
                DRM_INFO("%s: CPU domain flush %08x invalidate %08x\n",
                         __func__, flush_domains, invalidate_domains);
 #endif
-               /*
-                * If we're invaliding the CPU cache and flushing a GPU cache,
-                * then pause for rendering so that the GPU caches will be
-                * flushed before the cpu cache is invalidated
-                */
-               if ((invalidate_domains & I915_GEM_DOMAIN_CPU) &&
-                   (flush_domains & ~(I915_GEM_DOMAIN_CPU |
-                                      I915_GEM_DOMAIN_GTT))) {
-                       ret = i915_gem_object_wait_rendering(obj);
-                       if (ret)
-                               return ret;
-               }
                i915_gem_clflush_object(obj);
        }
 
        if ((write_domain | flush_domains) != 0)
                obj->write_domain = write_domain;
-
-       /* If we're invalidating the CPU domain, clear the per-page CPU
-        * domain list as well.
-        */
-       if (obj_priv->page_cpu_valid != NULL &&
-           (write_domain != 0 ||
-            read_domains & I915_GEM_DOMAIN_CPU)) {
-               drm_free(obj_priv->page_cpu_valid, obj->size / PAGE_SIZE,
-                        DRM_MEM_DRIVER);
-               obj_priv->page_cpu_valid = NULL;
-       }
        obj->read_domains = read_domains;
 
        dev->invalidate_domains |= invalidate_domains;
@@ -1423,47 +1567,94 @@ i915_gem_object_set_domain(struct drm_gem_object *obj,
                 obj->read_domains, obj->write_domain,
                 dev->invalidate_domains, dev->flush_domains);
 #endif
-       return 0;
 }
 
 /**
- * Set the read/write domain on a range of the object.
+ * Moves the object from a partially CPU read to a full one.
  *
- * Currently only implemented for CPU reads, otherwise drops to normal
- * i915_gem_object_set_domain().
+ * Note that this only resolves i915_gem_object_set_cpu_read_domain_range(),
+ * and doesn't handle transitioning from !(read_domains & I915_GEM_DOMAIN_CPU).
  */
-static int
-i915_gem_object_set_domain_range(struct drm_gem_object *obj,
-                                uint64_t offset,
-                                uint64_t size,
-                                uint32_t read_domains,
-                                uint32_t write_domain)
+static void
+i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj)
 {
+       struct drm_device *dev = obj->dev;
        struct drm_i915_gem_object *obj_priv = obj->driver_private;
-       int ret, i;
 
-       if (obj->read_domains & I915_GEM_DOMAIN_CPU)
-               return 0;
+       if (!obj_priv->page_cpu_valid)
+               return;
 
-       if (read_domains != I915_GEM_DOMAIN_CPU ||
-           write_domain != 0)
-               return i915_gem_object_set_domain(obj,
-                                                 read_domains, write_domain);
+       /* If we're partially in the CPU read domain, finish moving it in.
+        */
+       if (obj->read_domains & I915_GEM_DOMAIN_CPU) {
+               int i;
 
-       /* Wait on any GPU rendering to the object to be flushed. */
+               for (i = 0; i <= (obj->size - 1) / PAGE_SIZE; i++) {
+                       if (obj_priv->page_cpu_valid[i])
+                               continue;
+                       drm_clflush_pages(obj_priv->page_list + i, 1);
+               }
+               drm_agp_chipset_flush(dev);
+       }
+
+       /* Free the page_cpu_valid mappings which are now stale, whether
+        * or not we've got I915_GEM_DOMAIN_CPU.
+        */
+       drm_free(obj_priv->page_cpu_valid, obj->size / PAGE_SIZE,
+                DRM_MEM_DRIVER);
+       obj_priv->page_cpu_valid = NULL;
+}
+
+/**
+ * Set the CPU read domain on a range of the object.
+ *
+ * The object ends up with I915_GEM_DOMAIN_CPU in its read flags although it's
+ * not entirely valid.  The page_cpu_valid member of the object flags which
+ * pages have been flushed, and will be respected by
+ * i915_gem_object_set_to_cpu_domain() if it's called on to get a valid mapping
+ * of the whole object.
+ *
+ * This function returns when the move is complete, including waiting on
+ * flushes to occur.
+ */
+static int
+i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj,
+                                         uint64_t offset, uint64_t size)
+{
+       struct drm_i915_gem_object *obj_priv = obj->driver_private;
+       int i, ret;
+
+       if (offset == 0 && size == obj->size)
+               return i915_gem_object_set_to_cpu_domain(obj, 0);
+
+       i915_gem_object_flush_gpu_write_domain(obj);
+       /* Wait on any GPU rendering and flushing to occur. */
        ret = i915_gem_object_wait_rendering(obj);
-       if (ret)
+       if (ret != 0)
                return ret;
+       i915_gem_object_flush_gtt_write_domain(obj);
 
+       /* If we're already fully in the CPU read domain, we're done. */
+       if (obj_priv->page_cpu_valid == NULL &&
+           (obj->read_domains & I915_GEM_DOMAIN_CPU) != 0)
+               return 0;
+
+       /* Otherwise, create/clear the per-page CPU read domain flag if we're
+        * newly adding I915_GEM_DOMAIN_CPU
+        */
        if (obj_priv->page_cpu_valid == NULL) {
                obj_priv->page_cpu_valid = drm_calloc(1, obj->size / PAGE_SIZE,
                                                      DRM_MEM_DRIVER);
-       }
+               if (obj_priv->page_cpu_valid == NULL)
+                       return -ENOMEM;
+       } else if ((obj->read_domains & I915_GEM_DOMAIN_CPU) == 0)
+               memset(obj_priv->page_cpu_valid, 0, obj->size / PAGE_SIZE);
 
        /* Flush the cache on any pages that are still invalid from the CPU's
         * perspective.
         */
-       for (i = offset / PAGE_SIZE; i <= (offset + size - 1) / PAGE_SIZE; i++) {
+       for (i = offset / PAGE_SIZE; i <= (offset + size - 1) / PAGE_SIZE;
+            i++) {
                if (obj_priv->page_cpu_valid[i])
                        continue;
 
@@ -1472,39 +1663,14 @@ i915_gem_object_set_domain_range(struct drm_gem_object *obj,
                obj_priv->page_cpu_valid[i] = 1;
        }
 
-       return 0;
-}
-
-/**
- * Once all of the objects have been set in the proper domain,
- * perform the necessary flush and invalidate operations.
- *
- * Returns the write domains flushed, for use in flush tracking.
- */
-static uint32_t
-i915_gem_dev_set_domain(struct drm_device *dev)
-{
-       uint32_t flush_domains = dev->flush_domains;
-
-       /*
-        * Now that all the buffers are synced to the proper domains,
-        * flush and invalidate the collected domains
+       /* It should now be out of any other write domains, and we can update
+        * the domain values for our changes.
         */
-       if (dev->invalidate_domains | dev->flush_domains) {
-#if WATCH_EXEC
-               DRM_INFO("%s: invalidate_domains %08x flush_domains %08x\n",
-                         __func__,
-                        dev->invalidate_domains,
-                        dev->flush_domains);
-#endif
-               i915_gem_flush(dev,
-                              dev->invalidate_domains,
-                              dev->flush_domains);
-               dev->invalidate_domains = 0;
-               dev->flush_domains = 0;
-       }
+       BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_CPU) != 0);
 
-       return flush_domains;
+       obj->read_domains |= I915_GEM_DOMAIN_CPU;
+
+       return 0;
 }
 
 /**
@@ -1585,6 +1751,18 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
                        return -EINVAL;
                }
 
+               if (reloc.write_domain & I915_GEM_DOMAIN_CPU ||
+                   reloc.read_domains & I915_GEM_DOMAIN_CPU) {
+                       DRM_ERROR("reloc with read/write CPU domains: "
+                                 "obj %p target %d offset %d "
+                                 "read %08x write %08x",
+                                 obj, reloc.target_handle,
+                                 (int) reloc.offset,
+                                 reloc.read_domains,
+                                 reloc.write_domain);
+                       return -EINVAL;
+               }
+
                if (reloc.write_domain && target_obj->pending_write_domain &&
                    reloc.write_domain != target_obj->pending_write_domain) {
                        DRM_ERROR("Write domain conflict: "
@@ -1625,19 +1803,11 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
                        continue;
                }
 
-               /* Now that we're going to actually write some data in,
-                * make sure that any rendering using this buffer's contents
-                * is completed.
-                */
-               i915_gem_object_wait_rendering(obj);
-
-               /* As we're writing through the gtt, flush
-                * any CPU writes before we write the relocations
-                */
-               if (obj->write_domain & I915_GEM_DOMAIN_CPU) {
-                       i915_gem_clflush_object(obj);
-                       drm_agp_chipset_flush(dev);
-                       obj->write_domain = 0;
+               ret = i915_gem_object_set_to_gtt_domain(obj, 1);
+               if (ret != 0) {
+                       drm_gem_object_unreference(target_obj);
+                       i915_gem_object_unpin(obj);
+                       return -EINVAL;
                }
 
                /* Map the page containing the relocation we're going to
@@ -1779,6 +1949,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
        int ret, i, pinned = 0;
        uint64_t exec_offset;
        uint32_t seqno, flush_domains;
+       int pin_tries;
 
 #if WATCH_EXEC
        DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n",
@@ -1827,14 +1998,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
                return -EBUSY;
        }
 
-       /* Zero the gloabl flush/invalidate flags. These
-        * will be modified as each object is bound to the
-        * gtt
-        */
-       dev->invalidate_domains = 0;
-       dev->flush_domains = 0;
-
-       /* Look up object handles and perform the relocations */
+       /* Look up object handles */
        for (i = 0; i < args->buffer_count; i++) {
                object_list[i] = drm_gem_object_lookup(dev, file_priv,
                                                       exec_list[i].handle);
@@ -1844,17 +2008,39 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
                        ret = -EBADF;
                        goto err;
                }
+       }
 
-               object_list[i]->pending_read_domains = 0;
-               object_list[i]->pending_write_domain = 0;
-               ret = i915_gem_object_pin_and_relocate(object_list[i],
-                                                      file_priv,
-                                                      &exec_list[i]);
-               if (ret) {
-                       DRM_ERROR("object bind and relocate failed %d\n", ret);
+       /* Pin and relocate */
+       for (pin_tries = 0; ; pin_tries++) {
+               ret = 0;
+               for (i = 0; i < args->buffer_count; i++) {
+                       object_list[i]->pending_read_domains = 0;
+                       object_list[i]->pending_write_domain = 0;
+                       ret = i915_gem_object_pin_and_relocate(object_list[i],
+                                                              file_priv,
+                                                              &exec_list[i]);
+                       if (ret)
+                               break;
+                       pinned = i + 1;
+               }
+               /* success */
+               if (ret == 0)
+                       break;
+
+               /* error other than GTT full, or we've already tried again */
+               if (ret != -ENOMEM || pin_tries >= 1) {
+                       DRM_ERROR("Failed to pin buffers %d\n", ret);
                        goto err;
                }
-               pinned = i + 1;
+
+               /* unpin all of our buffers */
+               for (i = 0; i < pinned; i++)
+                       i915_gem_object_unpin(object_list[i]);
+
+               /* evict everyone we can from the aperture */
+               ret = i915_gem_evict_everything(dev);
+               if (ret)
+                       goto err;
        }
 
        /* Set the pending read domains for the batch buffer to COMMAND */
@@ -1864,21 +2050,37 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
 
        i915_verify_inactive(dev, __FILE__, __LINE__);
 
+       /* Zero the global flush/invalidate flags. These
+        * will be modified as new domains are computed
+        * for each object
+        */
+       dev->invalidate_domains = 0;
+       dev->flush_domains = 0;
+
        for (i = 0; i < args->buffer_count; i++) {
                struct drm_gem_object *obj = object_list[i];
 
-               /* make sure all previous memory operations have passed */
-               ret = i915_gem_object_set_domain(obj,
-                                                obj->pending_read_domains,
-                                                obj->pending_write_domain);
-               if (ret)
-                       goto err;
+               /* Compute new gpu domains and update invalidate/flush */
+               i915_gem_object_set_to_gpu_domain(obj,
+                                                 obj->pending_read_domains,
+                                                 obj->pending_write_domain);
        }
 
        i915_verify_inactive(dev, __FILE__, __LINE__);
 
-       /* Flush/invalidate caches and chipset buffer */
-       flush_domains = i915_gem_dev_set_domain(dev);
+       if (dev->invalidate_domains | dev->flush_domains) {
+#if WATCH_EXEC
+               DRM_INFO("%s: invalidate_domains %08x flush_domains %08x\n",
+                         __func__,
+                        dev->invalidate_domains,
+                        dev->flush_domains);
+#endif
+               i915_gem_flush(dev,
+                              dev->invalidate_domains,
+                              dev->flush_domains);
+               if (dev->flush_domains)
+                       (void)i915_add_request(dev, dev->flush_domains);
+       }
 
        i915_verify_inactive(dev, __FILE__, __LINE__);
 
@@ -1898,8 +2100,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
                              ~0);
 #endif
 
-       (void)i915_add_request(dev, flush_domains);
-
        /* Exec the batchbuffer */
        ret = i915_dispatch_gem_execbuffer(dev, args, exec_offset);
        if (ret) {
@@ -1927,10 +2127,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
        i915_file_priv->mm.last_gem_seqno = seqno;
        for (i = 0; i < args->buffer_count; i++) {
                struct drm_gem_object *obj = object_list[i];
-               struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
-               i915_gem_object_move_to_active(obj);
-               obj_priv->last_rendering_seqno = seqno;
+               i915_gem_object_move_to_active(obj, seqno);
 #if WATCH_LRU
                DRM_INFO("%s: move to exec list %p\n", __func__, obj);
 #endif
@@ -2061,11 +2259,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
        /* XXX - flush the CPU caches for pinned objects
         * as the X server doesn't manage domains yet
         */
-       if (obj->write_domain & I915_GEM_DOMAIN_CPU) {
-               i915_gem_clflush_object(obj);
-               drm_agp_chipset_flush(dev);
-               obj->write_domain = 0;
-       }
+       i915_gem_object_flush_cpu_write_domain(obj);
        args->offset = obj_priv->gtt_offset;
        drm_gem_object_unreference(obj);
        mutex_unlock(&dev->struct_mutex);
@@ -2115,7 +2309,14 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
        }
 
        obj_priv = obj->driver_private;
-       args->busy = obj_priv->active;
+       /* Don't count being on the flushing list against the object being
+        * done.  Otherwise, a buffer left on the flushing list but not getting
+        * flushed (because nobody's flushing that domain) won't ever return
+        * unbusy and get reused by libdrm's bo cache.  The other expected
+        * consumer of this interface, OpenGL's occlusion queries, also specs
+        * that the objects get unbusy "eventually" without any interference.
+        */
+       args->busy = obj_priv->active && obj_priv->last_rendering_seqno != 0;
 
        drm_gem_object_unreference(obj);
        mutex_unlock(&dev->struct_mutex);
@@ -2167,29 +2368,6 @@ void i915_gem_free_object(struct drm_gem_object *obj)
        drm_free(obj->driver_private, 1, DRM_MEM_DRIVER);
 }
 
-static int
-i915_gem_set_domain(struct drm_gem_object *obj,
-                   struct drm_file *file_priv,
-                   uint32_t read_domains,
-                   uint32_t write_domain)
-{
-       struct drm_device *dev = obj->dev;
-       int ret;
-       uint32_t flush_domains;
-
-       BUG_ON(!mutex_is_locked(&dev->struct_mutex));
-
-       ret = i915_gem_object_set_domain(obj, read_domains, write_domain);
-       if (ret)
-               return ret;
-       flush_domains = i915_gem_dev_set_domain(obj->dev);
-
-       if (flush_domains & ~(I915_GEM_DOMAIN_CPU|I915_GEM_DOMAIN_GTT))
-               (void) i915_add_request(dev, flush_domains);
-
-       return 0;
-}
-
 /** Unbinds all objects that are on the given buffer list. */
 static int
 i915_gem_evict_from_list(struct drm_device *dev, struct list_head *head)
index 93de15b4c9a722749d69d417d88cc1aba49d8280..e8d5abe1250ee14404bf8f9da972e34fd74ff6f0 100644 (file)
@@ -166,10 +166,9 @@ static int i915_gem_request_info(char *buf, char **start, off_t offset,
        list_for_each_entry(gem_request, &dev_priv->mm.request_list,
                            list)
        {
-               DRM_PROC_PRINT("    %d @ %d %08x\n",
+               DRM_PROC_PRINT("    %d @ %d\n",
                               gem_request->seqno,
-                              (int) (jiffies - gem_request->emitted_jiffies),
-                              gem_request->flush_domains);
+                              (int) (jiffies - gem_request->emitted_jiffies));
        }
        if (len > request + offset)
                return request;
index e8b85ac4ca041159553f5211e0bc3cbe58f03cc8..a8cb69469c641ff28f4d57df20b51d0dd5772f7c 100644 (file)
@@ -119,9 +119,10 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
                            dcc & DCC_CHANNEL_XOR_DISABLE) {
                                swizzle_x = I915_BIT_6_SWIZZLE_9_10;
                                swizzle_y = I915_BIT_6_SWIZZLE_9;
-                       } else if (IS_I965GM(dev) || IS_GM45(dev)) {
-                               /* GM965 only does bit 11-based channel
-                                * randomization
+                       } else if ((IS_I965GM(dev) || IS_GM45(dev)) &&
+                                  (dcc & DCC_CHANNEL_XOR_BIT_17) == 0) {
+                               /* GM965/GM45 does either bit 11 or bit 17
+                                * swizzling.
                                 */
                                swizzle_x = I915_BIT_6_SWIZZLE_9_10_11;
                                swizzle_y = I915_BIT_6_SWIZZLE_9_11;
index 0e476eba36e662b75ce24db2b7bb52162699f9e6..9d24aaeb8a453d76e2d23e2223af3bfc527a74fa 100644 (file)
 #define DCC_ADDRESSING_MODE_DUAL_CHANNEL_INTERLEAVED   (2 << 0)
 #define DCC_ADDRESSING_MODE_MASK                       (3 << 0)
 #define DCC_CHANNEL_XOR_DISABLE                                (1 << 10)
+#define DCC_CHANNEL_XOR_BIT_17                         (1 << 9)
 
 /** 965 MCH register controlling DRAM channel configuration */
 #define C0DRB3                 0x10206
index 7a183789be978d97d3e317b141c5119ff2dfe9c6..3bbb871b25d5102a2b6d832702cc55bc338a70ea 100644 (file)
@@ -299,7 +299,6 @@ typedef struct drm_radeon_private {
        atomic_t swi_emitted;
        int vblank_crtc;
        uint32_t irq_enable_reg;
-       int irq_enabled;
        uint32_t r500_disp_irq_reg;
 
        struct radeon_surface surfaces[RADEON_MAX_SURFACES];
index 97c0599fdb1e2c49898c14c0ba097101978f8dc2..8289e16419a8d24566559223489037860809ec54 100644 (file)
@@ -44,7 +44,8 @@ void radeon_irq_set_state(struct drm_device *dev, u32 mask, int state)
        else
                dev_priv->irq_enable_reg &= ~mask;
 
-       RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
+       if (dev->irq_enabled)
+               RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
 }
 
 static void r500_vbl_irq_set_state(struct drm_device *dev, u32 mask, int state)
@@ -56,7 +57,8 @@ static void r500_vbl_irq_set_state(struct drm_device *dev, u32 mask, int state)
        else
                dev_priv->r500_disp_irq_reg &= ~mask;
 
-       RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
+       if (dev->irq_enabled)
+               RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
 }
 
 int radeon_enable_vblank(struct drm_device *dev, int crtc)
@@ -355,8 +357,6 @@ void radeon_driver_irq_uninstall(struct drm_device * dev)
        if (!dev_priv)
                return;
 
-       dev_priv->irq_enabled = 0;
-
        if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690)
                RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
        /* Disable *all* interrupts */
index 228f75723063968c4e77fbb374e5421e5c87e393..3fcf78e906db185187d10c87466786fb3c3280c2 100644 (file)
@@ -365,6 +365,7 @@ static int cpm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
                pmsg = &msgs[tptr];
                if (pmsg->flags & I2C_M_RD)
                        ret = wait_event_interruptible_timeout(cpm->i2c_wait,
+                               (in_be16(&tbdf[tptr].cbd_sc) & BD_SC_NAK) ||
                                !(in_be16(&rbdf[rptr].cbd_sc) & BD_SC_EMPTY),
                                1 * HZ);
                else
index f4d22ae9d294a48fb69e1f53e4f46d5d496f7ce7..e5a8dae4a2890435f065e2b97017b83179647bcc 100644 (file)
@@ -92,7 +92,7 @@ static void highlander_i2c_setup(struct highlander_i2c_dev *dev)
 static void smbus_write_data(u8 *src, u16 *dst, int len)
 {
        for (; len > 1; len -= 2) {
-               *dst++ = be16_to_cpup((u16 *)src);
+               *dst++ = be16_to_cpup((__be16 *)src);
                src += 2;
        }
 
@@ -103,7 +103,7 @@ static void smbus_write_data(u8 *src, u16 *dst, int len)
 static void smbus_read_data(u16 *src, u8 *dst, int len)
 {
        for (; len > 1; len -= 2) {
-               *(u16 *)dst = cpu_to_be16p(src++);
+               *(__be16 *)dst = cpu_to_be16p(src++);
                dst += 2;
        }
 
index dcf2045b5222b44aac99b568f7170701ecf0ae78..0bdb2d7f0570bd465e59b4b87ef23dd33db04b1d 100644 (file)
@@ -486,7 +486,7 @@ static enum pmcmsptwi_xfer_result pmcmsptwi_xfer_cmd(
 
        if (cmd->type == MSP_TWI_CMD_WRITE ||
            cmd->type == MSP_TWI_CMD_WRITE_READ) {
-               __be64 tmp = cpu_to_be64p((u64 *)cmd->write_data);
+               u64 tmp = be64_to_cpup((__be64 *)cmd->write_data);
                tmp >>= (MSP_MAX_BYTES_PER_RW - cmd->write_len) * 8;
                dev_dbg(&pmcmsptwi_adapter.dev, "Writing 0x%016llx\n", tmp);
                pmcmsptwi_writel(tmp & 0x00000000ffffffffLL,
index 1fac4e233133879c8b06b07045c5318d87b91840..b7434d24904ebfa9750d655df8ab42f521ec2c40 100644 (file)
@@ -56,6 +56,7 @@ enum s3c24xx_i2c_state {
 struct s3c24xx_i2c {
        spinlock_t              lock;
        wait_queue_head_t       wait;
+       unsigned int            suspended:1;
 
        struct i2c_msg          *msg;
        unsigned int            msg_num;
@@ -507,7 +508,7 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int
        unsigned long timeout;
        int ret;
 
-       if (!(readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN))
+       if (i2c->suspended)
                return -EIO;
 
        ret = s3c24xx_i2c_set_master(i2c);
@@ -986,17 +987,26 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
+static int s3c24xx_i2c_suspend_late(struct platform_device *dev,
+                                   pm_message_t msg)
+{
+       struct s3c24xx_i2c *i2c = platform_get_drvdata(dev);
+       i2c->suspended = 1;
+       return 0;
+}
+
 static int s3c24xx_i2c_resume(struct platform_device *dev)
 {
        struct s3c24xx_i2c *i2c = platform_get_drvdata(dev);
 
-       if (i2c != NULL)
-               s3c24xx_i2c_init(i2c);
+       i2c->suspended = 0;
+       s3c24xx_i2c_init(i2c);
 
        return 0;
 }
 
 #else
+#define s3c24xx_i2c_suspend_late NULL
 #define s3c24xx_i2c_resume NULL
 #endif
 
@@ -1005,6 +1015,7 @@ static int s3c24xx_i2c_resume(struct platform_device *dev)
 static struct platform_driver s3c2410_i2c_driver = {
        .probe          = s3c24xx_i2c_probe,
        .remove         = s3c24xx_i2c_remove,
+       .suspend_late   = s3c24xx_i2c_suspend_late,
        .resume         = s3c24xx_i2c_resume,
        .driver         = {
                .owner  = THIS_MODULE,
@@ -1015,6 +1026,7 @@ static struct platform_driver s3c2410_i2c_driver = {
 static struct platform_driver s3c2440_i2c_driver = {
        .probe          = s3c24xx_i2c_probe,
        .remove         = s3c24xx_i2c_remove,
+       .suspend_late   = s3c24xx_i2c_suspend_late,
        .resume         = s3c24xx_i2c_resume,
        .driver         = {
                .owner  = THIS_MODULE,
index 6d7401772a8f6d7530a89331a16cace5528b4623..e6857e01d1bad372da0c62480753adbd1266d1f4 100644 (file)
@@ -669,10 +669,12 @@ config BLK_DEV_CELLEB
 
 endif
 
+# TODO: BLK_DEV_IDEDMA_PCI -> BLK_DEV_IDEDMA_SFF
 config BLK_DEV_IDE_PMAC
        tristate "PowerMac on-board IDE support"
        depends on PPC_PMAC && IDE=y
        select IDE_TIMINGS
+       select BLK_DEV_IDEDMA_PCI
        help
          This driver provides support for the on-board IDE controller on
          most of the recent Apple Power Macintoshes and PowerBooks.
@@ -689,16 +691,6 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST
          CD-ROM on hda. This option changes this to more natural hda for
          hard disk and hdc for CD-ROM.
 
-config BLK_DEV_IDEDMA_PMAC
-       bool "PowerMac IDE DMA support"
-       depends on BLK_DEV_IDE_PMAC
-       select BLK_DEV_IDEDMA_PCI
-       help
-         This option allows the driver for the on-board IDE controller on
-         Power Macintoshes and PowerBooks to use DMA (direct memory access)
-         to transfer data to and from memory.  Saying Y is safe and improves
-         performance.
-
 config BLK_DEV_IDE_AU1XXX
        bool "IDE for AMD Alchemy Au1200"
        depends on SOC_AU1200
@@ -912,7 +904,7 @@ config BLK_DEV_UMC8672
 endif
 
 config BLK_DEV_IDEDMA
-       def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
+       def_bool BLK_DEV_IDEDMA_SFF || \
                 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 
 endif # IDE
index e56c7b72f9e24ce592e4f776932815bf9dd5bccb..45d2356bb7254ff1fb9f96d71e6c7e1661e4bf18 100644 (file)
@@ -591,7 +591,7 @@ static int __init ali15x3_ide_init(void)
 
 static void __exit ali15x3_ide_exit(void)
 {
-       return pci_unregister_driver(&alim15x3_pci_driver);
+       pci_unregister_driver(&alim15x3_pci_driver);
 }
 
 module_init(ali15x3_ide_init);
index 81ec73134edacfead9286aa479c0a73f1526de05..c6bcd3014a29ec7891b3e11543cd6195ff30e985 100644 (file)
@@ -3,7 +3,7 @@
  * IDE driver for Linux.
  *
  * Copyright (c) 2000-2002 Vojtech Pavlik
- * Copyright (c) 2007 Bartlomiej Zolnierkiewicz
+ * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz
  *
  * Based on the work of:
  *      Andre Hedrick
@@ -263,6 +263,15 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_
                        d.udma_mask = ATA_UDMA5;
        }
 
+       /*
+        * It seems that on some nVidia controllers using AltStatus
+        * register can be unreliable so default to Status register
+        * if the device is in Compatibility Mode.
+        */
+       if (dev->vendor == PCI_VENDOR_ID_NVIDIA &&
+           ide_pci_is_in_compatibility_mode(dev))
+               d.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS;
+
        printk(KERN_INFO "%s %s: UDMA%s controller\n",
                d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);
 
index 53f079cc00afc010f2cf62b643fe98432feceea8..d8ede85fe17f4428be6713394e678af59c1457b2 100644 (file)
@@ -81,11 +81,12 @@ static u8 cs5530_udma_filter(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
        ide_drive_t *mate = ide_get_pair_dev(drive);
-       u16 *mateid = mate->id;
+       u16 *mateid;
        u8 mask = hwif->ultra_mask;
 
        if (mate == NULL)
                goto out;
+       mateid = mate->id;
 
        if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
                if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
index 7162d67562af92e1679501a99a9fc09bce69e745..cc35d6dbd41026d02cdc1ab5a32085cc8c63e0db 100644 (file)
@@ -132,10 +132,14 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
 }
 EXPORT_SYMBOL(ide_end_request);
 
-static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
+static void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
 {
        struct request_pm_state *pm = rq->data;
 
+#ifdef DEBUG_PM
+       printk(KERN_INFO "%s: complete_power_step(step: %d)\n",
+               drive->name, pm->pm_step);
+#endif
        if (drive->media != ide_disk)
                return;
 
@@ -172,7 +176,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
                /* Not supported? Switch to next step now. */
                if (ata_id_flush_enabled(drive->id) == 0 ||
                    (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) {
-                       ide_complete_power_step(drive, rq, 0, 0);
+                       ide_complete_power_step(drive, rq);
                        return ide_stopped;
                }
                if (ata_id_flush_ext_enabled(drive->id))
@@ -191,7 +195,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
                if (drive->media != ide_disk)
                        pm->pm_step = IDE_PM_RESTORE_DMA;
                else
-                       ide_complete_power_step(drive, rq, 0, 0);
+                       ide_complete_power_step(drive, rq);
                return ide_stopped;
        case IDE_PM_IDLE:               /* Resume step 2 (idle) */
                args->tf.command = ATA_CMD_IDLEIMMEDIATE;
@@ -322,11 +326,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
                }
        } else if (blk_pm_request(rq)) {
                struct request_pm_state *pm = rq->data;
-#ifdef DEBUG_PM
-               printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n",
-                       drive->name, rq->pm->pm_step, stat, err);
-#endif
-               ide_complete_power_step(drive, rq, stat, err);
+
+               ide_complete_power_step(drive, rq);
                if (pm->pm_step == IDE_PM_COMPLETED)
                        ide_complete_pm_request(drive, rq);
                return;
@@ -804,7 +805,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
                        struct request_pm_state *pm = rq->data;
 #ifdef DEBUG_PM
                        printk("%s: start_power_step(step: %d)\n",
-                               drive->name, rq->pm->pm_step);
+                               drive->name, pm->pm_step);
 #endif
                        startstop = ide_start_power_step(drive, rq);
                        if (startstop == ide_stopped &&
@@ -967,14 +968,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
        ide_startstop_t startstop;
        int             loops = 0;
 
-       /* for atari only: POSSIBLY BROKEN HERE(?) */
-       ide_get_lock(ide_intr, hwgroup);
-
        /* caller must own ide_lock */
        BUG_ON(!irqs_disabled());
 
        while (!hwgroup->busy) {
                hwgroup->busy = 1;
+               /* for atari only */
+               ide_get_lock(ide_intr, hwgroup);
                drive = choose_drive(hwgroup);
                if (drive == NULL) {
                        int sleeping = 0;
index 5d6ba14e211df826f794693bf0c682c59a9e4c06..c41c3b9b6f022b89148792c05d9564021ff271da 100644 (file)
@@ -457,18 +457,14 @@ int drive_is_ready (ide_drive_t *drive)
        if (drive->waiting_for_dma)
                return hwif->dma_ops->dma_test_irq(drive);
 
-#if 0
-       /* need to guarantee 400ns since last command was issued */
-       udelay(1);
-#endif
-
        /*
         * We do a passive status test under shared PCI interrupts on
         * cards that truly share the ATA side interrupt, but may also share
         * an interrupt with another pci card/device.  We make no assumptions
         * about possible isa-pnp and pci-pnp issues yet.
         */
-       if (hwif->io_ports.ctl_addr)
+       if (hwif->io_ports.ctl_addr &&
+           (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0)
                stat = hwif->tp_ops->read_altstatus(hwif);
        else
                /* Note: this may clear a pending IRQ!! */
@@ -610,6 +606,7 @@ static const struct drive_list_entry ivb_list[] = {
        { "TSSTcorp CDDVDW SH-S202N"    , "SB01"        },
        { "TSSTcorp CDDVDW SH-S202H"    , "SB00"        },
        { "TSSTcorp CDDVDW SH-S202H"    , "SB01"        },
+       { "SAMSUNG SP0822N"             , "WA100-10"    },
        { NULL                          , NULL          }
 };
 
index 1649ea54f76ce7c194f7ec8f5016f132aec79d0f..c55bdbd2231467541d5218de67ae2ff5479f3429 100644 (file)
@@ -266,7 +266,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
        /* take a deep breath */
        msleep(50);
 
-       if (io_ports->ctl_addr) {
+       if (io_ports->ctl_addr &&
+           (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) {
                a = tp_ops->read_altstatus(hwif);
                s = tp_ops->read_status(hwif);
                if ((a ^ s) & ~ATA_IDX)
index 2e19d6298536f2fb94d3e0a8a1b5fd08877f3734..7c481bb56fab90427001c4ac5f46a0fc367ac449 100644 (file)
@@ -66,7 +66,6 @@ typedef struct pmac_ide_hwif {
        struct macio_dev                *mdev;
        u32                             timings[4];
        volatile u32 __iomem *          *kauai_fcr;
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
        /* Those fields are duplicating what is in hwif. We currently
         * can't use the hwif ones because of some assumptions that are
         * beeing done by the generic code about the kind of dma controller
@@ -74,8 +73,6 @@ typedef struct pmac_ide_hwif {
         */
        volatile struct dbdma_regs __iomem *    dma_regs;
        struct dbdma_cmd*               dma_table_cpu;
-#endif
-       
 } pmac_ide_hwif_t;
 
 enum {
@@ -222,8 +219,6 @@ static const char* model_name[] = {
 #define KAUAI_FCR_UATA_RESET_N         0x00000002
 #define KAUAI_FCR_UATA_ENABLE          0x00000001
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
-
 /* Rounded Multiword DMA timings
  * 
  * I gave up finding a generic formula for all controller
@@ -413,8 +408,6 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq);
 static void pmac_ide_selectproc(ide_drive_t *drive);
 static void pmac_ide_kauai_selectproc(ide_drive_t *drive);
 
-#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
-
 #define PMAC_IDE_REG(x) \
        ((void __iomem *)((drive)->hwif->io_ports.data_addr + (x)))
 
@@ -584,8 +577,6 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
        pmac_ide_do_update_timings(drive);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
-
 /*
  * Calculate KeyLargo ATA/66 UDMA timings
  */
@@ -786,7 +777,6 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2,
                drive->name, speed & 0xf,  *timings);
 #endif 
 }
-#endif /* #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC */
 
 static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed)
 {
@@ -804,7 +794,6 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed)
        tl[0] = *timings;
        tl[1] = *timings2;
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
        if (speed >= XFER_UDMA_0) {
                if (pmif->kind == controller_kl_ata4)
                        ret = set_timings_udma_ata4(&tl[0], speed);
@@ -817,7 +806,7 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed)
                        ret = -1;
        } else
                set_timings_mdma(drive, pmif->kind, &tl[0], &tl[1], speed);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
+
        if (ret)
                return;
 
@@ -1008,9 +997,7 @@ static const struct ide_port_info pmac_port_info = {
        .chipset                = ide_pmac,
        .tp_ops                 = &pmac_tp_ops,
        .port_ops               = &pmac_ide_port_ops,
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
        .dma_ops                = &pmac_dma_ops,
-#endif
        .host_flags             = IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
                                  IDE_HFLAG_POST_SET_MODE |
                                  IDE_HFLAG_MMIO |
@@ -1182,7 +1169,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
        pmif->regbase = regbase;
        pmif->irq = irq;
        pmif->kauai_fcr = NULL;
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
+
        if (macio_resource_count(mdev) >= 2) {
                if (macio_request_resource(mdev, 1, "ide-pmac (dma)"))
                        printk(KERN_WARNING "ide-pmac: can't request DMA "
@@ -1192,7 +1179,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
                        pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 0x1000);
        } else
                pmif->dma_regs = NULL;
-#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
+
        dev_set_drvdata(&mdev->ofdev.dev, pmif);
 
        memset(&hw, 0, sizeof(hw));
@@ -1300,9 +1287,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 
        base = ioremap(rbase, rlen);
        pmif->regbase = (unsigned long) base + 0x2000;
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
        pmif->dma_regs = base + 0x1000;
-#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
        pmif->kauai_fcr = base;
        pmif->irq = pdev->irq;
 
@@ -1434,8 +1419,6 @@ out:
        return error;
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
-
 /*
  * pmac_ide_build_dmatable builds the DBDMA command list
  * for a transfer and sets the DBDMA channel to point to it.
@@ -1723,13 +1706,6 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
 
        return 0;
 }
-#else
-static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
-                                      const struct ide_port_info *d)
-{
-       return -EOPNOTSUPP;
-}
-#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
 
 module_init(pmac_ide_probe);
 
index f1a8758e3a99f7d8b6953782c4150c35fefb8097..ec7f766ef5e44ff6387e962592c5a985282de4c9 100644 (file)
@@ -104,11 +104,12 @@ static u8 sc1200_udma_filter(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
        ide_drive_t *mate = ide_get_pair_dev(drive);
-       u16 *mateid = mate->id;
+       u16 *mateid;
        u8 mask = hwif->ultra_mask;
 
        if (mate == NULL)
                goto out;
+       mateid = mate->id;
 
        if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
                if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
index 7defa0ae2014b1f0ea8b1598c0b0f135bd24b0f7..a687a7dfea6fd849a3c79916ba5c8c7facfe8b7b 100644 (file)
@@ -550,7 +550,7 @@ static const struct ide_dma_ops sgiioc4_dma_ops = {
        .dma_timeout            = ide_dma_timeout,
 };
 
-static const struct ide_port_info sgiioc4_port_info __devinitdata = {
+static const struct ide_port_info sgiioc4_port_info __devinitconst = {
        .name                   = DRV_NAME,
        .chipset                = ide_pci,
        .init_dma               = ide_dma_sgiioc4,
@@ -633,7 +633,7 @@ out:
        return ret;
 }
 
-int
+int __devinit
 ioc4_ide_attach_one(struct ioc4_driver_data *idd)
 {
        /* PCI-RT does not bring out IDE connection.
@@ -645,7 +645,7 @@ ioc4_ide_attach_one(struct ioc4_driver_data *idd)
        return pci_init_sgiioc4(idd->idd_pdev);
 }
 
-static struct ioc4_submodule ioc4_ide_submodule = {
+static struct ioc4_submodule __devinitdata ioc4_ide_submodule = {
        .is_name = "IOC4_ide",
        .is_owner = THIS_MODULE,
        .is_probe = ioc4_ide_attach_one,
index 9e39f73282ee6dd439e76647af5ab5c4755e711a..79ef5fd928ae42c0d8252f1d8bf07c479782be9c 100644 (file)
@@ -115,8 +115,14 @@ static int nodemgr_bus_read(struct csr1212_csr *csr, u64 addr, u16 length,
        return error;
 }
 
+#define OUI_FREECOM_TECHNOLOGIES_GMBH 0x0001db
+
 static int nodemgr_get_max_rom(quadlet_t *bus_info_data, void *__ci)
 {
+       /* Freecom FireWire Hard Drive firmware bug */
+       if (be32_to_cpu(bus_info_data[3]) >> 8 == OUI_FREECOM_TECHNOLOGIES_GMBH)
+               return 0;
+
        return (be32_to_cpu(bus_info_data[2]) >> 8) & 0x3;
 }
 
@@ -1685,6 +1691,7 @@ static int nodemgr_host_thread(void *data)
                g = get_hpsb_generation(host);
                for (i = 0; i < 4 ; i++) {
                        msleep_interruptible(63);
+                       try_to_freeze();
                        if (kthread_should_stop())
                                goto exit;
 
@@ -1725,6 +1732,7 @@ static int nodemgr_host_thread(void *data)
                /* Sleep 3 seconds */
                for (i = 3000/200; i; i--) {
                        msleep_interruptible(200);
+                       try_to_freeze();
                        if (kthread_should_stop())
                                goto exit;
 
index 1e288eeb5e2a5679908ca0f9cbf79793b91e18b8..6461a32bc838af31dceb5ea4073c17c5f3c79e41 100644 (file)
@@ -233,10 +233,8 @@ static void __exit b1isa_exit(void)
        int i;
 
        for (i = 0; i < MAX_CARDS; i++) {
-               if (!io[i])
-                       break;
-
-               b1isa_remove(&isa_dev[i]);
+               if (isa_dev[i].resource[0].start)
+                       b1isa_remove(&isa_dev[i]);
        }
        unregister_capi_driver(&capi_driver_b1isa);
 }
index cfa8fa5e44ab5d1352eff43b3cc5407624ca80e1..3f2a0a20c19b040538ba23fcce7d3d346d2e0f89 100644 (file)
@@ -83,12 +83,12 @@ net_open(struct net_device *dev)
 
        /* Fill in the MAC-level header (if not already set) */
        if (!card->mac_addr[0]) {
-               for (i = 0; i < ETH_ALEN - sizeof(unsigned long); i++)
+               for (i = 0; i < ETH_ALEN; i++)
                        dev->dev_addr[i] = 0xfc;
                if ((in_dev = dev->ip_ptr) != NULL) {
                        struct in_ifaddr *ifa = in_dev->ifa_list;
                        if (ifa != NULL)
-                               memcpy(dev->dev_addr + (ETH_ALEN - sizeof(unsigned long)), &ifa->ifa_local, sizeof(unsigned long));
+                               memcpy(dev->dev_addr + (ETH_ALEN - sizeof(ifa->ifa_local)), &ifa->ifa_local, sizeof(ifa->ifa_local));
                }
        } else
                memcpy(dev->dev_addr, card->mac_addr, ETH_ALEN);
index ac89a5deaca2e12fa62ccb78f1d62b088039675c..ab7c8e4a61f943c516ae5a3534e8775c33180f6b 100644 (file)
@@ -208,15 +208,18 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
  */
 
 /* IO operations when bitmap is stored near all superblocks */
-static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long index)
+static struct page *read_sb_page(mddev_t *mddev, long offset,
+                                struct page *page,
+                                unsigned long index, int size)
 {
        /* choose a good rdev and read the page from there */
 
        mdk_rdev_t *rdev;
        struct list_head *tmp;
-       struct page *page = alloc_page(GFP_KERNEL);
        sector_t target;
 
+       if (!page)
+               page = alloc_page(GFP_KERNEL);
        if (!page)
                return ERR_PTR(-ENOMEM);
 
@@ -227,7 +230,9 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde
 
                target = rdev->sb_start + offset + index * (PAGE_SIZE/512);
 
-               if (sync_page_io(rdev->bdev, target, PAGE_SIZE, page, READ)) {
+               if (sync_page_io(rdev->bdev, target,
+                                roundup(size, bdev_hardsect_size(rdev->bdev)),
+                                page, READ)) {
                        page->index = index;
                        attach_page_buffers(page, NULL); /* so that free_buffer will
                                                          * quietly no-op */
@@ -544,7 +549,9 @@ static int bitmap_read_sb(struct bitmap *bitmap)
 
                bitmap->sb_page = read_page(bitmap->file, 0, bitmap, bytes);
        } else {
-               bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0);
+               bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset,
+                                              NULL,
+                                              0, sizeof(bitmap_super_t));
        }
        if (IS_ERR(bitmap->sb_page)) {
                err = PTR_ERR(bitmap->sb_page);
@@ -957,11 +964,16 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
                                 */
                                page = bitmap->sb_page;
                                offset = sizeof(bitmap_super_t);
+                               read_sb_page(bitmap->mddev, bitmap->offset,
+                                            page,
+                                            index, count);
                        } else if (file) {
                                page = read_page(file, index, bitmap, count);
                                offset = 0;
                        } else {
-                               page = read_sb_page(bitmap->mddev, bitmap->offset, index);
+                               page = read_sb_page(bitmap->mddev, bitmap->offset,
+                                                   NULL,
+                                                   index, count);
                                offset = 0;
                        }
                        if (IS_ERR(page)) { /* read error */
index a63161aec48750ef51feb6e6e506c7ff83044dc0..04e5fd742c2c29e42fbba920e1303b889229ccf7 100644 (file)
@@ -668,7 +668,7 @@ static void check_for_valid_limits(struct io_restrictions *rs)
        if (!rs->max_segment_size)
                rs->max_segment_size = MAX_SEGMENT_SIZE;
        if (!rs->seg_boundary_mask)
-               rs->seg_boundary_mask = -1;
+               rs->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
        if (!rs->bounce_pfn)
                rs->bounce_pfn = -1;
 }
index 73dc2ee9b014021a5681d83be1badd96802010bc..b34301d56cd2859f7b248ee0df8c7899317d59d5 100644 (file)
@@ -9,11 +9,11 @@ config DVB_B2C2_FLEXCOP
        select DVB_STV0297 if !DVB_FE_CUSTOMISE
        select DVB_BCM3510 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
        select DVB_S5H1420 if !DVB_FE_CUSTOMISE
        select DVB_TUNER_ITD1000 if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
        select DVB_CX24123 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for the digital TV receiver chip made by B2C2 Inc. included in
          Technisats PCI cards and USB boxes.
index a127a4175c402a45c1940d7dec586762557544b5..5cded370854167b2d3db6ffec80e7914ad7437f1 100644 (file)
@@ -628,12 +628,14 @@ int flexcop_frontend_init(struct flexcop_device *fc)
        }
 
        /* try the cable dvb (stv0297) */
+       fc->fc_i2c_adap[0].no_base_addr = 1;
        fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c);
        if (fc->fe != NULL) {
                fc->dev_type = FC_CABLE;
                fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
                goto fe_found;
        }
+       fc->fc_i2c_adap[0].no_base_addr = 0;
 
        /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
        fc->fe = dvb_attach(mt312_attach,
index 43a112ec6d44f146b260c64cf12446d036e1283a..f13783f08f0f4e09bd054c38806792e1289af3a4 100644 (file)
@@ -47,8 +47,12 @@ static int flexcop_i2c_read4(struct flexcop_i2c_adapter *i2c,
        int len = r100.tw_sm_c_100.total_bytes, /* remember total_bytes is buflen-1 */
                ret;
 
-       r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
        ret = flexcop_i2c_operation(i2c->fc, &r100);
+       if (ret != 0) {
+               deb_i2c("Retrying operation\n");
+               r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
+               ret = flexcop_i2c_operation(i2c->fc, &r100);
+       }
        if (ret != 0) {
                deb_i2c("read failed. %d\n", ret);
                return ret;
index 7e9c090fc04ea9ae2e7273890fce6f5c04241db1..27edb0ece58752b0617f9bdb2bd26ef05500f510 100644 (file)
@@ -8,7 +8,7 @@ config DVB_BT8XX
        select DVB_OR51211 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for PCI cards based on the Bt8xx PCI bridge. Examples are
          the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards,
index 62b68c291d9968636ebe62a2a1605afc9a712d38..49f7b20c25d6f134f883d5c3c1e15cbebeb5a547 100644 (file)
@@ -24,8 +24,8 @@ config DVB_USB_A800
        tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
        select DVB_PLL if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver.
 
@@ -34,7 +34,7 @@ config DVB_USB_DIBUSB_MB
        depends on DVB_USB
        select DVB_PLL if !DVB_FE_CUSTOMISE
        select DVB_DIB3000MB
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by
          DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator.
@@ -55,7 +55,7 @@ config DVB_USB_DIBUSB_MC
        tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB2.0 DVB-T receivers based on reference designs made by
          DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator.
@@ -73,11 +73,11 @@ config DVB_USB_DIB0700
        select DVB_DIB7000M
        select DVB_DIB3000MC
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2266 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE
        select DVB_TUNER_DIB0070
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE
        help
          Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
          USB bridge is also present in devices having the DiB7700 DVB-T-USB
@@ -95,7 +95,7 @@ config DVB_USB_UMT_010
        depends on DVB_USB
        select DVB_PLL if !DVB_FE_CUSTOMISE
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver.
 
@@ -107,11 +107,11 @@ config DVB_USB_CXUSB
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_MT352 if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
        select DVB_DIB7000P if !DVB_FE_CUSTOMISE
        select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Conexant USB2.0 hybrid reference design.
          Currently, only DVB and ATSC modes are supported, analog mode
@@ -124,9 +124,9 @@ config DVB_USB_M920X
        tristate "Uli m920x DVB-T USB2.0 support"
        depends on DVB_USB
        select DVB_MT352 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
        select DVB_TDA1004X if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the MSI Mega Sky 580 USB2.0 DVB-T receiver.
          Currently, only devices with a product id of
@@ -137,7 +137,7 @@ config DVB_USB_GL861
        tristate "Genesys Logic GL861 USB2.0 support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the MSI Megasky 580 (55801) DVB-T USB2.0
          receiver with USB ID 0db0:5581.
@@ -146,7 +146,7 @@ config DVB_USB_AU6610
        tristate "Alcor Micro AU6610 USB2.0 support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Sigmatek DVB-110 DVB-T USB2.0 receiver.
 
@@ -198,8 +198,8 @@ config DVB_USB_NOVA_T_USB2
        tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support"
        depends on DVB_USB
        select DVB_DIB3000MC
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
        select DVB_PLL if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver.
 
@@ -235,8 +235,8 @@ config DVB_USB_OPERA1
 config DVB_USB_AF9005
        tristate "Afatech AF9005 DVB-T USB1.1 support"
        depends on DVB_USB && EXPERIMENTAL
-       select MEDIA_TUNER_MT2060 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Afatech AF9005 based DVB-T USB1.1 receiver
          and the TerraTec Cinergy T USB XE (Rev.1)
@@ -284,7 +284,7 @@ config DVB_USB_DTV5100
        tristate "AME DTV-5100 USB2.0 DVB-T support"
        depends on DVB_USB
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the AME DTV-5100 USB2.0 DVB-T receiver.
 
@@ -293,9 +293,9 @@ config DVB_USB_AF9015
        depends on DVB_USB && EXPERIMENTAL
        select DVB_AF9013
        select DVB_PLL              if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2060   if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_QT1010   if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MT2060   if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_QT1010   if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_TDA18271 if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        help
          Say Y here to support the Afatech AF9015 based DVB-T USB2.0 receiver
index f28d3ae59e046cd8e9d1d6c74565848ccb4a9833..3917327889117bcff8cf27f315c8a3d70fcb27c7 100644 (file)
@@ -446,13 +446,13 @@ static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
                == NULL ? -ENODEV : 0;
 }
 
-#define DEFAULT_RC_INTERVAL 150
+#define DEFAULT_RC_INTERVAL 50
 
 static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
 
 /* Number of keypresses to ignore before start repeating */
-#define RC_REPEAT_DELAY 2
-#define RC_REPEAT_DELAY_V1_20 5
+#define RC_REPEAT_DELAY 6
+#define RC_REPEAT_DELAY_V1_20 10
 
 
 
index 867027ceab3e71d29ce43b3944104043670eeb99..401a04effc06817befbc4d6772565c430648d78a 100644 (file)
@@ -106,7 +106,7 @@ config DVB_BUDGET_CI
        select DVB_TDA1004X if !DVB_FE_CUSTOMISE
        select DVB_LNBP21 if !DVB_FE_CUSTOMISE
        select DVB_TDA10023 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
        select VIDEO_IR
        help
          Support for simple SAA7146 based DVB cards
index e6ca4012b5f0f78fab90212e546aa1b6f0cd4946..0ea85a05e5c0d86911d9a62fe3445e472cf1e877 100644 (file)
@@ -831,7 +831,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
 {
        int ret = -ENOIOCTLCMD;
 
-       if (!file->f_op->ioctl)
+       if (!file->f_op->ioctl && !file->f_op->unlocked_ioctl)
                return ret;
 
        switch (cmd) {
index ef48565de7f1b7c5fdcd61e69fdb6e78b9ca9f83..8940b5387decc4fda02d8f41a3a86189d2380803 100644 (file)
@@ -9,7 +9,7 @@ config VIDEO_CX18
        select VIDEO_CX2341X
        select VIDEO_CS5345
        select DVB_S5H1409 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MXL5005S if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This is a video4linux driver for Conexant cx23418 based
          PCI combo video recorder devices.
index 8c1b7fa47a41cc36f35d3f4c763ff65c190e792c..00f1e2e8889e7fe23431827e17ce9f8b862d2714 100644 (file)
@@ -11,16 +11,16 @@ config VIDEO_CX23885
        select VIDEO_CX25840
        select VIDEO_CX2341X
        select DVB_DIB7000P if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_MT2131 if !DVB_FE_CUSTOMISE
        select DVB_S5H1409 if !DVB_FE_CUSTOMISE
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
+       select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
+       select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMIZE
        select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE
-       select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
        ---help---
          This is a video4linux driver for Conexant 23885 based
          TV cards.
index 0b9e5fac6239f5783e0f42e24f8eb9d1c700dfed..b0f837588e01ee9bb5a8d4c14f7617958a33be19 100644 (file)
@@ -56,12 +56,12 @@ config VIDEO_CX88_DVB
        select DVB_NXT200X if !DVB_FE_CUSTOMISE
        select DVB_CX24123 if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_CX24116 if !DVB_FE_CUSTOMISE
        select DVB_STV0299 if !DVB_FE_CUSTOMISE
        select DVB_STV0288 if !DVB_FE_CUSTOMISE
        select DVB_STB6000 if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This adds support for DVB/ATSC cards based on the
          Conexant 2388x chip.
index 610f535a257cd3c47b40d80484ad952177aaec38..4ea1f1e048979e51859652d93e24846a7f39fd3e 100644 (file)
@@ -549,10 +549,11 @@ static int em28xx_config(struct em28xx *dev)
 static void em28xx_config_i2c(struct em28xx *dev)
 {
        struct v4l2_routing route;
+       int zero = 0;
 
        route.input = INPUT(dev->ctl_input)->vmux;
        route.output = 0;
-       em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
+       em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, &zero);
        em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
        em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
 }
index 748a87e82e4423e2b9ecfb4c4ac621a339231e4a..02a6e9ef033740d7401b6bd1ccd5966552add823 100644 (file)
@@ -1264,10 +1264,10 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
        struct gspca_dev *gspca_dev = priv;
        int ret;
 
-       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
-               return -ERESTARTSYS;
        if (!gspca_dev->sd_desc->set_jcomp)
                return -EINVAL;
+       if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+               return -ERESTARTSYS;
        ret = gspca_dev->sd_desc->set_jcomp(gspca_dev, jpegcomp);
        mutex_unlock(&gspca_dev->usb_lock);
        return ret;
index 19eb274c9cd09d2f361154ed764d152472df709f..854c2a88535880a3e2a6c2d560303c46faaa8f2f 100644 (file)
@@ -42,7 +42,7 @@ config VIDEO_PVRUSB2_DVB
        select DVB_S5H1411 if !DVB_FE_CUSTOMISE
        select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
        select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE
        ---help---
 
index 7021bbf5897b3ac6988fd5d42d28bc70a4231c9f..fc2164e28e76d11bbcb12fa60de4cb69d8acb7f3 100644 (file)
@@ -34,9 +34,9 @@ config VIDEO_SAA7134_DVB
        select DVB_NXT200X if !DVB_FE_CUSTOMISE
        select DVB_TDA10086 if !DVB_FE_CUSTOMISE
        select DVB_TDA826X if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_TDA827X if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
-       select MEDIA_TUNER_SIMPLE if !DVB_FE_CUSTOMISE
+       select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE
+       select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE
        ---help---
          This adds support for DVB cards based on the
          Philips saa7134 chip.
index d62fd4f6b52e054db684e2af1e30ac12fa3a9240..ee090413e598e4254cad01d211e465e46e081f48 100644 (file)
@@ -2008,6 +2008,9 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
                return FAILED;
        }
 
+       /* make sure we have no outstanding commands at this stage */
+       mptscsih_flush_running_cmds(hd);
+
        ioc = hd->ioc;
        printk(MYIOC_s_INFO_FMT "attempting host reset! (sc=%p)\n",
            ioc->name, SCpnt);
index 84bdc2ee69e6bc1239775e27ef263cab8ef89805..a443e136dc41591136aecc1ec9e863ce43b2e35e 100644 (file)
@@ -354,7 +354,7 @@ static inline void i2o_block_sglist_free(struct i2o_block_request *ireq)
  *     @req: the request to prepare
  *
  *     Allocate the necessary i2o_block_request struct and connect it to
- *     the request. This is needed that we not loose the SG list later on.
+ *     the request. This is needed that we not lose the SG list later on.
  *
  *     Returns BLKPREP_OK on success or BLKPREP_DEFER on failure.
  */
index be2b5926d26c14b34bcbb40fd4db664f50618495..6e53a30bfd38a7809f8bbcb2ce9b0f3966f35413 100644 (file)
@@ -49,7 +49,6 @@ static int i2o_hrt_get(struct i2o_controller *c);
 /**
  *     i2o_msg_get_wait - obtain an I2O message from the IOP
  *     @c: I2O controller
- *     @msg: pointer to a I2O message pointer
  *     @wait: how long to wait until timeout
  *
  *     This function waits up to wait seconds for a message slot to be
index 8c389d606c304c8b9b34022c8d2e71ceba4bb6e8..3ee698ad85997cf2f5c32b986689d7c07a0ed607 100644 (file)
@@ -254,7 +254,11 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
                return 1;
 
        *paddr = pte_pfn(pte) << PAGE_SHIFT;
+#ifdef CONFIG_HUGETLB_PAGE
        *pageshift = is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT;
+#else
+       *pageshift = PAGE_SHIFT;
+#endif
        return 0;
 
 err:
index 5c027b6b4e5a7438815b290e09a99a0290bf55f5..6509838063924071cfdcfce11cf1d425b2ad170a 100644 (file)
@@ -481,7 +481,7 @@ struct vm_operations_struct gru_vm_ops = {
        .fault          = gru_fault,
 };
 
-module_init(gru_init);
+fs_initcall(gru_init);
 module_exit(gru_exit);
 
 module_param(gru_options, ulong, 0644);
index 76a76751da3660ce63123844d97eca891d2cbab2..6659b2275c0c6a5ce150906c25ac1d106700065a 100644 (file)
@@ -37,9 +37,9 @@
 #define        OPCODE_NORM_READ        0x03    /* Read data bytes (low frequency) */
 #define        OPCODE_FAST_READ        0x0b    /* Read data bytes (high frequency) */
 #define        OPCODE_PP               0x02    /* Page program (up to 256 bytes) */
-#define        OPCODE_BE_4K            0x20    /* Erase 4KiB block */
+#define        OPCODE_BE_4K            0x20    /* Erase 4KiB block */
 #define        OPCODE_BE_32K           0x52    /* Erase 32KiB block */
-#define        OPCODE_BE               0xc7    /* Erase whole flash block */
+#define        OPCODE_CHIP_ERASE       0xc7    /* Erase whole flash chip */
 #define        OPCODE_SE               0xd8    /* Sector erase (usually 64KiB) */
 #define        OPCODE_RDID             0x9f    /* Read JEDEC ID */
 
@@ -167,7 +167,7 @@ static int wait_till_ready(struct m25p *flash)
  *
  * Returns 0 if successful, non-zero otherwise.
  */
-static int erase_block(struct m25p *flash)
+static int erase_chip(struct m25p *flash)
 {
        DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n",
                        flash->spi->dev.bus_id, __func__,
@@ -181,7 +181,7 @@ static int erase_block(struct m25p *flash)
        write_enable(flash);
 
        /* Set up command buffer. */
-       flash->command[0] = OPCODE_BE;
+       flash->command[0] = OPCODE_CHIP_ERASE;
 
        spi_write(flash->spi, flash->command, 1);
 
@@ -250,15 +250,18 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
 
        mutex_lock(&flash->lock);
 
-       /* REVISIT in some cases we could speed up erasing large regions
-        * by using OPCODE_SE instead of OPCODE_BE_4K
-        */
-
-       /* now erase those sectors */
-       if (len == flash->mtd.size && erase_block(flash)) {
+       /* whole-chip erase? */
+       if (len == flash->mtd.size && erase_chip(flash)) {
                instr->state = MTD_ERASE_FAILED;
                mutex_unlock(&flash->lock);
                return -EIO;
+
+       /* REVISIT in some cases we could speed up erasing large regions
+        * by using OPCODE_SE instead of OPCODE_BE_4K.  We may have set up
+        * to use "small sector erase", but that's not always optimal.
+        */
+
+       /* "sector"-at-a-time erase */
        } else {
                while (len) {
                        if (erase_sector(flash, addr)) {
@@ -574,10 +577,11 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
        for (tmp = 0, info = m25p_data;
                        tmp < ARRAY_SIZE(m25p_data);
                        tmp++, info++) {
-               if (info->jedec_id == jedec)
-                       if (ext_jedec != 0 && info->ext_id != ext_jedec)
+               if (info->jedec_id == jedec) {
+                       if (info->ext_id != 0 && info->ext_id != ext_jedec)
                                continue;
                        return info;
+               }
        }
        dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);
        return NULL;
index 42d844f8f6bfef79bdfef42ed48b33368ac4ecd0..dfbf3f270cea9441a7261b69ca3c9f8aa9c87770 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/concat.h>
-#include <asm/io.h>
+#include <linux/io.h>
 
 #define MAX_RESOURCES          4
 
@@ -27,7 +27,6 @@ struct physmap_flash_info {
        struct mtd_info         *mtd[MAX_RESOURCES];
        struct mtd_info         *cmtd;
        struct map_info         map[MAX_RESOURCES];
-       struct resource         *res;
 #ifdef CONFIG_MTD_PARTITIONS
        int                     nr_parts;
        struct mtd_partition    *parts;
@@ -70,16 +69,7 @@ static int physmap_flash_remove(struct platform_device *dev)
 #endif
                        map_destroy(info->mtd[i]);
                }
-
-               if (info->map[i].virt != NULL)
-                       iounmap(info->map[i].virt);
-       }
-
-       if (info->res != NULL) {
-               release_resource(info->res);
-               kfree(info->res);
        }
-
        return 0;
 }
 
@@ -101,7 +91,8 @@ static int physmap_flash_probe(struct platform_device *dev)
        if (physmap_data == NULL)
                return -ENODEV;
 
-       info = kzalloc(sizeof(struct physmap_flash_info), GFP_KERNEL);
+       info = devm_kzalloc(&dev->dev, sizeof(struct physmap_flash_info),
+                           GFP_KERNEL);
        if (info == NULL) {
                err = -ENOMEM;
                goto err_out;
@@ -114,10 +105,10 @@ static int physmap_flash_probe(struct platform_device *dev)
                       (unsigned long long)(dev->resource[i].end - dev->resource[i].start + 1),
                       (unsigned long long)dev->resource[i].start);
 
-               info->res = request_mem_region(dev->resource[i].start,
-                                              dev->resource[i].end - dev->resource[i].start + 1,
-                                              dev->dev.bus_id);
-               if (info->res == NULL) {
+               if (!devm_request_mem_region(&dev->dev,
+                       dev->resource[i].start,
+                       dev->resource[i].end - dev->resource[i].start + 1,
+                       dev->dev.bus_id)) {
                        dev_err(&dev->dev, "Could not reserve memory region\n");
                        err = -ENOMEM;
                        goto err_out;
@@ -129,7 +120,8 @@ static int physmap_flash_probe(struct platform_device *dev)
                info->map[i].bankwidth = physmap_data->width;
                info->map[i].set_vpp = physmap_data->set_vpp;
 
-               info->map[i].virt = ioremap(info->map[i].phys, info->map[i].size);
+               info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys,
+                                                info->map[i].size);
                if (info->map[i].virt == NULL) {
                        dev_err(&dev->dev, "Failed to ioremap flash region\n");
                        err = EIO;
index 024e3fffd4bb49b6176af4701c07e344120a3fc2..a83192f80eba5176b6bbad4649bd5996159b086a 100644 (file)
@@ -163,9 +163,11 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
        ret = parse_mtd_partitions(&fun->mtd, part_types, &fun->parts, 0);
 
 #ifdef CONFIG_MTD_OF_PARTS
-       if (ret == 0)
-               ret = of_mtd_parse_partitions(fun->dev, &fun->mtd,
-                                             flash_np, &fun->parts);
+       if (ret == 0) {
+               ret = of_mtd_parse_partitions(fun->dev, flash_np, &fun->parts);
+               if (ret < 0)
+                       goto err;
+       }
 #endif
        if (ret > 0)
                ret = add_mtd_partitions(&fun->mtd, fun->parts, ret);
index 75c899039023051e9b0f8dda595d734ff9aebdc0..9bd6c9ac844396553cbbfcf026860ff4420bce25 100644 (file)
@@ -141,6 +141,7 @@ static int __devinit pasemi_nand_probe(struct of_device *ofdev,
        }
 
        lpcctl = pci_resource_start(pdev, 0);
+       pci_dev_put(pdev);
 
        if (!request_region(lpcctl, 4, driver_name)) {
                err = -EBUSY;
index c0fa9c9edf089c1a039ded475fb13740cfa52d1f..15f0a26730aea38e4c65708aac43473a8da02122 100644 (file)
@@ -269,6 +269,7 @@ static struct pxa3xx_nand_timing stm2GbX16_timing = {
 
 static struct pxa3xx_nand_flash stm2GbX16 = {
        .timing = &stm2GbX16_timing,
+       .cmdset = &largepage_cmdset,
        .page_per_block = 64,
        .page_size = 2048,
        .flash_width = 16,
index e39b21d3e168e5bb3cabf1a076193bca3f33bcab..a7e4d985f5ef553892a4fba5890647324f1c156c 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
 
-#include <asm/io.h>
 #include <asm/mach/flash.h>
-#include <asm/arch/gpmc.h>
-#include <asm/arch/onenand.h>
-#include <asm/arch/gpio.h>
-#include <asm/arch/pm.h>
+#include <mach/gpmc.h>
+#include <mach/onenand.h>
+#include <mach/gpio.h>
+#include <mach/pm.h>
 
-#include <linux/dma-mapping.h>
-#include <asm/dma-mapping.h>
-#include <asm/arch/dma.h>
+#include <mach/dma.h>
 
-#include <asm/arch/board.h>
+#include <mach/board.h>
 
 #define DRIVER_NAME "omap2-onenand"
 
index f19acf8b9220bf2e152ecae6fdc9727ee8e5fc19..017383ad5ec6e6de671b71c0165d783b525386f2 100644 (file)
@@ -114,7 +114,7 @@ obj-$(CONFIG_EL2) += 3c503.o 8390p.o
 obj-$(CONFIG_NE2000) += ne.o 8390p.o
 obj-$(CONFIG_NE2_MCA) += ne2.o 8390p.o
 obj-$(CONFIG_HPLAN) += hp.o 8390p.o
-obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390.o
+obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390p.o
 obj-$(CONFIG_ULTRA) += smc-ultra.o 8390.o
 obj-$(CONFIG_ULTRAMCA) += smc-mca.o 8390.o
 obj-$(CONFIG_ULTRA32) += smc-ultra32.o 8390.o
index d07e3f1489510642c0cde8b41b96875fdc115c92..9e8222f9e90ee0f69416ffe985103d0f6b183df5 100644 (file)
@@ -543,9 +543,9 @@ bnx2_free_rx_mem(struct bnx2 *bp)
                for (j = 0; j < bp->rx_max_pg_ring; j++) {
                        if (rxr->rx_pg_desc_ring[j])
                                pci_free_consistent(bp->pdev, RXBD_RING_SIZE,
-                                                   rxr->rx_pg_desc_ring[i],
-                                                   rxr->rx_pg_desc_mapping[i]);
-                       rxr->rx_pg_desc_ring[i] = NULL;
+                                                   rxr->rx_pg_desc_ring[j],
+                                                   rxr->rx_pg_desc_mapping[j]);
+                       rxr->rx_pg_desc_ring[j] = NULL;
                }
                if (rxr->rx_pg_ring)
                        vfree(rxr->rx_pg_ring);
@@ -3144,6 +3144,28 @@ bnx2_has_work(struct bnx2_napi *bnapi)
        return 0;
 }
 
+static void
+bnx2_chk_missed_msi(struct bnx2 *bp)
+{
+       struct bnx2_napi *bnapi = &bp->bnx2_napi[0];
+       u32 msi_ctrl;
+
+       if (bnx2_has_work(bnapi)) {
+               msi_ctrl = REG_RD(bp, BNX2_PCICFG_MSI_CONTROL);
+               if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE))
+                       return;
+
+               if (bnapi->last_status_idx == bp->idle_chk_status_idx) {
+                       REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &
+                              ~BNX2_PCICFG_MSI_CONTROL_ENABLE);
+                       REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);
+                       bnx2_msi(bp->irq_tbl[0].vector, bnapi);
+               }
+       }
+
+       bp->idle_chk_status_idx = bnapi->last_status_idx;
+}
+
 static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi)
 {
        struct status_block *sblk = bnapi->status_blk.msi;
@@ -3218,14 +3240,15 @@ static int bnx2_poll(struct napi_struct *napi, int budget)
 
                work_done = bnx2_poll_work(bp, bnapi, work_done, budget);
 
-               if (unlikely(work_done >= budget))
-                       break;
-
                /* bnapi->last_status_idx is used below to tell the hw how
                 * much work has been processed, so we must read it before
                 * checking for more work.
                 */
                bnapi->last_status_idx = sblk->status_idx;
+
+               if (unlikely(work_done >= budget))
+                       break;
+
                rmb();
                if (likely(!bnx2_has_work(bnapi))) {
                        netif_rx_complete(bp->dev, napi);
@@ -4570,6 +4593,8 @@ bnx2_init_chip(struct bnx2 *bp)
        for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
                bp->bnx2_napi[i].last_status_idx = 0;
 
+       bp->idle_chk_status_idx = 0xffff;
+
        bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;
 
        /* Set up how to generate a link change interrupt. */
@@ -5718,6 +5743,10 @@ bnx2_timer(unsigned long data)
        if (atomic_read(&bp->intr_sem) != 0)
                goto bnx2_restart_timer;
 
+       if ((bp->flags & (BNX2_FLAG_USING_MSI | BNX2_FLAG_ONE_SHOT_MSI)) ==
+            BNX2_FLAG_USING_MSI)
+               bnx2_chk_missed_msi(bp);
+
        bnx2_send_heart_beat(bp);
 
        bp->stats_blk->stat_FwRxDrop =
index 617d953401607e884873cf41a32fdf6dd73c1024..0b032c3c7b611c17cee29b12a62809839a1dae2b 100644 (file)
@@ -378,6 +378,9 @@ struct l2_fhdr {
  *  pci_config_l definition
  *  offset: 0000
  */
+#define BNX2_PCICFG_MSI_CONTROL                                0x00000058
+#define BNX2_PCICFG_MSI_CONTROL_ENABLE                  (1L<<16)
+
 #define BNX2_PCICFG_MISC_CONFIG                                0x00000068
 #define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP        (1L<<2)
 #define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP     (1L<<3)
@@ -6863,6 +6866,9 @@ struct bnx2 {
 
        u8                      num_tx_rings;
        u8                      num_rx_rings;
+
+       u32                     idle_chk_status_idx;
+
 };
 
 #define REG_RD(bp, offset)                                     \
index d6c7d2aa761b503da15a96126ee1f2f3895e4f0a..7092df50ff784007f34f72b74aac85d6a437a42e 100644 (file)
@@ -1035,10 +1035,6 @@ MODULE_PARM_DESC(copybreak, "Receive copy threshold");
  *     @pdev: the PCI device that received the packet
  *     @fl: the SGE free list holding the packet
  *     @len: the actual packet length, excluding any SGE padding
- *     @dma_pad: padding at beginning of buffer left by SGE DMA
- *     @skb_pad: padding to be used if the packet is copied
- *     @copy_thres: length threshold under which a packet should be copied
- *     @drop_thres: # of remaining buffers before we start dropping packets
  *
  *     Get the next packet from a free list and complete setup of the
  *     sk_buff.  If the packet is small we make a copy and recycle the
index 523b9716a543aec21d923b58a07cd5162b3edab3..d115a6d30f29c0b3acb81c8038c6215993980e8d 100644 (file)
@@ -1893,12 +1893,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
                ctrl |= E1000_CTRL_PHY_RST;
        }
        ret_val = e1000_acquire_swflag_ich8lan(hw);
+       /* Whether or not the swflag was acquired, we need to reset the part */
        hw_dbg(hw, "Issuing a global reset to ich8lan");
        ew32(CTRL, (ctrl | E1000_CTRL_RST));
        msleep(20);
 
-       /* release the swflag because it is not reset by hardware reset */
-       e1000_release_swflag_ich8lan(hw);
+       if (!ret_val) {
+               /* release the swflag because it is not reset by
+                * hardware reset
+                */
+               e1000_release_swflag_ich8lan(hw);
+       }
 
        ret_val = e1000e_get_auto_rd_done(hw);
        if (ret_val) {
index 91795f78c3e4da0a067378cdc757d8ddb32c138b..122539a0e1feb112f2e4f575f347d78349bb8536 100644 (file)
@@ -345,7 +345,6 @@ no_buffers:
 /**
  * e1000_alloc_jumbo_rx_buffers - Replace used jumbo receive buffers
  * @adapter: address of board private structure
- * @rx_ring: pointer to receive ring structure
  * @cleaned_count: number of buffers to allocate this pass
  **/
 
index e1b441effbbec15b81de2fe4b2d36992ac993724..36cb6e95b465c2545b822d30c14a675b6bd39e07 100644 (file)
@@ -568,6 +568,17 @@ static u16 erxrdpt_workaround(u16 next_packet_ptr, u16 start, u16 end)
        return erxrdpt;
 }
 
+/*
+ * Calculate wrap around when reading beyond the end of the RX buffer
+ */
+static u16 rx_packet_start(u16 ptr)
+{
+       if (ptr + RSV_SIZE > RXEND_INIT)
+               return (ptr + RSV_SIZE) - (RXEND_INIT - RXSTART_INIT + 1);
+       else
+               return ptr + RSV_SIZE;
+}
+
 static void nolock_rxfifo_init(struct enc28j60_net *priv, u16 start, u16 end)
 {
        u16 erxrdpt;
@@ -938,8 +949,9 @@ static void enc28j60_hw_rx(struct net_device *ndev)
                        skb->dev = ndev;
                        skb_reserve(skb, NET_IP_ALIGN);
                        /* copy the packet from the receive buffer */
-                       enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv),
-                                       len, skb_put(skb, len));
+                       enc28j60_mem_read(priv,
+                               rx_packet_start(priv->next_pk_ptr),
+                               len, skb_put(skb, len));
                        if (netif_msg_pktdata(priv))
                                dump_packet(__func__, skb->len, skb->data);
                        skb->protocol = eth_type_trans(skb, ndev);
@@ -947,7 +959,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
                        ndev->stats.rx_packets++;
                        ndev->stats.rx_bytes += len;
                        ndev->last_rx = jiffies;
-                       netif_rx(skb);
+                       netif_rx_ni(skb);
                }
        }
        /*
index fbbd3e660c2731800bf6b7e136a62980bc51032f..c01e290d09d28b7e9c1fb240a26a9ba6f92e0900 100644 (file)
@@ -230,7 +230,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
        dev->open = &hpp_open;
        dev->stop = &hpp_close;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ei_poll;
+       dev->poll_controller = eip_poll;
 #endif
 
        ei_status.name = name;
index 1cbae85b142627facb0753ab2513b95587e9cfc2..20d27e622ec10c1fabefdc24e85a67cb443d27a4 100644 (file)
@@ -1980,7 +1980,6 @@ static void igb_configure_rx(struct igb_adapter *adapter)
 
 /**
  * igb_free_tx_resources - Free Tx Resources per Queue
- * @adapter: board private structure
  * @tx_ring: Tx descriptor ring for a specific queue
  *
  * Free all transmit software resources
@@ -2033,7 +2032,6 @@ static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
 
 /**
  * igb_clean_tx_ring - Free Tx Buffers
- * @adapter: board private structure
  * @tx_ring: ring to be cleaned
  **/
 static void igb_clean_tx_ring(struct igb_ring *tx_ring)
@@ -2080,7 +2078,6 @@ static void igb_clean_all_tx_rings(struct igb_adapter *adapter)
 
 /**
  * igb_free_rx_resources - Free Rx Resources
- * @adapter: board private structure
  * @rx_ring: ring to clean the resources from
  *
  * Free all receive software resources
@@ -2120,7 +2117,6 @@ static void igb_free_all_rx_resources(struct igb_adapter *adapter)
 
 /**
  * igb_clean_rx_ring - Free Rx Buffers per Queue
- * @adapter: board private structure
  * @rx_ring: ring to free buffers from
  **/
 static void igb_clean_rx_ring(struct igb_ring *rx_ring)
index 8ed823ae639e6a2a1bcbc1eeabbc8fb1177d2c66..5236f633ee36e3361af138cf3e2c2ae3033e1b53 100644 (file)
@@ -1320,7 +1320,6 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter)
  * ixgbe_intr - legacy mode Interrupt Handler
  * @irq: interrupt number
  * @data: pointer to a network interface device structure
- * @pt_regs: CPU registers structure
  **/
 static irqreturn_t ixgbe_intr(int irq, void *data)
 {
index f863aee6648b49b0db38d2cdc077640669a2a424..3f5d91543246c88936d8fc086abf37c2cd3f6686 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #ifndef __JME_H_INCLUDED__
-#define __JME_H_INCLUDEE__
+#define __JME_H_INCLUDED__
 
 #define DRV_NAME       "jme"
 #define DRV_VERSION    "1.0.3"
index 42394505bb50b9a006b5d582eaef3378b1a9c5e6..590039cbb146f5a42b888055cc836ea576f23726 100644 (file)
@@ -70,6 +70,9 @@ static void macvlan_broadcast(struct sk_buff *skb,
        struct sk_buff *nskb;
        unsigned int i;
 
+       if (skb->protocol == htons(ETH_P_PAUSE))
+               return;
+
        for (i = 0; i < MACVLAN_HASH_SIZE; i++) {
                hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[i], hlist) {
                        dev = vlan->dev;
index b9bed82e1d214089f5b4e6682a965e11c781d6e5..b289a0a2b94563ea37b910c05deef15b6b61d0b6 100644 (file)
@@ -401,6 +401,8 @@ static int netx_eth_drv_probe(struct platform_device *pdev)
        priv->xmac_base = priv->xc->xmac_base;
        priv->sram_base = priv->xc->sram_base;
 
+       spin_lock_init(&priv->lock);
+
        ret = pfifo_request(PFIFO_MASK(priv->id));
        if (ret) {
                printk("unable to request PFIFO\n");
index b37a498939ae7d1a16f6e1a5c0ad8545f6d32380..0418045166c348f15431b94fbfa06af894bf6820 100644 (file)
@@ -779,6 +779,7 @@ static struct pcmcia_device_id axnet_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("IO DATA", "ETXPCM", 0x547e66dc, 0x233adac2),
        PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8),
        PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609),
+       PCMCIA_DEVICE_PROD_ID12("NETGEAR", "FA411", 0x9aa79dc3, 0x40fad875),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA", "FastEtherCard", 0x281f1c5d, 0x7ef26116),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA", "FEP501", 0x281f1c5d, 0x2e272058),
@@ -1174,7 +1175,6 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
  * ax_interrupt - handle the interrupts from an 8390
  * @irq: interrupt number
  * @dev_id: a pointer to the net_device
- * @regs: unused
  *
  * Handle the ether interface interrupts. We pull packets from
  * the 8390 via the card specific functions and fire them at the networking
index e40d6301aa7aaf1084b9e0cef1bfbf7588d692c3..ce486f09449215dc08baec27aeb723dd0484b371 100644 (file)
@@ -1693,7 +1693,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("National Semiconductor", "InfoMover NE4100", 0x36e1191f, 0xa6617ec8),
        PCMCIA_DEVICE_PROD_ID12("NEC", "PC-9801N-J12", 0x18df0ba0, 0xbc912d76),
        PCMCIA_DEVICE_PROD_ID12("NETGEAR", "FA410TX", 0x9aa79dc3, 0x60e5bc0e),
-       PCMCIA_DEVICE_PROD_ID12("NETGEAR", "FA411", 0x9aa79dc3, 0x40fad875),
        PCMCIA_DEVICE_PROD_ID12("Network Everywhere", "Fast Ethernet 10/100 PC Card", 0x820a67b6, 0x31ed1a5f),
        PCMCIA_DEVICE_PROD_ID12("NextCom K.K.", "Next Hawk", 0xaedaec74, 0xad050ef1),
        PCMCIA_DEVICE_PROD_ID12("PCMCIA", "10/100Mbps Ethernet Card", 0x281f1c5d, 0x6e41773b),
index 536bda1f428b6c09360be41448f7b0b7d4c16679..289fc267edf30eb5094d24f416ca644c9494d401 100644 (file)
@@ -105,8 +105,6 @@ int mdiobus_register(struct mii_bus *bus)
                return -EINVAL;
        }
 
-       bus->state = MDIOBUS_REGISTERED;
-
        mutex_init(&bus->mdio_lock);
 
        if (bus->reset)
@@ -123,6 +121,9 @@ int mdiobus_register(struct mii_bus *bus)
                }
        }
 
+       if (!err)
+               bus->state = MDIOBUS_REGISTERED;
+
        pr_info("%s: probed\n", bus->name);
 
        return err;
index 55bc24b234e324899b444298aeb37c847c8a9ba0..25acbbde4a6009f9c34926c0e2f89ca4e8066d6e 100644 (file)
@@ -227,8 +227,17 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
        if (r)
                return ERR_PTR(r);
 
-       /* If the phy_id is all Fs or all 0s, there is no device there */
-       if ((0xffff == phy_id) || (0x00 == phy_id))
+       /* If the phy_id is mostly Fs, there is no device there */
+       if ((phy_id & 0x1fffffff) == 0x1fffffff)
+               return NULL;
+
+       /*
+        * Broken hardware is sometimes missing the pull down resistor on the
+        * MDIO line, which results in reads to non-existent devices returning
+        * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
+        * device as well.
+        */
+       if (phy_id == 0)
                return NULL;
 
        dev = phy_device_create(bus, addr, phy_id);
index 8874497b6bbfa76384c42bdfc4af9903991af497..dd3b2447e85a63936b49e24d2deaffa7e9ac960d 100644 (file)
@@ -34,6 +34,8 @@
 #define MII_VSC8244_IMASK_DUPLEX       0x1000
 #define MII_VSC8244_IMASK_MASK         0xf000
 
+#define MII_VSC8221_IMASK_MASK         0xa000
+
 /* Vitesse Interrupt Status Register */
 #define MII_VSC8244_ISTAT              0x1a
 #define MII_VSC8244_ISTAT_STATUS       0x8000
 #define MII_VSC8244_AUXCONSTAT_GBIT            0x0010
 #define MII_VSC8244_AUXCONSTAT_100             0x0008
 
+#define MII_VSC8221_AUXCONSTAT_INIT    0x0004 /* need to set this bit? */
+#define MII_VSC8221_AUXCONSTAT_RESERVED        0x0004
+
+#define PHY_ID_VSC8244                 0x000fc6c0
+#define PHY_ID_VSC8221                 0x000fc550
+
 MODULE_DESCRIPTION("Vitesse PHY driver");
 MODULE_AUTHOR("Kriston Carson");
 MODULE_LICENSE("GPL");
@@ -95,13 +103,15 @@ static int vsc824x_ack_interrupt(struct phy_device *phydev)
        return (err < 0) ? err : 0;
 }
 
-static int vsc824x_config_intr(struct phy_device *phydev)
+static int vsc82xx_config_intr(struct phy_device *phydev)
 {
        int err;
 
        if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
                err = phy_write(phydev, MII_VSC8244_IMASK,
-                               MII_VSC8244_IMASK_MASK);
+                       phydev->drv->phy_id == PHY_ID_VSC8244 ?
+                               MII_VSC8244_IMASK_MASK :
+                               MII_VSC8221_IMASK_MASK);
        else {
                /*
                 * The Vitesse PHY cannot clear the interrupt
@@ -120,7 +130,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)
 
 /* Vitesse 824x */
 static struct phy_driver vsc8244_driver = {
-       .phy_id         = 0x000fc6c0,
+       .phy_id         = PHY_ID_VSC8244,
        .name           = "Vitesse VSC8244",
        .phy_id_mask    = 0x000fffc0,
        .features       = PHY_GBIT_FEATURES,
@@ -129,19 +139,55 @@ static struct phy_driver vsc8244_driver = {
        .config_aneg    = &genphy_config_aneg,
        .read_status    = &genphy_read_status,
        .ack_interrupt  = &vsc824x_ack_interrupt,
-       .config_intr    = &vsc824x_config_intr,
+       .config_intr    = &vsc82xx_config_intr,
        .driver         = { .owner = THIS_MODULE,},
 };
 
-static int __init vsc8244_init(void)
+static int vsc8221_config_init(struct phy_device *phydev)
 {
-       return phy_driver_register(&vsc8244_driver);
+       int err;
+
+       err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
+                       MII_VSC8221_AUXCONSTAT_INIT);
+       return err;
+
+       /* Perhaps we should set EXT_CON1 based on the interface?
+          Options are 802.3Z SerDes or SGMII */
+}
+
+/* Vitesse 8221 */
+static struct phy_driver vsc8221_driver = {
+       .phy_id         = PHY_ID_VSC8221,
+       .phy_id_mask    = 0x000ffff0,
+       .name           = "Vitesse VSC8221",
+       .features       = PHY_GBIT_FEATURES,
+       .flags          = PHY_HAS_INTERRUPT,
+       .config_init    = &vsc8221_config_init,
+       .config_aneg    = &genphy_config_aneg,
+       .read_status    = &genphy_read_status,
+       .ack_interrupt  = &vsc824x_ack_interrupt,
+       .config_intr    = &vsc82xx_config_intr,
+       .driver         = { .owner = THIS_MODULE,},
+};
+
+static int __init vsc82xx_init(void)
+{
+       int err;
+
+       err = phy_driver_register(&vsc8244_driver);
+       if (err < 0)
+               return err;
+       err = phy_driver_register(&vsc8221_driver);
+       if (err < 0)
+               phy_driver_unregister(&vsc8244_driver);
+       return err;
 }
 
-static void __exit vsc8244_exit(void)
+static void __exit vsc82xx_exit(void)
 {
        phy_driver_unregister(&vsc8244_driver);
+       phy_driver_unregister(&vsc8221_driver);
 }
 
-module_init(vsc8244_init);
-module_exit(vsc8244_exit);
+module_init(vsc82xx_init);
+module_exit(vsc82xx_exit);
index 7e857e938adb582ae432b26d35114e8099d51eb2..714a23035de1980a968c19a835712d587c007c17 100644 (file)
@@ -116,6 +116,7 @@ struct ppp {
        unsigned long   last_xmit;      /* jiffies when last pkt sent 9c */
        unsigned long   last_recv;      /* jiffies when last pkt rcvd a0 */
        struct net_device *dev;         /* network interface device a4 */
+       int             closing;        /* is device closing down? a8 */
 #ifdef CONFIG_PPP_MULTILINK
        int             nxchan;         /* next channel to send something on */
        u32             nxseq;          /* next sequence number to send */
@@ -995,7 +996,7 @@ ppp_xmit_process(struct ppp *ppp)
        struct sk_buff *skb;
 
        ppp_xmit_lock(ppp);
-       if (ppp->dev) {
+       if (!ppp->closing) {
                ppp_push(ppp);
                while (!ppp->xmit_pending
                       && (skb = skb_dequeue(&ppp->file.xq)))
@@ -1463,8 +1464,7 @@ static inline void
 ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
        ppp_recv_lock(ppp);
-       /* ppp->dev == 0 means interface is closing down */
-       if (ppp->dev)
+       if (!ppp->closing)
                ppp_receive_frame(ppp, skb, pch);
        else
                kfree_skb(skb);
@@ -2498,18 +2498,16 @@ init_ppp_file(struct ppp_file *pf, int kind)
  */
 static void ppp_shutdown_interface(struct ppp *ppp)
 {
-       struct net_device *dev;
-
        mutex_lock(&all_ppp_mutex);
-       ppp_lock(ppp);
-       dev = ppp->dev;
-       ppp->dev = NULL;
-       ppp_unlock(ppp);
        /* This will call dev_close() for us. */
-       if (dev) {
-               unregister_netdev(dev);
-               free_netdev(dev);
-       }
+       ppp_lock(ppp);
+       if (!ppp->closing) {
+               ppp->closing = 1;
+               ppp_unlock(ppp);
+               unregister_netdev(ppp->dev);
+       } else
+               ppp_unlock(ppp);
+
        cardmap_set(&all_ppp_units, ppp->file.index, NULL);
        ppp->file.dead = 1;
        ppp->owner = NULL;
@@ -2554,7 +2552,7 @@ static void ppp_destroy_interface(struct ppp *ppp)
        if (ppp->xmit_pending)
                kfree_skb(ppp->xmit_pending);
 
-       kfree(ppp);
+       free_netdev(ppp->dev);
 }
 
 /*
@@ -2616,7 +2614,7 @@ ppp_connect_channel(struct channel *pch, int unit)
        if (pch->file.hdrlen > ppp->file.hdrlen)
                ppp->file.hdrlen = pch->file.hdrlen;
        hdrlen = pch->file.hdrlen + 2;  /* for protocol bytes */
-       if (ppp->dev && hdrlen > ppp->dev->hard_header_len)
+       if (hdrlen > ppp->dev->hard_header_len)
                ppp->dev->hard_header_len = hdrlen;
        list_add_tail(&pch->clist, &ppp->channels);
        ++ppp->n_channels;
index 185b1dff10a8d572494c391aebf515133a56b2ff..e98d9773158d287ba1ae35052dca968fc6cf5735 100644 (file)
@@ -1353,6 +1353,7 @@ static int pppol2tp_release(struct socket *sock)
                        kfree_skb(skb);
                        sock_put(sk);
                }
+               sock_put(sk);
        }
 
        release_sock(sk);
index fa3a460f8e2f4ddd08d735c481e12466d86c6dca..8e8337e8b072252d416a497f233c8aa9a6f04ae4 100644 (file)
@@ -1630,7 +1630,6 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
  *     sis900_interrupt - sis900 interrupt handler
  *     @irq: the irq number
  *     @dev_instance: the client data object
- *     @regs: snapshot of processor context
  *
  *     The interrupt handler does all of the Rx thread work,
  *     and cleans up after the Tx thread
index b6435d0d71f9a067f887f7102159ae0d9a651ed5..07599b492359f16bc348f4271eb32793a3a362e0 100644 (file)
@@ -672,7 +672,6 @@ write_hash:
 /**
  * spider_net_prepare_tx_descr - fill tx descriptor with skb data
  * @card: card structure
- * @descr: descriptor structure to fill out
  * @skb: packet to use
  *
  * returns 0 on success, <0 on failure.
@@ -867,7 +866,6 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
 /**
  * spider_net_kick_tx_dma - enables TX DMA processing
  * @card: card structure
- * @descr: descriptor address to enable TX processing at
  *
  * This routine will start the transmit DMA running if
  * it is not already running. This routine ned only be
@@ -1637,7 +1635,6 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg,
  * spider_net_interrupt - interrupt handler for spider_net
  * @irq: interrupt number
  * @ptr: pointer to net_device
- * @regs: PU registers
  *
  * returns IRQ_HANDLED, if interrupt was for driver, or IRQ_NONE, if no
  * interrupt found raised by card.
@@ -2419,7 +2416,6 @@ spider_net_undo_pci_setup(struct spider_net_card *card)
 
 /**
  * spider_net_setup_pci_dev - sets up the device in terms of PCI operations
- * @card: card structure
  * @pdev: PCI device
  *
  * Returns the card structure or NULL if any errors occur
index 1d2ef8f47780904da79f621bf2ac09d284b50753..5a40f2d78beb1a9114478ac9e0385556c29d30bf 100644 (file)
@@ -1509,6 +1509,11 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                desc->status = 0;
                np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE;
        }
+
+       if (*quota == 0) {      /* out of rx quota */
+               retcode = 1;
+               goto out;
+       }
        writew(np->rx_done, np->base + CompletionQConsumerIdx);
 
  out:
index 4291458955ef7ac9ae1cf5201b3e72a998d61bde..fed7eba65ead6268e292eddc66c73905d8e263c7 100644 (file)
@@ -1142,6 +1142,70 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
        return NETDEV_TX_OK;
 }
 
+static void gem_pcs_reset(struct gem *gp)
+{
+       int limit;
+       u32 val;
+
+       /* Reset PCS unit. */
+       val = readl(gp->regs + PCS_MIICTRL);
+       val |= PCS_MIICTRL_RST;
+       writel(val, gp->regs + PCS_MIICTRL);
+
+       limit = 32;
+       while (readl(gp->regs + PCS_MIICTRL) & PCS_MIICTRL_RST) {
+               udelay(100);
+               if (limit-- <= 0)
+                       break;
+       }
+       if (limit <= 0)
+               printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
+                      gp->dev->name);
+}
+
+static void gem_pcs_reinit_adv(struct gem *gp)
+{
+       u32 val;
+
+       /* Make sure PCS is disabled while changing advertisement
+        * configuration.
+        */
+       val = readl(gp->regs + PCS_CFG);
+       val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
+       writel(val, gp->regs + PCS_CFG);
+
+       /* Advertise all capabilities except assymetric
+        * pause.
+        */
+       val = readl(gp->regs + PCS_MIIADV);
+       val |= (PCS_MIIADV_FD | PCS_MIIADV_HD |
+               PCS_MIIADV_SP | PCS_MIIADV_AP);
+       writel(val, gp->regs + PCS_MIIADV);
+
+       /* Enable and restart auto-negotiation, disable wrapback/loopback,
+        * and re-enable PCS.
+        */
+       val = readl(gp->regs + PCS_MIICTRL);
+       val |= (PCS_MIICTRL_RAN | PCS_MIICTRL_ANE);
+       val &= ~PCS_MIICTRL_WB;
+       writel(val, gp->regs + PCS_MIICTRL);
+
+       val = readl(gp->regs + PCS_CFG);
+       val |= PCS_CFG_ENABLE;
+       writel(val, gp->regs + PCS_CFG);
+
+       /* Make sure serialink loopback is off.  The meaning
+        * of this bit is logically inverted based upon whether
+        * you are in Serialink or SERDES mode.
+        */
+       val = readl(gp->regs + PCS_SCTRL);
+       if (gp->phy_type == phy_serialink)
+               val &= ~PCS_SCTRL_LOOP;
+       else
+               val |= PCS_SCTRL_LOOP;
+       writel(val, gp->regs + PCS_SCTRL);
+}
+
 #define STOP_TRIES 32
 
 /* Must be invoked under gp->lock and gp->tx_lock. */
@@ -1168,6 +1232,9 @@ static void gem_reset(struct gem *gp)
 
        if (limit <= 0)
                printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name);
+
+       if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes)
+               gem_pcs_reinit_adv(gp);
 }
 
 /* Must be invoked under gp->lock and gp->tx_lock. */
@@ -1324,7 +1391,7 @@ static int gem_set_link_modes(struct gem *gp)
                   gp->phy_type == phy_serdes) {
                u32 pcs_lpa = readl(gp->regs + PCS_MIILP);
 
-               if (pcs_lpa & PCS_MIIADV_FD)
+               if ((pcs_lpa & PCS_MIIADV_FD) || gp->phy_type == phy_serdes)
                        full_duplex = 1;
                speed = SPEED_1000;
        }
@@ -1488,6 +1555,9 @@ static void gem_link_timer(unsigned long data)
                        val = readl(gp->regs + PCS_MIISTAT);
 
                if ((val & PCS_MIISTAT_LS) != 0) {
+                       if (gp->lstate == link_up)
+                               goto restart;
+
                        gp->lstate = link_up;
                        netif_carrier_on(gp->dev);
                        (void)gem_set_link_modes(gp);
@@ -1708,61 +1778,8 @@ static void gem_init_phy(struct gem *gp)
                if (gp->phy_mii.def && gp->phy_mii.def->ops->init)
                        gp->phy_mii.def->ops->init(&gp->phy_mii);
        } else {
-               u32 val;
-               int limit;
-
-               /* Reset PCS unit. */
-               val = readl(gp->regs + PCS_MIICTRL);
-               val |= PCS_MIICTRL_RST;
-               writeb(val, gp->regs + PCS_MIICTRL);
-
-               limit = 32;
-               while (readl(gp->regs + PCS_MIICTRL) & PCS_MIICTRL_RST) {
-                       udelay(100);
-                       if (limit-- <= 0)
-                               break;
-               }
-               if (limit <= 0)
-                       printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
-                              gp->dev->name);
-
-               /* Make sure PCS is disabled while changing advertisement
-                * configuration.
-                */
-               val = readl(gp->regs + PCS_CFG);
-               val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
-               writel(val, gp->regs + PCS_CFG);
-
-               /* Advertise all capabilities except assymetric
-                * pause.
-                */
-               val = readl(gp->regs + PCS_MIIADV);
-               val |= (PCS_MIIADV_FD | PCS_MIIADV_HD |
-                       PCS_MIIADV_SP | PCS_MIIADV_AP);
-               writel(val, gp->regs + PCS_MIIADV);
-
-               /* Enable and restart auto-negotiation, disable wrapback/loopback,
-                * and re-enable PCS.
-                */
-               val = readl(gp->regs + PCS_MIICTRL);
-               val |= (PCS_MIICTRL_RAN | PCS_MIICTRL_ANE);
-               val &= ~PCS_MIICTRL_WB;
-               writel(val, gp->regs + PCS_MIICTRL);
-
-               val = readl(gp->regs + PCS_CFG);
-               val |= PCS_CFG_ENABLE;
-               writel(val, gp->regs + PCS_CFG);
-
-               /* Make sure serialink loopback is off.  The meaning
-                * of this bit is logically inverted based upon whether
-                * you are in Serialink or SERDES mode.
-                */
-               val = readl(gp->regs + PCS_SCTRL);
-               if (gp->phy_type == phy_serialink)
-                       val &= ~PCS_SCTRL_LOOP;
-               else
-                       val |= PCS_SCTRL_LOOP;
-               writel(val, gp->regs + PCS_SCTRL);
+               gem_pcs_reset(gp);
+               gem_pcs_reinit_adv(gp);
        }
 
        /* Default aneg parameters */
@@ -2680,6 +2697,21 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                cmd->speed = 0;
                cmd->duplex = cmd->port = cmd->phy_address =
                        cmd->transceiver = cmd->autoneg = 0;
+
+               /* serdes means usually a Fibre connector, with most fixed */
+               if (gp->phy_type == phy_serdes) {
+                       cmd->port = PORT_FIBRE;
+                       cmd->supported = (SUPPORTED_1000baseT_Half |
+                               SUPPORTED_1000baseT_Full |
+                               SUPPORTED_FIBRE | SUPPORTED_Autoneg |
+                               SUPPORTED_Pause | SUPPORTED_Asym_Pause);
+                       cmd->advertising = cmd->supported;
+                       cmd->transceiver = XCVR_INTERNAL;
+                       if (gp->lstate == link_up)
+                               cmd->speed = SPEED_1000;
+                       cmd->duplex = DUPLEX_FULL;
+                       cmd->autoneg = 1;
+               }
        }
        cmd->maxtxpkt = cmd->maxrxpkt = 0;
 
index c41d68761364550ebe2d2d8376f2a8c293b5d799..e60498232b94f83dede6c6d4ae153d8d135d7b19 100644 (file)
@@ -1098,6 +1098,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
        dma_addr_t      tail_list_phys;
        u8              *tail_buffer;
        unsigned long   flags;
+       unsigned int    txlen;
 
        if ( ! priv->phyOnline ) {
                TLAN_DBG( TLAN_DEBUG_TX, "TRANSMIT:  %s PHY is not ready\n",
@@ -1108,6 +1109,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
 
        if (skb_padto(skb, TLAN_MIN_FRAME_SIZE))
                return 0;
+       txlen = max(skb->len, (unsigned int)TLAN_MIN_FRAME_SIZE);
 
        tail_list = priv->txList + priv->txTail;
        tail_list_phys = priv->txListDMA + sizeof(TLanList) * priv->txTail;
@@ -1125,16 +1127,16 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
 
        if ( bbuf ) {
                tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE );
-               skb_copy_from_linear_data(skb, tail_buffer, skb->len);
+               skb_copy_from_linear_data(skb, tail_buffer, txlen);
        } else {
                tail_list->buffer[0].address = pci_map_single(priv->pciDev,
-                                                             skb->data, skb->len,
+                                                             skb->data, txlen,
                                                              PCI_DMA_TODEVICE);
                TLan_StoreSKB(tail_list, skb);
        }
 
-       tail_list->frameSize = (u16) skb->len;
-       tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) skb->len;
+       tail_list->frameSize = (u16) txlen;
+       tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) txlen;
        tail_list->buffer[1].count = 0;
        tail_list->buffer[1].address = 0;
 
@@ -1431,7 +1433,9 @@ static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
                if ( ! bbuf ) {
                        struct sk_buff *skb = TLan_GetSKB(head_list);
                        pci_unmap_single(priv->pciDev, head_list->buffer[0].address,
-                                        skb->len, PCI_DMA_TODEVICE);
+                                        max(skb->len,
+                                            (unsigned int)TLAN_MIN_FRAME_SIZE),
+                                        PCI_DMA_TODEVICE);
                        dev_kfree_skb_any(skb);
                        head_list->buffer[8].address = 0;
                        head_list->buffer[9].address = 0;
@@ -2055,9 +2059,12 @@ static void TLan_FreeLists( struct net_device *dev )
                        list = priv->txList + i;
                        skb = TLan_GetSKB(list);
                        if ( skb ) {
-                               pci_unmap_single(priv->pciDev,
-                                                list->buffer[0].address, skb->len,
-                                                PCI_DMA_TODEVICE);
+                               pci_unmap_single(
+                                       priv->pciDev,
+                                       list->buffer[0].address,
+                                       max(skb->len,
+                                           (unsigned int)TLAN_MIN_FRAME_SIZE),
+                                       PCI_DMA_TODEVICE);
                                dev_kfree_skb_any( skb );
                                list->buffer[8].address = 0;
                                list->buffer[9].address = 0;
index cfd4d052d666ea8cbda45b37c541cb2592dad3a0..2d14255eb103d60096256eee89c78bbfe68f8550 100644 (file)
@@ -240,6 +240,10 @@ static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
 static void ath5k_reset_tsf(struct ieee80211_hw *hw);
 static int ath5k_beacon_update(struct ieee80211_hw *hw,
                struct sk_buff *skb);
+static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
+               struct ieee80211_vif *vif,
+               struct ieee80211_bss_conf *bss_conf,
+               u32 changes);
 
 static struct ieee80211_ops ath5k_hw_ops = {
        .tx             = ath5k_tx,
@@ -256,6 +260,7 @@ static struct ieee80211_ops ath5k_hw_ops = {
        .get_tx_stats   = ath5k_get_tx_stats,
        .get_tsf        = ath5k_get_tsf,
        .reset_tsf      = ath5k_reset_tsf,
+       .bss_info_changed = ath5k_bss_info_changed,
 };
 
 /*
@@ -2942,7 +2947,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
                sc->opmode != NL80211_IFTYPE_MESH_POINT &&
                test_bit(ATH_STAT_PROMISC, sc->status))
                rfilt |= AR5K_RX_FILTER_PROM;
-       if (sc->opmode == NL80211_IFTYPE_STATION ||
+       if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) ||
                sc->opmode == NL80211_IFTYPE_ADHOC) {
                rfilt |= AR5K_RX_FILTER_BEACON;
        }
@@ -3083,4 +3088,32 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
 end:
        return ret;
 }
+static void
+set_beacon_filter(struct ieee80211_hw *hw, bool enable)
+{
+       struct ath5k_softc *sc = hw->priv;
+       struct ath5k_hw *ah = sc->ah;
+       u32 rfilt;
+       rfilt = ath5k_hw_get_rx_filter(ah);
+       if (enable)
+               rfilt |= AR5K_RX_FILTER_BEACON;
+       else
+               rfilt &= ~AR5K_RX_FILTER_BEACON;
+       ath5k_hw_set_rx_filter(ah, rfilt);
+       sc->filter_flags = rfilt;
+}
 
+static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
+                                   struct ieee80211_vif *vif,
+                                   struct ieee80211_bss_conf *bss_conf,
+                                   u32 changes)
+{
+       struct ath5k_softc *sc = hw->priv;
+       if (changes & BSS_CHANGED_ASSOC) {
+               mutex_lock(&sc->lock);
+               sc->assoc = bss_conf->assoc;
+               if (sc->opmode == NL80211_IFTYPE_STATION)
+                       set_beacon_filter(hw, sc->assoc);
+               mutex_unlock(&sc->lock);
+       }
+}
index 06d1054ca94b9cc525ee4f9516c5363b26d39fa2..facc60ddada2824ceba476c8efcda1a66a398a1d 100644 (file)
@@ -179,6 +179,7 @@ struct ath5k_softc {
 
        struct timer_list       calib_tim;      /* calibration timer */
        int                     power_level;    /* Requested tx power in dbm */
+       bool                    assoc;          /* assocate state */
 };
 
 #define ath5k_hw_hasbssidmask(_ah) \
index 19980cbd5d5fe6292367733c9423faffe735aaae..ccaeb5c219d2ddda8ea8e7f160a8f9a472c8c89a 100644 (file)
@@ -417,19 +417,19 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
        sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
                                ath5k_global_debugfs);
 
-       sc->debug.debugfs_debug = debugfs_create_file("debug", 0666,
+       sc->debug.debugfs_debug = debugfs_create_file("debug", S_IWUSR | S_IRUGO,
                                sc->debug.debugfs_phydir, sc, &fops_debug);
 
-       sc->debug.debugfs_registers = debugfs_create_file("registers", 0444,
+       sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO,
                                sc->debug.debugfs_phydir, sc, &fops_registers);
 
-       sc->debug.debugfs_tsf = debugfs_create_file("tsf", 0666,
+       sc->debug.debugfs_tsf = debugfs_create_file("tsf", S_IWUSR | S_IRUGO,
                                sc->debug.debugfs_phydir, sc, &fops_tsf);
 
-       sc->debug.debugfs_beacon = debugfs_create_file("beacon", 0666,
+       sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO,
                                sc->debug.debugfs_phydir, sc, &fops_beacon);
 
-       sc->debug.debugfs_reset = debugfs_create_file("reset", 0222,
+       sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR,
                                sc->debug.debugfs_phydir, sc, &fops_reset);
 }
 
index 9e15c30bbc065bcb0326ffee6860efda07242f64..4dd1c1bda0fb80958b16066d882d86c7219a3b3e 100644 (file)
@@ -170,7 +170,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
        skb = (struct sk_buff *)bf->bf_mpdu;
        if (skb) {
                pci_unmap_single(sc->pdev, bf->bf_dmacontext,
-                                skb_end_pointer(skb) - skb->head,
+                                skb->len,
                                 PCI_DMA_TODEVICE);
        }
 
@@ -193,7 +193,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
 
        bf->bf_buf_addr = bf->bf_dmacontext =
                pci_map_single(sc->pdev, skb->data,
-                              skb_end_pointer(skb) - skb->head,
+                              skb->len,
                               PCI_DMA_TODEVICE);
 
        skb = ieee80211_get_buffered_bc(sc->hw, avp->av_if_data);
@@ -352,7 +352,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
        if (bf->bf_mpdu != NULL) {
                skb = (struct sk_buff *)bf->bf_mpdu;
                pci_unmap_single(sc->pdev, bf->bf_dmacontext,
-                                skb_end_pointer(skb) - skb->head,
+                                skb->len,
                                 PCI_DMA_TODEVICE);
                dev_kfree_skb_any(skb);
                bf->bf_mpdu = NULL;
@@ -412,7 +412,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
 
        bf->bf_buf_addr = bf->bf_dmacontext =
                pci_map_single(sc->pdev, skb->data,
-                              skb_end_pointer(skb) - skb->head,
+                              skb->len,
                               PCI_DMA_TODEVICE);
        bf->bf_mpdu = skb;
 
@@ -439,7 +439,7 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp)
                if (bf->bf_mpdu != NULL) {
                        struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu;
                        pci_unmap_single(sc->pdev, bf->bf_dmacontext,
-                                        skb_end_pointer(skb) - skb->head,
+                                        skb->len,
                                         PCI_DMA_TODEVICE);
                        dev_kfree_skb_any(skb);
                        bf->bf_mpdu = NULL;
index 4983402af559871f8ed526480794235dfc37959e..504a0444d89f853672a4abd71886cc17e3068ff9 100644 (file)
@@ -49,10 +49,12 @@ static void ath_rx_buf_link(struct ath_softc *sc, struct ath_buf *bf)
        ASSERT(skb != NULL);
        ds->ds_vdata = skb->data;
 
-       /* setup rx descriptors */
+       /* setup rx descriptors. The sc_rxbufsize here tells the harware
+        * how much data it can DMA to us and that we are prepared
+        * to process */
        ath9k_hw_setuprxdesc(ah,
                             ds,
-                            skb_tailroom(skb),   /* buffer size */
+                            sc->sc_rxbufsize,
                             0);
 
        if (sc->sc_rxlink == NULL)
@@ -398,6 +400,13 @@ static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc,
         * in rx'd frames.
         */
 
+       /* Note: the kernel can allocate a value greater than
+        * what we ask it to give us. We really only need 4 KB as that
+        * is this hardware supports and in fact we need at least 3849
+        * as that is the MAX AMSDU size this hardware supports.
+        * Unfortunately this means we may get 8 KB here from the
+        * kernel... and that is actually what is observed on some
+        * systems :( */
        skb = dev_alloc_skb(len + sc->sc_cachelsz - 1);
        if (skb != NULL) {
                off = ((unsigned long) skb->data) % sc->sc_cachelsz;
@@ -456,7 +465,7 @@ static int ath_rx_indicate(struct ath_softc *sc,
        if (nskb != NULL) {
                bf->bf_mpdu = nskb;
                bf->bf_buf_addr = pci_map_single(sc->pdev, nskb->data,
-                                        skb_end_pointer(nskb) - nskb->head,
+                                        sc->sc_rxbufsize,
                                         PCI_DMA_FROMDEVICE);
                bf->bf_dmacontext = bf->bf_buf_addr;
                ATH_RX_CONTEXT(nskb)->ctx_rxbuf = bf;
@@ -542,7 +551,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
 
                        bf->bf_mpdu = skb;
                        bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data,
-                                        skb_end_pointer(skb) - skb->head,
+                                        sc->sc_rxbufsize,
                                         PCI_DMA_FROMDEVICE);
                        bf->bf_dmacontext = bf->bf_buf_addr;
                        ATH_RX_CONTEXT(skb)->ctx_rxbuf = bf;
@@ -1007,7 +1016,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
 
                pci_dma_sync_single_for_cpu(sc->pdev,
                                            bf->bf_buf_addr,
-                                           skb_tailroom(skb),
+                                           sc->sc_rxbufsize,
                                            PCI_DMA_FROMDEVICE);
                pci_unmap_single(sc->pdev,
                                 bf->bf_buf_addr,
index dcce3542d5a771d9eb24753d8d464854bb4e6639..7a9f901d4ff6dee5cf15ae78d0f9bb763344bdd7 100644 (file)
@@ -3897,6 +3897,7 @@ static int ipw_disassociate(void *data)
        if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)))
                return 0;
        ipw_send_disassociate(data, 0);
+       netif_carrier_off(priv->net_dev);
        return 1;
 }
 
@@ -10190,6 +10191,9 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
        u16 remaining_bytes;
        int fc;
 
+       if (!(priv->status & STATUS_ASSOCIATED))
+               goto drop;
+
        hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
        switch (priv->ieee->iw_mode) {
        case IW_MODE_ADHOC:
index 444c5cc05f03c671c2548a4f87ffef55c3c8f0d0..c4c0371c763b5d3b0e1ee13bfd1fcc1a386a6a6f 100644 (file)
@@ -1384,9 +1384,11 @@ void iwl_rx_handle(struct iwl_priv *priv)
 
                rxq->queue[i] = NULL;
 
-               pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr,
-                                           priv->hw_params.rx_buf_size,
-                                           PCI_DMA_FROMDEVICE);
+               dma_sync_single_range_for_cpu(
+                               &priv->pci_dev->dev, rxb->real_dma_addr,
+                               rxb->aligned_dma_addr - rxb->real_dma_addr,
+                               priv->hw_params.rx_buf_size,
+                               PCI_DMA_FROMDEVICE);
                pkt = (struct iwl_rx_packet *)rxb->skb->data;
 
                /* Reclaim a command buffer only if this packet is a response
index 4c312c55f90cf49838af8954e0e891a0893af99c..01a84585133834a45c603a0c55763b7864441181 100644 (file)
@@ -290,6 +290,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv)
        priv->num_stations = 0;
        memset(priv->stations, 0, sizeof(priv->stations));
 
+       /* clean ucode key table bit map */
+       priv->ucode_key_table = 0;
+
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 }
 EXPORT_SYMBOL(iwl_clear_stations_table);
index 61797f3f8d5c9a475b85d7fb980fe6a16dbb804a..26f7084d3011b7f8f514a4e23090ddfce33ca62c 100644 (file)
@@ -475,7 +475,7 @@ static int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
                if (!test_and_set_bit(i, &priv->ucode_key_table))
                        return i;
 
-       return -1;
+       return WEP_INVALID_OFFSET;
 }
 
 int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)
@@ -620,6 +620,9 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        priv->stations[sta_id].sta.key.key_flags = key_flags;
        priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
        priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
@@ -637,6 +640,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
 {
        unsigned long flags;
        __le16 key_flags = 0;
+       int ret;
 
        key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);
        key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
@@ -664,14 +668,18 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        priv->stations[sta_id].sta.key.key_flags = key_flags;
        priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
        priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
 
+       ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
+
        spin_unlock_irqrestore(&priv->sta_lock, flags);
 
-       IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");
-       return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
+       return ret;
 }
 
 static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
@@ -696,6 +704,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
        /* else, we are overriding an existing key => no need to allocated room
         * in uCode. */
 
+       WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
+               "no space for new kew");
+
        /* This copy is acutally not needed: we get the key with each TX */
        memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
 
@@ -734,6 +745,13 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
                return 0;
        }
 
+       if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) {
+               IWL_WARNING("Removing wrong key %d 0x%x\n",
+                           keyconf->keyidx, key_flags);
+               spin_unlock_irqrestore(&priv->sta_lock, flags);
+               return 0;
+       }
+
        if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset,
                &priv->ucode_key_table))
                IWL_ERROR("index %d not used in uCode key table.\n",
index fe1867b25ff7fb522e57927dfa6180f5f0f177bb..cac732f4047f524b3b575a1e86dbee1d7fd68644 100644 (file)
@@ -615,7 +615,7 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
                struct ieee80211_hdr *tx_hdr;
 
                tx_hdr = (struct ieee80211_hdr *)skb->data;
-               if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1)))
+               if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN)))
                {
                        __skb_unlink(skb, q);
                        tx_status(hw, skb, IEEE80211_TX_STAT_ACK, stats->signal, 1);
index f9e244da30aef9ea9e170c5cce58a524ab5f87a6..9bcb6cbd5aa93988e39bdf2b8c9285512d74df22 100644 (file)
@@ -113,7 +113,7 @@ struct acpiphp_slot {
 
        u8              device;         /* pci device# */
 
-       u32             sun;            /* ACPI _SUN (slot unique number) */
+       unsigned long long sun;         /* ACPI _SUN (slot unique number) */
        u32             flags;          /* see below */
 };
 
index 95b536a23d25d8d9f76d5aa757a411540017fef0..43c10bd261b48612b4ec2fa2620fa14207628805 100644 (file)
@@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
        slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
 
        acpiphp_slot->slot = slot;
-       snprintf(name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun);
+       snprintf(name, SLOT_NAME_SIZE, "%llu", slot->acpi_slot->sun);
 
        retval = pci_hp_register(slot->hotplug_slot,
                                        acpiphp_slot->bridge->pci_bus,
index 955aae4071f7a64eeb5cb716aaacf8ebb26c7a11..3affc6472e65253c94b77bcc8aa97061480b85d7 100644 (file)
@@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
 
                bridge->nr_slots++;
 
-               dbg("found ACPI PCI Hotplug slot %d at PCI %04x:%02x:%02x\n",
+               dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
                                slot->sun, pci_domain_nr(bridge->pci_bus),
                                bridge->pci_bus->number, slot->device);
                retval = acpiphp_register_hotplug_slot(slot);
                if (retval) {
                        if (retval == -EBUSY)
-                               warn("Slot %d already registered by another "
+                               warn("Slot %llu already registered by another "
                                        "hotplug driver\n", slot->sun);
                        else
                                warn("acpiphp_register_hotplug_slot failed "
index c892daae74d6dc325a77dc9050c0f6cd8a5105c8..633e743442ac711d0b02d6b85a8252a1ee74dbb5 100644 (file)
@@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void)
                goto error;
        }
 
-       /* lock ourselves into memory with a module 
-        * count of -1 so that no one can unload us. */
-       module_put(THIS_MODULE);
-
 exit:
        return rc;
 
@@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void)
 }
 
 module_init(ibmphp_init);
-module_exit(ibmphp_exit);
index 4b23bc39b11e513be82a54df9f01db2b268b5bb4..39cf248d24e3cd0592b61dee392f748e441301c0 100644 (file)
@@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
                goto err_out_release_ctlr;
        }
 
+       /* Check if slot is occupied */
        t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
-
-       t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
-       if (value && pciehp_force) {
-               rc = pciehp_enable_slot(t_slot);
-               if (rc) /* -ENODEV: shouldn't happen, but deal with it */
-                       value = 0;
-       }
-       if ((POWER_CTRL(ctrl)) && !value) {
-               rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
-               if (rc)
-                       goto err_out_free_ctrl_slot;
+       t_slot->hpc_ops->get_adapter_status(t_slot, &value);
+       if (value) {
+               if (pciehp_force)
+                       pciehp_enable_slot(t_slot);
+       } else {
+               /* Power off slot if not occupied */
+               if (POWER_CTRL(ctrl)) {
+                       rc = t_slot->hpc_ops->power_off_slot(t_slot);
+                       if (rc)
+                               goto err_out_free_ctrl_slot;
+               }
        }
 
        return 0;
index dfc63d01f20a0a7c072f9a65039f2776537b3e8e..aac7006949f15c9eb52b56968a4dca6ef812e3c2 100644 (file)
@@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data)
 
        if (!dev->driver ||
                !dev->driver->err_handler ||
-               !dev->driver->err_handler->slot_reset)
+               !dev->driver->err_handler->resume)
                return;
 
        err_handler = dev->driver->err_handler;
index 8f63f4c6b85f64e3f4d91d76ca7da90ac142c51e..9aad608bcf3fb947dac183a2153312a6ce5db962 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/pm.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/pci-aspm.h>
 #include "../pci.h"
 
@@ -161,11 +162,12 @@ static void pcie_check_clock_pm(struct pci_dev *pdev)
  */
 static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
 {
-       int pos, child_pos;
+       int pos, child_pos, i = 0;
        u16 reg16 = 0;
        struct pci_dev *child_dev;
        int same_clock = 1;
-
+       unsigned long start_jiffies;
+       u16 child_regs[8], parent_reg;
        /*
         * all functions of a slot should have the same Slot Clock
         * Configuration, so just check one function
@@ -191,16 +193,19 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
                child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
                pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
                        &reg16);
+               child_regs[i] = reg16;
                if (same_clock)
                        reg16 |= PCI_EXP_LNKCTL_CCC;
                else
                        reg16 &= ~PCI_EXP_LNKCTL_CCC;
                pci_write_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
                        reg16);
+               i++;
        }
 
        /* Configure upstream component */
        pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
+       parent_reg = reg16;
        if (same_clock)
                reg16 |= PCI_EXP_LNKCTL_CCC;
        else
@@ -212,12 +217,30 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
        pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
 
        /* Wait for link training end */
-       while (1) {
+       /* break out after waiting for 1 second */
+       start_jiffies = jiffies;
+       while ((jiffies - start_jiffies) < HZ) {
                pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, &reg16);
                if (!(reg16 & PCI_EXP_LNKSTA_LT))
                        break;
                cpu_relax();
        }
+       /* training failed -> recover */
+       if ((jiffies - start_jiffies) >= HZ) {
+               dev_printk (KERN_ERR, &pdev->dev, "ASPM: Could not configure"
+                           " common clock\n");
+               i = 0;
+               list_for_each_entry(child_dev, &pdev->subordinate->devices,
+                                   bus_list) {
+                       child_pos = pci_find_capability(child_dev,
+                                                       PCI_CAP_ID_EXP);
+                       pci_write_config_word(child_dev,
+                                             child_pos + PCI_EXP_LNKCTL,
+                                             child_regs[i]);
+                       i++;
+               }
+               pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, parent_reg);
+       }
 }
 
 /*
index 5049a47030ac9ec0ca84c82ee2f7fb39854602c6..5f4f85f56cb7c7b592f4583f61f7a0d0657ea9d7 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/kallsyms.h>
+#include <linux/dmi.h>
 #include "pci.h"
 
 int isa_dma_bridge_buggy;
@@ -1828,6 +1829,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
                         PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
                         ht_enable_msi_mapping);
 
+/* The P5N32-SLI Premium motherboard from Asus has a problem with msi
+ * for the MCP55 NIC. It is not yet determined whether the msi problem
+ * also affects other devices. As for now, turn off msi for this device.
+ */
+static void __devinit nvenet_msi_disable(struct pci_dev *dev)
+{
+       if (dmi_name_in_vendors("P5N32-SLI PREMIUM")) {
+               dev_info(&dev->dev,
+                        "Disabling msi for MCP55 NIC on P5N32-SLI Premium\n");
+               dev->no_msi = 1;
+       }
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA,
+                       PCI_DEVICE_ID_NVIDIA_NVENET_15,
+                       nvenet_msi_disable);
+
 static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
 {
        struct pci_dev *host_bridge;
index 4dd1c3e157aec6d6c136c02255faed19d46c3dc1..5a8ccb4f604deed50495b61ced5ba403e59e9484 100644 (file)
@@ -253,6 +253,7 @@ placeholder:
                 __func__, pci_domain_nr(parent), parent->number, slot_nr);
 
 out:
+       kfree(slot_name);
        up_write(&pci_bus_sem);
        return slot;
 err:
index bb7338863fb9aabeedfbb941b59f026176919673..b59d4115d20f541e5176ba309cb694687c1c1d17 100644 (file)
@@ -334,6 +334,6 @@ static void __exit bfin_cf_exit(void)
 module_init(bfin_cf_init);
 module_exit(bfin_cf_exit);
 
-MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>")
+MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("BFIN CF/PCMCIA Driver");
 MODULE_LICENSE("GPL");
index 341d7a5b45a28c3ecab9de39f9c0e515e5ac4331..4e91419e8911c50bcfbc18aa1d536e88c41178c0 100644 (file)
@@ -209,12 +209,18 @@ static int ds1672_probe(struct i2c_client *client,
        return err;
 }
 
+static struct i2c_device_id ds1672_id[] = {
+       { "ds1672", 0 },
+       { }
+};
+
 static struct i2c_driver ds1672_driver = {
        .driver = {
                   .name = "rtc-ds1672",
                   },
        .probe = &ds1672_probe,
        .remove = &ds1672_remove,
+       .id_table = ds1672_id,
 };
 
 static int __init ds1672_init(void)
index 2cd77ab8fc66b06e43d3b908884a9f4fe8603ca1..054e05294af8566e30d3834fc23c793b615239f9 100644 (file)
@@ -328,6 +328,13 @@ isl1208_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
        int sr;
        u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
 
+       /* The clock has an 8 bit wide bcd-coded register (they never learn)
+        * for the year. tm_year is an offset from 1900 and we are interested
+        * in the 2000-2099 range, so any value less than 100 is invalid.
+        */
+       if (tm->tm_year < 100)
+               return -EINVAL;
+
        regs[ISL1208_REG_SC] = bin2bcd(tm->tm_sec);
        regs[ISL1208_REG_MN] = bin2bcd(tm->tm_min);
        regs[ISL1208_REG_HR] = bin2bcd(tm->tm_hour) | ISL1208_REG_HR_MIL;
index 80782798763fa2528993ed652b0cf337e9d79008..a4f6665ab3c56760bbf72f63e05649d69dda3a03 100644 (file)
@@ -247,12 +247,18 @@ max6900_probe(struct i2c_client *client, const struct i2c_device_id *id)
        return 0;
 }
 
+static struct i2c_device_id max6900_id[] = {
+       { "max6900", 0 },
+       { }
+};
+
 static struct i2c_driver max6900_driver = {
        .driver = {
                   .name = "rtc-max6900",
                   },
        .probe = max6900_probe,
        .remove = max6900_remove,
+       .id_table = max6900_id,
 };
 
 static int __init max6900_init(void)
index 7ccb0dd700af250946f3ad160ddf9237a2c88ca2..5be98bfd7ed3ec6149b89bd6df1a268d52748776 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/time.h>
 #include <linux/rtc.h>
 #include <linux/platform_device.h>
 
@@ -16,11 +15,6 @@ MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");
 MODULE_DESCRIPTION("Starfire RTC driver");
 MODULE_LICENSE("GPL");
 
-struct starfire_rtc {
-       struct rtc_device       *rtc;
-       spinlock_t              lock;
-};
-
 static u32 starfire_get_time(void)
 {
        static char obp_gettod[32];
@@ -35,64 +29,31 @@ static u32 starfire_get_time(void)
 
 static int starfire_read_time(struct device *dev, struct rtc_time *tm)
 {
-       struct starfire_rtc *p = dev_get_drvdata(dev);
-       unsigned long flags, secs;
-
-       spin_lock_irqsave(&p->lock, flags);
-       secs = starfire_get_time();
-       spin_unlock_irqrestore(&p->lock, flags);
-
-       rtc_time_to_tm(secs, tm);
-
-       return 0;
-}
-
-static int starfire_set_time(struct device *dev, struct rtc_time *tm)
-{
-       unsigned long secs;
-       int err;
-
-       err = rtc_tm_to_time(tm, &secs);
-       if (err)
-               return err;
-
-       /* Do nothing, time is set using the service processor
-        * console on this platform.
-        */
-       return 0;
+       rtc_time_to_tm(starfire_get_time(), tm);
+       return rtc_valid_tm(tm);
 }
 
 static const struct rtc_class_ops starfire_rtc_ops = {
        .read_time      = starfire_read_time,
-       .set_time       = starfire_set_time,
 };
 
-static int __devinit starfire_rtc_probe(struct platform_device *pdev)
+static int __init starfire_rtc_probe(struct platform_device *pdev)
 {
-       struct starfire_rtc *p = kzalloc(sizeof(*p), GFP_KERNEL);
-
-       if (!p)
-               return -ENOMEM;
+       struct rtc_device *rtc = rtc_device_register("starfire", &pdev->dev,
+                                    &starfire_rtc_ops, THIS_MODULE);
+       if (IS_ERR(rtc))
+               return PTR_ERR(rtc);
 
-       spin_lock_init(&p->lock);
+       platform_set_drvdata(pdev, rtc);
 
-       p->rtc = rtc_device_register("starfire", &pdev->dev,
-                                    &starfire_rtc_ops, THIS_MODULE);
-       if (IS_ERR(p->rtc)) {
-               int err = PTR_ERR(p->rtc);
-               kfree(p);
-               return err;
-       }
-       platform_set_drvdata(pdev, p);
        return 0;
 }
 
-static int __devexit starfire_rtc_remove(struct platform_device *pdev)
+static int __exit starfire_rtc_remove(struct platform_device *pdev)
 {
-       struct starfire_rtc *p = platform_get_drvdata(pdev);
+       struct rtc_device *rtc = platform_get_drvdata(pdev);
 
-       rtc_device_unregister(p->rtc);
-       kfree(p);
+       rtc_device_unregister(rtc);
 
        return 0;
 }
@@ -102,13 +63,12 @@ static struct platform_driver starfire_rtc_driver = {
                .name   = "rtc-starfire",
                .owner  = THIS_MODULE,
        },
-       .probe          = starfire_rtc_probe,
-       .remove         = __devexit_p(starfire_rtc_remove),
+       .remove         = __exit_p(starfire_rtc_remove),
 };
 
 static int __init starfire_rtc_init(void)
 {
-       return platform_driver_register(&starfire_rtc_driver);
+       return platform_driver_probe(&starfire_rtc_driver, starfire_rtc_probe);
 }
 
 static void __exit starfire_rtc_exit(void)
index abe87a4d266520d67976ac7f7620cbdfe07446c2..01d8da9afdc8506f0469a3b8a8c6284b98a235fe 100644 (file)
@@ -337,7 +337,7 @@ static int twl4030_rtc_ioctl(struct device *dev, unsigned int cmd,
 }
 
 #else
-#define        omap_rtc_ioctl  NULL
+#define        twl4030_rtc_ioctl       NULL
 #endif
 
 static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc)
index 35364f64da7ff27ce7c740f3bde2a121df3d8556..c557ba34e1aab5b2c5b7d732e9e076620e9dcc94 100644 (file)
@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act,
                goto failed_openfcp;
 
        atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status);
-       schedule_work(&act->adapter->scan_work);
 
        return ZFCP_ERP_SUCCEEDED;
 
@@ -1186,7 +1185,9 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
                container_of(work, struct zfcp_erp_add_work, work);
        struct zfcp_unit *unit = p->unit;
        struct fc_rport *rport = unit->port->rport;
-       scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
+
+       if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
+               scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
                         scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
        atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
        zfcp_unit_put(unit);
@@ -1282,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
        case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
                if (result != ZFCP_ERP_SUCCEEDED)
                        zfcp_erp_rports_del(adapter);
+               else
+                       schedule_work(&adapter->scan_work);
                zfcp_adapter_put(adapter);
                break;
        }
index 1a7c80a77ff582cf90ed2cf3677a88a50c7ca4a3..8aab3091a7b1045488887b352e4eebcecf23a21c 100644 (file)
@@ -50,7 +50,8 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port)
        if (mutex_lock_interruptible(&wka_port->mutex))
                return -ERESTARTSYS;
 
-       if (wka_port->status != ZFCP_WKA_PORT_ONLINE) {
+       if (wka_port->status == ZFCP_WKA_PORT_OFFLINE ||
+           wka_port->status == ZFCP_WKA_PORT_CLOSING) {
                wka_port->status = ZFCP_WKA_PORT_OPENING;
                if (zfcp_fsf_open_wka_port(wka_port))
                        wka_port->status = ZFCP_WKA_PORT_OFFLINE;
@@ -125,8 +126,7 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
 
        read_lock_irqsave(&zfcp_data.config_lock, flags);
        list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) {
-               /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */
-               if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_DID_DID))
+               if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_PHYS_OPEN))
                        /* Try to connect to unused ports anyway. */
                        zfcp_erp_port_reopen(port,
                                             ZFCP_STATUS_COMMON_ERP_FAILED,
@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
        int ret, i;
        struct zfcp_gpn_ft *gpn_ft;
 
-       zfcp_erp_wait(adapter); /* wait until adapter is finished with ERP */
        if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
                return 0;
 
index d024442ee128d9ee04ec44c5fe6b43e9ec099959..dc0367690405e864538d33b0d96f088b0047e80a 100644 (file)
@@ -930,8 +930,10 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id,
                goto out;
        req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND,
                                  req_flags, adapter->pool.fsf_req_abort);
-       if (IS_ERR(req))
+       if (IS_ERR(req)) {
+               req = NULL;
                goto out;
+       }
 
        if (unlikely(!(atomic_read(&unit->status) &
                       ZFCP_STATUS_COMMON_UNBLOCKED)))
@@ -1584,6 +1586,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
                wka_port->status = ZFCP_WKA_PORT_OFFLINE;
                break;
        case FSF_PORT_ALREADY_OPEN:
+               break;
        case FSF_GOOD:
                wka_port->handle = header->port_handle;
                wka_port->status = ZFCP_WKA_PORT_ONLINE;
@@ -2113,18 +2116,21 @@ static inline void zfcp_fsf_trace_latency(struct zfcp_fsf_req *fsf_req)
 
 static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
 {
-       struct scsi_cmnd *scpnt = req->data;
+       struct scsi_cmnd *scpnt;
        struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *)
            &(req->qtcb->bottom.io.fcp_rsp);
        u32 sns_len;
        char *fcp_rsp_info = (unsigned char *) &fcp_rsp_iu[1];
        unsigned long flags;
 
-       if (unlikely(!scpnt))
-               return;
-
        read_lock_irqsave(&req->adapter->abort_lock, flags);
 
+       scpnt = req->data;
+       if (unlikely(!scpnt)) {
+               read_unlock_irqrestore(&req->adapter->abort_lock, flags);
+               return;
+       }
+
        if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {
                set_host_byte(scpnt, DID_SOFT_ERROR);
                set_driver_byte(scpnt, SUGGEST_RETRY);
@@ -2442,8 +2448,10 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter,
                goto out;
        req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
                                  adapter->pool.fsf_req_scsi);
-       if (IS_ERR(req))
+       if (IS_ERR(req)) {
+               req = NULL;
                goto out;
+       }
 
        req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT;
        req->data = unit;
index e46fd3e9f68fb85ff3dc9899e454772b5bb33a39..468c880f8b6d6db3df67ff382855886e2b056a4a 100644 (file)
@@ -88,7 +88,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
        ret = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, 0,
                                             ZFCP_REQ_AUTO_CLEANUP);
        if (unlikely(ret == -EBUSY))
-               zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT);
+               return SCSI_MLQUEUE_DEVICE_BUSY;
        else if (unlikely(ret < 0))
                return SCSI_MLQUEUE_HOST_BUSY;
 
index 9aa301c1ed07ac5275ceae2635bdbf8c4ecb650e..94acbeed4e7cfe7bc59ebc8003fdd7ae96e66ec4 100644 (file)
@@ -175,8 +175,8 @@ static struct aac_driver_ident aac_drivers[] = {
        { aac_rx_init, "percraid", "DELL    ", "PERCRAID        ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* PERC 3/Di (Boxster/PERC3DiB) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "catapult        ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* catapult */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "tomcat          ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* tomcat */
-       { aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* Adaptec 2120S (Crusader) */
-       { aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* Adaptec 2200S (Vulcan) */
+       { aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2120S   ", 1, AAC_QUIRK_31BIT | AAC_QUIRK_34SG },                     /* Adaptec 2120S (Crusader) */
+       { aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG },                     /* Adaptec 2200S (Vulcan) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "Adaptec 2200S   ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* Adaptec 2200S (Vulcan-2m) */
        { aac_rx_init, "aacraid",  "Legend  ", "Legend S220     ", 1, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* Legend S220 (Legend Crusader) */
        { aac_rx_init, "aacraid",  "Legend  ", "Legend S230     ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG | AAC_QUIRK_SCSI_32 }, /* Legend S230 (Legend Vulcan) */
@@ -427,8 +427,8 @@ static int aac_slave_configure(struct scsi_device *sdev)
                 * Firmware has an individual device recovery time typically
                 * of 35 seconds, give us a margin.
                 */
-               if (sdev->timeout < (45 * HZ))
-                       sdev->timeout = 45 * HZ;
+               if (sdev->request_queue->rq_timeout < (45 * HZ))
+                       blk_queue_rq_timeout(sdev->request_queue, 45*HZ);
                for (cid = 0; cid < aac->maximum_num_containers; ++cid)
                        if (aac->fsa_dev[cid].valid)
                                ++num_lsu;
index 9aec4ca64e56cf3f06f102b4860691ce94c12c94..f7da7530875e732a0b8155aa6887f8626ed8decf 100644 (file)
@@ -107,6 +107,7 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
        struct request *req;
        int ret;
 
+retry:
        req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
        if (!req)
                return SCSI_DH_RES_TEMP_UNAVAIL;
@@ -121,7 +122,6 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
        memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE);
        req->sense_len = 0;
 
-retry:
        ret = blk_execute_rq(req->q, NULL, req, 1);
        if (ret == -EIO) {
                if (req->sense_len > 0) {
@@ -136,8 +136,10 @@ retry:
                h->path_state = HP_SW_PATH_ACTIVE;
                ret = SCSI_DH_OK;
        }
-       if (ret == SCSI_DH_IMM_RETRY)
+       if (ret == SCSI_DH_IMM_RETRY) {
+               blk_put_request(req);
                goto retry;
+       }
        if (ret == SCSI_DH_DEV_OFFLINED) {
                h->path_state = HP_SW_PATH_PASSIVE;
                ret = SCSI_DH_OK;
@@ -200,6 +202,7 @@ static int hp_sw_start_stop(struct scsi_device *sdev, struct hp_sw_dh_data *h)
        struct request *req;
        int ret, retry;
 
+retry:
        req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
        if (!req)
                return SCSI_DH_RES_TEMP_UNAVAIL;
@@ -216,7 +219,6 @@ static int hp_sw_start_stop(struct scsi_device *sdev, struct hp_sw_dh_data *h)
        req->sense_len = 0;
        retry = h->retries;
 
-retry:
        ret = blk_execute_rq(req->q, NULL, req, 1);
        if (ret == -EIO) {
                if (req->sense_len > 0) {
@@ -231,8 +233,10 @@ retry:
                ret = SCSI_DH_OK;
 
        if (ret == SCSI_DH_RETRY) {
-               if (--retry)
+               if (--retry) {
+                       blk_put_request(req);
                        goto retry;
+               }
                ret = SCSI_DH_IO;
        }
 
index 87e09f35d3d4cb2bb50de263098d0a4c9ea2b66b..6cad1758243a5872a63e53eeea9b7a05b6d86507 100644 (file)
@@ -1442,7 +1442,7 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev)
        spin_lock_irqsave(shost->host_lock, lock_flags);
        if (sdev->type == TYPE_DISK) {
                sdev->allow_restart = 1;
-               sdev->timeout = 60 * HZ;
+               blk_queue_rq_timeout(sdev->request_queue, 60 * HZ);
        }
        scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
        spin_unlock_irqrestore(shost->host_lock, lock_flags);
index 2a5b29d12172e4a72bb774453d2662b7d29192ee..e2dd6a45924a5f598f6dafa05eff545b2aa5292b 100644 (file)
@@ -864,21 +864,23 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
 
        INIT_WORK(&vport->crq_work, handle_crq);
 
-       err = crq_queue_create(&vport->crq_queue, target);
+       err = scsi_add_host(shost, target->dev);
        if (err)
                goto free_srp_target;
 
-       err = scsi_add_host(shost, target->dev);
+       err = scsi_tgt_alloc_queue(shost);
        if (err)
-               goto destroy_queue;
+               goto remove_host;
 
-       err = scsi_tgt_alloc_queue(shost);
+       err = crq_queue_create(&vport->crq_queue, target);
        if (err)
-               goto destroy_queue;
+               goto free_queue;
 
        return 0;
-destroy_queue:
-       crq_queue_destroy(target);
+free_queue:
+       scsi_tgt_free_queue(shost);
+remove_host:
+       scsi_remove_host(shost);
 free_srp_target:
        srp_target_free(target);
 put_host:
index 801c7cf54d2ebb29b209fbd692eb7c807514fdc6..3fdee7370cccd235d9ad37aa8482c29cac715b7a 100644 (file)
@@ -489,12 +489,6 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
                if (!__kfifo_get(session->cmdpool.queue,
                                 (void*)&task, sizeof(void*)))
                        return NULL;
-
-               if ((hdr->opcode == (ISCSI_OP_NOOP_OUT | ISCSI_OP_IMMEDIATE)) &&
-                    hdr->ttt == RESERVED_ITT) {
-                       conn->ping_task = task;
-                       conn->last_ping = jiffies;
-               }
        }
        /*
         * released in complete pdu for task we expect a response for, and
@@ -703,6 +697,11 @@ static void iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
        task = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)&hdr, NULL, 0);
        if (!task)
                iscsi_conn_printk(KERN_ERR, conn, "Could not send nopout\n");
+       else if (!rhdr) {
+               /* only track our nops */
+               conn->ping_task = task;
+               conn->last_ping = jiffies;
+       }
 }
 
 static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
index a454f94623d73348491ccc603070cc55e0866edd..17ce7abe17ee02f7ea47055d296f95917b6e1b92 100644 (file)
@@ -1016,7 +1016,8 @@ static int megasas_slave_configure(struct scsi_device *sdev)
         * The RAID firmware may require extended timeouts.
         */
        if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS)
-               sdev->timeout = MEGASAS_DEFAULT_CMD_TIMEOUT * HZ;
+               blk_queue_rq_timeout(sdev->request_queue,
+                                    MEGASAS_DEFAULT_CMD_TIMEOUT * HZ);
        return 0;
 }
 
index 386361778ebb32d859c6770971329f46d55ae23e..edfaf241c5ba1dca4e3f3b0a75e8b2a6d4bee89f 100644 (file)
@@ -932,8 +932,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
                int i, rtn = NEEDS_RETRY;
 
                for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
-                       rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
-                                               scmd->device->timeout, 0);
+                       rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
 
                if (rtn == SUCCESS)
                        return 0;
index f5d3b96890dc6d9dd180eb86bb0f2b737a60e7f1..148d3af92aefad04fa42c48780ba4138e8033e59 100644 (file)
@@ -567,15 +567,18 @@ static inline int scsi_host_is_busy(struct Scsi_Host *shost)
  */
 static void scsi_run_queue(struct request_queue *q)
 {
-       struct scsi_device *starved_head = NULL, *sdev = q->queuedata;
+       struct scsi_device *sdev = q->queuedata;
        struct Scsi_Host *shost = sdev->host;
+       LIST_HEAD(starved_list);
        unsigned long flags;
 
        if (scsi_target(sdev)->single_lun)
                scsi_single_lun_run(sdev);
 
        spin_lock_irqsave(shost->host_lock, flags);
-       while (!list_empty(&shost->starved_list) && !scsi_host_is_busy(shost)) {
+       list_splice_init(&shost->starved_list, &starved_list);
+
+       while (!list_empty(&starved_list)) {
                int flagset;
 
                /*
@@ -588,24 +591,18 @@ static void scsi_run_queue(struct request_queue *q)
                 * scsi_request_fn must get the host_lock before checking
                 * or modifying starved_list or starved_entry.
                 */
-               sdev = list_entry(shost->starved_list.next,
-                                         struct scsi_device, starved_entry);
-               /*
-                * The *queue_ready functions can add a device back onto the
-                * starved list's tail, so we must check for a infinite loop.
-                */
-               if (sdev == starved_head)
+               if (scsi_host_is_busy(shost))
                        break;
-               if (!starved_head)
-                       starved_head = sdev;
 
+               sdev = list_entry(starved_list.next,
+                                 struct scsi_device, starved_entry);
+               list_del_init(&sdev->starved_entry);
                if (scsi_target_is_busy(scsi_target(sdev))) {
                        list_move_tail(&sdev->starved_entry,
                                       &shost->starved_list);
                        continue;
                }
 
-               list_del_init(&sdev->starved_entry);
                spin_unlock(shost->host_lock);
 
                spin_lock(sdev->request_queue->queue_lock);
@@ -621,6 +618,8 @@ static void scsi_run_queue(struct request_queue *q)
 
                spin_lock(shost->host_lock);
        }
+       /* put any unprocessed entries back */
+       list_splice(&starved_list, &shost->starved_list);
        spin_unlock_irqrestore(shost->host_lock, flags);
 
        blk_run_queue(q);
@@ -649,8 +648,8 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
        struct request *req = cmd->request;
        unsigned long flags;
 
-       scsi_unprep_request(req);
        spin_lock_irqsave(q->queue_lock, flags);
+       scsi_unprep_request(req);
        blk_requeue_request(q, req);
        spin_unlock_irqrestore(q->queue_lock, flags);
 
index c9e1242eaf2511067e122e89b331d438823a0a69..5081b3981d3c241487a9bf4f29be69796eb8e7cb 100644 (file)
@@ -757,7 +757,7 @@ static int sd_ioctl(struct block_device *bdev, fmode_t mode,
         * access to the device is prohibited.
         */
        error = scsi_nonblockable_ioctl(sdp, cmd, p,
-                                       (mode & FMODE_NDELAY_NOW) != 0);
+                                       (mode & FMODE_NDELAY) != 0);
        if (!scsi_block_when_processing_errors(sdp) || !error)
                return error;
 
index 62b6633e3a97b8d27511f1fbc9c9cb5d118abcea..45b66b98a516f492b0e76ea4bb792d1d19925570 100644 (file)
@@ -521,7 +521,7 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
         * if it doesn't recognise the ioctl
         */
        ret = scsi_nonblockable_ioctl(sdev, cmd, argp,
-                                       (mode & FMODE_NDELAY_NOW) != 0);
+                                       (mode & FMODE_NDELAY) != 0);
        if (ret != -ENODEV)
                return ret;
        return scsi_ioctl(sdev, cmd, argp);
index 3790906a77d10c06705b3616a22c5650d50f1948..2fa830c0be2790187e17e43cf6dc0ffb35df1da8 100644 (file)
@@ -477,7 +477,7 @@ stex_slave_config(struct scsi_device *sdev)
 {
        sdev->use_10_for_rw = 1;
        sdev->use_10_for_ms = 1;
-       sdev->timeout = 60 * HZ;
+       blk_queue_rq_timeout(sdev->request_queue, 60 * HZ);
        sdev->tagged_supported = 1;
 
        return 0;
index 6dd98f9fb89c0f655fbdc07f6c9af24f992250ef..ae3699d77dd0e320edc844f10cbc11c105afdea8 100644 (file)
@@ -2149,7 +2149,7 @@ out4:
        return ret;
 }
 
-static struct ioc3_submodule ioc3uart_submodule = {
+static struct ioc3_submodule ioc3uart_ops = {
        .name = "IOC3uart",
        .probe = ioc3uart_probe,
        .remove = ioc3uart_remove,
@@ -2173,7 +2173,7 @@ static int __devinit ioc3uart_init(void)
                       __func__);
                return ret;
        }
-       ret = ioc3_register_submodule(&ioc3uart_submodule);
+       ret = ioc3_register_submodule(&ioc3uart_ops);
        if (ret)
                uart_unregister_driver(&ioc3_uart);
        return ret;
@@ -2181,7 +2181,7 @@ static int __devinit ioc3uart_init(void)
 
 static void __devexit ioc3uart_exit(void)
 {
-       ioc3_unregister_submodule(&ioc3uart_submodule);
+       ioc3_unregister_submodule(&ioc3uart_ops);
        uart_unregister_driver(&ioc3_uart);
 }
 
index 6117d3db0b668980618991a2f66f578410f6e1a7..28c00c3d58f58273af3e1ab9bacd6f2df9e401c8 100644 (file)
@@ -591,8 +591,8 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
        /* Update the per-port timeout */
        uart_update_timeout(port, new->c_cflag, baud);
 
-       /* Do our best to flush TX & RX, so we don't loose anything */
-       /* But we don't wait indefinitly ! */
+       /* Do our best to flush TX & RX, so we don't lose anything */
+       /* But we don't wait indefinitely ! */
        j = 5000000;    /* Maximum wait */
        /* FIXME Can't receive chars since set_termios might be called at early
         * boot for the console, all stuff is not yet ready to receive at that
index 317d239ab74043cf10ada65e9329d4da0d3e87fe..29cbb0afef8e735276fe3fb39d6b2da5519ae6b2 100644 (file)
@@ -177,5 +177,5 @@ module_exit(s3c2440_serial_exit);
 
 MODULE_DESCRIPTION("Samsung S3C2440,S3C2442 SoC Serial port driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
-MODULE_LICENSE("GPLi v2");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:s3c2440-uart");
index d1812d32f47d40c4c5e3c028aae8727c755f451f..63f0de29aa14eeb508645dd0b917e7c4163950c1 100644 (file)
@@ -827,7 +827,7 @@ static int __init maple_bus_init(void)
 
        maple_queue_cache =
            kmem_cache_create("maple_queue_cache", 0x400, 0,
-                             SLAB_POISON|SLAB_HWCACHE_ALIGN, NULL);
+                             SLAB_HWCACHE_ALIGN, NULL);
 
        if (!maple_queue_cache)
                goto cleanup_bothirqs;
index c95b286a1239e8a6cbdb4da4a292e5d85c9079f1..5d457c96bd7ed596bdaab11852fc9ad45acaa635 100644 (file)
@@ -22,6 +22,8 @@ menuconfig STAGING
          If in doubt, say N here.
 
 
+if STAGING
+
 config STAGING_EXCLUDE_BUILD
        bool "Exclude Staging drivers from being built" if STAGING
        default y
@@ -62,3 +64,4 @@ source "drivers/staging/at76_usb/Kconfig"
 source "drivers/staging/poch/Kconfig"
 
 endif # !STAGING_EXCLUDE_BUILD
+endif # STAGING
index 8e74657f106c01d152c8e5244e75100bdd94f682..43a863c5cc430367ad045625eb4c3faecbfba7f9 100644 (file)
@@ -51,6 +51,7 @@ static struct usb_device_id usbtmc_devices[] = {
        { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), },
        { 0, } /* terminating entry */
 };
+MODULE_DEVICE_TABLE(usb, usbtmc_devices);
 
 /*
  * This structure is the capabilities for the device
index 3d7793d93031525400d3ed746a60639ebed1d52f..8c081308b0e2d8bf2349d6b9e9703de0548213ac 100644 (file)
@@ -279,7 +279,9 @@ static int usb_unbind_interface(struct device *dev)
         * altsetting means creating new endpoint device entries).
         * When either of these happens, defer the Set-Interface.
         */
-       if (!error && intf->dev.power.status == DPM_ON)
+       if (intf->cur_altsetting->desc.bAlternateSetting == 0)
+               ;       /* Already in altsetting 0 so skip Set-Interface */
+       else if (!error && intf->dev.power.status == DPM_ON)
                usb_set_interface(udev, intf->altsetting[0].
                                desc.bInterfaceNumber, 0);
        else
index 428b5993575a9126104da3ec32ea695e7881c9e8..3a8bb53fc473269e31366d0c11069490a30cb7bf 100644 (file)
@@ -651,6 +651,8 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
                                fs_in_desc.bEndpointAddress;
                hs_out_desc.bEndpointAddress =
                                fs_out_desc.bEndpointAddress;
+               hs_notify_desc.bEndpointAddress =
+                               fs_notify_desc.bEndpointAddress;
 
                /* copy descriptors, and track endpoint copies */
                f->hs_descriptors = usb_copy_descriptors(eth_hs_function);
@@ -662,6 +664,8 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
                                f->hs_descriptors, &hs_in_desc);
                rndis->hs.out = usb_find_endpoint(eth_hs_function,
                                f->hs_descriptors, &hs_out_desc);
+               rndis->hs.notify = usb_find_endpoint(eth_hs_function,
+                               f->hs_descriptors, &hs_notify_desc);
        }
 
        rndis->port.open = rndis_open;
index 51d7bdea2869ae147953fd10bbd7c3984c360aee..fb6f2933b01badb0075c285078fb6067fc7b6827 100644 (file)
@@ -143,6 +143,7 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
 static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
@@ -166,6 +167,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) },
@@ -1498,7 +1500,7 @@ static int ftdi_open(struct tty_struct *tty,
                        priv->interface, buf, 0, WDR_TIMEOUT);
 
        /* Termios defaults are set by usb_serial_init. We don't change
-          port->tty->termios - this would loose speed settings, etc.
+          port->tty->termios - this would lose speed settings, etc.
           This is same behaviour as serial.c/rs_open() - Kuba */
 
        /* ftdi_set_termios  will send usb control messages */
index 07a3992abad2b546095e35d247a3d7e68aec1eec..373ee09975bbd8c80b2a158aa32b9c6595a3bfbe 100644 (file)
@@ -40,6 +40,9 @@
 /* AlphaMicro Components AMC-232USB01 device */
 #define FTDI_AMC232_PID 0xFF00 /* Product Id */
 
+/* www.candapter.com Ewert Energy Systems CANdapter device */
+#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
+
 /* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */
 /* the VID is the standard ftdi vid (FTDI_VID) */
 #define FTDI_SCS_DEVICE_0_PID 0xD010    /* SCS PTC-IIusb */
@@ -75,6 +78,9 @@
 /* OpenDCC (www.opendcc.de) product id */
 #define FTDI_OPENDCC_PID       0xBFD8
 
+/* Sprog II (Andrew Crosland's SprogII DCC interface) */
+#define FTDI_SPROG_II          0xF0C8
+
 /* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
 /* they use the ftdi chipset for the USB interface and the vendor id is the same */
 #define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
index 491c8857b6448277a5cd49c51e88f6ac496233ad..1aed584be5eb9a528d904b3b3209afef29f40383 100644 (file)
@@ -91,6 +91,8 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(WS002IN_VENDOR_ID, WS002IN_PRODUCT_ID) },
        { USB_DEVICE(COREGA_VENDOR_ID, COREGA_PRODUCT_ID) },
        { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) },
+       { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
+       { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
index a3bd039c78e96769beeff504e4da6c32f63daa14..54974f446a8c2f51f213d293d3a2f53bcaf6479d 100644 (file)
 /* Y.C. Cable U.S.A., Inc - USB to RS-232 */
 #define YCCABLE_VENDOR_ID      0x05ad
 #define YCCABLE_PRODUCT_ID     0x0fba
+
+/* "Superial" USB - Serial */
+#define SUPERIAL_VENDOR_ID     0x5372
+#define SUPERIAL_PRODUCT_ID    0x2303
+
+/* Hewlett-Packard LD220-HP POS Pole Display */
+#define HP_VENDOR_ID           0x03f0
+#define HP_LD220_PRODUCT_ID    0x3524
index 31c42d1cae13cf746e49cce12c9f588247da2c5c..01d0c70d60e9b41129b44e76893958990f780b10 100644 (file)
  * For questions or problems with this driver, contact Texas Instruments
  * technical support, or Al Borchers <alborchers@steinerpoint.com>, or
  * Peter Berger <pberger@brimson.com>.
- *
- * This driver needs this hotplug script in /etc/hotplug/usb/ti_usb_3410_5052
- * or in /etc/hotplug.d/usb/ti_usb_3410_5052.hotplug to set the device
- * configuration.
- *
- * #!/bin/bash
- *
- * BOOT_CONFIG=1
- * ACTIVE_CONFIG=2
- *
- * if [[ "$ACTION" != "add" ]]
- * then
- *     exit
- * fi
- *
- * CONFIG_PATH=/sys${DEVPATH%/?*}/bConfigurationValue
- *
- * if [[ 0`cat $CONFIG_PATH` -ne $BOOT_CONFIG ]]
- * then
- *     exit
- * fi
- *
- * PRODUCT=${PRODUCT%/?*}              # delete version
- * VENDOR_ID=`printf "%d" 0x${PRODUCT%/?*}`
- * PRODUCT_ID=`printf "%d" 0x${PRODUCT#*?/}`
- *
- * PARAM_PATH=/sys/module/ti_usb_3410_5052/parameters
- *
- * function scan() {
- *     s=$1
- *     shift
- *     for i
- *     do
- *             if [[ $s -eq $i ]]
- *             then
- *                     return 0
- *             fi
- *     done
- *     return 1
- * }
- *
- * IFS=$IFS,
- *
- * if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` &&
- * scan $PRODUCT_ID 13328 `cat $PARAM_PATH/product_3410`) ||
- * (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` &&
- * scan $PRODUCT_ID 20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`)
- * then
- *     echo $ACTIVE_CONFIG > $CONFIG_PATH
- * fi
  */
 
 #include <linux/kernel.h>
@@ -457,9 +407,10 @@ static int ti_startup(struct usb_serial *serial)
                goto free_tdev;
        }
 
-       /* the second configuration must be set (in sysfs by hotplug script) */
+       /* the second configuration must be set */
        if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) {
-               status = -ENODEV;
+               status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG);
+               status = status ? status : -ENODEV;
                goto free_tdev;
        }
 
index e61f2bfc64add77ab938367c45c08db542c589e0..bfcc1fe82518d0e5739b1e936cf43d1b1430390c 100644 (file)
@@ -167,8 +167,22 @@ UNUSUAL_DEV(  0x0421, 0x005d, 0x0001, 0x0600,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY ),
 
+/* Reported by Ozan Sener <themgzzy@gmail.com> */
+UNUSUAL_DEV(  0x0421, 0x0060, 0x0551, 0x0551,
+               "Nokia",
+               "3500c",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY ),
+
+/* Reported by CSECSY Laszlo <boobaa@frugalware.org> */
+UNUSUAL_DEV(  0x0421, 0x0063, 0x0001, 0x0601,
+               "Nokia",
+               "Nokia 3109c",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY ),
+
 /* Patch for Nokia 5310 capacity */
-UNUSUAL_DEV(  0x0421, 0x006a, 0x0000, 0x0591,
+UNUSUAL_DEV(  0x0421, 0x006a, 0x0000, 0x0701,
                "Nokia",
                "5310",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
index a547e5d4c8bfee248e1722a285237aee93b49cf1..a469a3d6edcbd49abb9897b524f6c25f25b46931 100644 (file)
@@ -5,61 +5,61 @@
  * --dte
  */
 
-#define FLUSH_CACHE_WORKAROUND 1
-
-void radeon_fifo_update_and_wait(struct radeonfb_info *rinfo, int entries)
+static void radeon_fixup_offset(struct radeonfb_info *rinfo)
 {
-       int i;
+       u32 local_base;
+
+       /* *** Ugly workaround *** */
+       /*
+        * On some platforms, the video memory is mapped at 0 in radeon chip space
+        * (like PPCs) by the firmware. X will always move it up so that it's seen
+        * by the chip to be at the same address as the PCI BAR.
+        * That means that when switching back from X, there is a mismatch between
+        * the offsets programmed into the engine. This means that potentially,
+        * accel operations done before radeonfb has a chance to re-init the engine
+        * will have incorrect offsets, and potentially trash system memory !
+        *
+        * The correct fix is for fbcon to never call any accel op before the engine
+        * has properly been re-initialized (by a call to set_var), but this is a
+        * complex fix. This workaround in the meantime, called before every accel
+        * operation, makes sure the offsets are in sync.
+        */
 
-       for (i=0; i<2000000; i++) {
-               rinfo->fifo_free = INREG(RBBM_STATUS) & 0x7f;
-               if (rinfo->fifo_free >= entries)
-                       return;
-               udelay(10);
-       }
-       printk(KERN_ERR "radeonfb: FIFO Timeout !\n");
-       /* XXX Todo: attempt to reset the engine */
-}
+       radeon_fifo_wait (1);
+       local_base = INREG(MC_FB_LOCATION) << 16;
+       if (local_base == rinfo->fb_local_base)
+               return;
 
-static inline void radeon_fifo_wait(struct radeonfb_info *rinfo, int entries)
-{
-       if (entries <= rinfo->fifo_free)
-               rinfo->fifo_free -= entries;
-       else
-               radeon_fifo_update_and_wait(rinfo, entries);
-}
+       rinfo->fb_local_base = local_base;
 
-static inline void radeonfb_set_creg(struct radeonfb_info *rinfo, u32 reg,
-                                    u32 *cache, u32 new_val)
-{
-       if (new_val == *cache)
-               return;
-       *cache = new_val;
-       radeon_fifo_wait(rinfo, 1);
-       OUTREG(reg, new_val);
+       radeon_fifo_wait (3);
+       OUTREG(DEFAULT_PITCH_OFFSET, (rinfo->pitch << 0x16) |
+                                    (rinfo->fb_local_base >> 10));
+       OUTREG(DST_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
+       OUTREG(SRC_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
 }
 
 static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo, 
                                   const struct fb_fillrect *region)
 {
-       radeonfb_set_creg(rinfo, DP_GUI_MASTER_CNTL, &rinfo->dp_gui_mc_cache,
-                         rinfo->dp_gui_mc_base | GMC_BRUSH_SOLID_COLOR | ROP3_P);
-       radeonfb_set_creg(rinfo, DP_CNTL, &rinfo->dp_cntl_cache,
-                         DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM);
-       radeonfb_set_creg(rinfo, DP_BRUSH_FRGD_CLR, &rinfo->dp_brush_fg_cache,
-                         region->color);
-
-       /* Ensure the dst cache is flushed and the engine idle before
-        * issuing the operation.
-        *
-        * This works around engine lockups on some cards
-        */
-#if FLUSH_CACHE_WORKAROUND
-       radeon_fifo_wait(rinfo, 2);
+       radeon_fifo_wait(4);  
+  
+       OUTREG(DP_GUI_MASTER_CNTL,  
+               rinfo->dp_gui_master_cntl  /* contains, like GMC_DST_32BPP */
+                | GMC_BRUSH_SOLID_COLOR
+                | ROP3_P);
+       if (radeon_get_dstbpp(rinfo->depth) != DST_8BPP)
+               OUTREG(DP_BRUSH_FRGD_CLR, rinfo->pseudo_palette[region->color]);
+       else
+               OUTREG(DP_BRUSH_FRGD_CLR, region->color);
+       OUTREG(DP_WRITE_MSK, 0xffffffff);
+       OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
+
+       radeon_fifo_wait(2);
        OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
        OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
-#endif
-       radeon_fifo_wait(rinfo, 2);
+
+       radeon_fifo_wait(2);  
        OUTREG(DST_Y_X, (region->dy << 16) | region->dx);
        OUTREG(DST_WIDTH_HEIGHT, (region->width << 16) | region->height);
 }
@@ -70,14 +70,15 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
        struct fb_fillrect modded;
        int vxres, vyres;
   
-       WARN_ON(rinfo->gfx_mode);
-       if (info->state != FBINFO_STATE_RUNNING || rinfo->gfx_mode)
+       if (info->state != FBINFO_STATE_RUNNING)
                return;
        if (info->flags & FBINFO_HWACCEL_DISABLED) {
                cfb_fillrect(info, region);
                return;
        }
 
+       radeon_fixup_offset(rinfo);
+
        vxres = info->var.xres_virtual;
        vyres = info->var.yres_virtual;
 
@@ -90,10 +91,6 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
        if(modded.dx + modded.width  > vxres) modded.width  = vxres - modded.dx;
        if(modded.dy + modded.height > vyres) modded.height = vyres - modded.dy;
 
-       if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
-           info->fix.visual == FB_VISUAL_DIRECTCOLOR )
-               modded.color = ((u32 *) (info->pseudo_palette))[region->color];
-
        radeonfb_prim_fillrect(rinfo, &modded);
 }
 
@@ -112,22 +109,22 @@ static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo,
        if ( xdir < 0 ) { sx += w-1; dx += w-1; }
        if ( ydir < 0 ) { sy += h-1; dy += h-1; }
 
-       radeonfb_set_creg(rinfo, DP_GUI_MASTER_CNTL, &rinfo->dp_gui_mc_cache,
-                         rinfo->dp_gui_mc_base |
-                         GMC_BRUSH_NONE |
-                         GMC_SRC_DATATYPE_COLOR |
-                         ROP3_S |
-                         DP_SRC_SOURCE_MEMORY);
-       radeonfb_set_creg(rinfo, DP_CNTL, &rinfo->dp_cntl_cache,
-                         (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0) |
-                         (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
-
-#if FLUSH_CACHE_WORKAROUND
-       radeon_fifo_wait(rinfo, 2);
+       radeon_fifo_wait(3);
+       OUTREG(DP_GUI_MASTER_CNTL,
+               rinfo->dp_gui_master_cntl /* i.e. GMC_DST_32BPP */
+               | GMC_BRUSH_NONE
+               | GMC_SRC_DSTCOLOR
+               | ROP3_S 
+               | DP_SRC_SOURCE_MEMORY );
+       OUTREG(DP_WRITE_MSK, 0xffffffff);
+       OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
+                       | (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
+
+       radeon_fifo_wait(2);
        OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
        OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
-#endif
-       radeon_fifo_wait(rinfo, 3);
+
+       radeon_fifo_wait(3);
        OUTREG(SRC_Y_X, (sy << 16) | sx);
        OUTREG(DST_Y_X, (dy << 16) | dx);
        OUTREG(DST_HEIGHT_WIDTH, (h << 16) | w);
@@ -146,14 +143,15 @@ void radeonfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
        modded.width  = area->width;
        modded.height = area->height;
   
-       WARN_ON(rinfo->gfx_mode);
-       if (info->state != FBINFO_STATE_RUNNING || rinfo->gfx_mode)
+       if (info->state != FBINFO_STATE_RUNNING)
                return;
        if (info->flags & FBINFO_HWACCEL_DISABLED) {
                cfb_copyarea(info, area);
                return;
        }
 
+       radeon_fixup_offset(rinfo);
+
        vxres = info->var.xres_virtual;
        vyres = info->var.yres_virtual;
 
@@ -170,115 +168,13 @@ void radeonfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
        radeonfb_prim_copyarea(rinfo, &modded);
 }
 
-static void radeonfb_prim_imageblit(struct radeonfb_info *rinfo,
-                                   const struct fb_image *image,
-                                   u32 fg, u32 bg)
-{
-       unsigned int dwords;
-       u32 *bits;
-
-       radeonfb_set_creg(rinfo, DP_GUI_MASTER_CNTL, &rinfo->dp_gui_mc_cache,
-                         rinfo->dp_gui_mc_base |
-                         GMC_BRUSH_NONE | GMC_DST_CLIP_LEAVE |
-                         GMC_SRC_DATATYPE_MONO_FG_BG |
-                         ROP3_S |
-                         GMC_BYTE_ORDER_MSB_TO_LSB |
-                         DP_SRC_SOURCE_HOST_DATA);
-       radeonfb_set_creg(rinfo, DP_CNTL, &rinfo->dp_cntl_cache,
-                         DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM);
-       radeonfb_set_creg(rinfo, DP_SRC_FRGD_CLR, &rinfo->dp_src_fg_cache, fg);
-       radeonfb_set_creg(rinfo, DP_SRC_BKGD_CLR, &rinfo->dp_src_bg_cache, bg);
-
-       /* Ensure the dst cache is flushed and the engine idle before
-        * issuing the operation.
-        *
-        * This works around engine lockups on some cards
-        */
-#if FLUSH_CACHE_WORKAROUND
-       radeon_fifo_wait(rinfo, 2);
-       OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
-       OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
-#endif
-
-       /* X here pads width to a multiple of 32 and uses the clipper to
-        * adjust the result. Is that really necessary ? Things seem to
-        * work ok for me without that and the doco doesn't seem to imply]
-        * there is such a restriction.
-        */
-       radeon_fifo_wait(rinfo, 4);
-       OUTREG(SC_TOP_LEFT, (image->dy << 16) | image->dx);
-       OUTREG(SC_BOTTOM_RIGHT, ((image->dy + image->height) << 16) |
-              (image->dx + image->width));
-       OUTREG(DST_Y_X, (image->dy << 16) | image->dx);
-
-       OUTREG(DST_HEIGHT_WIDTH, (image->height << 16) | ((image->width + 31) & ~31));
-
-       dwords = (image->width + 31) >> 5;
-       dwords *= image->height;
-       bits = (u32*)(image->data);
-
-       while(dwords >= 8) {
-               radeon_fifo_wait(rinfo, 8);
-#if BITS_PER_LONG == 64
-               __raw_writeq(*((u64 *)(bits)), rinfo->mmio_base + HOST_DATA0);
-               __raw_writeq(*((u64 *)(bits+2)), rinfo->mmio_base + HOST_DATA2);
-               __raw_writeq(*((u64 *)(bits+4)), rinfo->mmio_base + HOST_DATA4);
-               __raw_writeq(*((u64 *)(bits+6)), rinfo->mmio_base + HOST_DATA6);
-               bits += 8;
-#else
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA0);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA1);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA2);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA3);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA4);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA5);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA6);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA7);
-#endif
-               dwords -= 8;
-       }
-       while(dwords--) {
-               radeon_fifo_wait(rinfo, 1);
-               __raw_writel(*(bits++), rinfo->mmio_base + HOST_DATA0);
-       }
-}
-
 void radeonfb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
        struct radeonfb_info *rinfo = info->par;
-       u32 fg, bg;
-
-       WARN_ON(rinfo->gfx_mode);
-       if (info->state != FBINFO_STATE_RUNNING || rinfo->gfx_mode)
-               return;
 
-       if (!image->width || !image->height)
+       if (info->state != FBINFO_STATE_RUNNING)
                return;
-
-       /* We only do 1 bpp color expansion for now */
-       if (info->flags & FBINFO_HWACCEL_DISABLED || image->depth != 1)
-               goto fallback;
-
-       /* Fallback if running out of the screen. We may do clipping
-        * in the future */
-       if ((image->dx + image->width) > info->var.xres_virtual ||
-           (image->dy + image->height) > info->var.yres_virtual)
-               goto fallback;
-
-       if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
-           info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
-               fg = ((u32*)(info->pseudo_palette))[image->fg_color];
-               bg = ((u32*)(info->pseudo_palette))[image->bg_color];
-       } else {
-               fg = image->fg_color;
-               bg = image->bg_color;
-       }
-
-       radeonfb_prim_imageblit(rinfo, image, fg, bg);
-       return;
-
- fallback:
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        cfb_imageblit(info, image);
 }
@@ -289,8 +185,7 @@ int radeonfb_sync(struct fb_info *info)
 
        if (info->state != FBINFO_STATE_RUNNING)
                return 0;
-
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        return 0;
 }
@@ -366,10 +261,9 @@ void radeonfb_engine_init (struct radeonfb_info *rinfo)
        /* disable 3D engine */
        OUTREG(RB3D_CNTL, 0);
 
-       rinfo->fifo_free = 0;
        radeonfb_engine_reset(rinfo);
 
-       radeon_fifo_wait(rinfo, 1);
+       radeon_fifo_wait (1);
        if (IS_R300_VARIANT(rinfo)) {
                OUTREG(RB2D_DSTCACHE_MODE, INREG(RB2D_DSTCACHE_MODE) |
                       RB2D_DC_AUTOFLUSH_ENABLE |
@@ -383,7 +277,7 @@ void radeonfb_engine_init (struct radeonfb_info *rinfo)
                OUTREG(RB2D_DSTCACHE_MODE, 0);
        }
 
-       radeon_fifo_wait(rinfo, 3);
+       radeon_fifo_wait (3);
        /* We re-read MC_FB_LOCATION from card as it can have been
         * modified by XFree drivers (ouch !)
         */
@@ -394,57 +288,41 @@ void radeonfb_engine_init (struct radeonfb_info *rinfo)
        OUTREG(DST_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
        OUTREG(SRC_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
 
-       radeon_fifo_wait(rinfo, 1);
-#ifdef __BIG_ENDIAN
+       radeon_fifo_wait (1);
+#if defined(__BIG_ENDIAN)
        OUTREGP(DP_DATATYPE, HOST_BIG_ENDIAN_EN, ~HOST_BIG_ENDIAN_EN);
 #else
        OUTREGP(DP_DATATYPE, 0, ~HOST_BIG_ENDIAN_EN);
 #endif
-       radeon_fifo_wait(rinfo, 2);
+       radeon_fifo_wait (2);
        OUTREG(DEFAULT_SC_TOP_LEFT, 0);
        OUTREG(DEFAULT_SC_BOTTOM_RIGHT, (DEFAULT_SC_RIGHT_MAX |
                                         DEFAULT_SC_BOTTOM_MAX));
 
-       /* set default DP_GUI_MASTER_CNTL */
        temp = radeon_get_dstbpp(rinfo->depth);
-       rinfo->dp_gui_mc_base = ((temp << 8) | GMC_CLR_CMP_CNTL_DIS);
+       rinfo->dp_gui_master_cntl = ((temp << 8) | GMC_CLR_CMP_CNTL_DIS);
 
-       rinfo->dp_gui_mc_cache = rinfo->dp_gui_mc_base |
-               GMC_BRUSH_SOLID_COLOR |
-               GMC_SRC_DATATYPE_COLOR;
-       radeon_fifo_wait(rinfo, 1);
-       OUTREG(DP_GUI_MASTER_CNTL, rinfo->dp_gui_mc_cache);
+       radeon_fifo_wait (1);
+       OUTREG(DP_GUI_MASTER_CNTL, (rinfo->dp_gui_master_cntl |
+                                   GMC_BRUSH_SOLID_COLOR |
+                                   GMC_SRC_DATATYPE_COLOR));
 
+       radeon_fifo_wait (7);
 
        /* clear line drawing regs */
-       radeon_fifo_wait(rinfo, 2);
        OUTREG(DST_LINE_START, 0);
        OUTREG(DST_LINE_END, 0);
 
-       /* set brush and source color regs */
-       rinfo->dp_brush_fg_cache = 0xffffffff;
-       rinfo->dp_brush_bg_cache = 0x00000000;
-       rinfo->dp_src_fg_cache = 0xffffffff;
-       rinfo->dp_src_bg_cache = 0x00000000;
-       radeon_fifo_wait(rinfo, 4);
-       OUTREG(DP_BRUSH_FRGD_CLR, rinfo->dp_brush_fg_cache);
-       OUTREG(DP_BRUSH_BKGD_CLR, rinfo->dp_brush_bg_cache);
-       OUTREG(DP_SRC_FRGD_CLR, rinfo->dp_src_fg_cache);
-       OUTREG(DP_SRC_BKGD_CLR, rinfo->dp_src_bg_cache);
-
-       /* Default direction */
-       rinfo->dp_cntl_cache = DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM;
-       radeon_fifo_wait(rinfo, 1);
-       OUTREG(DP_CNTL, rinfo->dp_cntl_cache);
+       /* set brush color regs */
+       OUTREG(DP_BRUSH_FRGD_CLR, 0xffffffff);
+       OUTREG(DP_BRUSH_BKGD_CLR, 0x00000000);
+
+       /* set source color regs */
+       OUTREG(DP_SRC_FRGD_CLR, 0xffffffff);
+       OUTREG(DP_SRC_BKGD_CLR, 0x00000000);
 
        /* default write mask */
-       radeon_fifo_wait(rinfo, 1);
        OUTREG(DP_WRITE_MSK, 0xffffffff);
 
-       /* Default to no swapping of host data */
-       radeon_fifo_wait(rinfo, 1);
-       OUTREG(RBBM_GUICNTL, RBBM_GUICNTL_HOST_DATA_SWAP_NONE);
-
-       /* Make sure it's settled */
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle ();
 }
index f343ba83f0ae0dbb6e50d25aa8ea95239598b1fd..1a056adb61c836784fce99d1c0314e710f4948e8 100644 (file)
@@ -66,7 +66,7 @@ static int radeon_bl_update_status(struct backlight_device *bd)
                level = bd->props.brightness;
 
        del_timer_sync(&rinfo->lvds_timer);
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        lvds_gen_cntl = INREG(LVDS_GEN_CNTL);
        if (level > 0) {
index b3ffe8205d2b738b7b567fa80820d2f71c662c25..d0f1a7fc2c9df7da492102db83247624c94dac9f 100644 (file)
@@ -852,6 +852,7 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
         if (rinfo->asleep)
                return 0;
 
+       radeon_fifo_wait(2);
         OUTREG(CRTC_OFFSET, ((var->yoffset * var->xres_virtual + var->xoffset)
                             * var->bits_per_pixel / 8) & ~7);
         return 0;
@@ -881,6 +882,7 @@ static int radeonfb_ioctl (struct fb_info *info, unsigned int cmd,
                        if (rc)
                                return rc;
 
+                       radeon_fifo_wait(2);
                        if (value & 0x01) {
                                tmp = INREG(LVDS_GEN_CNTL);
 
@@ -938,7 +940,7 @@ int radeon_screen_blank(struct radeonfb_info *rinfo, int blank, int mode_switch)
        if (rinfo->lock_blank)
                return 0;
 
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        val = INREG(CRTC_EXT_CNTL);
         val &= ~(CRTC_DISPLAY_DIS | CRTC_HSYNC_DIS |
@@ -1046,7 +1048,7 @@ static int radeonfb_blank (int blank, struct fb_info *info)
 
        if (rinfo->asleep)
                return 0;
-
+               
        return radeon_screen_blank(rinfo, blank, 0);
 }
 
@@ -1072,6 +1074,8 @@ static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green,
         pindex = regno;
 
         if (!rinfo->asleep) {
+               radeon_fifo_wait(9);
+
                if (rinfo->bpp == 16) {
                        pindex = regno * 8;
 
@@ -1240,6 +1244,8 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
 {
        int i;
 
+       radeon_fifo_wait(20);
+
        /* Workaround from XFree */
        if (rinfo->is_mobility) {
                /* A temporal workaround for the occational blanking on certain laptop
@@ -1335,7 +1341,7 @@ static void radeon_lvds_timer_func(unsigned long data)
 {
        struct radeonfb_info *rinfo = (struct radeonfb_info *)data;
 
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        OUTREG(LVDS_GEN_CNTL, rinfo->pending_lvds_gen_cntl);
 }
@@ -1353,11 +1359,10 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
        if (nomodeset)
                return;
 
-       radeon_engine_idle(rinfo);
-
        if (!regs_only)
                radeon_screen_blank(rinfo, FB_BLANK_NORMAL, 0);
 
+       radeon_fifo_wait(31);
        for (i=0; i<10; i++)
                OUTREG(common_regs[i].reg, common_regs[i].val);
 
@@ -1385,6 +1390,7 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
        radeon_write_pll_regs(rinfo, mode);
 
        if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+               radeon_fifo_wait(10);
                OUTREG(FP_CRTC_H_TOTAL_DISP, mode->fp_crtc_h_total_disp);
                OUTREG(FP_CRTC_V_TOTAL_DISP, mode->fp_crtc_v_total_disp);
                OUTREG(FP_H_SYNC_STRT_WID, mode->fp_h_sync_strt_wid);
@@ -1399,6 +1405,7 @@ void radeon_write_mode (struct radeonfb_info *rinfo, struct radeon_regs *mode,
        if (!regs_only)
                radeon_screen_blank(rinfo, FB_BLANK_UNBLANK, 0);
 
+       radeon_fifo_wait(2);
        OUTPLL(VCLK_ECP_CNTL, mode->vclk_ecp_cntl);
        
        return;
@@ -1549,7 +1556,7 @@ static int radeonfb_set_par(struct fb_info *info)
        /* We always want engine to be idle on a mode switch, even
         * if we won't actually change the mode
         */
-       radeon_engine_idle(rinfo);
+       radeon_engine_idle();
 
        hSyncStart = mode->xres + mode->right_margin;
        hSyncEnd = hSyncStart + mode->hsync_len;
@@ -1844,6 +1851,7 @@ static int radeonfb_set_par(struct fb_info *info)
        return 0;
 }
 
+
 static struct fb_ops radeonfb_ops = {
        .owner                  = THIS_MODULE,
        .fb_check_var           = radeonfb_check_var,
@@ -1867,7 +1875,6 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
        info->par = rinfo;
        info->pseudo_palette = rinfo->pseudo_palette;
        info->flags = FBINFO_DEFAULT
-                   | FBINFO_HWACCEL_IMAGEBLIT
                    | FBINFO_HWACCEL_COPYAREA
                    | FBINFO_HWACCEL_FILLRECT
                    | FBINFO_HWACCEL_XPAN
@@ -1875,7 +1882,6 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
        info->fbops = &radeonfb_ops;
        info->screen_base = rinfo->fb_base;
        info->screen_size = rinfo->mapped_vram;
-
        /* Fill fix common fields */
        strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
         info->fix.smem_start = rinfo->fb_base_phys;
@@ -1890,25 +1896,8 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
         info->fix.mmio_len = RADEON_REGSIZE;
        info->fix.accel = FB_ACCEL_ATI_RADEON;
 
-       /* Allocate colormap */
        fb_alloc_cmap(&info->cmap, 256, 0);
 
-       /* Setup pixmap used for acceleration */
-#define PIXMAP_SIZE    (2048 * 4)
-
-       info->pixmap.addr = kmalloc(PIXMAP_SIZE, GFP_KERNEL);
-       if (!info->pixmap.addr) {
-               printk(KERN_ERR "radeonfb: Failed to allocate pixmap !\n");
-               noaccel = 1;
-               goto bail;
-       }
-       info->pixmap.size = PIXMAP_SIZE;
-       info->pixmap.flags = FB_PIXMAP_SYSTEM;
-       info->pixmap.scan_align = 4;
-       info->pixmap.buf_align = 4;
-       info->pixmap.access_align = 32;
-
-bail:
        if (noaccel)
                info->flags |= FBINFO_HWACCEL_DISABLED;
 
@@ -2017,6 +2006,7 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo)
           u32 tom = INREG(NB_TOM);
           tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
 
+               radeon_fifo_wait(6);
           OUTREG(MC_FB_LOCATION, tom);
           OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
           OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
index 3df5015f1d13f540a6bc9b5cbfdd663663604eac..675abdafc2d8d047741ed3b8fdf2c0291343440c 100644 (file)
@@ -2653,9 +2653,9 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
 
        if (!(info->flags & FBINFO_HWACCEL_DISABLED)) {
                /* Make sure engine is reset */
-               radeon_engine_idle(rinfo);
+               radeon_engine_idle();
                radeonfb_engine_reset(rinfo);
-               radeon_engine_idle(rinfo);
+               radeon_engine_idle();
        }
 
        /* Blank display and LCD */
@@ -2767,7 +2767,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
 
                rinfo->asleep = 0;
        } else
-               radeon_engine_idle(rinfo);
+               radeon_engine_idle();
 
        /* Restore display & engine */
        radeon_write_mode (rinfo, &rinfo->state, 1);
index ea0b5b47acaf437027b0a5b153dd6cc4c5d5e1b3..3ea1b00fdd22ae66e882fc764359920ab8a609c5 100644 (file)
@@ -336,15 +336,7 @@ struct radeonfb_info {
        int                     mon2_type;
        u8                      *mon2_EDID;
 
-       /* accel bits */
-       u32                     dp_gui_mc_base;
-       u32                     dp_gui_mc_cache;
-       u32                     dp_cntl_cache;
-       u32                     dp_brush_fg_cache;
-       u32                     dp_brush_bg_cache;
-       u32                     dp_src_fg_cache;
-       u32                     dp_src_bg_cache;
-       u32                     fifo_free;
+       u32                     dp_gui_master_cntl;
 
        struct pll_info         pll;
 
@@ -356,7 +348,6 @@ struct radeonfb_info {
        int                     lock_blank;
        int                     dynclk;
        int                     no_schedule;
-       int                     gfx_mode;
        enum radeon_pm_mode     pm_mode;
        reinit_function_ptr     reinit_func;
 
@@ -401,14 +392,8 @@ static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms)
 #define OUTREG8(addr,val)      writeb(val, (rinfo->mmio_base)+addr)
 #define INREG16(addr)          readw((rinfo->mmio_base)+addr)
 #define OUTREG16(addr,val)     writew(val, (rinfo->mmio_base)+addr)
-
-#ifdef CONFIG_PPC
-#define INREG(addr)            ({ eieio(); ld_le32(rinfo->mmio_base+(addr)); })
-#define OUTREG(addr,val)       do { eieio(); st_le32(rinfo->mmio_base+(addr),(val)); } while(0)
-#else
 #define INREG(addr)            readl((rinfo->mmio_base)+addr)
 #define OUTREG(addr,val)       writel(val, (rinfo->mmio_base)+addr)
-#endif
 
 static inline void _OUTREGP(struct radeonfb_info *rinfo, u32 addr,
                       u32 val, u32 mask)
@@ -550,7 +535,17 @@ static inline u32 radeon_get_dstbpp(u16 depth)
  * 2D Engine helper routines
  */
 
-extern void radeon_fifo_update_and_wait(struct radeonfb_info *rinfo, int entries);
+static inline void _radeon_fifo_wait(struct radeonfb_info *rinfo, int entries)
+{
+       int i;
+
+       for (i=0; i<2000000; i++) {
+               if ((INREG(RBBM_STATUS) & 0x7f) >= entries)
+                       return;
+               udelay(1);
+       }
+       printk(KERN_ERR "radeonfb: FIFO Timeout !\n");
+}
 
 static inline void radeon_engine_flush (struct radeonfb_info *rinfo)
 {
@@ -563,7 +558,7 @@ static inline void radeon_engine_flush (struct radeonfb_info *rinfo)
        /* Ensure FIFO is empty, ie, make sure the flush commands
         * has reached the cache
         */
-       radeon_fifo_update_and_wait(rinfo, 64);
+       _radeon_fifo_wait (rinfo, 64);
 
        /* Wait for the flush to complete */
        for (i=0; i < 2000000; i++) {
@@ -575,12 +570,12 @@ static inline void radeon_engine_flush (struct radeonfb_info *rinfo)
 }
 
 
-static inline void radeon_engine_idle(struct radeonfb_info *rinfo)
+static inline void _radeon_engine_idle(struct radeonfb_info *rinfo)
 {
        int i;
 
        /* ensure FIFO is empty before waiting for idle */
-       radeon_fifo_update_and_wait (rinfo, 64);
+       _radeon_fifo_wait (rinfo, 64);
 
        for (i=0; i<2000000; i++) {
                if (((INREG(RBBM_STATUS) & GUI_ACTIVE)) == 0) {
@@ -593,6 +588,8 @@ static inline void radeon_engine_idle(struct radeonfb_info *rinfo)
 }
 
 
+#define radeon_engine_idle()           _radeon_engine_idle(rinfo)
+#define radeon_fifo_wait(entries)      _radeon_fifo_wait(rinfo,entries)
 #define radeon_msleep(ms)              _radeon_msleep(rinfo,ms)
 
 
@@ -622,7 +619,6 @@ extern void radeonfb_imageblit(struct fb_info *p, const struct fb_image *image);
 extern int radeonfb_sync(struct fb_info *info);
 extern void radeonfb_engine_init (struct radeonfb_info *rinfo);
 extern void radeonfb_engine_reset(struct radeonfb_info *rinfo);
-extern void radeon_fixup_mem_offset(struct radeonfb_info *rinfo);
 
 /* Other functions */
 extern int radeon_screen_blank(struct radeonfb_info *rinfo, int blank, int mode_switch);
index 67ff370d80afed55b52a256b0fbff13e8f6a2dc4..0b2adefe9e3d55f3b20e3e668a8d5e7969058948 100644 (file)
@@ -3531,12 +3531,18 @@ static void fbcon_exit(void)
        softback_buf = 0UL;
 
        for (i = 0; i < FB_MAX; i++) {
+               int pending;
+
                mapped = 0;
                info = registered_fb[i];
 
                if (info == NULL)
                        continue;
 
+               pending = cancel_work_sync(&info->queue);
+               DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
+                       "no"));
+
                for (j = first_fb_vc; j <= last_fb_vc; j++) {
                        if (con2fb_map[j] == i)
                                mapped = 1;
index b790ddff76f9f5f91d70dd181f69699d0f4b613b..ee380d5f34107d0713b582b9a29cd6259a327119 100644 (file)
@@ -164,7 +164,6 @@ static struct fb_var_screeninfo macfb_defined = {
 };
 
 static struct fb_fix_screeninfo macfb_fix = {
-       .id     = "Macintosh ",
        .type   = FB_TYPE_PACKED_PIXELS,
        .accel  = FB_ACCEL_NONE,
 };
@@ -760,22 +759,22 @@ static int __init macfb_init(void)
 
                switch(ndev->dr_hw) {
                case NUBUS_DRHW_APPLE_MDC:
-                       strcat( macfb_fix.id, "Display Card" );
+                       strcpy(macfb_fix.id, "Mac Disp. Card");
                        macfb_setpalette = mdc_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        break;
                case NUBUS_DRHW_APPLE_TFB:
-                       strcat( macfb_fix.id, "Toby" );
+                       strcpy(macfb_fix.id, "Toby");
                        macfb_setpalette = toby_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        break;
                case NUBUS_DRHW_APPLE_JET:
-                       strcat( macfb_fix.id, "Jet");
+                       strcpy(macfb_fix.id, "Jet");
                        macfb_setpalette = jet_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        break;                  
                default:
-                       strcat( macfb_fix.id, "Generic NuBus" );
+                       strcpy(macfb_fix.id, "Generic NuBus");
                        break;
                }
        }
@@ -786,21 +785,11 @@ static int __init macfb_init(void)
        if (!video_is_nubus)
                switch( mac_bi_data.id )
                {
-                       /* These don't have onboard video.  Eventually, we may
-                          be able to write separate framebuffer drivers for
-                          them (tobyfb.c, hiresfb.c, etc, etc) */
-               case MAC_MODEL_II:
-               case MAC_MODEL_IIX:
-               case MAC_MODEL_IICX:
-               case MAC_MODEL_IIFX:
-                       strcat( macfb_fix.id, "Generic NuBus" );
-                       break;
-
                        /* Valkyrie Quadras */
                case MAC_MODEL_Q630:
                        /* I'm not sure about this one */
                case MAC_MODEL_P588:
-                       strcat( macfb_fix.id, "Valkyrie built-in" );
+                       strcpy(macfb_fix.id, "Valkyrie");
                        macfb_setpalette = valkyrie_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        valkyrie_cmap_regs = ioremap(DAC_BASE, 0x1000);
@@ -823,7 +812,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_Q700:
                case MAC_MODEL_Q900:
                case MAC_MODEL_Q950:
-                       strcat( macfb_fix.id, "DAFB built-in" );
+                       strcpy(macfb_fix.id, "DAFB");
                        macfb_setpalette = dafb_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000);
@@ -831,7 +820,7 @@ static int __init macfb_init(void)
 
                        /* LC II uses the V8 framebuffer */
                case MAC_MODEL_LCII:
-                       strcat( macfb_fix.id, "V8 built-in" );
+                       strcpy(macfb_fix.id, "V8");
                        macfb_setpalette = v8_brazil_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
@@ -843,7 +832,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_IIVI:
                case MAC_MODEL_IIVX:
                case MAC_MODEL_P600:
-                       strcat( macfb_fix.id, "Brazil built-in" );
+                       strcpy(macfb_fix.id, "Brazil");
                        macfb_setpalette = v8_brazil_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
                        v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
@@ -860,7 +849,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_P460:
                        macfb_setpalette = v8_brazil_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
-                       strcat( macfb_fix.id, "Sonora built-in" );
+                       strcpy(macfb_fix.id, "Sonora");
                        v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
                        break;
 
@@ -871,7 +860,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_IISI:
                        macfb_setpalette = rbv_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
-                       strcat( macfb_fix.id, "RBV built-in" );
+                       strcpy(macfb_fix.id, "RBV");
                        rbv_cmap_regs = ioremap(DAC_BASE, 0x1000);
                        break;
 
@@ -880,7 +869,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_C660:
                        macfb_setpalette = civic_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
-                       strcat( macfb_fix.id, "Civic built-in" );
+                       strcpy(macfb_fix.id, "Civic");
                        civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
                        break;
 
@@ -901,7 +890,7 @@ static int __init macfb_init(void)
                                v8_brazil_cmap_regs =
                                        ioremap(DAC_BASE, 0x1000);
                        }
-                       strcat( macfb_fix.id, "LC built-in" );
+                       strcpy(macfb_fix.id, "LC");
                        break;
                        /* We think this may be like the LC II */
                case MAC_MODEL_CCL:
@@ -911,18 +900,18 @@ static int __init macfb_init(void)
                                v8_brazil_cmap_regs =
                                        ioremap(DAC_BASE, 0x1000);
                        }
-                       strcat( macfb_fix.id, "Color Classic built-in" );
+                       strcpy(macfb_fix.id, "Color Classic");
                        break;
 
                        /* And we *do* mean "weirdos" */
                case MAC_MODEL_TV:
-                       strcat( macfb_fix.id, "Mac TV built-in" );
+                       strcpy(macfb_fix.id, "Mac TV");
                        break;
 
                        /* These don't have colour, so no need to worry */
                case MAC_MODEL_SE30:
                case MAC_MODEL_CLII:
-                       strcat( macfb_fix.id, "Monochrome built-in" );
+                       strcpy(macfb_fix.id, "Monochrome");
                        break;
 
                        /* Powerbooks are particularly difficult.  Many of
@@ -935,7 +924,7 @@ static int __init macfb_init(void)
                case MAC_MODEL_PB140:
                case MAC_MODEL_PB145:
                case MAC_MODEL_PB170:
-                       strcat( macfb_fix.id, "DDC built-in" );
+                       strcpy(macfb_fix.id, "DDC");
                        break;
 
                        /* Internal is GSC, External (if present) is ViSC */
@@ -945,13 +934,13 @@ static int __init macfb_init(void)
                case MAC_MODEL_PB180:
                case MAC_MODEL_PB210:
                case MAC_MODEL_PB230:
-                       strcat( macfb_fix.id, "GSC built-in" );
+                       strcpy(macfb_fix.id, "GSC");
                        break;
 
                        /* Internal is TIM, External is ViSC */
                case MAC_MODEL_PB165C:
                case MAC_MODEL_PB180C:
-                       strcat( macfb_fix.id, "TIM built-in" );
+                       strcpy(macfb_fix.id, "TIM");
                        break;
 
                        /* Internal is CSC, External is Keystone+Ariel. */
@@ -963,12 +952,12 @@ static int __init macfb_init(void)
                case MAC_MODEL_PB280C:
                        macfb_setpalette = csc_setpalette;
                        macfb_defined.activate = FB_ACTIVATE_NOW;
-                       strcat( macfb_fix.id, "CSC built-in" );
+                       strcpy(macfb_fix.id, "CSC");
                        csc_cmap_regs = ioremap(CSC_BASE, 0x1000);
                        break;
                
                default:
-                       strcat( macfb_fix.id, "Unknown/Unsupported built-in" );
+                       strcpy(macfb_fix.id, "Unknown");
                        break;
                }
 
@@ -978,16 +967,23 @@ static int __init macfb_init(void)
        fb_info.pseudo_palette  = pseudo_palette;
        fb_info.flags           = FBINFO_DEFAULT;
 
-       fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
+       err = fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
+       if (err)
+               goto fail_unmap;
        
        err = register_framebuffer(&fb_info);
-       if (!err)
-               printk("fb%d: %s frame buffer device\n",
-                      fb_info.node, fb_info.fix.id);
-       else {
-               iounmap(fb_info.screen_base);
-               iounmap_macfb();
-       }
+       if (err)
+               goto fail_dealloc;
+
+       printk("fb%d: %s frame buffer device\n",
+              fb_info.node, fb_info.fix.id);
+       return 0;
+
+fail_dealloc:
+       fb_dealloc_cmap(&fb_info.cmap);
+fail_unmap:
+       iounmap(fb_info.screen_base);
+       iounmap_macfb();
        return err;
 }
 
index 38718d95fbb9ad3091ba7652e72f1377235bb19a..fb64234a3825a2a9d1ee7f24e52e7cd75b969713 100644 (file)
@@ -927,9 +927,9 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
        }
 
        dev_dbg(dev, "fb phys 0x%llx 0x%lx\n",
-               (u64)par->fb_base_phys, (ulong)par->mapped_vram);
+               (unsigned long long)par->fb_base_phys, (ulong)par->mapped_vram);
        dev_dbg(dev, "mmio phys 0x%llx 0x%lx\n",
-               (u64)par->mmio_base_phys, (ulong)par->mmio_len);
+               (unsigned long long)par->mmio_base_phys, (ulong)par->mmio_len);
 
        if (mb862xx_pci_gdc_init(par))
                goto io_unmap;
index 5a5e407dc45f713cc9252f11efcf1ae2b113f2a3..1a49519dafa483b864c992dfb1f92b2f8e02505f 100644 (file)
@@ -392,7 +392,7 @@ static void set_fb_fix(struct fb_info *fbi)
        int bpp;
 
        rg = &plane->fbdev->mem_desc.region[plane->idx];
-       fbi->screen_base        = (char __iomem *)rg->vaddr;
+       fbi->screen_base        = rg->vaddr;
        fix->smem_start         = rg->paddr;
        fix->smem_len           = rg->size;
 
index 0d15b0eaf79a7b5a56eb50bb00efc1a9571280e6..5139c25ca96288474cf976cf5577be12c6d6d30b 100644 (file)
@@ -356,7 +356,9 @@ int w1_reset_select_slave(struct w1_slave *sl)
                w1_write_8(sl->master, W1_SKIP_ROM);
        else {
                u8 match[9] = {W1_MATCH_ROM, };
-               memcpy(&match[1], (u8 *)&sl->reg_num, 8);
+               u64 rn = le64_to_cpu(*((u64*)&sl->reg_num));
+
+               memcpy(&match[1], &rn, 8);
                w1_write_block(sl->master, match, 9);
        }
        return 0;
index a3765e0be4a82db9bedd1adb9175cc7cef6b08d3..763c1ea5dce54b38ce2a1da262e0a8f39a2688a3 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/bootmem.h>
 #include <linux/slab.h>
 #include <asm/desc.h>
+#include <asm/cacheflush.h>
 
 #define PCI_BIOS32_SD_VALUE            0x5F32335F      /* "_32_" */
 #define CRU_BIOS_SIGNATURE_VALUE       0x55524324
@@ -394,6 +395,8 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm)
                                smbios_cru64_ptr->double_offset;
                        cru_rom_addr = ioremap(cru_physical_address,
                                smbios_cru64_ptr->double_length);
+                       set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
+                               smbios_cru64_ptr->double_length >> PAGE_SHIFT);
                }
        }
 }
@@ -482,7 +485,7 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
                        "Management Log for details.\n");
        }
 
-       return NOTIFY_STOP;
+       return NOTIFY_OK;
 }
 
 /*
index ca344a85eb9591e450d2aad02a0bcc9736e05e83..2474ebca88f6d816837765b667bdf7e9e4ea087f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     intel TCO vendor specific watchdog driver support
  *
- *     (c) Copyright 2006 Wim Van Sebroeck <wim@iguana.be>.
+ *     (c) Copyright 2006-2008 Wim Van Sebroeck <wim@iguana.be>.
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -19,8 +19,7 @@
 
 /* Module and version information */
 #define DRV_NAME       "iTCO_vendor_support"
-#define DRV_VERSION    "1.01"
-#define DRV_RELDATE    "11-Nov-2006"
+#define DRV_VERSION    "1.02"
 #define PFX            DRV_NAME ": "
 
 /* Includes */
@@ -78,24 +77,6 @@ MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (n
  *         20.6 seconds.
  */
 
-static void supermicro_old_pre_start(unsigned long acpibase)
-{
-       unsigned long val32;
-
-       val32 = inl(SMI_EN);
-       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
-       outl(val32, SMI_EN);    /* Needed to activate watchdog */
-}
-
-static void supermicro_old_pre_stop(unsigned long acpibase)
-{
-       unsigned long val32;
-
-       val32 = inl(SMI_EN);
-       val32 &= 0x00002000;    /* Turn on SMI clearing watchdog */
-       outl(val32, SMI_EN);    /* Needed to deactivate watchdog */
-}
-
 static void supermicro_old_pre_keepalive(unsigned long acpibase)
 {
        /* Reload TCO Timer (done in iTCO_wdt_keepalive) + */
@@ -247,18 +228,14 @@ static void supermicro_new_pre_set_heartbeat(unsigned int heartbeat)
 void iTCO_vendor_pre_start(unsigned long acpibase,
                           unsigned int heartbeat)
 {
-       if (vendorsupport == SUPERMICRO_OLD_BOARD)
-               supermicro_old_pre_start(acpibase);
-       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
+       if (vendorsupport == SUPERMICRO_NEW_BOARD)
                supermicro_new_pre_start(heartbeat);
 }
 EXPORT_SYMBOL(iTCO_vendor_pre_start);
 
 void iTCO_vendor_pre_stop(unsigned long acpibase)
 {
-       if (vendorsupport == SUPERMICRO_OLD_BOARD)
-               supermicro_old_pre_stop(acpibase);
-       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
+       if (vendorsupport == SUPERMICRO_NEW_BOARD)
                supermicro_new_pre_stop();
 }
 EXPORT_SYMBOL(iTCO_vendor_pre_stop);
index bfb93bc2ca9f50c27278fe8d29384605f8f03e26..5b395a4ddfdfec67dbd4324acbc521258977a855 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     intel TCO Watchdog Driver (Used in i82801 and i6300ESB chipsets)
  *
- *     (c) Copyright 2006-2007 Wim Van Sebroeck <wim@iguana.be>.
+ *     (c) Copyright 2006-2008 Wim Van Sebroeck <wim@iguana.be>.
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
  *     82801BAM (ICH2-M)    : document number 290687-002, 298242-027,
  *     82801CA  (ICH3-S)    : document number 290733-003, 290739-013,
  *     82801CAM (ICH3-M)    : document number 290716-001, 290718-007,
- *     82801DB  (ICH4)      : document number 290744-001, 290745-020,
- *     82801DBM (ICH4-M)    : document number 252337-001, 252663-005,
+ *     82801DB  (ICH4)      : document number 290744-001, 290745-025,
+ *     82801DBM (ICH4-M)    : document number 252337-001, 252663-008,
  *     82801E   (C-ICH)     : document number 273599-001, 273645-002,
- *     82801EB  (ICH5)      : document number 252516-001, 252517-003,
- *     82801ER  (ICH5R)     : document number 252516-001, 252517-003,
- *     82801FB  (ICH6)      : document number 301473-002, 301474-007,
- *     82801FR  (ICH6R)     : document number 301473-002, 301474-007,
- *     82801FBM (ICH6-M)    : document number 301473-002, 301474-007,
- *     82801FW  (ICH6W)     : document number 301473-001, 301474-007,
- *     82801FRW (ICH6RW)    : document number 301473-001, 301474-007,
- *     82801GB  (ICH7)      : document number 307013-002, 307014-009,
- *     82801GR  (ICH7R)     : document number 307013-002, 307014-009,
- *     82801GDH (ICH7DH)    : document number 307013-002, 307014-009,
- *     82801GBM (ICH7-M)    : document number 307013-002, 307014-009,
- *     82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
- *     82801HB  (ICH8)      : document number 313056-003, 313057-009,
- *     82801HR  (ICH8R)     : document number 313056-003, 313057-009,
- *     82801HBM (ICH8M)     : document number 313056-003, 313057-009,
- *     82801HH  (ICH8DH)    : document number 313056-003, 313057-009,
- *     82801HO  (ICH8DO)    : document number 313056-003, 313057-009,
- *     82801HEM (ICH8M-E)   : document number 313056-003, 313057-009,
- *     82801IB  (ICH9)      : document number 316972-001, 316973-006,
- *     82801IR  (ICH9R)     : document number 316972-001, 316973-006,
- *     82801IH  (ICH9DH)    : document number 316972-001, 316973-006,
- *     82801IO  (ICH9DO)    : document number 316972-001, 316973-006,
- *     6300ESB  (6300ESB)   : document number 300641-003, 300884-010,
- *     631xESB  (631xESB)   : document number 313082-001, 313075-005,
- *     632xESB  (632xESB)   : document number 313082-001, 313075-005
+ *     82801EB  (ICH5)      : document number 252516-001, 252517-028,
+ *     82801ER  (ICH5R)     : document number 252516-001, 252517-028,
+ *     6300ESB  (6300ESB)   : document number 300641-004, 300884-013,
+ *     82801FB  (ICH6)      : document number 301473-002, 301474-026,
+ *     82801FR  (ICH6R)     : document number 301473-002, 301474-026,
+ *     82801FBM (ICH6-M)    : document number 301473-002, 301474-026,
+ *     82801FW  (ICH6W)     : document number 301473-001, 301474-026,
+ *     82801FRW (ICH6RW)    : document number 301473-001, 301474-026,
+ *     631xESB  (631xESB)   : document number 313082-001, 313075-006,
+ *     632xESB  (632xESB)   : document number 313082-001, 313075-006,
+ *     82801GB  (ICH7)      : document number 307013-003, 307014-024,
+ *     82801GR  (ICH7R)     : document number 307013-003, 307014-024,
+ *     82801GDH (ICH7DH)    : document number 307013-003, 307014-024,
+ *     82801GBM (ICH7-M)    : document number 307013-003, 307014-024,
+ *     82801GHM (ICH7-M DH) : document number 307013-003, 307014-024,
+ *     82801GU  (ICH7-U)    : document number 307013-003, 307014-024,
+ *     82801HB  (ICH8)      : document number 313056-003, 313057-017,
+ *     82801HR  (ICH8R)     : document number 313056-003, 313057-017,
+ *     82801HBM (ICH8M)     : document number 313056-003, 313057-017,
+ *     82801HH  (ICH8DH)    : document number 313056-003, 313057-017,
+ *     82801HO  (ICH8DO)    : document number 313056-003, 313057-017,
+ *     82801HEM (ICH8M-E)   : document number 313056-003, 313057-017,
+ *     82801IB  (ICH9)      : document number 316972-004, 316973-012,
+ *     82801IR  (ICH9R)     : document number 316972-004, 316973-012,
+ *     82801IH  (ICH9DH)    : document number 316972-004, 316973-012,
+ *     82801IO  (ICH9DO)    : document number 316972-004, 316973-012,
+ *     82801IBM (ICH9M)     : document number 316972-004, 316973-012,
+ *     82801IEM (ICH9M-E)   : document number 316972-004, 316973-012,
+ *     82801JIB (ICH10)     : document number 319973-002, 319974-002,
+ *     82801JIR (ICH10R)    : document number 319973-002, 319974-002,
+ *     82801JD  (ICH10D)    : document number 319973-002, 319974-002,
+ *     82801JDO (ICH10DO)   : document number 319973-002, 319974-002
  */
 
 /*
@@ -56,8 +63,7 @@
 
 /* Module and version information */
 #define DRV_NAME       "iTCO_wdt"
-#define DRV_VERSION    "1.03"
-#define DRV_RELDATE    "30-Apr-2008"
+#define DRV_VERSION    "1.04"
 #define PFX            DRV_NAME ": "
 
 /* Includes */
@@ -96,19 +102,26 @@ enum iTCO_chipsets {
        TCO_ICH6,       /* ICH6 & ICH6R */
        TCO_ICH6M,      /* ICH6-M */
        TCO_ICH6W,      /* ICH6W & ICH6RW */
+       TCO_631XESB,    /* 631xESB/632xESB */
        TCO_ICH7,       /* ICH7 & ICH7R */
-       TCO_ICH7M,      /* ICH7-M */
+       TCO_ICH7DH,     /* ICH7DH */
+       TCO_ICH7M,      /* ICH7-M & ICH7-U */
        TCO_ICH7MDH,    /* ICH7-M DH */
        TCO_ICH8,       /* ICH8 & ICH8R */
-       TCO_ICH8ME,     /* ICH8M-E */
        TCO_ICH8DH,     /* ICH8DH */
        TCO_ICH8DO,     /* ICH8DO */
        TCO_ICH8M,      /* ICH8M */
+       TCO_ICH8ME,     /* ICH8M-E */
        TCO_ICH9,       /* ICH9 */
        TCO_ICH9R,      /* ICH9R */
        TCO_ICH9DH,     /* ICH9DH */
        TCO_ICH9DO,     /* ICH9DO */
-       TCO_631XESB,    /* 631xESB/632xESB */
+       TCO_ICH9M,      /* ICH9M */
+       TCO_ICH9ME,     /* ICH9M-E */
+       TCO_ICH10,      /* ICH10 */
+       TCO_ICH10R,     /* ICH10R */
+       TCO_ICH10D,     /* ICH10D */
+       TCO_ICH10DO,    /* ICH10DO */
 };
 
 static struct {
@@ -129,19 +142,26 @@ static struct {
        {"ICH6 or ICH6R", 2},
        {"ICH6-M", 2},
        {"ICH6W or ICH6RW", 2},
+       {"631xESB/632xESB", 2},
        {"ICH7 or ICH7R", 2},
-       {"ICH7-M", 2},
+       {"ICH7DH", 2},
+       {"ICH7-M or ICH7-U", 2},
        {"ICH7-M DH", 2},
        {"ICH8 or ICH8R", 2},
-       {"ICH8M-E", 2},
        {"ICH8DH", 2},
        {"ICH8DO", 2},
        {"ICH8M", 2},
+       {"ICH8M-E", 2},
        {"ICH9", 2},
        {"ICH9R", 2},
        {"ICH9DH", 2},
        {"ICH9DO", 2},
-       {"631xESB/632xESB", 2},
+       {"ICH9M", 2},
+       {"ICH9M-E", 2},
+       {"ICH10", 2},
+       {"ICH10R", 2},
+       {"ICH10D", 2},
+       {"ICH10DO", 2},
        {NULL, 0}
 };
 
@@ -175,18 +195,6 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_0,           TCO_ICH6)},
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_1,           TCO_ICH6M)},
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_2,           TCO_ICH6W)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_0,           TCO_ICH7)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_1,           TCO_ICH7M)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_31,          TCO_ICH7MDH)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_0,           TCO_ICH8)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_1,           TCO_ICH8ME)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_2,           TCO_ICH8DH)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_3,           TCO_ICH8DO)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_4,           TCO_ICH8M)},
-       { ITCO_PCI_DEVICE(0x2918,                               TCO_ICH9)},
-       { ITCO_PCI_DEVICE(0x2916,                               TCO_ICH9R)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2,           TCO_ICH9DH)},
-       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_4,           TCO_ICH9DO)},
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB2_0,           TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x2671,                               TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x2672,                               TCO_631XESB)},
@@ -203,6 +211,25 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
        { ITCO_PCI_DEVICE(0x267d,                               TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x267e,                               TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x267f,                               TCO_631XESB)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_0,           TCO_ICH7)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_30,          TCO_ICH7DH)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_1,           TCO_ICH7M)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_31,          TCO_ICH7MDH)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_0,           TCO_ICH8)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_2,           TCO_ICH8DH)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_3,           TCO_ICH8DO)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_4,           TCO_ICH8M)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_1,           TCO_ICH8ME)},
+       { ITCO_PCI_DEVICE(0x2918,                               TCO_ICH9)},
+       { ITCO_PCI_DEVICE(0x2916,                               TCO_ICH9R)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2,           TCO_ICH9DH)},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_4,           TCO_ICH9DO)},
+       { ITCO_PCI_DEVICE(0x2919,                               TCO_ICH9M)},
+       { ITCO_PCI_DEVICE(0x2917,                               TCO_ICH9ME)},
+       { ITCO_PCI_DEVICE(0x3a18,                               TCO_ICH10)},
+       { ITCO_PCI_DEVICE(0x3a16,                               TCO_ICH10R)},
+       { ITCO_PCI_DEVICE(0x3a1a,                               TCO_ICH10D)},
+       { ITCO_PCI_DEVICE(0x3a14,                               TCO_ICH10DO)},
        { 0, },                 /* End of list */
 };
 MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl);
@@ -311,6 +338,7 @@ static int iTCO_wdt_unset_NO_REBOOT_bit(void)
 static int iTCO_wdt_start(void)
 {
        unsigned int val;
+       unsigned long val32;
 
        spin_lock(&iTCO_wdt_private.io_lock);
 
@@ -323,6 +351,18 @@ static int iTCO_wdt_start(void)
                return -EIO;
        }
 
+       /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */
+       val32 = inl(SMI_EN);
+       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
+       outl(val32, SMI_EN);
+
+       /* Force the timer to its reload value by writing to the TCO_RLD
+          register */
+       if (iTCO_wdt_private.iTCO_version == 2)
+               outw(0x01, TCO_RLD);
+       else if (iTCO_wdt_private.iTCO_version == 1)
+               outb(0x01, TCO_RLD);
+
        /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */
        val = inw(TCO1_CNT);
        val &= 0xf7ff;
@@ -338,6 +378,7 @@ static int iTCO_wdt_start(void)
 static int iTCO_wdt_stop(void)
 {
        unsigned int val;
+       unsigned long val32;
 
        spin_lock(&iTCO_wdt_private.io_lock);
 
@@ -349,6 +390,11 @@ static int iTCO_wdt_stop(void)
        outw(val, TCO1_CNT);
        val = inw(TCO1_CNT);
 
+       /* Bit 13: TCO_EN -> 1 = Enables the TCO logic to generate SMI# */
+       val32 = inl(SMI_EN);
+       val32 |= 0x00002000;
+       outl(val32, SMI_EN);
+
        /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
        iTCO_wdt_set_NO_REBOOT_bit();
 
@@ -459,7 +505,6 @@ static int iTCO_wdt_open(struct inode *inode, struct file *file)
        /*
         *      Reload and activate timer
         */
-       iTCO_wdt_keepalive();
        iTCO_wdt_start();
        return nonseekable_open(inode, file);
 }
@@ -604,7 +649,6 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
        int ret;
        u32 base_address;
        unsigned long RCBA;
-       unsigned long val32;
 
        /*
         *      Find the ACPI/PM base I/O address which is the base
@@ -644,17 +688,13 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
        /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
        iTCO_wdt_set_NO_REBOOT_bit();
 
-       /* Set the TCO_EN bit in SMI_EN register */
+       /* The TCO logic uses the TCO_EN bit in the SMI_EN register */
        if (!request_region(SMI_EN, 4, "iTCO_wdt")) {
                printk(KERN_ERR PFX
                        "I/O address 0x%04lx already in use\n", SMI_EN);
                ret = -EIO;
                goto out;
        }
-       val32 = inl(SMI_EN);
-       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
-       outl(val32, SMI_EN);
-       release_region(SMI_EN, 4);
 
        /* The TCO I/O registers reside in a 32-byte range pointed to
           by the TCOBASE value */
@@ -662,7 +702,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
                printk(KERN_ERR PFX "I/O address 0x%04lx already in use\n",
                        TCOBASE);
                ret = -EIO;
-               goto out;
+               goto unreg_smi_en;
        }
 
        printk(KERN_INFO PFX
@@ -672,8 +712,9 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
                        TCOBASE);
 
        /* Clear out the (probably old) status */
-       outb(0, TCO1_STS);
-       outb(3, TCO2_STS);
+       outb(8, TCO1_STS);      /* Clear the Time Out Status bit */
+       outb(2, TCO2_STS);      /* Clear SECOND_TO_STS bit */
+       outb(4, TCO2_STS);      /* Clear BOOT_STS bit */
 
        /* Make sure the watchdog is not running */
        iTCO_wdt_stop();
@@ -701,6 +742,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
 
 unreg_region:
        release_region(TCOBASE, 0x20);
+unreg_smi_en:
+       release_region(SMI_EN, 4);
 out:
        if (iTCO_wdt_private.iTCO_version == 2)
                iounmap(iTCO_wdt_private.gcs);
@@ -718,6 +761,7 @@ static void __devexit iTCO_wdt_cleanup(void)
        /* Deregister */
        misc_deregister(&iTCO_wdt_miscdev);
        release_region(TCOBASE, 0x20);
+       release_region(SMI_EN, 4);
        if (iTCO_wdt_private.iTCO_version == 2)
                iounmap(iTCO_wdt_private.gcs);
        pci_dev_put(iTCO_wdt_private.pdev);
@@ -782,8 +826,8 @@ static int __init iTCO_wdt_init_module(void)
 {
        int err;
 
-       printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s (%s)\n",
-               DRV_VERSION, DRV_RELDATE);
+       printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s\n",
+               DRV_VERSION);
 
        err = platform_driver_register(&iTCO_wdt_driver);
        if (err)
index b4b7b0a4c119d47aa88675d28c7eefc8f04103a8..3acce623f20918328688b23656f197739bf5194d 100644 (file)
@@ -98,6 +98,8 @@ static void mtx1_wdt_reset(void)
 
 static void mtx1_wdt_start(void)
 {
+       unsigned long flags;
+
        spin_lock_irqsave(&mtx1_wdt_device.lock, flags);
        if (!mtx1_wdt_device.queue) {
                mtx1_wdt_device.queue = 1;
@@ -110,6 +112,8 @@ static void mtx1_wdt_start(void)
 
 static int mtx1_wdt_stop(void)
 {
+       unsigned long flags;
+
        spin_lock_irqsave(&mtx1_wdt_device.lock, flags);
        if (mtx1_wdt_device.queue) {
                mtx1_wdt_device.queue = 0;
index 3031e3233dd625302715ff10c3e49ddc4b1aa7f7..2a983d49d19cba78984b5ae317ded774605121c1 100644 (file)
@@ -45,7 +45,7 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
        struct v9fs_dentry *dent;
 
        P9_DPRINTK(P9_DEBUG_VFS, "fid %d dentry %s\n",
-                                       fid->fid, dentry->d_iname);
+                                       fid->fid, dentry->d_name.name);
 
        dent = dentry->d_fsdata;
        if (!dent) {
@@ -79,7 +79,7 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any)
        struct p9_fid *fid, *ret;
 
        P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
-               dentry->d_iname, dentry, uid, any);
+               dentry->d_name.name, dentry, uid, any);
        dent = (struct v9fs_dentry *) dentry->d_fsdata;
        ret = NULL;
        if (dent) {
index 24eb01087b6d63313404dff82b4f192177189342..332b5ff02fec11b8e8e43645c93ae09679ac9a61 100644 (file)
@@ -160,7 +160,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses)
                                v9ses->flags |= V9FS_ACCESS_ANY;
                        else {
                                v9ses->flags |= V9FS_ACCESS_SINGLE;
-                               v9ses->uid = simple_strtol(s, &e, 10);
+                               v9ses->uid = simple_strtoul(s, &e, 10);
                                if (*e != '\0')
                                        v9ses->uid = ~0;
                        }
index f9534f18df0a1a2bafdf70cd1b00466b8c5fb6b7..06dcc7c4f2343ebb9cced85a8da46c880849794f 100644 (file)
@@ -52,7 +52,8 @@
 
 static int v9fs_dentry_delete(struct dentry *dentry)
 {
-       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
+                                                                       dentry);
 
        return 1;
 }
@@ -69,7 +70,8 @@ static int v9fs_dentry_delete(struct dentry *dentry)
 static int v9fs_cached_dentry_delete(struct dentry *dentry)
 {
        struct inode *inode = dentry->d_inode;
-       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
+                                                                       dentry);
 
        if(!inode)
                return 1;
@@ -88,7 +90,8 @@ void v9fs_dentry_release(struct dentry *dentry)
        struct v9fs_dentry *dent;
        struct p9_fid *temp, *current_fid;
 
-       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
+                                                                       dentry);
        dent = dentry->d_fsdata;
        if (dent) {
                list_for_each_entry_safe(current_fid, temp, &dent->fidlist,
index 8314d3f43b716f41560e4517d42eaade5cfc1459..2dfcf5487efebff886a9f42c23733875d4264608 100644 (file)
@@ -963,7 +963,8 @@ static int v9fs_vfs_readlink(struct dentry *dentry, char __user * buffer,
        if (buflen > PATH_MAX)
                buflen = PATH_MAX;
 
-       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+       P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
+                                                                       dentry);
 
        retval = v9fs_readlink(dentry, link, buflen);
 
@@ -1022,7 +1023,8 @@ v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
 {
        char *s = nd_get_link(nd);
 
-       P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name, s);
+       P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name,
+               IS_ERR(s) ? "<error>" : s);
        if (!IS_ERR(s))
                __putname(s);
 }
index db831efbdbbdcc0d2b1298af4e3055916357fee2..99e0ae1a4c789fff59aae0e32207755e38fa7e41 100644 (file)
@@ -1135,12 +1135,15 @@ static int blkdev_open(struct inode * inode, struct file * filp)
        if (res)
                return res;
 
-       if (!(filp->f_mode & FMODE_EXCL))
-               return 0;
+       if (filp->f_mode & FMODE_EXCL) {
+               res = bd_claim(bdev, filp);
+               if (res)
+                       goto out_blkdev_put;
+       }
 
-       if (!(res = bd_claim(bdev, filp)))
-               return 0;
+       return 0;
 
+ out_blkdev_put:
        blkdev_put(bdev, filp->f_mode);
        return res;
 }
@@ -1203,8 +1206,16 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
        struct block_device *bdev = I_BDEV(file->f_mapping->host);
        fmode_t mode = file->f_mode;
+
+       /*
+        * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have
+        * to updated it before every ioctl.
+        */
        if (file->f_flags & O_NDELAY)
-               mode |= FMODE_NDELAY_NOW;
+               mode |= FMODE_NDELAY;
+       else
+               mode &= ~FMODE_NDELAY;
+
        return blkdev_ioctl(bdev, mode, cmd, arg);
 }
 
index 2af8626ced435c10bea3654e38570f7decaa8a7d..6d51696dc762d3b6656ed027fe2d7ed40d549409 100644 (file)
@@ -3983,7 +3983,8 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
 
                node->flags = le16_to_cpu(pSMBr->DFSFlags);
                if (is_unicode) {
-                       __le16 *tmp = kmalloc(strlen(searchName)*2, GFP_KERNEL);
+                       __le16 *tmp = kmalloc(strlen(searchName)*2 + 2,
+                                               GFP_KERNEL);
                        cifsConvertToUCS((__le16 *) tmp, searchName,
                                        PATH_MAX, nls_codepage, remap);
                        node->path_consumed = hostlen_fromUCS(tmp,
index 4e834f16d9da7d49c0f232b9fd46a7db2c680070..ec5df9a38313397565e44173cc434e09f6fc6ec4 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1159,6 +1159,7 @@ EXPORT_SYMBOL(remove_arg_zero);
  */
 int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
 {
+       unsigned int depth = bprm->recursion_depth;
        int try,retval;
        struct linux_binfmt *fmt;
 #ifdef __alpha__
@@ -1219,8 +1220,15 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
                                continue;
                        read_unlock(&binfmt_lock);
                        retval = fn(bprm, regs);
+                       /*
+                        * Restore the depth counter to its starting value
+                        * in this call, so we don't have to rely on every
+                        * load_binary function to restore it on return.
+                        */
+                       bprm->recursion_depth = depth;
                        if (retval >= 0) {
-                               tracehook_report_exec(fmt, bprm, regs);
+                               if (depth == 0)
+                                       tracehook_report_exec(fmt, bprm, regs);
                                put_binfmt(fmt);
                                allow_write_access(bprm->file);
                                if (bprm->file)
index 80246bad1b7fe513a7da15f4d6ac057cad3d7e54..890e018288171e90d9991b47e7077dfbaf9c7cf8 100644 (file)
@@ -367,6 +367,8 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
         * Try to get any dentry for the given file handle from the filesystem.
         */
        result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type);
+       if (!result)
+               result = ERR_PTR(-ESTALE);
        if (IS_ERR(result))
                return result;
 
@@ -420,6 +422,8 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
 
                target_dir = nop->fh_to_parent(mnt->mnt_sb, fid,
                                fh_len, fileid_type);
+               if (!target_dir)
+                       goto err_result;
                err = PTR_ERR(target_dir);
                if (IS_ERR(target_dir))
                        goto err_result;
index d2003cdc36aa687ab998a8c558144ddcc23ae6bb..db35cfdb3c8b6e25424a78af0aaaa69579cc2a07 100644 (file)
@@ -609,8 +609,8 @@ int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks)
 
        if (free_blocks - (nblocks + root_blocks + dirty_blocks) <
                                                EXT4_FREEBLOCKS_WATERMARK) {
-               free_blocks  = percpu_counter_sum(fbc);
-               dirty_blocks = percpu_counter_sum(dbc);
+               free_blocks  = percpu_counter_sum_positive(fbc);
+               dirty_blocks = percpu_counter_sum_positive(dbc);
                if (dirty_blocks < 0) {
                        printk(KERN_CRIT "Dirty block accounting "
                                        "went wrong %lld\n",
index ac4f7db9f13452790e4d41daa8e6fc9633506259..549daf8005fb5da252252d7e5bf0e73185250169 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/signal.h>
 #include <linux/rcupdate.h>
 #include <linux/pid_namespace.h>
+#include <linux/smp_lock.h>
 
 #include <asm/poll.h>
 #include <asm/siginfo.h>
@@ -175,6 +176,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
        if (error)
                return error;
 
+       /*
+        * We still need a lock here for now to keep multiple FASYNC calls
+        * from racing with each other.
+        */
+       lock_kernel();
        if ((arg ^ filp->f_flags) & FASYNC) {
                if (filp->f_op && filp->f_op->fasync) {
                        error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
@@ -185,6 +191,7 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 
        filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
  out:
+       unlock_kernel();
        return error;
 }
 
index 7bbed1b89825f8b37f4fa753201290d0002bf618..dae3f28f30d4779ee69cc8780d8424818b0fbfa4 100644 (file)
@@ -428,11 +428,13 @@ void inotify_unmount_inodes(struct list_head *list)
                watches = &inode->inotify_watches;
                list_for_each_entry_safe(watch, next_w, watches, i_list) {
                        struct inotify_handle *ih= watch->ih;
+                       get_inotify_watch(watch);
                        mutex_lock(&ih->mutex);
                        ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0,
                                                 NULL, NULL);
                        inotify_remove_watch_locked(ih, watch);
                        mutex_unlock(&ih->mutex);
+                       put_inotify_watch(watch);
                }
                mutex_unlock(&inode->inotify_mutex);
                iput(inode);            
index d152856c371be4906b7effec1f3c42842a4cee2d..43e8b2c0664b1b3d302a6d46e3fa40185edb5ae7 100644 (file)
@@ -400,11 +400,9 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp,
 
        /* Did FASYNC state change ? */
        if ((flag ^ filp->f_flags) & FASYNC) {
-               if (filp->f_op && filp->f_op->fasync) {
-                       lock_kernel();
+               if (filp->f_op && filp->f_op->fasync)
                        error = filp->f_op->fasync(fd, filp, on);
-                       unlock_kernel();
-               } else
+               else
                        error = -ENOTTY;
        }
        if (error)
@@ -440,11 +438,17 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
                break;
 
        case FIONBIO:
+               /* BKL needed to avoid races tweaking f_flags */
+               lock_kernel();
                error = ioctl_fionbio(filp, argp);
+               unlock_kernel();
                break;
 
        case FIOASYNC:
+               /* BKL needed to avoid races tweaking f_flags */
+               lock_kernel();
                error = ioctl_fioasync(fd, filp, argp);
+               unlock_kernel();
                break;
 
        case FIOQSIZE:
index 9fd8889097b728b735150ff82b1ff123a503dac7..70fc63a1727b131f496bc9a98186d61a022dc975 100644 (file)
@@ -167,7 +167,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
                        continue;
                if (host->h_server != ni->server)
                        continue;
-               if (!nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap))
+               if (ni->server &&
+                   !nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap))
                        continue;
 
                /* Move to head of hash chain. */
index c631a83931cec9cd56128daf5fc494b8fac9703a..56b076736b56afd054aa91b7585d80257f0f22ac 100644 (file)
@@ -181,6 +181,7 @@ lockd(void *vrqstp)
        }
        flush_signals(current);
        cancel_delayed_work_sync(&grace_period_end);
+       locks_end_grace(&lockd_manager);
        if (nlmsvc_ops)
                nlmsvc_invalidate_all();
        nlm_shutdown_hosts();
index bb93946ace2249841dd94a25d4ce0a0582e9dfde..b79ec930d9f1af003ddfb1fd9d130b12f6755f8b 100644 (file)
@@ -225,12 +225,12 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f)
                return 0;
 
        nfs4_save_user(&uid, &gid);
+       INIT_LIST_HEAD(dentries);
 
        filp = dentry_open(dget(dir), mntget(rec_dir.mnt), O_RDONLY);
        status = PTR_ERR(filp);
        if (IS_ERR(filp))
                goto out;
-       INIT_LIST_HEAD(dentries);
        status = vfs_readdir(filp, nfsd4_build_dentrylist, &dla);
        fput(filp);
        while (!list_empty(dentries)) {
index b0bebc552a11f3cec582b83c80c45c97a7734cdd..1a052ac2bde90b6599194380124c61b1c4054134 100644 (file)
@@ -3261,6 +3261,7 @@ nfs4_state_shutdown(void)
 {
        cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work);
        destroy_workqueue(laundry_wq);
+       locks_end_grace(&nfsd4_manager);
        nfs4_lock_state();
        nfs4_release_reclaim();
        __nfs4_state_shutdown();
index 5f180cf7abbd6f4e21dc1a662932f06ad56a6407..5e0c0d0aef7dcbcf1c9baae7b108cc47bce1f9cf 100644 (file)
@@ -86,7 +86,8 @@
 #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask)                  \
        OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
 
-#define OCFS2_FEATURE_COMPAT_SUPP      OCFS2_FEATURE_COMPAT_BACKUP_SB
+#define OCFS2_FEATURE_COMPAT_SUPP      (OCFS2_FEATURE_COMPAT_BACKUP_SB \
+                                        | OCFS2_FEATURE_COMPAT_JBD2_SB)
 #define OCFS2_FEATURE_INCOMPAT_SUPP    (OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT \
                                         | OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC \
                                         | OCFS2_FEATURE_INCOMPAT_INLINE_DATA \
  */
 #define OCFS2_FEATURE_COMPAT_BACKUP_SB         0x0001
 
+/*
+ * The filesystem will correctly handle journal feature bits.
+ */
+#define OCFS2_FEATURE_COMPAT_JBD2_SB           0x0002
+
 /*
  * Unwritten extents support.
  */
index 054e2efb0b7e71f196025c777d61f2cc5954e0f9..74d7367ade13e1e36cb74a13327ca65573fabf86 100644 (file)
@@ -2645,9 +2645,9 @@ static int ocfs2_xattr_update_xattr_search(struct inode *inode,
                                return ret;
                        }
 
-                       i = xs->here - old_xh->xh_entries;
-                       xs->here = &xs->header->xh_entries[i];
                }
+               i = xs->here - old_xh->xh_entries;
+               xs->here = &xs->header->xh_entries[i];
        }
 
        return ret;
index 486cf3fe7139949a0911e0e33f9cb99a06bfb8fb..d4677603c88920b45e14af3d91b71894b2c5b7b2 100644 (file)
@@ -371,7 +371,7 @@ static int lstats_show_proc(struct seq_file *m, void *v)
                                task->latency_record[i].time,
                                task->latency_record[i].max);
                        for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
-                               char sym[KSYM_NAME_LEN];
+                               char sym[KSYM_SYMBOL_LEN];
                                char *c;
                                if (!task->latency_record[i].backtrace[q])
                                        break;
index b770c095e45c62f86e78da2f9d1524085f9d45fd..3a8bdd7f5756e37d430f15b2b5b76fb672c9b965 100644 (file)
@@ -557,9 +557,9 @@ static u64 swap_pte_to_pagemap_entry(pte_t pte)
        return swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT);
 }
 
-static unsigned long pte_to_pagemap_entry(pte_t pte)
+static u64 pte_to_pagemap_entry(pte_t pte)
 {
-       unsigned long pme = 0;
+       u64 pme = 0;
        if (is_swap_pte(pte))
                pme = PM_PFRAME(swap_pte_to_pagemap_entry(pte))
                        | PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
index 0a6aa2cc78f07eb7e0aa4ce6af2dfe8b5fe32ca5..b49884c8c10e823cbe484e9d5c1fadddf16b5008 100644 (file)
@@ -234,8 +234,8 @@ int ubifs_bg_thread(void *info)
        int err;
        struct ubifs_info *c = info;
 
-       ubifs_msg("background thread \"%s\" started, PID %d",
-                 c->bgt_name, current->pid);
+       dbg_msg("background thread \"%s\" started, PID %d",
+               c->bgt_name, current->pid);
        set_freezable();
 
        while (1) {
index 7186400750e775ad18bd2e9975a373ecb7803e62..510ffa0bbda4658559cf682a01145d4ff7f9231e 100644 (file)
@@ -101,21 +101,24 @@ static void sprintf_key(const struct ubifs_info *c, const union ubifs_key *key,
        if (c->key_fmt == UBIFS_SIMPLE_KEY_FMT) {
                switch (type) {
                case UBIFS_INO_KEY:
-                       sprintf(p, "(%lu, %s)", key_inum(c, key),
+                       sprintf(p, "(%lu, %s)", (unsigned long)key_inum(c, key),
                               get_key_type(type));
                        break;
                case UBIFS_DENT_KEY:
                case UBIFS_XENT_KEY:
-                       sprintf(p, "(%lu, %s, %#08x)", key_inum(c, key),
+                       sprintf(p, "(%lu, %s, %#08x)",
+                               (unsigned long)key_inum(c, key),
                                get_key_type(type), key_hash(c, key));
                        break;
                case UBIFS_DATA_KEY:
-                       sprintf(p, "(%lu, %s, %u)", key_inum(c, key),
+                       sprintf(p, "(%lu, %s, %u)",
+                               (unsigned long)key_inum(c, key),
                                get_key_type(type), key_block(c, key));
                        break;
                case UBIFS_TRUN_KEY:
                        sprintf(p, "(%lu, %s)",
-                               key_inum(c, key), get_key_type(type));
+                               (unsigned long)key_inum(c, key),
+                               get_key_type(type));
                        break;
                default:
                        sprintf(p, "(bad key type: %#08x, %#08x)",
@@ -364,8 +367,8 @@ void dbg_dump_node(const struct ubifs_info *c, const void *node)
                       le32_to_cpu(mst->ihead_lnum));
                printk(KERN_DEBUG "\tihead_offs     %u\n",
                       le32_to_cpu(mst->ihead_offs));
-               printk(KERN_DEBUG "\tindex_size     %u\n",
-                      le32_to_cpu(mst->index_size));
+               printk(KERN_DEBUG "\tindex_size     %llu\n",
+                      (unsigned long long)le64_to_cpu(mst->index_size));
                printk(KERN_DEBUG "\tlpt_lnum       %u\n",
                       le32_to_cpu(mst->lpt_lnum));
                printk(KERN_DEBUG "\tlpt_offs       %u\n",
@@ -1589,7 +1592,7 @@ static struct fsck_inode *add_inode(struct ubifs_info *c,
 
        if (inum > c->highest_inum) {
                ubifs_err("too high inode number, max. is %lu",
-                         c->highest_inum);
+                         (unsigned long)c->highest_inum);
                return ERR_PTR(-EINVAL);
        }
 
@@ -1668,16 +1671,18 @@ static struct fsck_inode *read_add_inode(struct ubifs_info *c,
        ino_key_init(c, &key, inum);
        err = ubifs_lookup_level0(c, &key, &znode, &n);
        if (!err) {
-               ubifs_err("inode %lu not found in index", inum);
+               ubifs_err("inode %lu not found in index", (unsigned long)inum);
                return ERR_PTR(-ENOENT);
        } else if (err < 0) {
-               ubifs_err("error %d while looking up inode %lu", err, inum);
+               ubifs_err("error %d while looking up inode %lu",
+                         err, (unsigned long)inum);
                return ERR_PTR(err);
        }
 
        zbr = &znode->zbranch[n];
        if (zbr->len < UBIFS_INO_NODE_SZ) {
-               ubifs_err("bad node %lu node length %d", inum, zbr->len);
+               ubifs_err("bad node %lu node length %d",
+                         (unsigned long)inum, zbr->len);
                return ERR_PTR(-EINVAL);
        }
 
@@ -1697,7 +1702,7 @@ static struct fsck_inode *read_add_inode(struct ubifs_info *c,
        kfree(ino);
        if (IS_ERR(fscki)) {
                ubifs_err("error %ld while adding inode %lu node",
-                         PTR_ERR(fscki), inum);
+                         PTR_ERR(fscki), (unsigned long)inum);
                return fscki;
        }
 
@@ -1786,7 +1791,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
                if (IS_ERR(fscki)) {
                        err = PTR_ERR(fscki);
                        ubifs_err("error %d while processing data node and "
-                                 "trying to find inode node %lu", err, inum);
+                                 "trying to find inode node %lu",
+                                 err, (unsigned long)inum);
                        goto out_dump;
                }
 
@@ -1819,7 +1825,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
                if (IS_ERR(fscki)) {
                        err = PTR_ERR(fscki);
                        ubifs_err("error %d while processing entry node and "
-                                 "trying to find inode node %lu", err, inum);
+                                 "trying to find inode node %lu",
+                                 err, (unsigned long)inum);
                        goto out_dump;
                }
 
@@ -1832,7 +1839,7 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
                        err = PTR_ERR(fscki);
                        ubifs_err("error %d while processing entry node and "
                                  "trying to find parent inode node %lu",
-                                 err, inum);
+                                 err, (unsigned long)inum);
                        goto out_dump;
                }
 
@@ -1923,7 +1930,8 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
                            fscki->references != 1) {
                                ubifs_err("directory inode %lu has %d "
                                          "direntries which refer it, but "
-                                         "should be 1", fscki->inum,
+                                         "should be 1",
+                                         (unsigned long)fscki->inum,
                                          fscki->references);
                                goto out_dump;
                        }
@@ -1931,27 +1939,29 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
                            fscki->references != 0) {
                                ubifs_err("root inode %lu has non-zero (%d) "
                                          "direntries which refer it",
-                                         fscki->inum, fscki->references);
+                                         (unsigned long)fscki->inum,
+                                         fscki->references);
                                goto out_dump;
                        }
                        if (fscki->calc_sz != fscki->size) {
                                ubifs_err("directory inode %lu size is %lld, "
                                          "but calculated size is %lld",
-                                         fscki->inum, fscki->size,
-                                         fscki->calc_sz);
+                                         (unsigned long)fscki->inum,
+                                         fscki->size, fscki->calc_sz);
                                goto out_dump;
                        }
                        if (fscki->calc_cnt != fscki->nlink) {
                                ubifs_err("directory inode %lu nlink is %d, "
                                          "but calculated nlink is %d",
-                                         fscki->inum, fscki->nlink,
-                                         fscki->calc_cnt);
+                                         (unsigned long)fscki->inum,
+                                         fscki->nlink, fscki->calc_cnt);
                                goto out_dump;
                        }
                } else {
                        if (fscki->references != fscki->nlink) {
                                ubifs_err("inode %lu nlink is %d, but "
-                                         "calculated nlink is %d", fscki->inum,
+                                         "calculated nlink is %d",
+                                         (unsigned long)fscki->inum,
                                          fscki->nlink, fscki->references);
                                goto out_dump;
                        }
@@ -1959,20 +1969,21 @@ static int check_inodes(struct ubifs_info *c, struct fsck_data *fsckd)
                if (fscki->xattr_sz != fscki->calc_xsz) {
                        ubifs_err("inode %lu has xattr size %u, but "
                                  "calculated size is %lld",
-                                 fscki->inum, fscki->xattr_sz,
+                                 (unsigned long)fscki->inum, fscki->xattr_sz,
                                  fscki->calc_xsz);
                        goto out_dump;
                }
                if (fscki->xattr_cnt != fscki->calc_xcnt) {
                        ubifs_err("inode %lu has %u xattrs, but "
-                                 "calculated count is %lld", fscki->inum,
+                                 "calculated count is %lld",
+                                 (unsigned long)fscki->inum,
                                  fscki->xattr_cnt, fscki->calc_xcnt);
                        goto out_dump;
                }
                if (fscki->xattr_nms != fscki->calc_xnms) {
                        ubifs_err("inode %lu has xattr names' size %u, but "
                                  "calculated names' size is %lld",
-                                 fscki->inum, fscki->xattr_nms,
+                                 (unsigned long)fscki->inum, fscki->xattr_nms,
                                  fscki->calc_xnms);
                        goto out_dump;
                }
@@ -1985,11 +1996,12 @@ out_dump:
        ino_key_init(c, &key, fscki->inum);
        err = ubifs_lookup_level0(c, &key, &znode, &n);
        if (!err) {
-               ubifs_err("inode %lu not found in index", fscki->inum);
+               ubifs_err("inode %lu not found in index",
+                         (unsigned long)fscki->inum);
                return -ENOENT;
        } else if (err < 0) {
                ubifs_err("error %d while looking up inode %lu",
-                         err, fscki->inum);
+                         err, (unsigned long)fscki->inum);
                return err;
        }
 
@@ -2007,7 +2019,7 @@ out_dump:
        }
 
        ubifs_msg("dump of the inode %lu sitting in LEB %d:%d",
-                 fscki->inum, zbr->lnum, zbr->offs);
+                 (unsigned long)fscki->inum, zbr->lnum, zbr->offs);
        dbg_dump_node(c, ino);
        kfree(ino);
        return -EINVAL;
index 526c01ec80032be9205e6057c48f9188b136b6e8..0422c98e17932e41ecca3f25c6dea8aedb10e133 100644 (file)
@@ -161,7 +161,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
                        return ERR_PTR(-EINVAL);
                }
                ubifs_warn("running out of inode numbers (current %lu, max %d)",
-                          c->highest_inum, INUM_WATERMARK);
+                          (unsigned long)c->highest_inum, INUM_WATERMARK);
        }
 
        inode->i_ino = ++c->highest_inum;
@@ -428,7 +428,8 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
                dbg_gen("feed '%s', ino %llu, new f_pos %#x",
                        dent->name, (unsigned long long)le64_to_cpu(dent->inum),
                        key_hash_flash(c, &dent->key));
-               ubifs_assert(dent->ch.sqnum > ubifs_inode(dir)->creat_sqnum);
+               ubifs_assert(le64_to_cpu(dent->ch.sqnum) >
+                            ubifs_inode(dir)->creat_sqnum);
 
                nm.len = le16_to_cpu(dent->nlen);
                over = filldir(dirent, dent->name, nm.len, file->f_pos,
index 51cf511d44d918ccef3210c340f55fa7cc90e35b..2624411d9758d11023c938418f8a6a7938066ff5 100644 (file)
@@ -72,7 +72,7 @@ static int read_block(struct inode *inode, void *addr, unsigned int block,
                return err;
        }
 
-       ubifs_assert(dn->ch.sqnum > ubifs_inode(inode)->creat_sqnum);
+       ubifs_assert(le64_to_cpu(dn->ch.sqnum) > ubifs_inode(inode)->creat_sqnum);
 
        len = le32_to_cpu(dn->size);
        if (len <= 0 || len > UBIFS_BLOCK_SIZE)
@@ -626,7 +626,7 @@ static int populate_page(struct ubifs_info *c, struct page *page,
 
                        dn = bu->buf + (bu->zbranch[nn].offs - offs);
 
-                       ubifs_assert(dn->ch.sqnum >
+                       ubifs_assert(le64_to_cpu(dn->ch.sqnum) >
                                     ubifs_inode(inode)->creat_sqnum);
 
                        len = le32_to_cpu(dn->size);
@@ -691,32 +691,22 @@ out_err:
 /**
  * ubifs_do_bulk_read - do bulk-read.
  * @c: UBIFS file-system description object
- * @page1: first page
+ * @bu: bulk-read information
+ * @page1: first page to read
  *
  * This function returns %1 if the bulk-read is done, otherwise %0 is returned.
  */
-static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
+static int ubifs_do_bulk_read(struct ubifs_info *c, struct bu_info *bu,
+                             struct page *page1)
 {
        pgoff_t offset = page1->index, end_index;
        struct address_space *mapping = page1->mapping;
        struct inode *inode = mapping->host;
        struct ubifs_inode *ui = ubifs_inode(inode);
-       struct bu_info *bu;
        int err, page_idx, page_cnt, ret = 0, n = 0;
+       int allocate = bu->buf ? 0 : 1;
        loff_t isize;
 
-       bu = kmalloc(sizeof(struct bu_info), GFP_NOFS);
-       if (!bu)
-               return 0;
-
-       bu->buf_len = c->bulk_read_buf_size;
-       bu->buf = kmalloc(bu->buf_len, GFP_NOFS);
-       if (!bu->buf)
-               goto out_free;
-
-       data_key_init(c, &bu->key, inode->i_ino,
-                     offset << UBIFS_BLOCKS_PER_PAGE_SHIFT);
-
        err = ubifs_tnc_get_bu_keys(c, bu);
        if (err)
                goto out_warn;
@@ -735,12 +725,25 @@ static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
                 * together. If all the pages were like this, bulk-read would
                 * reduce performance, so we turn it off for a while.
                 */
-               ui->read_in_a_row = 0;
-               ui->bulk_read = 0;
-               goto out_free;
+               goto out_bu_off;
        }
 
        if (bu->cnt) {
+               if (allocate) {
+                       /*
+                        * Allocate bulk-read buffer depending on how many data
+                        * nodes we are going to read.
+                        */
+                       bu->buf_len = bu->zbranch[bu->cnt - 1].offs +
+                                     bu->zbranch[bu->cnt - 1].len -
+                                     bu->zbranch[0].offs;
+                       ubifs_assert(bu->buf_len > 0);
+                       ubifs_assert(bu->buf_len <= c->leb_size);
+                       bu->buf = kmalloc(bu->buf_len, GFP_NOFS | __GFP_NOWARN);
+                       if (!bu->buf)
+                               goto out_bu_off;
+               }
+
                err = ubifs_tnc_bulk_read(c, bu);
                if (err)
                        goto out_warn;
@@ -779,13 +782,17 @@ static int ubifs_do_bulk_read(struct ubifs_info *c, struct page *page1)
        ui->last_page_read = offset + page_idx - 1;
 
 out_free:
-       kfree(bu->buf);
-       kfree(bu);
+       if (allocate)
+               kfree(bu->buf);
        return ret;
 
 out_warn:
        ubifs_warn("ignoring error %d and skipping bulk-read", err);
        goto out_free;
+
+out_bu_off:
+       ui->read_in_a_row = ui->bulk_read = 0;
+       goto out_free;
 }
 
 /**
@@ -803,18 +810,20 @@ static int ubifs_bulk_read(struct page *page)
        struct ubifs_info *c = inode->i_sb->s_fs_info;
        struct ubifs_inode *ui = ubifs_inode(inode);
        pgoff_t index = page->index, last_page_read = ui->last_page_read;
-       int ret = 0;
+       struct bu_info *bu;
+       int err = 0, allocated = 0;
 
        ui->last_page_read = index;
-
        if (!c->bulk_read)
                return 0;
+
        /*
-        * Bulk-read is protected by ui_mutex, but it is an optimization, so
-        * don't bother if we cannot lock the mutex.
+        * Bulk-read is protected by @ui->ui_mutex, but it is an optimization,
+        * so don't bother if we cannot lock the mutex.
         */
        if (!mutex_trylock(&ui->ui_mutex))
                return 0;
+
        if (index != last_page_read + 1) {
                /* Turn off bulk-read if we stop reading sequentially */
                ui->read_in_a_row = 1;
@@ -822,6 +831,7 @@ static int ubifs_bulk_read(struct page *page)
                        ui->bulk_read = 0;
                goto out_unlock;
        }
+
        if (!ui->bulk_read) {
                ui->read_in_a_row += 1;
                if (ui->read_in_a_row < 3)
@@ -829,10 +839,35 @@ static int ubifs_bulk_read(struct page *page)
                /* Three reads in a row, so switch on bulk-read */
                ui->bulk_read = 1;
        }
-       ret = ubifs_do_bulk_read(c, page);
+
+       /*
+        * If possible, try to use pre-allocated bulk-read information, which
+        * is protected by @c->bu_mutex.
+        */
+       if (mutex_trylock(&c->bu_mutex))
+               bu = &c->bu;
+       else {
+               bu = kmalloc(sizeof(struct bu_info), GFP_NOFS | __GFP_NOWARN);
+               if (!bu)
+                       goto out_unlock;
+
+               bu->buf = NULL;
+               allocated = 1;
+       }
+
+       bu->buf_len = c->max_bu_buf_len;
+       data_key_init(c, &bu->key, inode->i_ino,
+                     page->index << UBIFS_BLOCKS_PER_PAGE_SHIFT);
+       err = ubifs_do_bulk_read(c, bu, page);
+
+       if (!allocated)
+               mutex_unlock(&c->bu_mutex);
+       else
+               kfree(bu);
+
 out_unlock:
        mutex_unlock(&ui->ui_mutex);
-       return ret;
+       return err;
 }
 
 static int ubifs_readpage(struct file *file, struct page *page)
index 22993f867d194ffbc3bab30f25675c0fbb22dbb4..f91b745908ea595ac94bd25b86368d5515149be0 100644 (file)
@@ -690,8 +690,9 @@ int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode,
        int dlen = UBIFS_DATA_NODE_SZ + UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR;
        struct ubifs_inode *ui = ubifs_inode(inode);
 
-       dbg_jnl("ino %lu, blk %u, len %d, key %s", key_inum(c, key),
-               key_block(c, key), len, DBGKEY(key));
+       dbg_jnl("ino %lu, blk %u, len %d, key %s",
+               (unsigned long)key_inum(c, key), key_block(c, key), len,
+               DBGKEY(key));
        ubifs_assert(len <= UBIFS_BLOCK_SIZE);
 
        data = kmalloc(dlen, GFP_NOFS);
@@ -1128,7 +1129,8 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,
        ino_t inum = inode->i_ino;
        unsigned int blk;
 
-       dbg_jnl("ino %lu, size %lld -> %lld", inum, old_size, new_size);
+       dbg_jnl("ino %lu, size %lld -> %lld",
+               (unsigned long)inum, old_size, new_size);
        ubifs_assert(!ui->data_len);
        ubifs_assert(S_ISREG(inode->i_mode));
        ubifs_assert(mutex_is_locked(&ui->ui_mutex));
index 9ee65086f627eec8d393746bc957fc7538027b66..3f1f16bc25c99ba1e019c940030c1fa48b7217fa 100644 (file)
@@ -345,7 +345,7 @@ static inline int key_type_flash(const struct ubifs_info *c, const void *k)
 {
        const union ubifs_key *key = k;
 
-       return le32_to_cpu(key->u32[1]) >> UBIFS_S_KEY_BLOCK_BITS;
+       return le32_to_cpu(key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS;
 }
 
 /**
@@ -416,7 +416,7 @@ static inline unsigned int key_block_flash(const struct ubifs_info *c,
 {
        const union ubifs_key *key = k;
 
-       return le32_to_cpu(key->u32[1]) & UBIFS_S_KEY_BLOCK_MASK;
+       return le32_to_cpu(key->j32[1]) & UBIFS_S_KEY_BLOCK_MASK;
 }
 
 /**
index eed5a0025d63f8b3b4d21dba633f4c9b208cb6be..a41434b427854e66527775ca3e6fdfcb89a332bd 100644 (file)
@@ -571,8 +571,6 @@ static struct ubifs_pnode *next_pnode(struct ubifs_info *c,
                /* We assume here that LEB zero is never an LPT LEB */
                if (nnode->nbranch[iip].lnum)
                        return ubifs_get_pnode(c, nnode, iip);
-               else
-                       return NULL;
        }
 
        /* Go up while can't go right */
index 02d3462f4d3e99edb907ddaee16ed75300e827b0..9bd5a43d4526c8d7a55d0ae2a1fb4fa37a3fd922 100644 (file)
@@ -105,7 +105,7 @@ int ubifs_add_orphan(struct ubifs_info *c, ino_t inum)
        list_add_tail(&orphan->list, &c->orph_list);
        list_add_tail(&orphan->new_list, &c->orph_new);
        spin_unlock(&c->orphan_lock);
-       dbg_gen("ino %lu", inum);
+       dbg_gen("ino %lu", (unsigned long)inum);
        return 0;
 }
 
@@ -132,14 +132,16 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum)
                else {
                        if (o->dnext) {
                                spin_unlock(&c->orphan_lock);
-                               dbg_gen("deleted twice ino %lu", inum);
+                               dbg_gen("deleted twice ino %lu",
+                                       (unsigned long)inum);
                                return;
                        }
                        if (o->cnext) {
                                o->dnext = c->orph_dnext;
                                c->orph_dnext = o;
                                spin_unlock(&c->orphan_lock);
-                               dbg_gen("delete later ino %lu", inum);
+                               dbg_gen("delete later ino %lu",
+                                       (unsigned long)inum);
                                return;
                        }
                        rb_erase(p, &c->orph_tree);
@@ -151,12 +153,12 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum)
                        }
                        spin_unlock(&c->orphan_lock);
                        kfree(o);
-                       dbg_gen("inum %lu", inum);
+                       dbg_gen("inum %lu", (unsigned long)inum);
                        return;
                }
        }
        spin_unlock(&c->orphan_lock);
-       dbg_err("missing orphan ino %lu", inum);
+       dbg_err("missing orphan ino %lu", (unsigned long)inum);
        dbg_dump_stack();
 }
 
@@ -448,7 +450,7 @@ static void erase_deleted(struct ubifs_info *c)
                rb_erase(&orphan->rb, &c->orph_tree);
                list_del(&orphan->list);
                c->tot_orphans -= 1;
-               dbg_gen("deleting orphan ino %lu", orphan->inum);
+               dbg_gen("deleting orphan ino %lu", (unsigned long)orphan->inum);
                kfree(orphan);
        }
        c->orph_dnext = NULL;
@@ -536,8 +538,8 @@ static int insert_dead_orphan(struct ubifs_info *c, ino_t inum)
        list_add_tail(&orphan->list, &c->orph_list);
        orphan->dnext = c->orph_dnext;
        c->orph_dnext = orphan;
-       dbg_mnt("ino %lu, new %d, tot %d",
-               inum, c->new_orphans, c->tot_orphans);
+       dbg_mnt("ino %lu, new %d, tot %d", (unsigned long)inum,
+               c->new_orphans, c->tot_orphans);
        return 0;
 }
 
@@ -609,7 +611,8 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
                n = (le32_to_cpu(orph->ch.len) - UBIFS_ORPH_NODE_SZ) >> 3;
                for (i = 0; i < n; i++) {
                        inum = le64_to_cpu(orph->inos[i]);
-                       dbg_rcvry("deleting orphaned inode %lu", inum);
+                       dbg_rcvry("deleting orphaned inode %lu",
+                                 (unsigned long)inum);
                        err = ubifs_tnc_remove_ino(c, inum);
                        if (err)
                                return err;
@@ -840,8 +843,8 @@ static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr,
        if (inum != ci->last_ino) {
                /* Lowest node type is the inode node, so it comes first */
                if (key_type(c, &zbr->key) != UBIFS_INO_KEY)
-                       ubifs_err("found orphan node ino %lu, type %d", inum,
-                                 key_type(c, &zbr->key));
+                       ubifs_err("found orphan node ino %lu, type %d",
+                                 (unsigned long)inum, key_type(c, &zbr->key));
                ci->last_ino = inum;
                ci->tot_inos += 1;
                err = ubifs_tnc_read_node(c, zbr, ci->node);
@@ -853,7 +856,8 @@ static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr,
                        /* Must be recorded as an orphan */
                        if (!dbg_find_check_orphan(&ci->root, inum) &&
                            !dbg_find_orphan(c, inum)) {
-                               ubifs_err("missing orphan, ino %lu", inum);
+                               ubifs_err("missing orphan, ino %lu",
+                                         (unsigned long)inum);
                                ci->missing += 1;
                        }
        }
index 77d26c141cf651997082f3be64c98e5a6675bad0..90acac603e635baf82e05037150c85c818a2c738 100644 (file)
@@ -168,12 +168,12 @@ static int write_rcvrd_mst_node(struct ubifs_info *c,
                                struct ubifs_mst_node *mst)
 {
        int err = 0, lnum = UBIFS_MST_LNUM, sz = c->mst_node_alsz;
-       uint32_t save_flags;
+       __le32 save_flags;
 
        dbg_rcvry("recovery");
 
        save_flags = mst->flags;
-       mst->flags = cpu_to_le32(le32_to_cpu(mst->flags) | UBIFS_MST_RCVRY);
+       mst->flags |= cpu_to_le32(UBIFS_MST_RCVRY);
 
        ubifs_prepare_node(c, mst, UBIFS_MST_NODE_SZ, 1);
        err = ubi_leb_change(c->ubi, lnum, mst, sz, UBI_SHORTTERM);
@@ -1435,13 +1435,13 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e)
        err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN);
        if (err)
                goto out;
-       dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ", e->inum, lnum, offs,
-                 i_size, e->d_size);
+       dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ",
+                 (unsigned long)e->inum, lnum, offs, i_size, e->d_size);
        return 0;
 
 out:
        ubifs_warn("inode %lu failed to fix size %lld -> %lld error %d",
-                  e->inum, e->i_size, e->d_size, err);
+                  (unsigned long)e->inum, e->i_size, e->d_size, err);
        return err;
 }
 
@@ -1472,7 +1472,8 @@ int ubifs_recover_size(struct ubifs_info *c)
                                return err;
                        if (err == -ENOENT) {
                                /* Remove data nodes that have no inode */
-                               dbg_rcvry("removing ino %lu", e->inum);
+                               dbg_rcvry("removing ino %lu",
+                                         (unsigned long)e->inum);
                                err = ubifs_tnc_remove_ino(c, e->inum);
                                if (err)
                                        return err;
@@ -1493,8 +1494,8 @@ int ubifs_recover_size(struct ubifs_info *c)
                                        return PTR_ERR(inode);
                                if (inode->i_size < e->d_size) {
                                        dbg_rcvry("ino %lu size %lld -> %lld",
-                                                 e->inum, e->d_size,
-                                                 inode->i_size);
+                                                 (unsigned long)e->inum,
+                                                 e->d_size, inode->i_size);
                                        inode->i_size = e->d_size;
                                        ubifs_inode(inode)->ui_size = e->d_size;
                                        e->inode = inode;
index 7399692af859e2ea62b40c3924e792611745e59e..21f7d047c306be4cc3761deed76ea0de2ff8ea3f 100644 (file)
@@ -1065,7 +1065,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
        ubifs_assert(c->bud_bytes <= c->max_bud_bytes || c->need_recovery);
        dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, "
                "highest_inum %lu", c->lhead_lnum, c->lhead_offs, c->max_sqnum,
-               c->highest_inum);
+               (unsigned long)c->highest_inum);
 out:
        destroy_replay_tree(c);
        destroy_bud_list(c);
index 2bf753b388894e449b894a87c6eaaa152d6e7d56..0f392351dc5a57232c776ccf7577c7d759d5da85 100644 (file)
@@ -81,6 +81,7 @@ static int create_default_filesystem(struct ubifs_info *c)
        int lpt_lebs, lpt_first, orph_lebs, big_lpt, ino_waste, sup_flags = 0;
        int min_leb_cnt = UBIFS_MIN_LEB_CNT;
        uint64_t tmp64, main_bytes;
+       __le64 tmp_le64;
 
        /* Some functions called from here depend on the @c->key_len filed */
        c->key_len = UBIFS_SK_LEN;
@@ -295,10 +296,10 @@ static int create_default_filesystem(struct ubifs_info *c)
        ino->ch.node_type = UBIFS_INO_NODE;
        ino->creat_sqnum = cpu_to_le64(++c->max_sqnum);
        ino->nlink = cpu_to_le32(2);
-       tmp = cpu_to_le64(CURRENT_TIME_SEC.tv_sec);
-       ino->atime_sec   = tmp;
-       ino->ctime_sec   = tmp;
-       ino->mtime_sec   = tmp;
+       tmp_le64 = cpu_to_le64(CURRENT_TIME_SEC.tv_sec);
+       ino->atime_sec   = tmp_le64;
+       ino->ctime_sec   = tmp_le64;
+       ino->mtime_sec   = tmp_le64;
        ino->atime_nsec  = 0;
        ino->ctime_nsec  = 0;
        ino->mtime_nsec  = 0;
index 8780efbf40ac64fbf901fd448998361823c38be3..d80b2aef42b661001b2c87ac645f9a8ac29fbfd7 100644 (file)
 #include <linux/mount.h>
 #include "ubifs.h"
 
+/*
+ * Maximum amount of memory we may 'kmalloc()' without worrying that we are
+ * allocating too much.
+ */
+#define UBIFS_KMALLOC_OK (128*1024)
+
 /* Slab cache for UBIFS inodes */
 struct kmem_cache *ubifs_inode_slab;
 
@@ -561,18 +567,11 @@ static int init_constants_early(struct ubifs_info *c)
         * calculations when reporting free space.
         */
        c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ;
-       /* Buffer size for bulk-reads */
-       c->bulk_read_buf_size = UBIFS_MAX_BULK_READ * UBIFS_MAX_DATA_NODE_SZ;
-       if (c->bulk_read_buf_size > c->leb_size)
-               c->bulk_read_buf_size = c->leb_size;
-       if (c->bulk_read_buf_size > 128 * 1024) {
-               /* Check if we can kmalloc more than 128KiB */
-               void *try = kmalloc(c->bulk_read_buf_size, GFP_KERNEL);
 
-               kfree(try);
-               if (!try)
-                       c->bulk_read_buf_size = 128 * 1024;
-       }
+       /* Buffer size for bulk-reads */
+       c->max_bu_buf_len = UBIFS_MAX_BULK_READ * UBIFS_MAX_DATA_NODE_SZ;
+       if (c->max_bu_buf_len > c->leb_size)
+               c->max_bu_buf_len = c->leb_size;
        return 0;
 }
 
@@ -991,6 +990,34 @@ static void destroy_journal(struct ubifs_info *c)
        free_buds(c);
 }
 
+/**
+ * bu_init - initialize bulk-read information.
+ * @c: UBIFS file-system description object
+ */
+static void bu_init(struct ubifs_info *c)
+{
+       ubifs_assert(c->bulk_read == 1);
+
+       if (c->bu.buf)
+               return; /* Already initialized */
+
+again:
+       c->bu.buf = kmalloc(c->max_bu_buf_len, GFP_KERNEL | __GFP_NOWARN);
+       if (!c->bu.buf) {
+               if (c->max_bu_buf_len > UBIFS_KMALLOC_OK) {
+                       c->max_bu_buf_len = UBIFS_KMALLOC_OK;
+                       goto again;
+               }
+
+               /* Just disable bulk-read */
+               ubifs_warn("Cannot allocate %d bytes of memory for bulk-read, "
+                          "disabling it", c->max_bu_buf_len);
+               c->mount_opts.bulk_read = 1;
+               c->bulk_read = 0;
+               return;
+       }
+}
+
 /**
  * mount_ubifs - mount UBIFS file-system.
  * @c: UBIFS file-system description object
@@ -1059,6 +1086,13 @@ static int mount_ubifs(struct ubifs_info *c)
                        goto out_free;
        }
 
+       if (c->bulk_read == 1)
+               bu_init(c);
+
+       /*
+        * We have to check all CRCs, even for data nodes, when we mount the FS
+        * (specifically, when we are replaying).
+        */
        c->always_chk_crc = 1;
 
        err = ubifs_read_superblock(c);
@@ -1289,6 +1323,7 @@ out_cbuf:
 out_dereg:
        dbg_failure_mode_deregistration(c);
 out_free:
+       kfree(c->bu.buf);
        vfree(c->ileb_buf);
        vfree(c->sbuf);
        kfree(c->bottom_up_buf);
@@ -1325,10 +1360,11 @@ static void ubifs_umount(struct ubifs_info *c)
        kfree(c->cbuf);
        kfree(c->rcvrd_mst_node);
        kfree(c->mst_node);
+       kfree(c->bu.buf);
+       vfree(c->ileb_buf);
        vfree(c->sbuf);
        kfree(c->bottom_up_buf);
        UBIFS_DBG(vfree(c->dbg_buf));
-       vfree(c->ileb_buf);
        dbg_failure_mode_deregistration(c);
 }
 
@@ -1626,6 +1662,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
                ubifs_err("invalid or unknown remount parameter");
                return err;
        }
+
        if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
                err = ubifs_remount_rw(c);
                if (err)
@@ -1633,6 +1670,14 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
        } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY))
                ubifs_remount_ro(c);
 
+       if (c->bulk_read == 1)
+               bu_init(c);
+       else {
+               dbg_gen("disable bulk-read");
+               kfree(c->bu.buf);
+               c->bu.buf = NULL;
+       }
+
        return 0;
 }
 
@@ -1723,6 +1768,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
        mutex_init(&c->log_mutex);
        mutex_init(&c->mst_mutex);
        mutex_init(&c->umount_mutex);
+       mutex_init(&c->bu_mutex);
        init_waitqueue_head(&c->cmt_wq);
        c->buds = RB_ROOT;
        c->old_idx = RB_ROOT;
index d27fd918b9c935a1fd115a3f1729576c8c4ae883..6eef5344a145ec845ee17791567ea41ad4db2fa9 100644 (file)
@@ -1501,7 +1501,12 @@ out:
  * @bu: bulk-read parameters and results
  *
  * Lookup consecutive data node keys for the same inode that reside
- * consecutively in the same LEB.
+ * consecutively in the same LEB. This function returns zero in case of success
+ * and a negative error code in case of failure.
+ *
+ * Note, if the bulk-read buffer length (@bu->buf_len) is known, this function
+ * makes sure bulk-read nodes fit the buffer. Otherwise, this function prepares
+ * maxumum possible amount of nodes for bulk-read.
  */
 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu)
 {
@@ -2677,7 +2682,7 @@ int ubifs_tnc_remove_ino(struct ubifs_info *c, ino_t inum)
        struct ubifs_dent_node *xent, *pxent = NULL;
        struct qstr nm = { .name = NULL };
 
-       dbg_tnc("ino %lu", inum);
+       dbg_tnc("ino %lu", (unsigned long)inum);
 
        /*
         * Walk all extended attribute entries and remove them together with
@@ -2697,7 +2702,8 @@ int ubifs_tnc_remove_ino(struct ubifs_info *c, ino_t inum)
                }
 
                xattr_inum = le64_to_cpu(xent->inum);
-               dbg_tnc("xent '%s', ino %lu", xent->name, xattr_inum);
+               dbg_tnc("xent '%s', ino %lu", xent->name,
+                       (unsigned long)xattr_inum);
 
                nm.name = xent->name;
                nm.len = le16_to_cpu(xent->nlen);
index a7bd32fa15b987d9510583041a7b3a6e5f6f0998..46b172560a064eb7b4d541359aa9b02e7dd39380 100644 (file)
@@ -753,7 +753,7 @@ struct ubifs_znode {
 };
 
 /**
- * struct bu_info - bulk-read information
+ * struct bu_info - bulk-read information.
  * @key: first data node key
  * @zbranch: zbranches of data nodes to bulk read
  * @buf: buffer to read into
@@ -969,7 +969,10 @@ struct ubifs_mount_opts {
  * @mst_node: master node
  * @mst_offs: offset of valid master node
  * @mst_mutex: protects the master node area, @mst_node, and @mst_offs
- * @bulk_read_buf_size: buffer size for bulk-reads
+ *
+ * @max_bu_buf_len: maximum bulk-read buffer length
+ * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu
+ * @bu: pre-allocated bulk-read information
  *
  * @log_lebs: number of logical eraseblocks in the log
  * @log_bytes: log size in bytes
@@ -1217,7 +1220,10 @@ struct ubifs_info {
        struct ubifs_mst_node *mst_node;
        int mst_offs;
        struct mutex mst_mutex;
-       int bulk_read_buf_size;
+
+       int max_bu_buf_len;
+       struct mutex bu_mutex;
+       struct bu_info bu;
 
        int log_lebs;
        long long log_bytes;
index d700dacdb10e7f68302853945b22ab56a752c7ad..c903130be7fd6f6ec3032067e990bab8582b9886 100644 (file)
@@ -212,7 +212,7 @@ xfs_rename(
        if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
                     (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) {
                error = XFS_ERROR(EXDEV);
-               xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
+               xfs_rename_unlock4(inodes, XFS_ILOCK_EXCL);
                xfs_trans_cancel(tp, cancel_flags);
                goto std_return;
        }
index 09d33c7740f0bfbf48f195c57bb209a03297baf4..db8852d8bcf7a41c515ef2ec7c19db097026971e 100644 (file)
 
 /* Defaults for debug_level, debug and normal */
 
-#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
+#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INFO)
 #define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
 #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
 
index 029c8c06c151ab4f7153d4aeb143bb51ed4d258c..0515e754449d13bd8d10fddb3f6b92ad6f6e5fd0 100644 (file)
@@ -141,6 +141,10 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
 /*
  * We need to show where it is safe to preempt execution of ACPICA
  */
-#define ACPI_PREEMPTION_POINT()        cond_resched()
+#define ACPI_PREEMPTION_POINT()                \
+       do {                            \
+               if (!irqs_disabled())   \
+                       cond_resched(); \
+       } while (0)
 
 #endif                         /* __ACLINUX_H__ */
index 4ec0a296bdec8413394dbecedbf779bb19bfcf4b..7abdaa91ccd3738ea7e8633f16c78f3031ce15bf 100644 (file)
@@ -251,7 +251,7 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
 #define atomic_long_cmpxchg(l, old, new) \
        (atomic_cmpxchg((atomic_t *)(l), (old), (new)))
 #define atomic_long_xchg(v, new) \
-       (atomic_xchg((atomic_t *)(l), (new)))
+       (atomic_xchg((atomic_t *)(v), (new)))
 
 #endif  /*  BITS_PER_LONG == 64  */
 
index f10d367fb2a5b1f31f4741ddaf58f06a61968f61..c5f1c2c920e26c033761d640a81256b0b13c13eb 100644 (file)
@@ -1,6 +1,8 @@
 #include <asm-generic/audit_dir_write.h>
 __NR_acct,
+#ifdef __NR_swapon
 __NR_swapon,
+#endif
 __NR_quotactl,
 __NR_truncate,
 #ifdef __NR_truncate64
index 46b9b647f3c3864540a9a44411f91b9881c0028f..8a3a4dd55763eba744552c46c825831569e90610 100644 (file)
@@ -266,7 +266,7 @@ extern int __get_user_unknown(void);
                "       .section        .fixup,\"ax\"   \n"             \
                "4:                                     \n"             \
                "       mov             %5,%0           \n"             \
-               "       jmp             2b              \n"             \
+               "       jmp             3b              \n"             \
                "       .previous                       \n"             \
                "       .section        __ex_table,\"a\"\n"             \
                "       .balign         4               \n"             \
index 6272a395d43c0b73a6ef4fd5d0a19062d6154a38..8f0672d13eb1bf8bbddba0d30c6ecdfd30c94ddf 100644 (file)
@@ -391,6 +391,7 @@ extern int audit_classify_arch(int arch);
 #ifdef CONFIG_AUDITSYSCALL
 /* These are defined in auditsc.c */
                                /* Public API */
+extern void audit_finish_fork(struct task_struct *child);
 extern int  audit_alloc(struct task_struct *task);
 extern void audit_free(struct task_struct *task);
 extern void audit_syscall_entry(int arch,
@@ -434,7 +435,7 @@ static inline void audit_ptrace(struct task_struct *t)
 
                                /* Private API (for audit.c only) */
 extern unsigned int audit_serial(void);
-extern void auditsc_get_stamp(struct audit_context *ctx,
+extern int auditsc_get_stamp(struct audit_context *ctx,
                              struct timespec *t, unsigned int *serial);
 extern int  audit_set_loginuid(struct task_struct *task, uid_t loginuid);
 #define audit_get_loginuid(t) ((t)->loginuid)
@@ -504,6 +505,7 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
 extern int audit_n_rules;
 extern int audit_signals;
 #else
+#define audit_finish_fork(t)
 #define audit_alloc(t) ({ 0; })
 #define audit_free(t) do { ; } while (0)
 #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
@@ -516,7 +518,7 @@ extern int audit_signals;
 #define audit_inode(n,d) do { ; } while (0)
 #define audit_inode_child(d,i,p) do { ; } while (0)
 #define audit_core_dumps(i) do { ; } while (0)
-#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
+#define auditsc_get_stamp(c,t,s) (0)
 #define audit_get_loginuid(t) (-1)
 #define audit_get_sessionid(t) (-1)
 #define audit_log_task_context(b) do { ; } while (0)
index a135256b272c79f6a7b462826e59735ce3b4d620..031a315c0509e5aa9eaa73c080b7e76a44dc95a0 100644 (file)
@@ -662,6 +662,7 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
  * default timeout for SG_IO if none specified
  */
 #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ)
+#define BLK_MIN_SG_TIMEOUT     (7 * HZ)
 
 #ifdef CONFIG_BOUNCE
 extern int init_emergency_isa_pool(void);
@@ -786,6 +787,8 @@ static inline void blk_run_address_space(struct address_space *mapping)
                blk_run_backing_dev(mapping->backing_dev_info, NULL);
 }
 
+extern void blkdev_dequeue_request(struct request *req);
+
 /*
  * blk_end_request() and friends.
  * __blk_end_request() and end_request() must be called with
@@ -820,11 +823,6 @@ extern void blk_update_request(struct request *rq, int error,
 extern unsigned int blk_rq_bytes(struct request *rq);
 extern unsigned int blk_rq_cur_bytes(struct request *rq);
 
-static inline void blkdev_dequeue_request(struct request *req)
-{
-       elv_dequeue_request(req->q, req);
-}
-
 /*
  * Access functions for manipulating queue properties
  */
@@ -921,6 +919,8 @@ extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
 
 #define MAX_SEGMENT_SIZE       65536
 
+#define BLK_SEG_BOUNDARY_MASK  0xFFFFFFFFUL
+
 #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
 
 static inline int queue_hardsect_size(struct request_queue *q)
index e9ca210ffa5b6cf9fd9c0c5f577bbca752fc04d1..f50785ad478147f8b4a80ba017dc1deba70d6368 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 
-#define CAN_VERSION "20071116"
+#define CAN_VERSION "20081130"
 
 /* increment this number each time you change some user-space interface */
 #define CAN_ABI_VERSION "8"
index 0dcdd9458f4bcce56d1a89c566892f5d5097e876..4a853ef6fd35076d4aad21b488a97a513fb7bacc 100644 (file)
@@ -63,23 +63,24 @@ extern int dir_notify_enable;
 #define MAY_ACCESS 16
 #define MAY_OPEN 32
 
-#define FMODE_READ ((__force fmode_t)1)
-#define FMODE_WRITE ((__force fmode_t)2)
-
-/* Internal kernel extensions */
-#define FMODE_LSEEK    ((__force fmode_t)4)
-#define FMODE_PREAD    ((__force fmode_t)8)
-#define FMODE_PWRITE   FMODE_PREAD     /* These go hand in hand */
-
-/* File is being opened for execution. Primary users of this flag are
-   distributed filesystems that can use it to achieve correct ETXTBUSY
-   behavior for cross-node execution/opening_for_writing of files */
-#define FMODE_EXEC     ((__force fmode_t)16)
-
-#define FMODE_NDELAY   ((__force fmode_t)32)
-#define FMODE_EXCL     ((__force fmode_t)64)
+/* file is open for reading */
+#define FMODE_READ             ((__force fmode_t)1)
+/* file is open for writing */
+#define FMODE_WRITE            ((__force fmode_t)2)
+/* file is seekable */
+#define FMODE_LSEEK            ((__force fmode_t)4)
+/* file can be accessed using pread/pwrite */
+#define FMODE_PREAD            ((__force fmode_t)8)
+#define FMODE_PWRITE           FMODE_PREAD     /* These go hand in hand */
+/* File is opened for execution with sys_execve / sys_uselib */
+#define FMODE_EXEC             ((__force fmode_t)16)
+/* File is opened with O_NDELAY (only set for block devices) */
+#define FMODE_NDELAY           ((__force fmode_t)32)
+/* File is opened with O_EXCL (only set for block devices) */
+#define FMODE_EXCL             ((__force fmode_t)64)
+/* File is opened using open(.., 3, ..) and is writeable only for ioctls
+   (specialy hack for floppy.c) */
 #define FMODE_WRITE_IOCTL      ((__force fmode_t)128)
-#define FMODE_NDELAY_NOW       ((__force fmode_t)256)
 
 #define RW_MASK                1
 #define RWA_MASK       2
index 703eb53cfa2b2a1512b7ce97d9c1da218ad9ac0f..9c5bc6be2b091274b37b14046f03ebf3db70c194 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/ktime.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/module.h>
 #include <linux/kallsyms.h>
 
 #ifdef CONFIG_FUNCTION_TRACER
@@ -231,7 +232,7 @@ ftrace_init_module(unsigned long *start, unsigned long *end) { }
 
 struct boot_trace {
        pid_t                   caller;
-       char                    func[KSYM_NAME_LEN];
+       char                    func[KSYM_SYMBOL_LEN];
        int                     result;
        unsigned long long      duration;               /* usecs */
        ktime_t                 calltime;
index 54525be4b5f87f8d0f43d21a40db8efee2ec10f5..010fb26a15796452b4382ad167e58cc4210e0c38 100644 (file)
@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
 #define ide_pci_register_driver(d) pci_register_driver(d)
 #endif
 
+static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)
+{
+       if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)
+               return 1;
+       return 0;
+}
+
 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int,
                         hw_regs_t *, hw_regs_t **);
 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
@@ -1375,6 +1382,7 @@ enum {
        IDE_HFLAG_IO_32BIT              = (1 << 24),
        /* unmask IRQs */
        IDE_HFLAG_UNMASK_IRQS           = (1 << 25),
+       IDE_HFLAG_BROKEN_ALTSTATUS      = (1 << 26),
        /* serialize ports if DMA is possible (for sl82c105) */
        IDE_HFLAG_SERIALIZE_DMA         = (1 << 27),
        /* force host out of "simplex" mode */
index 217bb22ebb8e81a532d7023312e64dba76776737..af95a1d2f3a11e333fbe6a00fcb2354f16657a2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * audio.h  --  Audio Driver for Wolfson WM8350 PMIC
  *
- * Copyright 2007 Wolfson Microelectronics PLC
+ * Copyright 2007, 2008 Wolfson Microelectronics PLC
  *
  *  This program is free software; you can redistribute  it and/or modify it
  *  under  the terms of  the GNU General  Public License as published by the
@@ -70,9 +70,9 @@
 #define WM8350_CODEC_ISEL_0_5                   3      /* x0.5 */
 
 #define WM8350_VMID_OFF                         0
-#define WM8350_VMID_500K                        1
-#define WM8350_VMID_100K                        2
-#define WM8350_VMID_10K                         3
+#define WM8350_VMID_300K                        1
+#define WM8350_VMID_50K                         2
+#define WM8350_VMID_5K                          3
 
 /*
  * R40 (0x28) - Clock Control 1
 #define WM8350_IRQ_CODEC_MICSCD                        41
 #define WM8350_IRQ_CODEC_MICD                  42
 
+/*
+ * WM8350 Platform data.
+ *
+ * This must be initialised per platform for best audio performance.
+ * Please see WM8350 datasheet for information.
+ */
+struct wm8350_audio_platform_data {
+       int vmid_discharge_msecs;       /* VMID --> OFF discharge time */
+       int drain_msecs;        /* OFF drain time */
+       int cap_discharge_msecs;        /* Cap ON (from OFF) discharge time */
+       int vmid_charge_msecs;  /* vmid power up time */
+       u32 vmid_s_curve:2;     /* vmid enable s curve speed */
+       u32 dis_out4:2;         /* out4 discharge speed */
+       u32 dis_out3:2;         /* out3 discharge speed */
+       u32 dis_out2:2;         /* out2 discharge speed */
+       u32 dis_out1:2;         /* out1 discharge speed */
+       u32 vroi_out4:1;        /* out4 tie off */
+       u32 vroi_out3:1;        /* out3 tie off */
+       u32 vroi_out2:1;        /* out2 tie off */
+       u32 vroi_out1:1;        /* out1 tie off */
+       u32 vroi_enable:1;      /* enable tie off */
+       u32 codec_current_on:2; /* current level ON */
+       u32 codec_current_standby:2;    /* current level STANDBY */
+       u32 codec_current_charge:2;     /* codec current @ vmid charge */
+};
+
+struct snd_soc_codec;
+
 struct wm8350_codec {
        struct platform_device *pdev;
+       struct snd_soc_codec *codec;
+       struct wm8350_audio_platform_data *platform_data;
 };
 
 #endif
index 9d77b1d7dca806e540838d27bbc632961a340f0e..e26f54952892e9c46be142344e36ceb37f19f6f0 100644 (file)
@@ -319,6 +319,7 @@ enum
 {
        NAPI_STATE_SCHED,       /* Poll is scheduled */
        NAPI_STATE_DISABLE,     /* Disable pending */
+       NAPI_STATE_NPSVC,       /* Netpoll - don't dequeue from poll_list */
 };
 
 extern void __napi_schedule(struct napi_struct *n);
@@ -1497,6 +1498,12 @@ static inline void netif_rx_complete(struct net_device *dev,
 {
        unsigned long flags;
 
+       /*
+        * don't let napi dequeue from the cpu poll list
+        * just in case its running on a different cpu
+        */
+       if (unlikely(test_bit(NAPI_STATE_NPSVC, &napi->state)))
+               return;
        local_irq_save(flags);
        __netif_rx_complete(dev, napi);
        local_irq_restore(flags);
index c19595c8930491d8e0f64a2795d36cb127ee3b60..29fe9ea1d3463a5964ee158eeb1a39211b1c756f 100644 (file)
@@ -141,6 +141,7 @@ enum ctattr_protonat {
 #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
 
 enum ctattr_natseq {
+       CTA_NAT_SEQ_UNSPEC,
        CTA_NAT_SEQ_CORRECTION_POS,
        CTA_NAT_SEQ_OFFSET_BEFORE,
        CTA_NAT_SEQ_OFFSET_AFTER,
index be41b609c88fddbe6384ab5e73f3fe393fb56320..e52ce475d19f13796080ba21f24e4464054f0990 100644 (file)
@@ -251,7 +251,7 @@ struct xt_target_param {
  */
 struct xt_tgchk_param {
        const char *table;
-       void *entryinfo;
+       const void *entryinfo;
        const struct xt_target *target;
        void *targinfo;
        unsigned int hook_mask;
index c13f1cec9abb154e24296216d91d225d245166b2..e3d4ecda267381d85da5697b2ad681c1da749fe3 100644 (file)
@@ -1818,17 +1818,21 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
 
 static inline int security_vm_enough_memory(long pages)
 {
+       WARN_ON(current->mm == NULL);
        return cap_vm_enough_memory(current->mm, pages);
 }
 
-static inline int security_vm_enough_memory_kern(long pages)
+static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
 {
-       return cap_vm_enough_memory(current->mm, pages);
+       WARN_ON(mm == NULL);
+       return cap_vm_enough_memory(mm, pages);
 }
 
-static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
+static inline int security_vm_enough_memory_kern(long pages)
 {
-       return cap_vm_enough_memory(mm, pages);
+       /* If current->mm is a kernel thread then we will pass NULL,
+          for this specific case that is fine */
+       return cap_vm_enough_memory(current->mm, pages);
 }
 
 static inline int security_bprm_alloc(struct linux_binprm *bprm)
index 3f9a60043a975617a3b8217f8e69b24751c13e01..6e7ba16ff454f878d28315c02f66572b9734bd09 100644 (file)
@@ -146,6 +146,8 @@ static inline void smp_send_reschedule(int cpu) { }
 })
 #define smp_call_function_mask(mask, func, info, wait) \
                        (up_smp_call_function(func, info))
+#define smp_call_function_many(mask, func, info, wait) \
+                       (up_smp_call_function(func, info))
 static inline void init_call_single_data(void)
 {
 }
index 73a2f4eb1f7ae1a6f9c23131a56f5d1d6d631d58..9b42baed39009c75c8e3932a8c9be3cfbb0984f0 100644 (file)
@@ -158,8 +158,12 @@ struct usb_ctrlrequest {
  * (rarely) accepted by SET_DESCRIPTOR.
  *
  * Note that all multi-byte values here are encoded in little endian
- * byte order "on the wire".  But when exposed through Linux-USB APIs,
- * they've been converted to cpu byte order.
+ * byte order "on the wire".  Within the kernel and when exposed
+ * through the Linux-USB APIs, they are not converted to cpu byte
+ * order; it is the responsibility of the client code to do this.
+ * The single exception is when device and configuration descriptors (but
+ * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
+ * in this case the fields are converted to host endianness by the kernel.
  */
 
 /*
index c29ff1da8a18ac2dbf905f6bd83a27066e2283e4..1614d78c60ed2c4b616b530b89f8247addbcc17f 100644 (file)
@@ -9,6 +9,7 @@
 extern void unix_inflight(struct file *fp);
 extern void unix_notinflight(struct file *fp);
 extern void unix_gc(void);
+extern void wait_for_unix_gc(void);
 
 #define UNIX_HASH_SIZE 256
 
index 3025ae17ddbeb46207ca71e88b3d31d6aaad44a8..94c852d47d0f8d5c7d033279bf2f67ca3fd861dd 100644 (file)
@@ -135,9 +135,11 @@ struct dongle_reg {
 
 /* 
  * Per-packet information we need to hide inside sk_buff 
- * (must not exceed 48 bytes, check with struct sk_buff) 
+ * (must not exceed 48 bytes, check with struct sk_buff)
+ * The default_qdisc_pad field is a temporary hack.
  */
 struct irda_skb_cb {
+       unsigned int default_qdisc_pad;
        magic_t magic;       /* Be sure that we can trust the information */
        __u32   next_speed;  /* The Speed to be set *after* this frame */
        __u16   mtt;         /* Minimum turn around time */
index cac811e51f6dc0ef78ebc9ac124c1c42637b3f02..c7190846e128e21221106379e619589b3d7f0603 100644 (file)
@@ -31,6 +31,7 @@ struct request_sock_ops {
        int             family;
        int             obj_size;
        struct kmem_cache       *slab;
+       char            *slab_name;
        int             (*rtx_syn_ack)(struct sock *sk,
                                       struct request_sock *req);
        void            (*send_ack)(struct sock *sk, struct sk_buff *skb,
index 1e1ee3253fd8fd9a46d24778f9534e7c042f98a4..97c3b14da55df2e655ac8ceade98da1e4d77682d 100644 (file)
@@ -16,6 +16,7 @@
 
 struct timewait_sock_ops {
        struct kmem_cache       *twsk_slab;
+       char            *twsk_slab_name;
        unsigned int    twsk_obj_size;
        int             (*twsk_unique)(struct sock *sk,
                                       struct sock *sktw, void *twp);
index 49d8913c4f860ad97dab941dd6538edbe08b6420..6e04e6fe79c70dfdcba023c8457405ed1e4a0e13 100644 (file)
@@ -357,7 +357,7 @@ struct fc_rport {   /* aka fc_starget_attrs */
 /* bit field values for struct fc_rport "flags" field: */
 #define FC_RPORT_DEVLOSS_PENDING       0x01
 #define FC_RPORT_SCAN_PENDING          0x02
-#define FC_RPORT_FAST_FAIL_TIMEDOUT    0x03
+#define FC_RPORT_FAST_FAIL_TIMEDOUT    0x04
 
 #define        dev_to_rport(d)                         \
        container_of(d, struct fc_rport, dev)
index 1508c4ec1ba929162fa14651426d27dc9ab81437..f632484bc7439171d1b682788305981b66e074f4 100644 (file)
@@ -353,7 +353,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
  * snd_printk - printk wrapper
  * @fmt: format string
  *
- * Works like print() but prints the file and the line of the caller
+ * Works like printk() but prints the file and the line of the caller
  * when configured with CONFIG_SND_VERBOSE_PRINTK.
  */
 #define snd_printk(fmt, args...) \
@@ -380,18 +380,40 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
        printk(fmt ,##args)
 #endif
 
+/**
+ * snd_BUG - give a BUG warning message and stack trace
+ *
+ * Calls WARN() if CONFIG_SND_DEBUG is set.
+ * Ignored when CONFIG_SND_DEBUG is not set.
+ */
 #define snd_BUG()              WARN(1, "BUG?\n")
+
+/**
+ * snd_BUG_ON - debugging check macro
+ * @cond: condition to evaluate
+ *
+ * When CONFIG_SND_DEBUG is set, this macro evaluates the given condition,
+ * and call WARN() and returns the value if it's non-zero.
+ * 
+ * When CONFIG_SND_DEBUG is not set, this just returns zero, and the given
+ * condition is ignored.
+ *
+ * NOTE: the argument won't be evaluated at all when CONFIG_SND_DEBUG=n.
+ * Thus, don't put any statement that influences on the code behavior,
+ * such as pre/post increment, to the argument of this macro.
+ * If you want to evaluate and give a warning, use standard WARN_ON().
+ */
 #define snd_BUG_ON(cond)       WARN((cond), "BUG? (%s)\n", __stringify(cond))
 
 #else /* !CONFIG_SND_DEBUG */
 
 #define snd_printd(fmt, args...)       do { } while (0)
 #define snd_BUG()                      do { } while (0)
-static inline int __snd_bug_on(void)
+static inline int __snd_bug_on(int cond)
 {
        return 0;
 }
-#define snd_BUG_ON(cond)               __snd_bug_on()  /* always false */
+#define snd_BUG_ON(cond)       __snd_bug_on(0 && (cond))  /* always false */
 
 #endif /* CONFIG_SND_DEBUG */
 
diff --git a/include/sound/l3.h b/include/sound/l3.h
new file mode 100644 (file)
index 0000000..423a08f
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _L3_H_
+#define _L3_H_ 1
+
+struct l3_pins {
+       void (*setdat)(int);
+       void (*setclk)(int);
+       void (*setmode)(int);
+       int data_hold;
+       int data_setup;
+       int clock_high;
+       int mode_hold;
+       int mode;
+       int mode_setup;
+};
+
+int l3_write(struct l3_pins *adap, u8 addr, u8 *data, int len);
+
+#endif
diff --git a/include/sound/s3c24xx_uda134x.h b/include/sound/s3c24xx_uda134x.h
new file mode 100644 (file)
index 0000000..33df4cb
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _S3C24XX_UDA134X_H_
+#define _S3C24XX_UDA134X_H_ 1
+
+#include <sound/uda134x.h>
+
+struct s3c24xx_uda134x_platform_data {
+       int l3_clk;
+       int l3_mode;
+       int l3_data;
+       void (*power) (int);
+       int model;
+};
+
+#endif
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
new file mode 100644 (file)
index 0000000..24247f7
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * linux/sound/soc-dai.h -- ALSA SoC Layer
+ *
+ * Copyright:  2005-2008 Wolfson Microelectronics. PLC.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Digital Audio Interface (DAI) API.
+ */
+
+#ifndef __LINUX_SND_SOC_DAI_H
+#define __LINUX_SND_SOC_DAI_H
+
+
+#include <linux/list.h>
+
+struct snd_pcm_substream;
+
+/*
+ * DAI hardware audio formats.
+ *
+ * Describes the physical PCM data formating and clocking. Add new formats
+ * to the end.
+ */
+#define SND_SOC_DAIFMT_I2S             0 /* I2S mode */
+#define SND_SOC_DAIFMT_RIGHT_J         1 /* Right Justified mode */
+#define SND_SOC_DAIFMT_LEFT_J          2 /* Left Justified mode */
+#define SND_SOC_DAIFMT_DSP_A           3 /* L data msb after FRM LRC */
+#define SND_SOC_DAIFMT_DSP_B           4 /* L data msb during FRM LRC */
+#define SND_SOC_DAIFMT_AC97            5 /* AC97 */
+
+/* left and right justified also known as MSB and LSB respectively */
+#define SND_SOC_DAIFMT_MSB             SND_SOC_DAIFMT_LEFT_J
+#define SND_SOC_DAIFMT_LSB             SND_SOC_DAIFMT_RIGHT_J
+
+/*
+ * DAI Clock gating.
+ *
+ * DAI bit clocks can be be gated (disabled) when not the DAI is not
+ * sending or receiving PCM data in a frame. This can be used to save power.
+ */
+#define SND_SOC_DAIFMT_CONT            (0 << 4) /* continuous clock */
+#define SND_SOC_DAIFMT_GATED           (1 << 4) /* clock is gated */
+
+/*
+ * DAI Left/Right Clocks.
+ *
+ * Specifies whether the DAI can support different samples for similtanious
+ * playback and capture. This usually requires a seperate physical frame
+ * clock for playback and capture.
+ */
+#define SND_SOC_DAIFMT_SYNC            (0 << 5) /* Tx FRM = Rx FRM */
+#define SND_SOC_DAIFMT_ASYNC           (1 << 5) /* Tx FRM ~ Rx FRM */
+
+/*
+ * TDM
+ *
+ * Time Division Multiplexing. Allows PCM data to be multplexed with other
+ * data on the DAI.
+ */
+#define SND_SOC_DAIFMT_TDM             (1 << 6)
+
+/*
+ * DAI hardware signal inversions.
+ *
+ * Specifies whether the DAI can also support inverted clocks for the specified
+ * format.
+ */
+#define SND_SOC_DAIFMT_NB_NF           (0 << 8) /* normal bit clock + frame */
+#define SND_SOC_DAIFMT_NB_IF           (1 << 8) /* normal bclk + inv frm */
+#define SND_SOC_DAIFMT_IB_NF           (2 << 8) /* invert bclk + nor frm */
+#define SND_SOC_DAIFMT_IB_IF           (3 << 8) /* invert bclk + frm */
+
+/*
+ * DAI hardware clock masters.
+ *
+ * This is wrt the codec, the inverse is true for the interface
+ * i.e. if the codec is clk and frm master then the interface is
+ * clk and frame slave.
+ */
+#define SND_SOC_DAIFMT_CBM_CFM         (0 << 12) /* codec clk & frm master */
+#define SND_SOC_DAIFMT_CBS_CFM         (1 << 12) /* codec clk slave & frm master */
+#define SND_SOC_DAIFMT_CBM_CFS         (2 << 12) /* codec clk master & frame slave */
+#define SND_SOC_DAIFMT_CBS_CFS         (3 << 12) /* codec clk & frm slave */
+
+#define SND_SOC_DAIFMT_FORMAT_MASK     0x000f
+#define SND_SOC_DAIFMT_CLOCK_MASK      0x00f0
+#define SND_SOC_DAIFMT_INV_MASK                0x0f00
+#define SND_SOC_DAIFMT_MASTER_MASK     0xf000
+
+/*
+ * Master Clock Directions
+ */
+#define SND_SOC_CLOCK_IN               0
+#define SND_SOC_CLOCK_OUT              1
+
+struct snd_soc_dai_ops;
+struct snd_soc_dai;
+struct snd_ac97_bus_ops;
+
+/* Digital Audio Interface registration */
+int snd_soc_register_dai(struct snd_soc_dai *dai);
+void snd_soc_unregister_dai(struct snd_soc_dai *dai);
+int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count);
+void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count);
+
+/* Digital Audio Interface clocking API.*/
+int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
+       unsigned int freq, int dir);
+
+int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
+       int div_id, int div);
+
+int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
+       int pll_id, unsigned int freq_in, unsigned int freq_out);
+
+/* Digital Audio interface formatting */
+int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
+
+int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
+       unsigned int mask, int slots);
+
+int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
+
+/* Digital Audio Interface mute */
+int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
+
+/*
+ * Digital Audio Interface.
+ *
+ * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97
+ * operations an capabilities. Codec and platfom drivers will register a this
+ * structure for every DAI they have.
+ *
+ * This structure covers the clocking, formating and ALSA operations for each
+ * interface a
+ */
+struct snd_soc_dai_ops {
+       /*
+        * DAI clocking configuration, all optional.
+        * Called by soc_card drivers, normally in their hw_params.
+        */
+       int (*set_sysclk)(struct snd_soc_dai *dai,
+               int clk_id, unsigned int freq, int dir);
+       int (*set_pll)(struct snd_soc_dai *dai,
+               int pll_id, unsigned int freq_in, unsigned int freq_out);
+       int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
+
+       /*
+        * DAI format configuration
+        * Called by soc_card drivers, normally in their hw_params.
+        */
+       int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
+       int (*set_tdm_slot)(struct snd_soc_dai *dai,
+               unsigned int mask, int slots);
+       int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
+
+       /*
+        * DAI digital mute - optional.
+        * Called by soc-core to minimise any pops.
+        */
+       int (*digital_mute)(struct snd_soc_dai *dai, int mute);
+
+       /*
+        * ALSA PCM audio operations - all optional.
+        * Called by soc-core during audio PCM operations.
+        */
+       int (*startup)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
+       void (*shutdown)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
+       int (*hw_params)(struct snd_pcm_substream *,
+               struct snd_pcm_hw_params *, struct snd_soc_dai *);
+       int (*hw_free)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
+       int (*prepare)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
+       int (*trigger)(struct snd_pcm_substream *, int,
+               struct snd_soc_dai *);
+};
+
+/*
+ * Digital Audio Interface runtime data.
+ *
+ * Holds runtime data for a DAI.
+ */
+struct snd_soc_dai {
+       /* DAI description */
+       char *name;
+       unsigned int id;
+       int ac97_control;
+
+       struct device *dev;
+
+       /* DAI callbacks */
+       int (*probe)(struct platform_device *pdev,
+                    struct snd_soc_dai *dai);
+       void (*remove)(struct platform_device *pdev,
+                      struct snd_soc_dai *dai);
+       int (*suspend)(struct snd_soc_dai *dai);
+       int (*resume)(struct snd_soc_dai *dai);
+
+       /* ops */
+       struct snd_soc_dai_ops ops;
+
+       /* DAI capabilities */
+       struct snd_soc_pcm_stream capture;
+       struct snd_soc_pcm_stream playback;
+
+       /* DAI runtime info */
+       struct snd_pcm_runtime *runtime;
+       struct snd_soc_codec *codec;
+       unsigned int active;
+       unsigned char pop_wait:1;
+       void *dma_data;
+
+       /* DAI private data */
+       void *private_data;
+
+       /* parent codec/platform */
+       union {
+               struct snd_soc_codec *codec;
+               struct snd_soc_platform *platform;
+       };
+
+       struct list_head list;
+};
+
+#endif
index ca699a3017f39563fc8f6b1d4dc36841e724f125..7ee2f70ca42e9009038d02b60e147603ad919d13 100644 (file)
@@ -221,8 +221,6 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
        int num);
 
 /* dapm path setup */
-int  __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec,
-       const char *sink_name, const char *control_name, const char *src_name);
 int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec);
 void snd_soc_dapm_free(struct snd_soc_device *socdev);
 int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
index 5e0189876afda7a9d523ae705a113cce1be2c69d..f86e455d3828b222e6cab7331d6cbfda5fef0456 100644 (file)
@@ -21,8 +21,6 @@
 #include <sound/control.h>
 #include <sound/ac97_codec.h>
 
-#define SND_SOC_VERSION "0.13.2"
-
 /*
  * Convenience kcontrol builders
  */
@@ -145,105 +143,31 @@ enum snd_soc_bias_level {
        SND_SOC_BIAS_OFF,
 };
 
-/*
- * Digital Audio Interface (DAI) types
- */
-#define SND_SOC_DAI_AC97       0x1
-#define SND_SOC_DAI_I2S                0x2
-#define SND_SOC_DAI_PCM                0x4
-#define SND_SOC_DAI_AC97_BUS   0x8     /* for custom i.e. non ac97_codec.c */
-
-/*
- * DAI hardware audio formats
- */
-#define SND_SOC_DAIFMT_I2S             0       /* I2S mode */
-#define SND_SOC_DAIFMT_RIGHT_J 1       /* Right justified mode */
-#define SND_SOC_DAIFMT_LEFT_J  2       /* Left Justified mode */
-#define SND_SOC_DAIFMT_DSP_A   3       /* L data msb after FRM or LRC */
-#define SND_SOC_DAIFMT_DSP_B   4       /* L data msb during FRM or LRC */
-#define SND_SOC_DAIFMT_AC97            5       /* AC97 */
-
-#define SND_SOC_DAIFMT_MSB     SND_SOC_DAIFMT_LEFT_J
-#define SND_SOC_DAIFMT_LSB     SND_SOC_DAIFMT_RIGHT_J
-
-/*
- * DAI Gating
- */
-#define SND_SOC_DAIFMT_CONT                    (0 << 4)        /* continuous clock */
-#define SND_SOC_DAIFMT_GATED           (1 << 4)        /* clock is gated when not Tx/Rx */
-
-/*
- * DAI Sync
- * Synchronous LR (Left Right) clocks and Frame signals.
- */
-#define SND_SOC_DAIFMT_SYNC            (0 << 5)        /* Tx FRM = Rx FRM */
-#define SND_SOC_DAIFMT_ASYNC           (1 << 5)        /* Tx FRM ~ Rx FRM */
-
-/*
- * TDM
- */
-#define SND_SOC_DAIFMT_TDM             (1 << 6)
-
-/*
- * DAI hardware signal inversions
- */
-#define SND_SOC_DAIFMT_NB_NF           (0 << 8)        /* normal bclk + frm */
-#define SND_SOC_DAIFMT_NB_IF           (1 << 8)        /* normal bclk + inv frm */
-#define SND_SOC_DAIFMT_IB_NF           (2 << 8)        /* invert bclk + nor frm */
-#define SND_SOC_DAIFMT_IB_IF           (3 << 8)        /* invert bclk + frm */
-
-/*
- * DAI hardware clock masters
- * This is wrt the codec, the inverse is true for the interface
- * i.e. if the codec is clk and frm master then the interface is
- * clk and frame slave.
- */
-#define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */
-#define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */
-#define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */
-#define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */
-
-#define SND_SOC_DAIFMT_FORMAT_MASK             0x000f
-#define SND_SOC_DAIFMT_CLOCK_MASK              0x00f0
-#define SND_SOC_DAIFMT_INV_MASK                        0x0f00
-#define SND_SOC_DAIFMT_MASTER_MASK             0xf000
-
-
-/*
- * Master Clock Directions
- */
-#define SND_SOC_CLOCK_IN       0
-#define SND_SOC_CLOCK_OUT      1
-
-/*
- * AC97 codec ID's bitmask
- */
-#define SND_SOC_DAI_AC97_ID0   (1 << 0)
-#define SND_SOC_DAI_AC97_ID1   (1 << 1)
-#define SND_SOC_DAI_AC97_ID2   (1 << 2)
-#define SND_SOC_DAI_AC97_ID3   (1 << 3)
-
 struct snd_soc_device;
 struct snd_soc_pcm_stream;
 struct snd_soc_ops;
 struct snd_soc_dai_mode;
 struct snd_soc_pcm_runtime;
 struct snd_soc_dai;
+struct snd_soc_platform;
 struct snd_soc_codec;
-struct snd_soc_machine_config;
 struct soc_enum;
 struct snd_soc_ac97_ops;
-struct snd_soc_clock_info;
 
 typedef int (*hw_write_t)(void *,const char* ,int);
 typedef int (*hw_read_t)(void *,char* ,int);
 
 extern struct snd_ac97_bus_ops soc_ac97_ops;
 
+int snd_soc_register_platform(struct snd_soc_platform *platform);
+void snd_soc_unregister_platform(struct snd_soc_platform *platform);
+int snd_soc_register_codec(struct snd_soc_codec *codec);
+void snd_soc_unregister_codec(struct snd_soc_codec *codec);
+
 /* pcm <-> DAI connect */
 void snd_soc_free_pcms(struct snd_soc_device *socdev);
 int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
-int snd_soc_register_card(struct snd_soc_device *socdev);
+int snd_soc_init_card(struct snd_soc_device *socdev);
 
 /* set runtime hw params */
 int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
@@ -263,27 +187,6 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
        struct snd_ac97_bus_ops *ops, int num);
 void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
 
-/* Digital Audio Interface clocking API.*/
-int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
-       unsigned int freq, int dir);
-
-int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
-       int div_id, int div);
-
-int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
-       int pll_id, unsigned int freq_in, unsigned int freq_out);
-
-/* Digital Audio interface formatting */
-int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
-
-int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
-       unsigned int mask, int slots);
-
-int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
-
-/* Digital Audio Interface mute */
-int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
-
 /*
  *Controls
  */
@@ -341,66 +244,14 @@ struct snd_soc_ops {
        int (*trigger)(struct snd_pcm_substream *, int);
 };
 
-/* ASoC DAI ops */
-struct snd_soc_dai_ops {
-       /* DAI clocking configuration */
-       int (*set_sysclk)(struct snd_soc_dai *dai,
-               int clk_id, unsigned int freq, int dir);
-       int (*set_pll)(struct snd_soc_dai *dai,
-               int pll_id, unsigned int freq_in, unsigned int freq_out);
-       int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
-
-       /* DAI format configuration */
-       int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
-       int (*set_tdm_slot)(struct snd_soc_dai *dai,
-               unsigned int mask, int slots);
-       int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
-
-       /* digital mute */
-       int (*digital_mute)(struct snd_soc_dai *dai, int mute);
-};
-
-/* SoC  DAI (Digital Audio Interface) */
-struct snd_soc_dai {
-       /* DAI description */
-       char *name;
-       unsigned int id;
-       unsigned char type;
-
-       /* DAI callbacks */
-       int (*probe)(struct platform_device *pdev,
-                    struct snd_soc_dai *dai);
-       void (*remove)(struct platform_device *pdev,
-                      struct snd_soc_dai *dai);
-       int (*suspend)(struct platform_device *pdev,
-               struct snd_soc_dai *dai);
-       int (*resume)(struct platform_device *pdev,
-               struct snd_soc_dai *dai);
-
-       /* ops */
-       struct snd_soc_ops ops;
-       struct snd_soc_dai_ops dai_ops;
-
-       /* DAI capabilities */
-       struct snd_soc_pcm_stream capture;
-       struct snd_soc_pcm_stream playback;
-
-       /* DAI runtime info */
-       struct snd_pcm_runtime *runtime;
-       struct snd_soc_codec *codec;
-       unsigned int active;
-       unsigned char pop_wait:1;
-       void *dma_data;
-
-       /* DAI private data */
-       void *private_data;
-};
-
 /* SoC Audio Codec */
 struct snd_soc_codec {
        char *name;
        struct module *owner;
        struct mutex mutex;
+       struct device *dev;
+
+       struct list_head list;
 
        /* callbacks */
        int (*set_bias_level)(struct snd_soc_codec *,
@@ -426,6 +277,7 @@ struct snd_soc_codec {
        short reg_cache_step;
 
        /* dapm */
+       u32 pop_time;
        struct list_head dapm_widgets;
        struct list_head dapm_paths;
        enum snd_soc_bias_level bias_level;
@@ -435,6 +287,11 @@ struct snd_soc_codec {
        /* codec DAI's */
        struct snd_soc_dai *dai;
        unsigned int num_dai;
+
+#ifdef CONFIG_DEBUG_FS
+       struct dentry *debugfs_reg;
+       struct dentry *debugfs_pop_time;
+#endif
 };
 
 /* codec device */
@@ -448,13 +305,12 @@ struct snd_soc_codec_device {
 /* SoC platform interface */
 struct snd_soc_platform {
        char *name;
+       struct list_head list;
 
        int (*probe)(struct platform_device *pdev);
        int (*remove)(struct platform_device *pdev);
-       int (*suspend)(struct platform_device *pdev,
-               struct snd_soc_dai *dai);
-       int (*resume)(struct platform_device *pdev,
-               struct snd_soc_dai *dai);
+       int (*suspend)(struct snd_soc_dai *dai);
+       int (*resume)(struct snd_soc_dai *dai);
 
        /* pcm creation and destruction */
        int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
@@ -484,9 +340,14 @@ struct snd_soc_dai_link  {
        struct snd_pcm *pcm;
 };
 
-/* SoC machine */
-struct snd_soc_machine {
+/* SoC card */
+struct snd_soc_card {
        char *name;
+       struct device *dev;
+
+       struct list_head list;
+
+       int instantiated;
 
        int (*probe)(struct platform_device *pdev);
        int (*remove)(struct platform_device *pdev);
@@ -499,23 +360,26 @@ struct snd_soc_machine {
        int (*resume_post)(struct platform_device *pdev);
 
        /* callbacks */
-       int (*set_bias_level)(struct snd_soc_machine *,
+       int (*set_bias_level)(struct snd_soc_card *,
                              enum snd_soc_bias_level level);
 
        /* CPU <--> Codec DAI links  */
        struct snd_soc_dai_link *dai_link;
        int num_links;
+
+       struct snd_soc_device *socdev;
+
+       struct snd_soc_platform *platform;
+       struct delayed_work delayed_work;
+       struct work_struct deferred_resume_work;
 };
 
 /* SoC Device - the audio subsystem */
 struct snd_soc_device {
        struct device *dev;
-       struct snd_soc_machine *machine;
-       struct snd_soc_platform *platform;
+       struct snd_soc_card *card;
        struct snd_soc_codec *codec;
        struct snd_soc_codec_device *codec_dev;
-       struct delayed_work delayed_work;
-       struct work_struct deferred_resume_work;
        void *codec_data;
 };
 
@@ -542,4 +406,6 @@ struct soc_enum {
        void *dapm;
 };
 
+#include <sound/soc-dai.h>
+
 #endif
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h
new file mode 100644 (file)
index 0000000..475ef8b
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * uda134x.h  --  UDA134x ALSA SoC Codec driver
+ *
+ * Copyright 2007 Dension Audio Systems Ltd.
+ * Author: Zoltan Devai
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _UDA134X_H
+#define _UDA134X_H
+
+#include <sound/l3.h>
+
+struct uda134x_platform_data {
+       struct l3_pins l3;
+       void (*power) (int);
+       int model;
+#define UDA134X_UDA1340 1
+#define UDA134X_UDA1341 2
+#define UDA134X_UDA1344 3
+};
+
+#endif /* _UDA134X_H */
index 4aafeda886347d58da257313c9f4d8fbabdf8fa2..2b48237e23bfae6ac9a432059933a2c3555b5a8f 100644 (file)
@@ -1,3 +1,3 @@
 /* include/version.h */
-#define CONFIG_SND_VERSION "1.0.18rc3"
+#define CONFIG_SND_VERSION "1.0.18a"
 #define CONFIG_SND_DATE ""
index d5dcaf154ba4092412cb45e59bebebe5c6d23c5f..1cd09cc5b169460609ca91f7d71edaba6a32f284 100644 (file)
 #define CRTC_DISPLAY_DIS                          (1 << 10)
 #define CRTC_CRT_ON                               (1 << 15)
 
-/* DSTCACHE_MODE bits constants */
-#define RB2D_DC_AUTOFLUSH_ENABLE                   (1 << 8)
-#define RB2D_DC_DC_DISABLE_IGNORE_PE               (1 << 17)
 
 /* DSTCACHE_CTLSTAT bit constants */
 #define RB2D_DC_FLUSH_2D                          (1 << 0)
 #define GMC_DST_16BPP_YVYU422                      0x00000c00
 #define GMC_DST_32BPP_AYUV444                      0x00000e00
 #define GMC_DST_16BPP_ARGB4444                     0x00000f00
+#define GMC_SRC_MONO                               0x00000000
+#define GMC_SRC_MONO_LBKGD                         0x00001000
+#define GMC_SRC_DSTCOLOR                           0x00003000
 #define GMC_BYTE_ORDER_MSB_TO_LSB                  0x00000000
 #define GMC_BYTE_ORDER_LSB_TO_MSB                  0x00004000
 #define GMC_DP_CONVERSION_TEMP_9300                0x00008000
 #define GMC_DP_CONVERSION_TEMP_6500                0x00000000
+#define GMC_DP_SRC_RECT                            0x02000000
+#define GMC_DP_SRC_HOST                            0x03000000
 #define GMC_DP_SRC_HOST_BYTEALIGN                  0x04000000
 #define GMC_3D_FCN_EN_CLR                          0x00000000
 #define GMC_3D_FCN_EN_SET                          0x08000000
 #define GMC_WRITE_MASK_LEAVE                       0x00000000
 #define GMC_WRITE_MASK_SET                         0x40000000
 #define GMC_CLR_CMP_CNTL_DIS                      (1 << 28)
-#define GMC_SRC_DATATYPE_MASK                     (3 << 12)
-#define GMC_SRC_DATATYPE_MONO_FG_BG               (0 << 12)
-#define GMC_SRC_DATATYPE_MONO_FG_LA               (1 << 12)
 #define GMC_SRC_DATATYPE_COLOR                    (3 << 12)
 #define ROP3_S                                    0x00cc0000
 #define ROP3_SRCCOPY                              0x00cc0000
 #define DP_SRC_SOURCE_MASK                        (7    << 24)
 #define GMC_BRUSH_NONE                            (15   <<  4)
 #define DP_SRC_SOURCE_MEMORY                      (2    << 24)
-#define DP_SRC_SOURCE_HOST_DATA                           (3    << 24)
 #define GMC_BRUSH_SOLIDCOLOR                      0x000000d0
 
 /* DP_MIX bit constants */
 #define DISP_PWR_MAN_TV_ENABLE_RST                 (1 << 25)
 #define DISP_PWR_MAN_AUTO_PWRUP_EN                 (1 << 26)
 
-/* RBBM_GUICNTL constants */
-#define RBBM_GUICNTL_HOST_DATA_SWAP_NONE          (0 << 0)
-#define RBBM_GUICNTL_HOST_DATA_SWAP_16BIT          (1 << 0)
-#define RBBM_GUICNTL_HOST_DATA_SWAP_32BIT         (2 << 0)
-#define RBBM_GUICNTL_HOST_DATA_SWAP_HDW                   (3 << 0)
-
 /* masks */
 
 #define CONFIG_MEMSIZE_MASK            0x1f000000
index 4414e93d875018b89b6363e2821093c38600d776..ce6d8ea3131e78136b3b50803c424c0fffbeb20a 100644 (file)
 
 #include "audit.h"
 
-/* No auditing will take place until audit_initialized != 0.
+/* No auditing will take place until audit_initialized == AUDIT_INITIALIZED.
  * (Initialization happens after skb_init is called.) */
+#define AUDIT_DISABLED         -1
+#define AUDIT_UNINITIALIZED    0
+#define AUDIT_INITIALIZED      1
 static int     audit_initialized;
 
 #define AUDIT_OFF      0
@@ -965,6 +968,9 @@ static int __init audit_init(void)
 {
        int i;
 
+       if (audit_initialized == AUDIT_DISABLED)
+               return 0;
+
        printk(KERN_INFO "audit: initializing netlink socket (%s)\n",
               audit_default ? "enabled" : "disabled");
        audit_sock = netlink_kernel_create(&init_net, NETLINK_AUDIT, 0,
@@ -976,7 +982,7 @@ static int __init audit_init(void)
 
        skb_queue_head_init(&audit_skb_queue);
        skb_queue_head_init(&audit_skb_hold_queue);
-       audit_initialized = 1;
+       audit_initialized = AUDIT_INITIALIZED;
        audit_enabled = audit_default;
        audit_ever_enabled |= !!audit_default;
 
@@ -999,13 +1005,21 @@ __initcall(audit_init);
 static int __init audit_enable(char *str)
 {
        audit_default = !!simple_strtol(str, NULL, 0);
-       printk(KERN_INFO "audit: %s%s\n",
-              audit_default ? "enabled" : "disabled",
-              audit_initialized ? "" : " (after initialization)");
-       if (audit_initialized) {
+       if (!audit_default)
+               audit_initialized = AUDIT_DISABLED;
+
+       printk(KERN_INFO "audit: %s", audit_default ? "enabled" : "disabled");
+
+       if (audit_initialized == AUDIT_INITIALIZED) {
                audit_enabled = audit_default;
                audit_ever_enabled |= !!audit_default;
+       } else if (audit_initialized == AUDIT_UNINITIALIZED) {
+               printk(" (after initialization)");
+       } else {
+               printk(" (until reboot)");
        }
+       printk("\n");
+
        return 1;
 }
 
@@ -1107,9 +1121,7 @@ unsigned int audit_serial(void)
 static inline void audit_get_stamp(struct audit_context *ctx,
                                   struct timespec *t, unsigned int *serial)
 {
-       if (ctx)
-               auditsc_get_stamp(ctx, t, serial);
-       else {
+       if (!ctx || !auditsc_get_stamp(ctx, t, serial)) {
                *t = CURRENT_TIME;
                *serial = audit_serial();
        }
@@ -1146,7 +1158,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
        int reserve;
        unsigned long timeout_start = jiffies;
 
-       if (!audit_initialized)
+       if (audit_initialized != AUDIT_INITIALIZED)
                return NULL;
 
        if (unlikely(audit_filter_type(type)))
index cf5bc2f5f9c3e527ac2ea72ec019d156be72ecb6..2a3f0afc4d2ac191835c39988506dfd84d1e4737 100644 (file)
@@ -1459,7 +1459,6 @@ void audit_free(struct task_struct *tsk)
 
 /**
  * audit_syscall_entry - fill in an audit record at syscall entry
- * @tsk: task being audited
  * @arch: architecture type
  * @major: major syscall type (function)
  * @a1: additional syscall register 1
@@ -1548,9 +1547,25 @@ void audit_syscall_entry(int arch, int major,
        context->ppid       = 0;
 }
 
+void audit_finish_fork(struct task_struct *child)
+{
+       struct audit_context *ctx = current->audit_context;
+       struct audit_context *p = child->audit_context;
+       if (!p || !ctx || !ctx->auditable)
+               return;
+       p->arch = ctx->arch;
+       p->major = ctx->major;
+       memcpy(p->argv, ctx->argv, sizeof(ctx->argv));
+       p->ctime = ctx->ctime;
+       p->dummy = ctx->dummy;
+       p->auditable = ctx->auditable;
+       p->in_syscall = ctx->in_syscall;
+       p->filterkey = kstrdup(ctx->filterkey, GFP_KERNEL);
+       p->ppid = current->pid;
+}
+
 /**
  * audit_syscall_exit - deallocate audit context after a system call
- * @tsk: task being audited
  * @valid: success/failure flag
  * @return_code: syscall return value
  *
@@ -1942,15 +1957,18 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);
  *
  * Also sets the context as auditable.
  */
-void auditsc_get_stamp(struct audit_context *ctx,
+int auditsc_get_stamp(struct audit_context *ctx,
                       struct timespec *t, unsigned int *serial)
 {
+       if (!ctx->in_syscall)
+               return 0;
        if (!ctx->serial)
                ctx->serial = audit_serial();
        t->tv_sec  = ctx->ctime.tv_sec;
        t->tv_nsec = ctx->ctime.tv_nsec;
        *serial    = ctx->serial;
        ctx->auditable = 1;
+       return 1;
 }
 
 /* global counter which is incremented every time something logs in */
index fe00b3b983a86387332234703217abb1d28ca202..2606d0fb4e54e8f120618328c7b72c01634dc35d 100644 (file)
@@ -702,7 +702,7 @@ static int rebind_subsystems(struct cgroupfs_root *root,
         * any child cgroups exist. This is theoretically supportable
         * but involves complex error handling, so it's being left until
         * later */
-       if (!list_empty(&cgrp->children))
+       if (root->number_of_cgroups > 1)
                return -EBUSY;
 
        /* Process each subsystem */
@@ -1024,7 +1024,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
                if (ret == -EBUSY) {
                        mutex_unlock(&cgroup_mutex);
                        mutex_unlock(&inode->i_mutex);
-                       goto drop_new_super;
+                       goto free_cg_links;
                }
 
                /* EBUSY should be the only error here */
@@ -1073,10 +1073,11 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 
        return simple_set_mnt(mnt, sb);
 
+ free_cg_links:
+       free_cg_links(&tmp_cg_links);
  drop_new_super:
        up_write(&sb->s_umount);
        deactivate_super(sb);
-       free_cg_links(&tmp_cg_links);
        return ret;
 }
 
@@ -2934,9 +2935,6 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
  again:
        root = subsys->root;
        if (root == &rootnode) {
-               printk(KERN_INFO
-                      "Not cloning cgroup for unused subsystem %s\n",
-                      subsys->name);
                mutex_unlock(&cgroup_mutex);
                return 0;
        }
index 2a372a0e206fa2de99dbfdd594f86f6eb927bf40..495da2e9a8b4d92a1b464b98196228f818c892e7 100644 (file)
@@ -315,17 +315,20 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                file = tmp->vm_file;
                if (file) {
                        struct inode *inode = file->f_path.dentry->d_inode;
+                       struct address_space *mapping = file->f_mapping;
+
                        get_file(file);
                        if (tmp->vm_flags & VM_DENYWRITE)
                                atomic_dec(&inode->i_writecount);
-
-                       /* insert tmp into the share list, just after mpnt */
-                       spin_lock(&file->f_mapping->i_mmap_lock);
+                       spin_lock(&mapping->i_mmap_lock);
+                       if (tmp->vm_flags & VM_SHARED)
+                               mapping->i_mmap_writable++;
                        tmp->vm_truncate_count = mpnt->vm_truncate_count;
-                       flush_dcache_mmap_lock(file->f_mapping);
+                       flush_dcache_mmap_lock(mapping);
+                       /* insert tmp into the share list, just after mpnt */
                        vma_prio_tree_add(tmp, mpnt);
-                       flush_dcache_mmap_unlock(file->f_mapping);
-                       spin_unlock(&file->f_mapping->i_mmap_lock);
+                       flush_dcache_mmap_unlock(mapping);
+                       spin_unlock(&mapping->i_mmap_lock);
                }
 
                /*
@@ -1398,6 +1401,7 @@ long do_fork(unsigned long clone_flags,
                        init_completion(&vfork);
                }
 
+               audit_finish_fork(p);
                tracehook_report_clone(trace, regs, clone_flags, nr, p);
 
                /*
index 5e7b45c569233536ef23dadfafd90e40d20b7f62..449db466bdbc280f1509dad905a72a6a1407d9cb 100644 (file)
@@ -191,7 +191,7 @@ static int lstats_show(struct seq_file *m, void *v)
                                latency_record[i].time,
                                latency_record[i].max);
                        for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
-                               char sym[KSYM_NAME_LEN];
+                               char sym[KSYM_SYMBOL_LEN];
                                char *c;
                                if (!latency_record[i].backtrace[q])
                                        break;
index 895337b16a24e7b9df95e8a9306b224bbe000971..4e5288a831de2e696260c12f97d60fdbcfc551a3 100644 (file)
@@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
        struct task_cputime cputime;
 
        thread_group_cputime(p, &cputime);
-       switch (which_clock) {
+       switch (CPUCLOCK_WHICH(which_clock)) {
        default:
                return -EINVAL;
        case CPUCLOCK_PROF:
index 5e79c662294bf542750af232be67a1e92bed858d..a140e44eebbacbe88b989e98b1bbdc744a99c94f 100644 (file)
@@ -197,6 +197,11 @@ static int common_timer_create(struct k_itimer *new_timer)
        return 0;
 }
 
+static int no_timer_create(struct k_itimer *new_timer)
+{
+       return -EOPNOTSUPP;
+}
+
 /*
  * Return nonzero if we know a priori this clockid_t value is bogus.
  */
@@ -248,6 +253,7 @@ static __init int init_posix_timers(void)
                .clock_getres = hrtimer_get_res,
                .clock_get = posix_get_monotonic_raw,
                .clock_set = do_posix_clock_nosettime,
+               .timer_create = no_timer_create,
        };
 
        register_posix_clock(CLOCK_REALTIME, &clock_realtime);
index b7713b53d07a7a17a97130b81bf9b5946e8f1d29..6da14358537c8779db14f4ccab91a64365270d16 100644 (file)
@@ -633,7 +633,7 @@ void swsusp_close(fmode_t mode)
                return;
        }
 
-       blkdev_put(resume_bdev, mode); /* move up */
+       blkdev_put(resume_bdev, mode);
 }
 
 static int swsusp_header_init(void)
index 32b0befdcb6a6cba585cb555d9db4a87246d9468..09ac2008f77b419a5c169e41f3ddcbab6aa90746 100644 (file)
@@ -1317,12 +1317,9 @@ static ssize_t relay_file_splice_read(struct file *in,
                if (ret < 0)
                        break;
                else if (!ret) {
-                       if (spliced)
-                               break;
-                       if (flags & SPLICE_F_NONBLOCK) {
+                       if (flags & SPLICE_F_NONBLOCK)
                                ret = -EAGAIN;
-                               break;
-                       }
+                       break;
                }
 
                *ppos += ret;
index b7480fb5c3dc21a7bf6513a978cf0ed2e8c19a8f..e4bb1dd7b308fce6f47e736b70425f4bc3482c0a 100644 (file)
@@ -6587,7 +6587,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
                        req = list_entry(rq->migration_queue.next,
                                         struct migration_req, list);
                        list_del_init(&req->list);
+                       spin_unlock_irq(&rq->lock);
                        complete(&req->done);
+                       spin_lock_irq(&rq->lock);
                }
                spin_unlock_irq(&rq->lock);
                break;
index 81787248b60fda5bc58b6231be84a6a54a763cb0..e8ab096ddfe399dc3007e32b169b46d02ed9cb48 100644 (file)
@@ -118,13 +118,13 @@ static u64 __update_sched_clock(struct sched_clock_data *scd, u64 now)
 
        /*
         * scd->clock = clamp(scd->tick_gtod + delta,
-        *                    max(scd->tick_gtod, scd->clock),
-        *                    max(scd->clock, scd->tick_gtod + TICK_NSEC));
+        *                    max(scd->tick_gtod, scd->clock),
+        *                    scd->tick_gtod + TICK_NSEC);
         */
 
        clock = scd->tick_gtod + delta;
        min_clock = wrap_max(scd->tick_gtod, scd->clock);
-       max_clock = wrap_max(scd->clock, scd->tick_gtod + TICK_NSEC);
+       max_clock = scd->tick_gtod + TICK_NSEC;
 
        clock = wrap_max(clock, min_clock);
        clock = wrap_min(clock, max_clock);
index 3953e4aed733d32284f48ecfffa1fbff05e234c6..dc0b3be6b7d52cb98bd84d599bfbb7e7d85b1e85 100644 (file)
@@ -188,7 +188,7 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
        if ((long)(now - t->last_switch_timestamp) <
                                        sysctl_hung_task_timeout_secs)
                return;
-       if (sysctl_hung_task_warnings < 0)
+       if (!sysctl_hung_task_warnings)
                return;
        sysctl_hung_task_warnings--;
 
index e7acfb482a680ea248f5268fbb7f158868938e56..fa05e88aa76f36af2dc5cb0cc26f737466d0a423 100644 (file)
@@ -518,6 +518,28 @@ void update_wall_time(void)
        /* correct the clock when NTP error is too big */
        clocksource_adjust(offset);
 
+       /*
+        * Since in the loop above, we accumulate any amount of time
+        * in xtime_nsec over a second into xtime.tv_sec, its possible for
+        * xtime_nsec to be fairly small after the loop. Further, if we're
+        * slightly speeding the clocksource up in clocksource_adjust(),
+        * its possible the required corrective factor to xtime_nsec could
+        * cause it to underflow.
+        *
+        * Now, we cannot simply roll the accumulated second back, since
+        * the NTP subsystem has been notified via second_overflow. So
+        * instead we push xtime_nsec forward by the amount we underflowed,
+        * and add that amount into the error.
+        *
+        * We'll correct this error next time through this function, when
+        * xtime_nsec is not as small.
+        */
+       if (unlikely((s64)clock->xtime_nsec < 0)) {
+               s64 neg = -(s64)clock->xtime_nsec;
+               clock->xtime_nsec = 0;
+               clock->error += neg << (NTP_SCALE_SHIFT - clock->shift);
+       }
+
        /* store full nanoseconds into xtime after rounding it up and
         * add the remainder to the error difference.
         */
index d83660fd6fdde53617121f3f72e38b58158126b9..8e30295e8566579515ca8126a694150e290107aa 100644 (file)
@@ -135,7 +135,7 @@ int unregister_dynamic_debug_module(char *mod_name)
        nr_entries--;
 out:
        up(&debug_list_mutex);
-       return 0;
+       return ret;
 }
 EXPORT_SYMBOL_GPL(unregister_dynamic_debug_module);
 
@@ -289,7 +289,7 @@ static ssize_t pr_debug_write(struct file *file, const char __user *buf,
                                        dynamic_enabled = DYNAMIC_ENABLED_SOME;
                                        err = 0;
                                        printk(KERN_DEBUG
-                                              "debugging enabled for module %s",
+                                              "debugging enabled for module %s\n",
                                               elem->name);
                                } else if (!value && (elem->enable == 1)) {
                                        elem->enable = 0;
@@ -309,7 +309,7 @@ static ssize_t pr_debug_write(struct file *file, const char __user *buf,
                                        err = 0;
                                        printk(KERN_DEBUG
                                               "debugging disabled for module "
-                                              "%s", elem->name);
+                                              "%s\n", elem->name);
                                }
                        }
                }
index 7a785a0c2ea0fccead72653a0fd66af5111888ea..1c4f9281f412db349d3a80e0ed51e51f6102027c 100644 (file)
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -220,8 +220,14 @@ build_up:
         */
        while ((layers < (MAX_LEVEL - 1)) && (id >= (1 << (layers*IDR_BITS)))) {
                layers++;
-               if (!p->count)
+               if (!p->count) {
+                       /* special case: if the tree is currently empty,
+                        * then we grow the tree by moving the top node
+                        * upwards.
+                        */
+                       p->layer++;
                        continue;
+               }
                if (!(new = get_from_free_list(idp))) {
                        /*
                         * The allocation failed.  If we built part of
index a8663890a88c2e358f21b8cdc6f23a8ebb9d77e5..b255b939bc1b85bd4fc385df4e1322e9472b2b26 100644 (file)
@@ -62,10 +62,7 @@ s64 __percpu_counter_sum(struct percpu_counter *fbc)
        for_each_online_cpu(cpu) {
                s32 *pcount = per_cpu_ptr(fbc->counters, cpu);
                ret += *pcount;
-               *pcount = 0;
        }
-       fbc->count = ret;
-
        spin_unlock(&fbc->lock);
        return ret;
 }
@@ -104,13 +101,13 @@ void percpu_counter_destroy(struct percpu_counter *fbc)
        if (!fbc->counters)
                return;
 
-       free_percpu(fbc->counters);
-       fbc->counters = NULL;
 #ifdef CONFIG_HOTPLUG_CPU
        mutex_lock(&percpu_counters_lock);
        list_del(&fbc->list);
        mutex_unlock(&percpu_counters_lock);
 #endif
+       free_percpu(fbc->counters);
+       fbc->counters = NULL;
 }
 EXPORT_SYMBOL(percpu_counter_destroy);
 
index f2e574dbc30089d778880d2ad178d5dd48174034..801c08b046e6cc0f1a12740dc74fed16ff018fe6 100644 (file)
@@ -176,6 +176,9 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
        int ret = 0;
        struct device *dev;
 
+       if (bdi->dev)   /* The driver needs to use separate queues per device */
+               goto exit;
+
        va_start(args, fmt);
        dev = device_create_vargs(bdi_class, parent, MKDEV(0, 0), bdi, fmt, args);
        va_end(args);
index 1e0d6b237f4418c2f8b8ca50e88d85a787adc0a7..037b0967c1e3b40cda18e57a775d61867bafb95f 100644 (file)
@@ -987,25 +987,18 @@ out:
 /*
  * Determine the nodes of an array of pages and store it in an array of status.
  */
-static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages,
-                        const void __user * __user *pages,
-                        int __user *status)
+static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
+                               const void __user **pages, int *status)
 {
        unsigned long i;
-       int err;
 
        down_read(&mm->mmap_sem);
 
        for (i = 0; i < nr_pages; i++) {
-               const void __user *p;
-               unsigned long addr;
+               unsigned long addr = (unsigned long)(*pages);
                struct vm_area_struct *vma;
                struct page *page;
-
-               err = -EFAULT;
-               if (get_user(p, pages+i))
-                       goto out;
-               addr = (unsigned long) p;
+               int err = -EFAULT;
 
                vma = find_vma(mm, addr);
                if (!vma)
@@ -1024,12 +1017,52 @@ static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages,
 
                err = page_to_nid(page);
 set_status:
-               put_user(err, status+i);
+               *status = err;
+
+               pages++;
+               status++;
+       }
+
+       up_read(&mm->mmap_sem);
+}
+
+/*
+ * Determine the nodes of a user array of pages and store it in
+ * a user array of status.
+ */
+static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages,
+                        const void __user * __user *pages,
+                        int __user *status)
+{
+#define DO_PAGES_STAT_CHUNK_NR 16
+       const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR];
+       int chunk_status[DO_PAGES_STAT_CHUNK_NR];
+       unsigned long i, chunk_nr = DO_PAGES_STAT_CHUNK_NR;
+       int err;
+
+       for (i = 0; i < nr_pages; i += chunk_nr) {
+               if (chunk_nr + i > nr_pages)
+                       chunk_nr = nr_pages - i;
+
+               err = copy_from_user(chunk_pages, &pages[i],
+                                    chunk_nr * sizeof(*chunk_pages));
+               if (err) {
+                       err = -EFAULT;
+                       goto out;
+               }
+
+               do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status);
+
+               err = copy_to_user(&status[i], chunk_status,
+                                  chunk_nr * sizeof(*chunk_status));
+               if (err) {
+                       err = -EFAULT;
+                       goto out;
+               }
        }
        err = 0;
 
 out:
-       up_read(&mm->mmap_sem);
        return err;
 }
 
index 0b3cbf090a674a1424cb1d7cc9e4cd4f3bfa4c02..ab27ff75051958fb992417ddcf675a296b96176e 100644 (file)
@@ -49,6 +49,9 @@ static int __init alloc_node_page_cgroup(int nid)
        start_pfn = NODE_DATA(nid)->node_start_pfn;
        nr_pages = NODE_DATA(nid)->node_spanned_pages;
 
+       if (!nr_pages)
+               return 0;
+
        table_size = sizeof(struct page_cgroup) * nr_pages;
 
        base = __alloc_bootmem_node_nopanic(NODE_DATA(nid),
index cb675d1267914dc263100b9c4a9ea5eb20fefa48..bf7e8fc3aed806542e44cc7b1d222d9e2b56dc3a 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -535,7 +535,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
        struct kmem_cache *c;
 
        c = slob_alloc(sizeof(struct kmem_cache),
-               flags, ARCH_KMALLOC_MINALIGN, -1);
+               GFP_KERNEL, ARCH_KMALLOC_MINALIGN, -1);
 
        if (c) {
                c->name = name;
index 749588a50a5ac2764eb49cf944d8bf784eedfb5f..a2cd47d89e0aa1f159d8e9e6ed2dcee32969068f 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3597,7 +3597,7 @@ static int list_locations(struct kmem_cache *s, char *buf,
        for (i = 0; i < t.count; i++) {
                struct location *l = &t.loc[i];
 
-               if (len > PAGE_SIZE - 100)
+               if (len > PAGE_SIZE - KSYM_SYMBOL_LEN - 100)
                        break;
                len += sprintf(buf + len, "%7ld ", l->count);
 
index 2152e48a7b8f0726f06a88c516d82a0becf3c19d..b135ec90cdeb92673e2e97389f7cf9afc3ae80c9 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -299,7 +299,6 @@ void lru_add_drain(void)
        put_cpu();
 }
 
-#if defined(CONFIG_NUMA) || defined(CONFIG_UNEVICTABLE_LRU)
 static void lru_add_drain_per_cpu(struct work_struct *dummy)
 {
        lru_add_drain();
@@ -313,18 +312,6 @@ int lru_add_drain_all(void)
        return schedule_on_each_cpu(lru_add_drain_per_cpu);
 }
 
-#else
-
-/*
- * Returns 0 for success
- */
-int lru_add_drain_all(void)
-{
-       lru_add_drain();
-       return 0;
-}
-#endif
-
 /*
  * Batched page_cache_release().  Decrement the reference count on all the
  * passed pages.  If it fell to zero then remove the page from the LRU and
@@ -445,6 +432,7 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
        for (i = 0; i < pagevec_count(pvec); i++) {
                struct page *page = pvec->pages[i];
                struct zone *pagezone = page_zone(page);
+               int file;
 
                if (pagezone != zone) {
                        if (zone)
@@ -456,8 +444,12 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
                VM_BUG_ON(PageUnevictable(page));
                VM_BUG_ON(PageLRU(page));
                SetPageLRU(page);
-               if (is_active_lru(lru))
+               file = is_file_lru(lru);
+               zone->recent_scanned[file]++;
+               if (is_active_lru(lru)) {
                        SetPageActive(page);
+                       zone->recent_rotated[file]++;
+               }
                add_page_to_lru_list(zone, page, lru);
        }
        if (zone)
index f3f6e0758562283ac51fc4267a4d87fed600e917..1ddb77ba3995c2d8f486baf32c1409b3daf8093f 100644 (file)
@@ -1717,7 +1717,7 @@ static int s_show(struct seq_file *m, void *p)
                v->addr, v->addr + v->size, v->size);
 
        if (v->caller) {
-               char buff[2 * KSYM_NAME_LEN];
+               char buff[KSYM_SYMBOL_LEN];
 
                seq_putc(m, ' ');
                sprint_symbol(buff, (unsigned long)v->caller);
index de1e4f2f3a43ea983f9a4eef973618772b69cc82..8fb54dc870b393d61373e308dfa8bec722d591a5 100644 (file)
@@ -293,7 +293,10 @@ static int svc_listen(struct socket *sock,int backlog)
                error = -EINVAL;
                goto out;
        }
-       vcc_insert_socket(sk);
+       if (test_bit(ATM_VF_LISTEN, &vcc->flags)) {
+               error = -EADDRINUSE;
+               goto out;
+        }
        set_bit(ATM_VF_WAITING, &vcc->flags);
        prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
        sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
@@ -307,6 +310,7 @@ static int svc_listen(struct socket *sock,int backlog)
                goto out;
        }
        set_bit(ATM_VF_LISTEN,&vcc->flags);
+       vcc_insert_socket(sk);
        sk->sk_max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
        error = -sk->sk_err;
 out:
index ba537fae0a4ca653b4a7eedb7b941deb8aef613b..ce68e046d963840e4a3822972ed33f2a30a86244 100644 (file)
@@ -1786,8 +1786,6 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
        if (err < 0)
                return;
 
-       __module_get(nsock->ops->owner);
-
        /* Set our callbacks */
        nsock->sk->sk_data_ready   = rfcomm_l2data_ready;
        nsock->sk->sk_state_change = rfcomm_l2state_change;
index fa5cda4e552ab0088901a2820f4267d31b303030..45f61c348e369c7a78d2fd91d8a14fb1ea75b7e5 100644 (file)
@@ -101,6 +101,18 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb)
         pppoe_proto(skb) == htons(PPP_IPV6) && \
         brnf_filter_pppoe_tagged)
 
+static void fake_update_pmtu(struct dst_entry *dst, u32 mtu)
+{
+}
+
+static struct dst_ops fake_dst_ops = {
+       .family =               AF_INET,
+       .protocol =             __constant_htons(ETH_P_IP),
+       .update_pmtu =          fake_update_pmtu,
+       .entry_size =           sizeof(struct rtable),
+       .entries =              ATOMIC_INIT(0),
+};
+
 /*
  * Initialize bogus route table used to keep netfilter happy.
  * Currently, we fill in the PMTU entry because netfilter
@@ -117,6 +129,7 @@ void br_netfilter_rtable_init(struct net_bridge *br)
        rt->u.dst.path = &rt->u.dst;
        rt->u.dst.metrics[RTAX_MTU - 1] = 1500;
        rt->u.dst.flags = DST_NOXFRM;
+       rt->u.dst.ops = &fake_dst_ops;
 }
 
 static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
index 7d4d2b3c137ef6b84598d9bebd50b1a69dfaf707..3dadb338addd3ab36212333281ab377362a7e56f 100644 (file)
@@ -319,23 +319,52 @@ static struct dev_rcv_lists *find_dev_rcv_lists(struct net_device *dev)
        return n ? d : NULL;
 }
 
+/**
+ * find_rcv_list - determine optimal filterlist inside device filter struct
+ * @can_id: pointer to CAN identifier of a given can_filter
+ * @mask: pointer to CAN mask of a given can_filter
+ * @d: pointer to the device filter struct
+ *
+ * Description:
+ *  Returns the optimal filterlist to reduce the filter handling in the
+ *  receive path. This function is called by service functions that need
+ *  to register or unregister a can_filter in the filter lists.
+ *
+ *  A filter matches in general, when
+ *
+ *          <received_can_id> & mask == can_id & mask
+ *
+ *  so every bit set in the mask (even CAN_EFF_FLAG, CAN_RTR_FLAG) describe
+ *  relevant bits for the filter.
+ *
+ *  The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
+ *  filter for error frames (CAN_ERR_FLAG bit set in mask). For error frames
+ *  there is a special filterlist and a special rx path filter handling.
+ *
+ * Return:
+ *  Pointer to optimal filterlist for the given can_id/mask pair.
+ *  Constistency checked mask.
+ *  Reduced can_id to have a preprocessed filter compare value.
+ */
 static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask,
                                        struct dev_rcv_lists *d)
 {
        canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */
 
-       /* filter error frames */
+       /* filter for error frames in extra filterlist */
        if (*mask & CAN_ERR_FLAG) {
-               /* clear CAN_ERR_FLAG in list entry */
+               /* clear CAN_ERR_FLAG in filter entry */
                *mask &= CAN_ERR_MASK;
                return &d->rx[RX_ERR];
        }
 
-       /* ensure valid values in can_mask */
-       if (*mask & CAN_EFF_FLAG)
-               *mask &= (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG);
-       else
-               *mask &= (CAN_SFF_MASK | CAN_RTR_FLAG);
+       /* with cleared CAN_ERR_FLAG we have a simple mask/value filterpair */
+
+#define CAN_EFF_RTR_FLAGS (CAN_EFF_FLAG | CAN_RTR_FLAG)
+
+       /* ensure valid values in can_mask for 'SFF only' frame filtering */
+       if ((*mask & CAN_EFF_FLAG) && !(*can_id & CAN_EFF_FLAG))
+               *mask &= (CAN_SFF_MASK | CAN_EFF_RTR_FLAGS);
 
        /* reduce condition testing at receive time */
        *can_id &= *mask;
@@ -348,15 +377,19 @@ static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask,
        if (!(*mask))
                return &d->rx[RX_ALL];
 
-       /* use extra filterset for the subscription of exactly *ONE* can_id */
-       if (*can_id & CAN_EFF_FLAG) {
-               if (*mask == (CAN_EFF_MASK | CAN_EFF_FLAG)) {
-                       /* RFC: a use-case for hash-tables in the future? */
-                       return &d->rx[RX_EFF];
+       /* extra filterlists for the subscription of a single non-RTR can_id */
+       if (((*mask & CAN_EFF_RTR_FLAGS) == CAN_EFF_RTR_FLAGS)
+           && !(*can_id & CAN_RTR_FLAG)) {
+
+               if (*can_id & CAN_EFF_FLAG) {
+                       if (*mask == (CAN_EFF_MASK | CAN_EFF_RTR_FLAGS)) {
+                               /* RFC: a future use-case for hash-tables? */
+                               return &d->rx[RX_EFF];
+                       }
+               } else {
+                       if (*mask == (CAN_SFF_MASK | CAN_EFF_RTR_FLAGS))
+                               return &d->rx_sff[*can_id];
                }
-       } else {
-               if (*mask == CAN_SFF_MASK)
-                       return &d->rx_sff[*can_id];
        }
 
        /* default: filter via can_id/can_mask */
@@ -589,7 +622,10 @@ static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb)
                }
        }
 
-       /* check CAN_ID specific entries */
+       /* check filterlists for single non-RTR can_ids */
+       if (can_id & CAN_RTR_FLAG)
+               return matches;
+
        if (can_id & CAN_EFF_FLAG) {
                hlist_for_each_entry_rcu(r, n, &d->rx[RX_EFF], list) {
                        if (r->can_id == can_id) {
index d0dd382001e210c052e2fcb1ca6ae304d72b46a1..da0d426c0ce473f53450c65690a7bfe4a3e79f42 100644 (file)
 #define BCM_CAN_DLC_MASK 0x0F /* clean private flags in can_dlc by masking */
 
 /* get best masking value for can_rx_register() for a given single can_id */
-#define REGMASK(id) ((id & CAN_RTR_FLAG) | ((id & CAN_EFF_FLAG) ? \
-                       (CAN_EFF_MASK | CAN_EFF_FLAG) : CAN_SFF_MASK))
+#define REGMASK(id) ((id & CAN_EFF_FLAG) ? \
+                    (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG) : \
+                    (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
 
-#define CAN_BCM_VERSION "20080415"
+#define CAN_BCM_VERSION CAN_VERSION
 static __initdata const char banner[] = KERN_INFO
        "can: broadcast manager protocol (rev " CAN_BCM_VERSION ")\n";
 
index 6c7af390be0a515cfb1d09d2db79f16776e0dbe4..dadac6281f20392d0431d80a9001a6169ab94ca7 100644 (file)
@@ -133,9 +133,11 @@ static int poll_one_napi(struct netpoll_info *npinfo,
 
        npinfo->rx_flags |= NETPOLL_RX_DROP;
        atomic_inc(&trapped);
+       set_bit(NAPI_STATE_NPSVC, &napi->state);
 
        work = napi->poll(napi, budget);
 
+       clear_bit(NAPI_STATE_NPSVC, &napi->state);
        atomic_dec(&trapped);
        npinfo->rx_flags &= ~NETPOLL_RX_DROP;
 
index d49ef8301b5bd5de20d1b8a6e57aa5144ffff28a..65f7757465bd2ed8b99c2a0934c8e5dc32c73b00 100644 (file)
@@ -149,7 +149,7 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
 
 void skb_truesize_bug(struct sk_buff *skb)
 {
-       printk(KERN_ERR "SKB BUG: Invalid truesize (%u) "
+       WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) "
               "len=%u, sizeof(sk_buff)=%Zd\n",
               skb->truesize, skb->len, sizeof(struct sk_buff));
 }
index 341e39456952abc106b9b7c9ec5eaa04e8de208f..edf7220889a4b75f1e1671c39aeef8c31351387b 100644 (file)
@@ -2035,9 +2035,6 @@ static inline void release_proto_idx(struct proto *prot)
 
 int proto_register(struct proto *prot, int alloc_slab)
 {
-       char *request_sock_slab_name = NULL;
-       char *timewait_sock_slab_name;
-
        if (alloc_slab) {
                prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
                                               SLAB_HWCACHE_ALIGN, NULL);
@@ -2051,12 +2048,12 @@ int proto_register(struct proto *prot, int alloc_slab)
                if (prot->rsk_prot != NULL) {
                        static const char mask[] = "request_sock_%s";
 
-                       request_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
-                       if (request_sock_slab_name == NULL)
+                       prot->rsk_prot->slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
+                       if (prot->rsk_prot->slab_name == NULL)
                                goto out_free_sock_slab;
 
-                       sprintf(request_sock_slab_name, mask, prot->name);
-                       prot->rsk_prot->slab = kmem_cache_create(request_sock_slab_name,
+                       sprintf(prot->rsk_prot->slab_name, mask, prot->name);
+                       prot->rsk_prot->slab = kmem_cache_create(prot->rsk_prot->slab_name,
                                                                 prot->rsk_prot->obj_size, 0,
                                                                 SLAB_HWCACHE_ALIGN, NULL);
 
@@ -2070,14 +2067,14 @@ int proto_register(struct proto *prot, int alloc_slab)
                if (prot->twsk_prot != NULL) {
                        static const char mask[] = "tw_sock_%s";
 
-                       timewait_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
+                       prot->twsk_prot->twsk_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL);
 
-                       if (timewait_sock_slab_name == NULL)
+                       if (prot->twsk_prot->twsk_slab_name == NULL)
                                goto out_free_request_sock_slab;
 
-                       sprintf(timewait_sock_slab_name, mask, prot->name);
+                       sprintf(prot->twsk_prot->twsk_slab_name, mask, prot->name);
                        prot->twsk_prot->twsk_slab =
-                               kmem_cache_create(timewait_sock_slab_name,
+                               kmem_cache_create(prot->twsk_prot->twsk_slab_name,
                                                  prot->twsk_prot->twsk_obj_size,
                                                  0, SLAB_HWCACHE_ALIGN,
                                                  NULL);
@@ -2093,14 +2090,14 @@ int proto_register(struct proto *prot, int alloc_slab)
        return 0;
 
 out_free_timewait_sock_slab_name:
-       kfree(timewait_sock_slab_name);
+       kfree(prot->twsk_prot->twsk_slab_name);
 out_free_request_sock_slab:
        if (prot->rsk_prot && prot->rsk_prot->slab) {
                kmem_cache_destroy(prot->rsk_prot->slab);
                prot->rsk_prot->slab = NULL;
        }
 out_free_request_sock_slab_name:
-       kfree(request_sock_slab_name);
+       kfree(prot->rsk_prot->slab_name);
 out_free_sock_slab:
        kmem_cache_destroy(prot->slab);
        prot->slab = NULL;
@@ -2123,18 +2120,14 @@ void proto_unregister(struct proto *prot)
        }
 
        if (prot->rsk_prot != NULL && prot->rsk_prot->slab != NULL) {
-               const char *name = kmem_cache_name(prot->rsk_prot->slab);
-
                kmem_cache_destroy(prot->rsk_prot->slab);
-               kfree(name);
+               kfree(prot->rsk_prot->slab_name);
                prot->rsk_prot->slab = NULL;
        }
 
        if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) {
-               const char *name = kmem_cache_name(prot->twsk_prot->twsk_slab);
-
                kmem_cache_destroy(prot->twsk_prot->twsk_slab);
-               kfree(name);
+               kfree(prot->twsk_prot->twsk_slab_name);
                prot->twsk_prot->twsk_slab = NULL;
        }
 }
index bea54a685109ed3b6fa1fe3f621fb7522ceb2de8..8d489e746b21cb513d0d1b49b3984b514f6e634c 100644 (file)
@@ -61,7 +61,7 @@ static struct
 static struct xt_table nat_table = {
        .name           = "nat",
        .valid_hooks    = NAT_VALID_HOOKS,
-       .lock           = __RW_LOCK_UNLOCKED(__nat_table.lock),
+       .lock           = __RW_LOCK_UNLOCKED(nat_table.lock),
        .me             = THIS_MODULE,
        .af             = AF_INET,
 };
index ba85d8831893183b6f72053f5b4952a54cdf0ba5..fe3b4bdfd2516d6cfd5297354b7046bf4c97d8e3 100644 (file)
@@ -1028,10 +1028,6 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
 
 /* Compute the current effective MSS, taking SACKs and IP options,
  * and even PMTU discovery events into account.
- *
- * LARGESEND note: !tcp_urg_mode is overkill, only frames up to snd_up
- * cannot be large. However, taking into account rare use of URG, this
- * is not a big flaw.
  */
 unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
 {
@@ -1046,7 +1042,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
 
        mss_now = tp->mss_cache;
 
-       if (large_allowed && sk_can_gso(sk) && !tcp_urg_mode(tp))
+       if (large_allowed && sk_can_gso(sk))
                doing_tso = 1;
 
        if (dst) {
@@ -1516,6 +1512,10 @@ static int tcp_mtu_probe(struct sock *sk)
  * send_head.  This happens as incoming acks open up the remote
  * window for us.
  *
+ * LARGESEND note: !tcp_urg_mode is overkill, only frames between
+ * snd_up-64k-mss .. snd_up cannot be large. However, taking into
+ * account rare use of URG, this is not a big flaw.
+ *
  * Returns 1, if no segments are in flight and we have queued segments, but
  * cannot send anything now because of SWS or another problem.
  */
@@ -1567,7 +1567,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
                }
 
                limit = mss_now;
-               if (tso_segs > 1)
+               if (tso_segs > 1 && !tcp_urg_mode(tp))
                        limit = tcp_mss_split_point(sk, skb, mss_now,
                                                    cwnd_quota);
 
@@ -1616,6 +1616,7 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
  */
 void tcp_push_one(struct sock *sk, unsigned int mss_now)
 {
+       struct tcp_sock *tp = tcp_sk(sk);
        struct sk_buff *skb = tcp_send_head(sk);
        unsigned int tso_segs, cwnd_quota;
 
@@ -1630,7 +1631,7 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now)
                BUG_ON(!tso_segs);
 
                limit = mss_now;
-               if (tso_segs > 1)
+               if (tso_segs > 1 && !tcp_urg_mode(tp))
                        limit = tcp_mss_split_point(sk, skb, mss_now,
                                                    cwnd_quota);
 
index 14504dada1166d57f36f3f603c5fbe5fbd0bfc95..a453aac91bd3b740ef44363ef10e5be5390bf6dc 100644 (file)
 
 #include "tcp_vegas.h"
 
-/* Default values of the Vegas variables, in fixed-point representation
- * with V_PARAM_SHIFT bits to the right of the binary point.
- */
-#define V_PARAM_SHIFT 1
-static int alpha = 2<<V_PARAM_SHIFT;
-static int beta  = 4<<V_PARAM_SHIFT;
-static int gamma = 1<<V_PARAM_SHIFT;
+static int alpha = 2;
+static int beta  = 4;
+static int gamma = 1;
 
 module_param(alpha, int, 0644);
-MODULE_PARM_DESC(alpha, "lower bound of packets in network (scale by 2)");
+MODULE_PARM_DESC(alpha, "lower bound of packets in network");
 module_param(beta, int, 0644);
-MODULE_PARM_DESC(beta, "upper bound of packets in network (scale by 2)");
+MODULE_PARM_DESC(beta, "upper bound of packets in network");
 module_param(gamma, int, 0644);
 MODULE_PARM_DESC(gamma, "limit on increase (scale by 2)");
 
@@ -172,49 +168,13 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                return;
        }
 
-       /* The key players are v_beg_snd_una and v_beg_snd_nxt.
-        *
-        * These are so named because they represent the approximate values
-        * of snd_una and snd_nxt at the beginning of the current RTT. More
-        * precisely, they represent the amount of data sent during the RTT.
-        * At the end of the RTT, when we receive an ACK for v_beg_snd_nxt,
-        * we will calculate that (v_beg_snd_nxt - v_beg_snd_una) outstanding
-        * bytes of data have been ACKed during the course of the RTT, giving
-        * an "actual" rate of:
-        *
-        *     (v_beg_snd_nxt - v_beg_snd_una) / (rtt duration)
-        *
-        * Unfortunately, v_beg_snd_una is not exactly equal to snd_una,
-        * because delayed ACKs can cover more than one segment, so they
-        * don't line up nicely with the boundaries of RTTs.
-        *
-        * Another unfortunate fact of life is that delayed ACKs delay the
-        * advance of the left edge of our send window, so that the number
-        * of bytes we send in an RTT is often less than our cwnd will allow.
-        * So we keep track of our cwnd separately, in v_beg_snd_cwnd.
-        */
-
        if (after(ack, vegas->beg_snd_nxt)) {
                /* Do the Vegas once-per-RTT cwnd adjustment. */
-               u32 old_wnd, old_snd_cwnd;
-
-
-               /* Here old_wnd is essentially the window of data that was
-                * sent during the previous RTT, and has all
-                * been acknowledged in the course of the RTT that ended
-                * with the ACK we just received. Likewise, old_snd_cwnd
-                * is the cwnd during the previous RTT.
-                */
-               old_wnd = (vegas->beg_snd_nxt - vegas->beg_snd_una) /
-                       tp->mss_cache;
-               old_snd_cwnd = vegas->beg_snd_cwnd;
 
                /* Save the extent of the current window so we can use this
                 * at the end of the next RTT.
                 */
-               vegas->beg_snd_una  = vegas->beg_snd_nxt;
                vegas->beg_snd_nxt  = tp->snd_nxt;
-               vegas->beg_snd_cwnd = tp->snd_cwnd;
 
                /* We do the Vegas calculations only if we got enough RTT
                 * samples that we can be reasonably sure that we got
@@ -252,22 +212,14 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                         *
                         * This is:
                         *     (actual rate in segments) * baseRTT
-                        * We keep it as a fixed point number with
-                        * V_PARAM_SHIFT bits to the right of the binary point.
                         */
-                       target_cwnd = ((u64)old_wnd * vegas->baseRTT);
-                       target_cwnd <<= V_PARAM_SHIFT;
-                       do_div(target_cwnd, rtt);
+                       target_cwnd = tp->snd_cwnd * vegas->baseRTT / rtt;
 
                        /* Calculate the difference between the window we had,
                         * and the window we would like to have. This quantity
                         * is the "Diff" from the Arizona Vegas papers.
-                        *
-                        * Again, this is a fixed point number with
-                        * V_PARAM_SHIFT bits to the right of the binary
-                        * point.
                         */
-                       diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
+                       diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT;
 
                        if (diff > gamma && tp->snd_ssthresh > 2 ) {
                                /* Going too fast. Time to slow down
@@ -282,16 +234,13 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                                 * truncation robs us of full link
                                 * utilization.
                                 */
-                               tp->snd_cwnd = min(tp->snd_cwnd,
-                                                  ((u32)target_cwnd >>
-                                                   V_PARAM_SHIFT)+1);
+                               tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1);
 
                        } else if (tp->snd_cwnd <= tp->snd_ssthresh) {
                                /* Slow start.  */
                                tcp_slow_start(tp);
                        } else {
                                /* Congestion avoidance. */
-                               u32 next_snd_cwnd;
 
                                /* Figure out where we would like cwnd
                                 * to be.
@@ -300,32 +249,25 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                                        /* The old window was too fast, so
                                         * we slow down.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd - 1;
+                                       tp->snd_cwnd--;
                                } else if (diff < alpha) {
                                        /* We don't have enough extra packets
                                         * in the network, so speed up.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd + 1;
+                                       tp->snd_cwnd++;
                                } else {
                                        /* Sending just as fast as we
                                         * should be.
                                         */
-                                       next_snd_cwnd = old_snd_cwnd;
                                }
-
-                               /* Adjust cwnd upward or downward, toward the
-                                * desired value.
-                                */
-                               if (next_snd_cwnd > tp->snd_cwnd)
-                                       tp->snd_cwnd++;
-                               else if (next_snd_cwnd < tp->snd_cwnd)
-                                       tp->snd_cwnd--;
                        }
 
                        if (tp->snd_cwnd < 2)
                                tp->snd_cwnd = 2;
                        else if (tp->snd_cwnd > tp->snd_cwnd_clamp)
                                tp->snd_cwnd = tp->snd_cwnd_clamp;
+
+                       tp->snd_ssthresh = tcp_current_ssthresh(sk);
                }
 
                /* Wipe the slate clean for the next RTT. */
index 172438320eec74287b045cd6b784bb3de0b38b0f..d0f54d18e19b92de1407eb9a36fed5344363d01d 100644 (file)
@@ -912,8 +912,13 @@ static void ndisc_recv_na(struct sk_buff *skb)
                   is invalid, but ndisc specs say nothing
                   about it. It could be misconfiguration, or
                   an smart proxy agent tries to help us :-)
+
+                  We should not print the error if NA has been
+                  received from loopback - it is just our own
+                  unsolicited advertisement.
                 */
-               ND_PRINTK1(KERN_WARNING
+               if (skb->pkt_type != PACKET_LOOPBACK)
+                       ND_PRINTK1(KERN_WARNING
                           "ICMPv6 NA: someone advertises our address on %s!\n",
                           ifp->idev->dev->name);
                in6_ifa_put(ifp);
index 7fef8ea1f5ecf53eaf5b1596479ef1d8a834b348..d254446b85b59d76bf3d940fce4364270a2d5bb0 100644 (file)
@@ -99,7 +99,7 @@ struct sta_info *sta_info_get(struct ieee80211_local *local, const u8 *addr)
 
        sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);
        while (sta) {
-               if (compare_ether_addr(sta->sta.addr, addr) == 0)
+               if (memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
                        break;
                sta = rcu_dereference(sta->hnext);
        }
index 742f811ca416e5b16701ce2ae49f582ed32317a6..ab4ddba874be5ce73cb4ffc0b5e7e1da77053dac 100644 (file)
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
                                   __u32 *mode, char *extra)
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+       struct ieee80211_local *local = sdata->local;
        int type;
 
        if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
                type = NL80211_IFTYPE_STATION;
                break;
        case IW_MODE_ADHOC:
+               /* Setting ad-hoc mode on non ibss channel is not
+                * supported.
+                */
+               if (local->oper_channel &&
+                   (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS))
+                       return -EOPNOTSUPP;
+
                type = NL80211_IFTYPE_ADHOC;
                break;
        case IW_MODE_REPEAT:
index 622d7c671cb78533082f9bf0b655a3bbffcd2f92..233fdd2d7d2186b03fd6bac169d4090dbab562a3 100644 (file)
@@ -305,9 +305,7 @@ void nf_conntrack_hash_insert(struct nf_conn *ct)
        hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
        repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
 
-       spin_lock_bh(&nf_conntrack_lock);
        __nf_conntrack_hash_insert(ct, hash, repl_hash);
-       spin_unlock_bh(&nf_conntrack_lock);
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert);
 
index a040d46f85d6c8967f88af6c549f23206e6416c7..5f4a6516b3b6b6f935e677f774c22de1c038dccb 100644 (file)
@@ -1090,7 +1090,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
        struct nf_conn_help *help;
        struct nf_conntrack_helper *helper;
 
-       ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_KERNEL);
+       ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC);
        if (ct == NULL || IS_ERR(ct))
                return -ENOMEM;
 
@@ -1138,7 +1138,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
                }
        }
 
-       nf_ct_acct_ext_add(ct, GFP_KERNEL);
+       nf_ct_acct_ext_add(ct, GFP_ATOMIC);
 
 #if defined(CONFIG_NF_CONNTRACK_MARK)
        if (cda[CTA_MARK])
@@ -1212,13 +1212,14 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
                        atomic_inc(&master_ct->ct_general.use);
                }
 
-               spin_unlock_bh(&nf_conntrack_lock);
                err = -ENOENT;
                if (nlh->nlmsg_flags & NLM_F_CREATE)
                        err = ctnetlink_create_conntrack(cda,
                                                         &otuple,
                                                         &rtuple,
                                                         master_ct);
+               spin_unlock_bh(&nf_conntrack_lock);
+
                if (err < 0 && master_ct)
                        nf_ct_put(master_ct);
 
index 02a8fed210820879d5b6026041626c7816cc5612..1acc089be7e94b6e8570d9529895402d3e5a75df 100644 (file)
@@ -141,7 +141,7 @@ socket_mt(const struct sk_buff *skb, const struct xt_match_param *par)
        sk = nf_tproxy_get_sock_v4(dev_net(skb->dev), protocol,
                                   saddr, daddr, sport, dport, par->in, false);
        if (sk != NULL) {
-               bool wildcard = (inet_sk(sk)->rcv_saddr == 0);
+               bool wildcard = (sk->sk_state != TCP_TIME_WAIT && inet_sk(sk)->rcv_saddr == 0);
 
                nf_tproxy_put_sock(sk);
                if (wildcard)
index e8a5c32b0f106042c82790c2e1c924837bfe0b64..8c03080321784fe7fee76ec1ea2ebd3d85187765 100644 (file)
@@ -562,7 +562,6 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
                                      const struct in_addr *mask,
                                      struct netlbl_audit *audit_info)
 {
-       int ret_val = 0;
        struct netlbl_af4list *list_entry;
        struct netlbl_unlhsh_addr4 *entry;
        struct audit_buffer *audit_buf;
@@ -574,9 +573,10 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
        list_entry = netlbl_af4list_remove(addr->s_addr, mask->s_addr,
                                           &iface->addr4_list);
        spin_unlock(&netlbl_unlhsh_lock);
-       if (list_entry == NULL)
-               ret_val = -ENOENT;
-       entry = netlbl_unlhsh_addr4_entry(list_entry);
+       if (list_entry != NULL)
+               entry = netlbl_unlhsh_addr4_entry(list_entry);
+       else
+               entry = NULL;
 
        audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
                                              audit_info);
@@ -587,19 +587,21 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
                                          addr->s_addr, mask->s_addr);
                if (dev != NULL)
                        dev_put(dev);
-               if (entry && security_secid_to_secctx(entry->secid,
-                                                     &secctx,
-                                                     &secctx_len) == 0) {
+               if (entry != NULL &&
+                   security_secid_to_secctx(entry->secid,
+                                            &secctx, &secctx_len) == 0) {
                        audit_log_format(audit_buf, " sec_obj=%s", secctx);
                        security_release_secctx(secctx, secctx_len);
                }
-               audit_log_format(audit_buf, " res=%u", ret_val == 0 ? 1 : 0);
+               audit_log_format(audit_buf, " res=%u", entry != NULL ? 1 : 0);
                audit_log_end(audit_buf);
        }
 
-       if (ret_val == 0)
-               call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4);
-       return ret_val;
+       if (entry == NULL)
+               return -ENOENT;
+
+       call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4);
+       return 0;
 }
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
@@ -623,7 +625,6 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
                                      const struct in6_addr *mask,
                                      struct netlbl_audit *audit_info)
 {
-       int ret_val = 0;
        struct netlbl_af6list *list_entry;
        struct netlbl_unlhsh_addr6 *entry;
        struct audit_buffer *audit_buf;
@@ -634,9 +635,10 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
        spin_lock(&netlbl_unlhsh_lock);
        list_entry = netlbl_af6list_remove(addr, mask, &iface->addr6_list);
        spin_unlock(&netlbl_unlhsh_lock);
-       if (list_entry == NULL)
-               ret_val = -ENOENT;
-       entry = netlbl_unlhsh_addr6_entry(list_entry);
+       if (list_entry != NULL)
+               entry = netlbl_unlhsh_addr6_entry(list_entry);
+       else
+               entry = NULL;
 
        audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCDEL,
                                              audit_info);
@@ -647,19 +649,21 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
                                          addr, mask);
                if (dev != NULL)
                        dev_put(dev);
-               if (entry && security_secid_to_secctx(entry->secid,
-                                                     &secctx,
-                                                     &secctx_len) == 0) {
+               if (entry != NULL &&
+                   security_secid_to_secctx(entry->secid,
+                                            &secctx, &secctx_len) == 0) {
                        audit_log_format(audit_buf, " sec_obj=%s", secctx);
                        security_release_secctx(secctx, secctx_len);
                }
-               audit_log_format(audit_buf, " res=%u", ret_val == 0 ? 1 : 0);
+               audit_log_format(audit_buf, " res=%u", entry != NULL ? 1 : 0);
                audit_log_end(audit_buf);
        }
 
-       if (ret_val == 0)
-               call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6);
-       return ret_val;
+       if (entry == NULL)
+               return -ENOENT;
+
+       call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6);
+       return 0;
 }
 #endif /* IPv6 */
 
index 9978afbd9f2ad5033375df896358f88b929ecfcc..803eeef0aa856877ddced0e45fc283f4641da2ab 100644 (file)
@@ -155,12 +155,13 @@ static void gprs_data_ready(struct sock *sk, int len)
 static void gprs_write_space(struct sock *sk)
 {
        struct gprs_dev *dev = sk->sk_user_data;
+       struct net_device *net = dev->net;
        unsigned credits = pep_writeable(sk);
 
        spin_lock_bh(&dev->tx_lock);
        dev->tx_max = credits;
-       if (credits > skb_queue_len(&dev->tx_queue))
-               netif_wake_queue(dev->net);
+       if (credits > skb_queue_len(&dev->tx_queue) && netif_running(net))
+               netif_wake_queue(net);
        spin_unlock_bh(&dev->tx_lock);
 }
 
@@ -168,6 +169,23 @@ static void gprs_write_space(struct sock *sk)
  * Network device callbacks
  */
 
+static int gprs_open(struct net_device *dev)
+{
+       struct gprs_dev *gp = netdev_priv(dev);
+
+       gprs_write_space(gp->sk);
+       return 0;
+}
+
+static int gprs_close(struct net_device *dev)
+{
+       struct gprs_dev *gp = netdev_priv(dev);
+
+       netif_stop_queue(dev);
+       flush_work(&gp->tx_work);
+       return 0;
+}
+
 static int gprs_xmit(struct sk_buff *skb, struct net_device *net)
 {
        struct gprs_dev *dev = netdev_priv(net);
@@ -254,6 +272,8 @@ static void gprs_setup(struct net_device *net)
        net->tx_queue_len       = 10;
 
        net->destructor         = free_netdev;
+       net->open               = gprs_open;
+       net->stop               = gprs_close;
        net->hard_start_xmit    = gprs_xmit; /* mandatory */
        net->change_mtu         = gprs_set_mtu;
        net->get_stats          = gprs_get_stats;
@@ -318,7 +338,6 @@ int gprs_attach(struct sock *sk)
        dev->sk = sk;
 
        printk(KERN_DEBUG"%s: attached\n", net->name);
-       gprs_write_space(sk); /* kick off TX */
        return net->ifindex;
 
 out_rel:
@@ -341,7 +360,5 @@ void gprs_detach(struct sock *sk)
 
        printk(KERN_DEBUG"%s: detached\n", net->name);
        unregister_netdev(net);
-       flush_scheduled_work();
        sock_put(sk);
-       skb_queue_purge(&dev->tx_queue);
 }
index 53be9fc82aaadb2a0aa588974b13d603491ee0b0..f93ff8ef47d0f8d47635af976c4fab46b8fcd1ce 100644 (file)
@@ -115,7 +115,7 @@ int phonet_address_del(struct net_device *dev, u8 addr)
        pnd = __phonet_get(dev);
        if (!pnd || !test_and_clear_bit(addr >> 2, pnd->addrs))
                err = -EADDRNOTAVAIL;
-       if (bitmap_empty(pnd->addrs, 64))
+       else if (bitmap_empty(pnd->addrs, 64))
                __phonet_device_free(pnd);
        spin_unlock_bh(&pndevs.lock);
        return err;
index b1770d66bc8d68fc3c9ede8fd2408f813994dd93..242fe8f8c322d5fb048d737a46d36b99797f47aa 100644 (file)
@@ -123,6 +123,7 @@ nla_put_failure:
 
 static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 {
+       struct net *net = sock_net(skb->sk);
        struct phonet_device *pnd;
        int dev_idx = 0, dev_start_idx = cb->args[0];
        int addr_idx = 0, addr_start_idx = cb->args[1];
@@ -131,6 +132,8 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
        list_for_each_entry(pnd, &pndevs.list, list) {
                u8 addr;
 
+               if (!net_eq(dev_net(pnd->netdev), net))
+                       continue;
                if (dev_idx > dev_start_idx)
                        addr_start_idx = 0;
                if (dev_idx++ < dev_start_idx)
index a7f1ce11bc22d140d52526c11816973d05683729..0c1cc76128006e81d39b663f994de9e78f8539f5 100644 (file)
@@ -1072,6 +1072,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
        unsigned char *asmptr;
        int n, size, qbit = 0;
 
+       /* ROSE empty frame has no meaning : don't send */
+       if (len == 0)
+               return 0;
+
        if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
                return -EINVAL;
 
@@ -1265,6 +1269,12 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
        skb_reset_transport_header(skb);
        copied     = skb->len;
 
+       /* ROSE empty frame has no meaning : ignore it */
+       if (copied == 0) {
+               skb_free_datagram(sk, skb);
+               return copied;
+       }
+
        if (copied > size) {
                copied = size;
                msg->msg_flags |= MSG_TRUNC;
index a11959908d9a68c405114d56c5073c0d77647402..98402f0efa47727677b8d57acfe2ecd7cb9441b2 100644 (file)
@@ -46,9 +46,6 @@
         layering other disciplines.  It does not need to do bandwidth
         control either since that can be handled by using token
         bucket or other rate control.
-
-        The simulator is limited by the Linux timer resolution
-        and will create packet bursts on the HZ boundary (1ms).
 */
 
 struct netem_sched_data {
index 92764d836891833e1cb7f8255a38edacad1f3b7f..76ba80aeac1a86217ae77edc0e239084840f90d6 100644 (file)
@@ -2307,6 +2307,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
        }
 
        (*newsock)->ops = sock->ops;
+       __module_get((*newsock)->ops->owner);
 
 done:
        return err;
index 95293f549e9c2b371b82ce32af4ca43be00b5ada..a1951dcc577614df63fc0a3ab1e5ce92dce9d7ab 100644 (file)
@@ -1183,7 +1183,11 @@ int svc_addsock(struct svc_serv *serv,
        else if (so->state > SS_UNCONNECTED)
                err = -EISCONN;
        else {
-               svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS);
+               if (!try_module_get(THIS_MODULE))
+                       err = -ENOENT;
+               else
+                       svsk = svc_setup_socket(serv, so, &err,
+                                               SVC_SOCK_DEFAULTS);
                if (svsk) {
                        struct sockaddr_storage addr;
                        struct sockaddr *sin = (struct sockaddr *)&addr;
@@ -1196,7 +1200,8 @@ int svc_addsock(struct svc_serv *serv,
                        spin_unlock_bh(&serv->sv_lock);
                        svc_xprt_received(&svsk->sk_xprt);
                        err = 0;
-               }
+               } else
+                       module_put(THIS_MODULE);
        }
        if (err) {
                sockfd_put(so);
index eb90f77bb0e294b6358db3361740deaa0bec969e..66d5ac4773abac12f517c84b25916dc078cda007 100644 (file)
@@ -1343,6 +1343,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
 
        if (NULL == siocb->scm)
                siocb->scm = &tmp_scm;
+       wait_for_unix_gc();
        err = scm_send(sock, msg, siocb->scm);
        if (err < 0)
                return err;
@@ -1493,6 +1494,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
 
        if (NULL == siocb->scm)
                siocb->scm = &tmp_scm;
+       wait_for_unix_gc();
        err = scm_send(sock, msg, siocb->scm);
        if (err < 0)
                return err;
index 6d4a9a8de5ef1d8974a4f8fe17956dfd31b63fe6..abb3ab34cb1ece8f357819c8124430996e15d443 100644 (file)
@@ -80,6 +80,7 @@
 #include <linux/file.h>
 #include <linux/proc_fs.h>
 #include <linux/mutex.h>
+#include <linux/wait.h>
 
 #include <net/sock.h>
 #include <net/af_unix.h>
@@ -91,6 +92,7 @@
 static LIST_HEAD(gc_inflight_list);
 static LIST_HEAD(gc_candidates);
 static DEFINE_SPINLOCK(unix_gc_lock);
+static DECLARE_WAIT_QUEUE_HEAD(unix_gc_wait);
 
 unsigned int unix_tot_inflight;
 
@@ -266,12 +268,16 @@ static void inc_inflight_move_tail(struct unix_sock *u)
                list_move_tail(&u->link, &gc_candidates);
 }
 
-/* The external entry point: unix_gc() */
+static bool gc_in_progress = false;
 
-void unix_gc(void)
+void wait_for_unix_gc(void)
 {
-       static bool gc_in_progress = false;
+       wait_event(unix_gc_wait, gc_in_progress == false);
+}
 
+/* The external entry point: unix_gc() */
+void unix_gc(void)
+{
        struct unix_sock *u;
        struct unix_sock *next;
        struct sk_buff_head hitlist;
@@ -376,6 +382,7 @@ void unix_gc(void)
        /* All candidates should have been detached by now. */
        BUG_ON(!list_empty(&gc_candidates));
        gc_in_progress = false;
+       wake_up(&unix_gc_wait);
 
  out:
        spin_unlock(&unix_gc_lock);
index 626dbb688499bd9dafa0b963305df65d3ac0c04a..eb3b1a9f9b12477d5a2562916491e9d73c6a7792 100644 (file)
@@ -343,9 +343,9 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
                                return 0;
                        return -EALREADY;
                }
-               if (WARN_ON(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2)),
+               if (WARN(!is_alpha2_set(alpha2) || !is_an_alpha2(alpha2),
                                "Invalid Country IE regulatory hint passed "
-                               "to the wireless core\n")
+                               "to the wireless core\n"))
                        return -EINVAL;
                /* We ignore Country IE hints for now, as we haven't yet
                 * added the dot11MultiDomainCapabilityEnabled flag
index 058f04f54b9024857eb418321d6842bd448c744a..fb216c9adf86722bc81079fd25f4ed4b908e642c 100644 (file)
@@ -817,6 +817,7 @@ int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info)
                                continue;
                        hlist_del(&pol->bydst);
                        hlist_del(&pol->byidx);
+                       list_del(&pol->walk.all);
                        write_unlock_bh(&xfrm_policy_lock);
 
                        xfrm_audit_policy_delete(pol, 1, audit_info->loginuid,
index 7fa37e15f1961b8c6b48834bc4886c403bcb568c..a351dd0a09c7dc0eb53daa0b2cedb9c625ba9225 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/string.h>
+#include <sound/ac97_codec.h>
 
 /*
  * Let drivers decide whether they want to support given codec from their
index 31cbe68fd42f172eebdc36bdc755996c462a3940..c3ee77fc4b2dc4bb5ae60191bea60705edcc4c36 100644 (file)
@@ -1,3 +1,7 @@
+snd-aoa-codec-onyx-objs := onyx.o
+snd-aoa-codec-tas-objs := tas.o
+snd-aoa-codec-toonie-objs := toonie.o
+
 obj-$(CONFIG_SND_AOA_ONYX) += snd-aoa-codec-onyx.o
 obj-$(CONFIG_SND_AOA_TAS) += snd-aoa-codec-tas.o
 obj-$(CONFIG_SND_AOA_TOONIE) += snd-aoa-codec-toonie.o
diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
new file mode 100644 (file)
index 0000000..15500b9
--- /dev/null
@@ -0,0 +1,1118 @@
+/*
+ * Apple Onboard Audio driver for Onyx codec
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ *
+ * This is a driver for the pcm3052 codec chip (codenamed Onyx)
+ * that is present in newer Apple hardware (with digital output).
+ *
+ * The Onyx codec has the following connections (listed by the bit
+ * to be used in aoa_codec.connected):
+ *  0: analog output
+ *  1: digital output
+ *  2: line input
+ *  3: microphone input
+ * Note that even though I know of no machine that has for example
+ * the digital output connected but not the analog, I have handled
+ * all the different cases in the code so that this driver may serve
+ * as a good example of what to do.
+ *
+ * NOTE: This driver assumes that there's at most one chip to be
+ *      used with one alsa card, in form of creating all kinds
+ *      of mixer elements without regard for their existence.
+ *      But snd-aoa assumes that there's at most one card, so
+ *      this means you can only have one onyx on a system. This
+ *      should probably be fixed by changing the assumption of
+ *      having just a single card on a system, and making the
+ *      'card' pointer accessible to anyone who needs it instead
+ *      of hiding it in the aoa_snd_* functions...
+ *
+ */
+#include <linux/delay.h>
+#include <linux/module.h>
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("pcm3052 (onyx) codec driver for snd-aoa");
+
+#include "onyx.h"
+#include "../aoa.h"
+#include "../soundbus/soundbus.h"
+
+
+#define PFX "snd-aoa-codec-onyx: "
+
+struct onyx {
+       /* cache registers 65 to 80, they are write-only! */
+       u8                      cache[16];
+       struct i2c_client       i2c;
+       struct aoa_codec        codec;
+       u32                     initialised:1,
+                               spdif_locked:1,
+                               analog_locked:1,
+                               original_mute:2;
+       int                     open_count;
+       struct codec_info       *codec_info;
+
+       /* mutex serializes concurrent access to the device
+        * and this structure.
+        */
+       struct mutex mutex;
+};
+#define codec_to_onyx(c) container_of(c, struct onyx, codec)
+
+/* both return 0 if all ok, else on error */
+static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value)
+{
+       s32 v;
+
+       if (reg != ONYX_REG_CONTROL) {
+               *value = onyx->cache[reg-FIRSTREGISTER];
+               return 0;
+       }
+       v = i2c_smbus_read_byte_data(&onyx->i2c, reg);
+       if (v < 0)
+               return -1;
+       *value = (u8)v;
+       onyx->cache[ONYX_REG_CONTROL-FIRSTREGISTER] = *value;
+       return 0;
+}
+
+static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value)
+{
+       int result;
+
+       result = i2c_smbus_write_byte_data(&onyx->i2c, reg, value);
+       if (!result)
+               onyx->cache[reg-FIRSTREGISTER] = value;
+       return result;
+}
+
+/* alsa stuff */
+
+static int onyx_dev_register(struct snd_device *dev)
+{
+       return 0;
+}
+
+static struct snd_device_ops ops = {
+       .dev_register = onyx_dev_register,
+};
+
+/* this is necessary because most alsa mixer programs
+ * can't properly handle the negative range */
+#define VOLUME_RANGE_SHIFT     128
+
+static int onyx_snd_vol_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 2;
+       uinfo->value.integer.min = -128 + VOLUME_RANGE_SHIFT;
+       uinfo->value.integer.max = -1 + VOLUME_RANGE_SHIFT;
+       return 0;
+}
+
+static int onyx_snd_vol_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       s8 l, r;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
+       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
+       mutex_unlock(&onyx->mutex);
+
+       ucontrol->value.integer.value[0] = l + VOLUME_RANGE_SHIFT;
+       ucontrol->value.integer.value[1] = r + VOLUME_RANGE_SHIFT;
+
+       return 0;
+}
+
+static int onyx_snd_vol_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       s8 l, r;
+
+       if (ucontrol->value.integer.value[0] < -128 + VOLUME_RANGE_SHIFT ||
+           ucontrol->value.integer.value[0] > -1 + VOLUME_RANGE_SHIFT)
+               return -EINVAL;
+       if (ucontrol->value.integer.value[1] < -128 + VOLUME_RANGE_SHIFT ||
+           ucontrol->value.integer.value[1] > -1 + VOLUME_RANGE_SHIFT)
+               return -EINVAL;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
+       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
+
+       if (l + VOLUME_RANGE_SHIFT == ucontrol->value.integer.value[0] &&
+           r + VOLUME_RANGE_SHIFT == ucontrol->value.integer.value[1]) {
+               mutex_unlock(&onyx->mutex);
+               return 0;
+       }
+
+       onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_LEFT,
+                           ucontrol->value.integer.value[0]
+                            - VOLUME_RANGE_SHIFT);
+       onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT,
+                           ucontrol->value.integer.value[1]
+                            - VOLUME_RANGE_SHIFT);
+       mutex_unlock(&onyx->mutex);
+
+       return 1;
+}
+
+static struct snd_kcontrol_new volume_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Master Playback Volume",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = onyx_snd_vol_info,
+       .get = onyx_snd_vol_get,
+       .put = onyx_snd_vol_put,
+};
+
+/* like above, this is necessary because a lot
+ * of alsa mixer programs don't handle ranges
+ * that don't start at 0 properly.
+ * even alsamixer is one of them... */
+#define INPUTGAIN_RANGE_SHIFT  (-3)
+
+static int onyx_snd_inputgain_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 1;
+       uinfo->value.integer.min = 3 + INPUTGAIN_RANGE_SHIFT;
+       uinfo->value.integer.max = 28 + INPUTGAIN_RANGE_SHIFT;
+       return 0;
+}
+
+static int onyx_snd_inputgain_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 ig;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &ig);
+       mutex_unlock(&onyx->mutex);
+
+       ucontrol->value.integer.value[0] =
+               (ig & ONYX_ADC_PGA_GAIN_MASK) + INPUTGAIN_RANGE_SHIFT;
+
+       return 0;
+}
+
+static int onyx_snd_inputgain_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 v, n;
+
+       if (ucontrol->value.integer.value[0] < 3 + INPUTGAIN_RANGE_SHIFT ||
+           ucontrol->value.integer.value[0] > 28 + INPUTGAIN_RANGE_SHIFT)
+               return -EINVAL;
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
+       n = v;
+       n &= ~ONYX_ADC_PGA_GAIN_MASK;
+       n |= (ucontrol->value.integer.value[0] - INPUTGAIN_RANGE_SHIFT)
+               & ONYX_ADC_PGA_GAIN_MASK;
+       onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, n);
+       mutex_unlock(&onyx->mutex);
+
+       return n != v;
+}
+
+static struct snd_kcontrol_new inputgain_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Master Capture Volume",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = onyx_snd_inputgain_info,
+       .get = onyx_snd_inputgain_get,
+       .put = onyx_snd_inputgain_put,
+};
+
+static int onyx_snd_capture_source_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       static char *texts[] = { "Line-In", "Microphone" };
+
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+       uinfo->count = 1;
+       uinfo->value.enumerated.items = 2;
+       if (uinfo->value.enumerated.item > 1)
+               uinfo->value.enumerated.item = 1;
+       strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+       return 0;
+}
+
+static int onyx_snd_capture_source_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       s8 v;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
+       mutex_unlock(&onyx->mutex);
+
+       ucontrol->value.enumerated.item[0] = !!(v&ONYX_ADC_INPUT_MIC);
+
+       return 0;
+}
+
+static void onyx_set_capture_source(struct onyx *onyx, int mic)
+{
+       s8 v;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
+       v &= ~ONYX_ADC_INPUT_MIC;
+       if (mic)
+               v |= ONYX_ADC_INPUT_MIC;
+       onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, v);
+       mutex_unlock(&onyx->mutex);
+}
+
+static int onyx_snd_capture_source_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       if (ucontrol->value.enumerated.item[0] > 1)
+               return -EINVAL;
+       onyx_set_capture_source(snd_kcontrol_chip(kcontrol),
+                               ucontrol->value.enumerated.item[0]);
+       return 1;
+}
+
+static struct snd_kcontrol_new capture_source_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       /* If we name this 'Input Source', it properly shows up in
+        * alsamixer as a selection, * but it's shown under the
+        * 'Playback' category.
+        * If I name it 'Capture Source', it shows up in strange
+        * ways (two bools of which one can be selected at a
+        * time) but at least it's shown in the 'Capture'
+        * category.
+        * I was told that this was due to backward compatibility,
+        * but I don't understand then why the mangling is *not*
+        * done when I name it "Input Source".....
+        */
+       .name = "Capture Source",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = onyx_snd_capture_source_info,
+       .get = onyx_snd_capture_source_get,
+       .put = onyx_snd_capture_source_put,
+};
+
+#define onyx_snd_mute_info     snd_ctl_boolean_stereo_info
+
+static int onyx_snd_mute_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 c;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c);
+       mutex_unlock(&onyx->mutex);
+
+       ucontrol->value.integer.value[0] = !(c & ONYX_MUTE_LEFT);
+       ucontrol->value.integer.value[1] = !(c & ONYX_MUTE_RIGHT);
+
+       return 0;
+}
+
+static int onyx_snd_mute_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 v = 0, c = 0;
+       int err = -EBUSY;
+
+       mutex_lock(&onyx->mutex);
+       if (onyx->analog_locked)
+               goto out_unlock;
+
+       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
+       c = v;
+       c &= ~(ONYX_MUTE_RIGHT | ONYX_MUTE_LEFT);
+       if (!ucontrol->value.integer.value[0])
+               c |= ONYX_MUTE_LEFT;
+       if (!ucontrol->value.integer.value[1])
+               c |= ONYX_MUTE_RIGHT;
+       err = onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, c);
+
+ out_unlock:
+       mutex_unlock(&onyx->mutex);
+
+       return !err ? (v != c) : err;
+}
+
+static struct snd_kcontrol_new mute_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Master Playback Switch",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = onyx_snd_mute_info,
+       .get = onyx_snd_mute_get,
+       .put = onyx_snd_mute_put,
+};
+
+
+#define onyx_snd_single_bit_info       snd_ctl_boolean_mono_info
+
+#define FLAG_POLARITY_INVERT   1
+#define FLAG_SPDIFLOCK         2
+
+static int onyx_snd_single_bit_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 c;
+       long int pv = kcontrol->private_value;
+       u8 polarity = (pv >> 16) & FLAG_POLARITY_INVERT;
+       u8 address = (pv >> 8) & 0xff;
+       u8 mask = pv & 0xff;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, address, &c);
+       mutex_unlock(&onyx->mutex);
+
+       ucontrol->value.integer.value[0] = !!(c & mask) ^ polarity;
+
+       return 0;
+}
+
+static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 v = 0, c = 0;
+       int err;
+       long int pv = kcontrol->private_value;
+       u8 polarity = (pv >> 16) & FLAG_POLARITY_INVERT;
+       u8 spdiflock = (pv >> 16) & FLAG_SPDIFLOCK;
+       u8 address = (pv >> 8) & 0xff;
+       u8 mask = pv & 0xff;
+
+       mutex_lock(&onyx->mutex);
+       if (spdiflock && onyx->spdif_locked) {
+               /* even if alsamixer doesn't care.. */
+               err = -EBUSY;
+               goto out_unlock;
+       }
+       onyx_read_register(onyx, address, &v);
+       c = v;
+       c &= ~(mask);
+       if (!!ucontrol->value.integer.value[0] ^ polarity)
+               c |= mask;
+       err = onyx_write_register(onyx, address, c);
+
+ out_unlock:
+       mutex_unlock(&onyx->mutex);
+
+       return !err ? (v != c) : err;
+}
+
+#define SINGLE_BIT(n, type, description, address, mask, flags)         \
+static struct snd_kcontrol_new n##_control = {                         \
+       .iface = SNDRV_CTL_ELEM_IFACE_##type,                           \
+       .name = description,                                            \
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,                      \
+       .info = onyx_snd_single_bit_info,                               \
+       .get = onyx_snd_single_bit_get,                                 \
+       .put = onyx_snd_single_bit_put,                                 \
+       .private_value = (flags << 16) | (address << 8) | mask          \
+}
+
+SINGLE_BIT(spdif,
+          MIXER,
+          SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH),
+          ONYX_REG_DIG_INFO4,
+          ONYX_SPDIF_ENABLE,
+          FLAG_SPDIFLOCK);
+SINGLE_BIT(ovr1,
+          MIXER,
+          "Oversampling Rate",
+          ONYX_REG_DAC_CONTROL,
+          ONYX_OVR1,
+          0);
+SINGLE_BIT(flt0,
+          MIXER,
+          "Fast Digital Filter Rolloff",
+          ONYX_REG_DAC_FILTER,
+          ONYX_ROLLOFF_FAST,
+          FLAG_POLARITY_INVERT);
+SINGLE_BIT(hpf,
+          MIXER,
+          "Highpass Filter",
+          ONYX_REG_ADC_HPF_BYPASS,
+          ONYX_HPF_DISABLE,
+          FLAG_POLARITY_INVERT);
+SINGLE_BIT(dm12,
+          MIXER,
+          "Digital De-Emphasis",
+          ONYX_REG_DAC_DEEMPH,
+          ONYX_DIGDEEMPH_CTRL,
+          0);
+
+static int onyx_spdif_info(struct snd_kcontrol *kcontrol,
+                          struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
+       uinfo->count = 1;
+       return 0;
+}
+
+static int onyx_spdif_mask_get(struct snd_kcontrol *kcontrol,
+                              struct snd_ctl_elem_value *ucontrol)
+{
+       /* datasheet page 30, all others are 0 */
+       ucontrol->value.iec958.status[0] = 0x3e;
+       ucontrol->value.iec958.status[1] = 0xff;
+
+       ucontrol->value.iec958.status[3] = 0x3f;
+       ucontrol->value.iec958.status[4] = 0x0f;
+
+       return 0;
+}
+
+static struct snd_kcontrol_new onyx_spdif_mask = {
+       .access =       SNDRV_CTL_ELEM_ACCESS_READ,
+       .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
+       .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
+       .info =         onyx_spdif_info,
+       .get =          onyx_spdif_mask_get,
+};
+
+static int onyx_spdif_get(struct snd_kcontrol *kcontrol,
+                         struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 v;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
+       ucontrol->value.iec958.status[0] = v & 0x3e;
+
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO2, &v);
+       ucontrol->value.iec958.status[1] = v;
+
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
+       ucontrol->value.iec958.status[3] = v & 0x3f;
+
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
+       ucontrol->value.iec958.status[4] = v & 0x0f;
+       mutex_unlock(&onyx->mutex);
+
+       return 0;
+}
+
+static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
+                         struct snd_ctl_elem_value *ucontrol)
+{
+       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
+       u8 v;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
+       v = (v & ~0x3e) | (ucontrol->value.iec958.status[0] & 0x3e);
+       onyx_write_register(onyx, ONYX_REG_DIG_INFO1, v);
+
+       v = ucontrol->value.iec958.status[1];
+       onyx_write_register(onyx, ONYX_REG_DIG_INFO2, v);
+
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
+       v = (v & ~0x3f) | (ucontrol->value.iec958.status[3] & 0x3f);
+       onyx_write_register(onyx, ONYX_REG_DIG_INFO3, v);
+
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
+       v = (v & ~0x0f) | (ucontrol->value.iec958.status[4] & 0x0f);
+       onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
+       mutex_unlock(&onyx->mutex);
+
+       return 1;
+}
+
+static struct snd_kcontrol_new onyx_spdif_ctrl = {
+       .access =       SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
+       .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+       .info =         onyx_spdif_info,
+       .get =          onyx_spdif_get,
+       .put =          onyx_spdif_put,
+};
+
+/* our registers */
+
+static u8 register_map[] = {
+       ONYX_REG_DAC_ATTEN_LEFT,
+       ONYX_REG_DAC_ATTEN_RIGHT,
+       ONYX_REG_CONTROL,
+       ONYX_REG_DAC_CONTROL,
+       ONYX_REG_DAC_DEEMPH,
+       ONYX_REG_DAC_FILTER,
+       ONYX_REG_DAC_OUTPHASE,
+       ONYX_REG_ADC_CONTROL,
+       ONYX_REG_ADC_HPF_BYPASS,
+       ONYX_REG_DIG_INFO1,
+       ONYX_REG_DIG_INFO2,
+       ONYX_REG_DIG_INFO3,
+       ONYX_REG_DIG_INFO4
+};
+
+static u8 initial_values[ARRAY_SIZE(register_map)] = {
+       0x80, 0x80, /* muted */
+       ONYX_MRST | ONYX_SRST, /* but handled specially! */
+       ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT,
+       0, /* no deemphasis */
+       ONYX_DAC_FILTER_ALWAYS,
+       ONYX_OUTPHASE_INVERTED,
+       (-1 /*dB*/ + 8) & 0xF, /* line in selected, -1 dB gain*/
+       ONYX_ADC_HPF_ALWAYS,
+       (1<<2), /* pcm audio */
+       2,      /* category: pcm coder */
+       0,      /* sampling frequency 44.1 kHz, clock accuracy level II */
+       1       /* 24 bit depth */
+};
+
+/* reset registers of chip, either to initial or to previous values */
+static int onyx_register_init(struct onyx *onyx)
+{
+       int i;
+       u8 val;
+       u8 regs[sizeof(initial_values)];
+
+       if (!onyx->initialised) {
+               memcpy(regs, initial_values, sizeof(initial_values));
+               if (onyx_read_register(onyx, ONYX_REG_CONTROL, &val))
+                       return -1;
+               val &= ~ONYX_SILICONVERSION;
+               val |= initial_values[3];
+               regs[3] = val;
+       } else {
+               for (i=0; i<sizeof(register_map); i++)
+                       regs[i] = onyx->cache[register_map[i]-FIRSTREGISTER];
+       }
+
+       for (i=0; i<sizeof(register_map); i++) {
+               if (onyx_write_register(onyx, register_map[i], regs[i]))
+                       return -1;
+       }
+       onyx->initialised = 1;
+       return 0;
+}
+
+static struct transfer_info onyx_transfers[] = {
+       /* this is first so we can skip it if no input is present...
+        * No hardware exists with that, but it's here as an example
+        * of what to do :) */
+       {
+               /* analog input */
+               .formats = SNDRV_PCM_FMTBIT_S8 |
+                          SNDRV_PCM_FMTBIT_S16_BE |
+                          SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_8000_96000,
+               .transfer_in = 1,
+               .must_be_clock_source = 0,
+               .tag = 0,
+       },
+       {
+               /* if analog and digital are currently off, anything should go,
+                * so this entry describes everything we can do... */
+               .formats = SNDRV_PCM_FMTBIT_S8 |
+                          SNDRV_PCM_FMTBIT_S16_BE |
+                          SNDRV_PCM_FMTBIT_S24_BE
+#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
+                          | SNDRV_PCM_FMTBIT_COMPRESSED_16BE
+#endif
+               ,
+               .rates = SNDRV_PCM_RATE_8000_96000,
+               .tag = 0,
+       },
+       {
+               /* analog output */
+               .formats = SNDRV_PCM_FMTBIT_S8 |
+                          SNDRV_PCM_FMTBIT_S16_BE |
+                          SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_8000_96000,
+               .transfer_in = 0,
+               .must_be_clock_source = 0,
+               .tag = 1,
+       },
+       {
+               /* digital pcm output, also possible for analog out */
+               .formats = SNDRV_PCM_FMTBIT_S8 |
+                          SNDRV_PCM_FMTBIT_S16_BE |
+                          SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_32000 |
+                        SNDRV_PCM_RATE_44100 |
+                        SNDRV_PCM_RATE_48000,
+               .transfer_in = 0,
+               .must_be_clock_source = 0,
+               .tag = 2,
+       },
+#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
+       /* Once alsa gets supports for this kind of thing we can add it... */
+       {
+               /* digital compressed output */
+               .formats =  SNDRV_PCM_FMTBIT_COMPRESSED_16BE,
+               .rates = SNDRV_PCM_RATE_32000 |
+                        SNDRV_PCM_RATE_44100 |
+                        SNDRV_PCM_RATE_48000,
+               .tag = 2,
+       },
+#endif
+       {}
+};
+
+static int onyx_usable(struct codec_info_item *cii,
+                      struct transfer_info *ti,
+                      struct transfer_info *out)
+{
+       u8 v;
+       struct onyx *onyx = cii->codec_data;
+       int spdif_enabled, analog_enabled;
+
+       mutex_lock(&onyx->mutex);
+       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
+       spdif_enabled = !!(v & ONYX_SPDIF_ENABLE);
+       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
+       analog_enabled =
+               (v & (ONYX_MUTE_RIGHT|ONYX_MUTE_LEFT))
+                != (ONYX_MUTE_RIGHT|ONYX_MUTE_LEFT);
+       mutex_unlock(&onyx->mutex);
+
+       switch (ti->tag) {
+       case 0: return 1;
+       case 1: return analog_enabled;
+       case 2: return spdif_enabled;
+       }
+       return 1;
+}
+
+static int onyx_prepare(struct codec_info_item *cii,
+                       struct bus_info *bi,
+                       struct snd_pcm_substream *substream)
+{
+       u8 v;
+       struct onyx *onyx = cii->codec_data;
+       int err = -EBUSY;
+
+       mutex_lock(&onyx->mutex);
+
+#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
+       if (substream->runtime->format == SNDRV_PCM_FMTBIT_COMPRESSED_16BE) {
+               /* mute and lock analog output */
+               onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
+               if (onyx_write_register(onyx,
+                                       ONYX_REG_DAC_CONTROL,
+                                       v | ONYX_MUTE_RIGHT | ONYX_MUTE_LEFT))
+                       goto out_unlock;
+               onyx->analog_locked = 1;
+               err = 0;
+               goto out_unlock;
+       }
+#endif
+       switch (substream->runtime->rate) {
+       case 32000:
+       case 44100:
+       case 48000:
+               /* these rates are ok for all outputs */
+               /* FIXME: program spdif channel control bits here so that
+                *        userspace doesn't have to if it only plays pcm! */
+               err = 0;
+               goto out_unlock;
+       default:
+               /* got some rate that the digital output can't do,
+                * so disable and lock it */
+               onyx_read_register(cii->codec_data, ONYX_REG_DIG_INFO4, &v);
+               if (onyx_write_register(onyx,
+                                       ONYX_REG_DIG_INFO4,
+                                       v & ~ONYX_SPDIF_ENABLE))
+                       goto out_unlock;
+               onyx->spdif_locked = 1;
+               err = 0;
+               goto out_unlock;
+       }
+
+ out_unlock:
+       mutex_unlock(&onyx->mutex);
+
+       return err;
+}
+
+static int onyx_open(struct codec_info_item *cii,
+                    struct snd_pcm_substream *substream)
+{
+       struct onyx *onyx = cii->codec_data;
+
+       mutex_lock(&onyx->mutex);
+       onyx->open_count++;
+       mutex_unlock(&onyx->mutex);
+
+       return 0;
+}
+
+static int onyx_close(struct codec_info_item *cii,
+                     struct snd_pcm_substream *substream)
+{
+       struct onyx *onyx = cii->codec_data;
+
+       mutex_lock(&onyx->mutex);
+       onyx->open_count--;
+       if (!onyx->open_count)
+               onyx->spdif_locked = onyx->analog_locked = 0;
+       mutex_unlock(&onyx->mutex);
+
+       return 0;
+}
+
+static int onyx_switch_clock(struct codec_info_item *cii,
+                            enum clock_switch what)
+{
+       struct onyx *onyx = cii->codec_data;
+
+       mutex_lock(&onyx->mutex);
+       /* this *MUST* be more elaborate later... */
+       switch (what) {
+       case CLOCK_SWITCH_PREPARE_SLAVE:
+               onyx->codec.gpio->methods->all_amps_off(onyx->codec.gpio);
+               break;
+       case CLOCK_SWITCH_SLAVE:
+               onyx->codec.gpio->methods->all_amps_restore(onyx->codec.gpio);
+               break;
+       default: /* silence warning */
+               break;
+       }
+       mutex_unlock(&onyx->mutex);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+
+static int onyx_suspend(struct codec_info_item *cii, pm_message_t state)
+{
+       struct onyx *onyx = cii->codec_data;
+       u8 v;
+       int err = -ENXIO;
+
+       mutex_lock(&onyx->mutex);
+       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
+               goto out_unlock;
+       onyx_write_register(onyx, ONYX_REG_CONTROL, v | ONYX_ADPSV | ONYX_DAPSV);
+       /* Apple does a sleep here but the datasheet says to do it on resume */
+       err = 0;
+ out_unlock:
+       mutex_unlock(&onyx->mutex);
+
+       return err;
+}
+
+static int onyx_resume(struct codec_info_item *cii)
+{
+       struct onyx *onyx = cii->codec_data;
+       u8 v;
+       int err = -ENXIO;
+
+       mutex_lock(&onyx->mutex);
+
+       /* reset codec */
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
+       msleep(1);
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
+       msleep(1);
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
+       msleep(1);
+
+       /* take codec out of suspend (if it still is after reset) */
+       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
+               goto out_unlock;
+       onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
+       /* FIXME: should divide by sample rate, but 8k is the lowest we go */
+       msleep(2205000/8000);
+       /* reset all values */
+       onyx_register_init(onyx);
+       err = 0;
+ out_unlock:
+       mutex_unlock(&onyx->mutex);
+
+       return err;
+}
+
+#endif /* CONFIG_PM */
+
+static struct codec_info onyx_codec_info = {
+       .transfers = onyx_transfers,
+       .sysclock_factor = 256,
+       .bus_factor = 64,
+       .owner = THIS_MODULE,
+       .usable = onyx_usable,
+       .prepare = onyx_prepare,
+       .open = onyx_open,
+       .close = onyx_close,
+       .switch_clock = onyx_switch_clock,
+#ifdef CONFIG_PM
+       .suspend = onyx_suspend,
+       .resume = onyx_resume,
+#endif
+};
+
+static int onyx_init_codec(struct aoa_codec *codec)
+{
+       struct onyx *onyx = codec_to_onyx(codec);
+       struct snd_kcontrol *ctl;
+       struct codec_info *ci = &onyx_codec_info;
+       u8 v;
+       int err;
+
+       if (!onyx->codec.gpio || !onyx->codec.gpio->methods) {
+               printk(KERN_ERR PFX "gpios not assigned!!\n");
+               return -EINVAL;
+       }
+
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
+       msleep(1);
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
+       msleep(1);
+       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
+       msleep(1);
+
+       if (onyx_register_init(onyx)) {
+               printk(KERN_ERR PFX "failed to initialise onyx registers\n");
+               return -ENODEV;
+       }
+
+       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, onyx, &ops)) {
+               printk(KERN_ERR PFX "failed to create onyx snd device!\n");
+               return -ENODEV;
+       }
+
+       /* nothing connected? what a joke! */
+       if ((onyx->codec.connected & 0xF) == 0)
+               return -ENOTCONN;
+
+       /* if no inputs are present... */
+       if ((onyx->codec.connected & 0xC) == 0) {
+               if (!onyx->codec_info)
+                       onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL);
+               if (!onyx->codec_info)
+                       return -ENOMEM;
+               ci = onyx->codec_info;
+               *ci = onyx_codec_info;
+               ci->transfers++;
+       }
+
+       /* if no outputs are present... */
+       if ((onyx->codec.connected & 3) == 0) {
+               if (!onyx->codec_info)
+                       onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL);
+               if (!onyx->codec_info)
+                       return -ENOMEM;
+               ci = onyx->codec_info;
+               /* this is fine as there have to be inputs
+                * if we end up in this part of the code */
+               *ci = onyx_codec_info;
+               ci->transfers[1].formats = 0;
+       }
+
+       if (onyx->codec.soundbus_dev->attach_codec(onyx->codec.soundbus_dev,
+                                                  aoa_get_card(),
+                                                  ci, onyx)) {
+               printk(KERN_ERR PFX "error creating onyx pcm\n");
+               return -ENODEV;
+       }
+#define ADDCTL(n)                                                      \
+       do {                                                            \
+               ctl = snd_ctl_new1(&n, onyx);                           \
+               if (ctl) {                                              \
+                       ctl->id.device =                                \
+                               onyx->codec.soundbus_dev->pcm->device;  \
+                       err = aoa_snd_ctl_add(ctl);                     \
+                       if (err)                                        \
+                               goto error;                             \
+               }                                                       \
+       } while (0)
+
+       if (onyx->codec.soundbus_dev->pcm) {
+               /* give the user appropriate controls
+                * depending on what inputs are connected */
+               if ((onyx->codec.connected & 0xC) == 0xC)
+                       ADDCTL(capture_source_control);
+               else if (onyx->codec.connected & 4)
+                       onyx_set_capture_source(onyx, 0);
+               else
+                       onyx_set_capture_source(onyx, 1);
+               if (onyx->codec.connected & 0xC)
+                       ADDCTL(inputgain_control);
+
+               /* depending on what output is connected,
+                * give the user appropriate controls */
+               if (onyx->codec.connected & 1) {
+                       ADDCTL(volume_control);
+                       ADDCTL(mute_control);
+                       ADDCTL(ovr1_control);
+                       ADDCTL(flt0_control);
+                       ADDCTL(hpf_control);
+                       ADDCTL(dm12_control);
+                       /* spdif control defaults to off */
+               }
+               if (onyx->codec.connected & 2) {
+                       ADDCTL(onyx_spdif_mask);
+                       ADDCTL(onyx_spdif_ctrl);
+               }
+               if ((onyx->codec.connected & 3) == 3)
+                       ADDCTL(spdif_control);
+               /* if only S/PDIF is connected, enable it unconditionally */
+               if ((onyx->codec.connected & 3) == 2) {
+                       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
+                       v |= ONYX_SPDIF_ENABLE;
+                       onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
+               }
+       }
+#undef ADDCTL
+       printk(KERN_INFO PFX "attached to onyx codec via i2c\n");
+
+       return 0;
+ error:
+       onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
+       snd_device_free(aoa_get_card(), onyx);
+       return err;
+}
+
+static void onyx_exit_codec(struct aoa_codec *codec)
+{
+       struct onyx *onyx = codec_to_onyx(codec);
+
+       if (!onyx->codec.soundbus_dev) {
+               printk(KERN_ERR PFX "onyx_exit_codec called without soundbus_dev!\n");
+               return;
+       }
+       onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
+}
+
+static struct i2c_driver onyx_driver;
+
+static int onyx_create(struct i2c_adapter *adapter,
+                      struct device_node *node,
+                      int addr)
+{
+       struct onyx *onyx;
+       u8 dummy;
+
+       onyx = kzalloc(sizeof(struct onyx), GFP_KERNEL);
+
+       if (!onyx)
+               return -ENOMEM;
+
+       mutex_init(&onyx->mutex);
+       onyx->i2c.driver = &onyx_driver;
+       onyx->i2c.adapter = adapter;
+       onyx->i2c.addr = addr & 0x7f;
+       strlcpy(onyx->i2c.name, "onyx audio codec", I2C_NAME_SIZE);
+
+       if (i2c_attach_client(&onyx->i2c)) {
+               printk(KERN_ERR PFX "failed to attach to i2c\n");
+               goto fail;
+       }
+
+       /* we try to read from register ONYX_REG_CONTROL
+        * to check if the codec is present */
+       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) {
+               i2c_detach_client(&onyx->i2c);
+               printk(KERN_ERR PFX "failed to read control register\n");
+               goto fail;
+       }
+
+       strlcpy(onyx->codec.name, "onyx", MAX_CODEC_NAME_LEN);
+       onyx->codec.owner = THIS_MODULE;
+       onyx->codec.init = onyx_init_codec;
+       onyx->codec.exit = onyx_exit_codec;
+       onyx->codec.node = of_node_get(node);
+
+       if (aoa_codec_register(&onyx->codec)) {
+               i2c_detach_client(&onyx->i2c);
+               goto fail;
+       }
+       printk(KERN_DEBUG PFX "created and attached onyx instance\n");
+       return 0;
+ fail:
+       kfree(onyx);
+       return -EINVAL;
+}
+
+static int onyx_i2c_attach(struct i2c_adapter *adapter)
+{
+       struct device_node *busnode, *dev = NULL;
+       struct pmac_i2c_bus *bus;
+
+       bus = pmac_i2c_adapter_to_bus(adapter);
+       if (bus == NULL)
+               return -ENODEV;
+       busnode = pmac_i2c_get_bus_node(bus);
+
+       while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+               if (of_device_is_compatible(dev, "pcm3052")) {
+                       const u32 *addr;
+                       printk(KERN_DEBUG PFX "found pcm3052\n");
+                       addr = of_get_property(dev, "reg", NULL);
+                       if (!addr)
+                               return -ENODEV;
+                       return onyx_create(adapter, dev, (*addr)>>1);
+               }
+       }
+
+       /* if that didn't work, try desperate mode for older
+        * machines that have stuff missing from the device tree */
+
+       if (!of_device_is_compatible(busnode, "k2-i2c"))
+               return -ENODEV;
+
+       printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n");
+       /* probe both possible addresses for the onyx chip */
+       if (onyx_create(adapter, NULL, 0x46) == 0)
+               return 0;
+       return onyx_create(adapter, NULL, 0x47);
+}
+
+static int onyx_i2c_detach(struct i2c_client *client)
+{
+       struct onyx *onyx = container_of(client, struct onyx, i2c);
+       int err;
+
+       if ((err = i2c_detach_client(client)))
+               return err;
+       aoa_codec_unregister(&onyx->codec);
+       of_node_put(onyx->codec.node);
+       if (onyx->codec_info)
+               kfree(onyx->codec_info);
+       kfree(onyx);
+       return 0;
+}
+
+static struct i2c_driver onyx_driver = {
+       .driver = {
+               .name = "aoa_codec_onyx",
+               .owner = THIS_MODULE,
+       },
+       .attach_adapter = onyx_i2c_attach,
+       .detach_client = onyx_i2c_detach,
+};
+
+static int __init onyx_init(void)
+{
+       return i2c_add_driver(&onyx_driver);
+}
+
+static void __exit onyx_exit(void)
+{
+       i2c_del_driver(&onyx_driver);
+}
+
+module_init(onyx_init);
+module_exit(onyx_exit);
diff --git a/sound/aoa/codecs/onyx.h b/sound/aoa/codecs/onyx.h
new file mode 100644 (file)
index 0000000..ffd2025
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Apple Onboard Audio driver for Onyx codec (header)
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#ifndef __SND_AOA_CODEC_ONYX_H
+#define __SND_AOA_CODEC_ONYX_H
+#include <stddef.h>
+#include <linux/i2c.h>
+#include <asm/pmac_low_i2c.h>
+#include <asm/prom.h>
+
+/* PCM3052 register definitions */
+
+/* the attenuation registers take values from
+ * -1 (0dB) to -127 (-63.0 dB) or others (muted) */
+#define ONYX_REG_DAC_ATTEN_LEFT                65
+#define FIRSTREGISTER                  ONYX_REG_DAC_ATTEN_LEFT
+#define ONYX_REG_DAC_ATTEN_RIGHT       66
+
+#define ONYX_REG_CONTROL               67
+#      define ONYX_MRST                (1<<7)
+#      define ONYX_SRST                (1<<6)
+#      define ONYX_ADPSV               (1<<5)
+#      define ONYX_DAPSV               (1<<4)
+#      define ONYX_SILICONVERSION      (1<<0)
+/* all others reserved */
+
+#define ONYX_REG_DAC_CONTROL           68
+#      define ONYX_OVR1                (1<<6)
+#      define ONYX_MUTE_RIGHT          (1<<1)
+#      define ONYX_MUTE_LEFT           (1<<0)
+
+#define ONYX_REG_DAC_DEEMPH            69
+#      define ONYX_DIGDEEMPH_SHIFT     5
+#      define ONYX_DIGDEEMPH_MASK      (3<<ONYX_DIGDEEMPH_SHIFT)
+#      define ONYX_DIGDEEMPH_CTRL      (1<<4)
+
+#define ONYX_REG_DAC_FILTER            70
+#      define ONYX_ROLLOFF_FAST        (1<<5)
+#      define ONYX_DAC_FILTER_ALWAYS   (1<<2)
+
+#define        ONYX_REG_DAC_OUTPHASE           71
+#      define ONYX_OUTPHASE_INVERTED   (1<<0)
+
+#define ONYX_REG_ADC_CONTROL           72
+#      define ONYX_ADC_INPUT_MIC       (1<<5)
+/* 8 + input gain in dB, valid range for input gain is -4 .. 20 dB */
+#      define ONYX_ADC_PGA_GAIN_MASK   0x1f
+
+#define ONYX_REG_ADC_HPF_BYPASS                75
+#      define ONYX_HPF_DISABLE         (1<<3)
+#      define ONYX_ADC_HPF_ALWAYS      (1<<2)
+
+#define ONYX_REG_DIG_INFO1             77
+#      define ONYX_MASK_DIN_TO_BPZ     (1<<7)
+/* bits 1-5 control channel bits 1-5 */
+#      define ONYX_DIGOUT_DISABLE      (1<<0)
+
+#define ONYX_REG_DIG_INFO2             78
+/* controls channel bits 8-15 */
+
+#define ONYX_REG_DIG_INFO3             79
+/* control channel bits 24-29, high 2 bits reserved */
+
+#define ONYX_REG_DIG_INFO4             80
+#      define ONYX_VALIDL              (1<<7)
+#      define ONYX_VALIDR              (1<<6)
+#      define ONYX_SPDIF_ENABLE        (1<<5)
+/* lower 4 bits control bits 32-35 of channel control and word length */
+#      define ONYX_WORDLEN_MASK        (0xF)
+
+#endif /* __SND_AOA_CODEC_ONYX_H */
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
deleted file mode 100644 (file)
index 6a3837d..0000000
+++ /dev/null
@@ -1,1118 +0,0 @@
-/*
- * Apple Onboard Audio driver for Onyx codec
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- *
- *
- * This is a driver for the pcm3052 codec chip (codenamed Onyx)
- * that is present in newer Apple hardware (with digital output).
- *
- * The Onyx codec has the following connections (listed by the bit
- * to be used in aoa_codec.connected):
- *  0: analog output
- *  1: digital output
- *  2: line input
- *  3: microphone input
- * Note that even though I know of no machine that has for example
- * the digital output connected but not the analog, I have handled
- * all the different cases in the code so that this driver may serve
- * as a good example of what to do.
- *
- * NOTE: This driver assumes that there's at most one chip to be
- *      used with one alsa card, in form of creating all kinds
- *      of mixer elements without regard for their existence.
- *      But snd-aoa assumes that there's at most one card, so
- *      this means you can only have one onyx on a system. This
- *      should probably be fixed by changing the assumption of
- *      having just a single card on a system, and making the
- *      'card' pointer accessible to anyone who needs it instead
- *      of hiding it in the aoa_snd_* functions...
- *
- */
-#include <linux/delay.h>
-#include <linux/module.h>
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("pcm3052 (onyx) codec driver for snd-aoa");
-
-#include "snd-aoa-codec-onyx.h"
-#include "../aoa.h"
-#include "../soundbus/soundbus.h"
-
-
-#define PFX "snd-aoa-codec-onyx: "
-
-struct onyx {
-       /* cache registers 65 to 80, they are write-only! */
-       u8                      cache[16];
-       struct i2c_client       i2c;
-       struct aoa_codec        codec;
-       u32                     initialised:1,
-                               spdif_locked:1,
-                               analog_locked:1,
-                               original_mute:2;
-       int                     open_count;
-       struct codec_info       *codec_info;
-
-       /* mutex serializes concurrent access to the device
-        * and this structure.
-        */
-       struct mutex mutex;
-};
-#define codec_to_onyx(c) container_of(c, struct onyx, codec)
-
-/* both return 0 if all ok, else on error */
-static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value)
-{
-       s32 v;
-
-       if (reg != ONYX_REG_CONTROL) {
-               *value = onyx->cache[reg-FIRSTREGISTER];
-               return 0;
-       }
-       v = i2c_smbus_read_byte_data(&onyx->i2c, reg);
-       if (v < 0)
-               return -1;
-       *value = (u8)v;
-       onyx->cache[ONYX_REG_CONTROL-FIRSTREGISTER] = *value;
-       return 0;
-}
-
-static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value)
-{
-       int result;
-
-       result = i2c_smbus_write_byte_data(&onyx->i2c, reg, value);
-       if (!result)
-               onyx->cache[reg-FIRSTREGISTER] = value;
-       return result;
-}
-
-/* alsa stuff */
-
-static int onyx_dev_register(struct snd_device *dev)
-{
-       return 0;
-}
-
-static struct snd_device_ops ops = {
-       .dev_register = onyx_dev_register,
-};
-
-/* this is necessary because most alsa mixer programs
- * can't properly handle the negative range */
-#define VOLUME_RANGE_SHIFT     128
-
-static int onyx_snd_vol_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 2;
-       uinfo->value.integer.min = -128 + VOLUME_RANGE_SHIFT;
-       uinfo->value.integer.max = -1 + VOLUME_RANGE_SHIFT;
-       return 0;
-}
-
-static int onyx_snd_vol_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       s8 l, r;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
-       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
-       mutex_unlock(&onyx->mutex);
-
-       ucontrol->value.integer.value[0] = l + VOLUME_RANGE_SHIFT;
-       ucontrol->value.integer.value[1] = r + VOLUME_RANGE_SHIFT;
-
-       return 0;
-}
-
-static int onyx_snd_vol_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       s8 l, r;
-
-       if (ucontrol->value.integer.value[0] < -128 + VOLUME_RANGE_SHIFT ||
-           ucontrol->value.integer.value[0] > -1 + VOLUME_RANGE_SHIFT)
-               return -EINVAL;
-       if (ucontrol->value.integer.value[1] < -128 + VOLUME_RANGE_SHIFT ||
-           ucontrol->value.integer.value[1] > -1 + VOLUME_RANGE_SHIFT)
-               return -EINVAL;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
-       onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
-
-       if (l + VOLUME_RANGE_SHIFT == ucontrol->value.integer.value[0] &&
-           r + VOLUME_RANGE_SHIFT == ucontrol->value.integer.value[1]) {
-               mutex_unlock(&onyx->mutex);
-               return 0;
-       }
-
-       onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_LEFT,
-                           ucontrol->value.integer.value[0]
-                            - VOLUME_RANGE_SHIFT);
-       onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT,
-                           ucontrol->value.integer.value[1]
-                            - VOLUME_RANGE_SHIFT);
-       mutex_unlock(&onyx->mutex);
-
-       return 1;
-}
-
-static struct snd_kcontrol_new volume_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Master Playback Volume",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = onyx_snd_vol_info,
-       .get = onyx_snd_vol_get,
-       .put = onyx_snd_vol_put,
-};
-
-/* like above, this is necessary because a lot
- * of alsa mixer programs don't handle ranges
- * that don't start at 0 properly.
- * even alsamixer is one of them... */
-#define INPUTGAIN_RANGE_SHIFT  (-3)
-
-static int onyx_snd_inputgain_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 3 + INPUTGAIN_RANGE_SHIFT;
-       uinfo->value.integer.max = 28 + INPUTGAIN_RANGE_SHIFT;
-       return 0;
-}
-
-static int onyx_snd_inputgain_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 ig;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &ig);
-       mutex_unlock(&onyx->mutex);
-
-       ucontrol->value.integer.value[0] =
-               (ig & ONYX_ADC_PGA_GAIN_MASK) + INPUTGAIN_RANGE_SHIFT;
-
-       return 0;
-}
-
-static int onyx_snd_inputgain_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 v, n;
-
-       if (ucontrol->value.integer.value[0] < 3 + INPUTGAIN_RANGE_SHIFT ||
-           ucontrol->value.integer.value[0] > 28 + INPUTGAIN_RANGE_SHIFT)
-               return -EINVAL;
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
-       n = v;
-       n &= ~ONYX_ADC_PGA_GAIN_MASK;
-       n |= (ucontrol->value.integer.value[0] - INPUTGAIN_RANGE_SHIFT)
-               & ONYX_ADC_PGA_GAIN_MASK;
-       onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, n);
-       mutex_unlock(&onyx->mutex);
-
-       return n != v;
-}
-
-static struct snd_kcontrol_new inputgain_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Master Capture Volume",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = onyx_snd_inputgain_info,
-       .get = onyx_snd_inputgain_get,
-       .put = onyx_snd_inputgain_put,
-};
-
-static int onyx_snd_capture_source_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       static char *texts[] = { "Line-In", "Microphone" };
-
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-       uinfo->count = 1;
-       uinfo->value.enumerated.items = 2;
-       if (uinfo->value.enumerated.item > 1)
-               uinfo->value.enumerated.item = 1;
-       strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
-       return 0;
-}
-
-static int onyx_snd_capture_source_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       s8 v;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
-       mutex_unlock(&onyx->mutex);
-
-       ucontrol->value.enumerated.item[0] = !!(v&ONYX_ADC_INPUT_MIC);
-
-       return 0;
-}
-
-static void onyx_set_capture_source(struct onyx *onyx, int mic)
-{
-       s8 v;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
-       v &= ~ONYX_ADC_INPUT_MIC;
-       if (mic)
-               v |= ONYX_ADC_INPUT_MIC;
-       onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, v);
-       mutex_unlock(&onyx->mutex);
-}
-
-static int onyx_snd_capture_source_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       if (ucontrol->value.enumerated.item[0] > 1)
-               return -EINVAL;
-       onyx_set_capture_source(snd_kcontrol_chip(kcontrol),
-                               ucontrol->value.enumerated.item[0]);
-       return 1;
-}
-
-static struct snd_kcontrol_new capture_source_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       /* If we name this 'Input Source', it properly shows up in
-        * alsamixer as a selection, * but it's shown under the 
-        * 'Playback' category.
-        * If I name it 'Capture Source', it shows up in strange
-        * ways (two bools of which one can be selected at a
-        * time) but at least it's shown in the 'Capture'
-        * category.
-        * I was told that this was due to backward compatibility,
-        * but I don't understand then why the mangling is *not*
-        * done when I name it "Input Source".....
-        */
-       .name = "Capture Source",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = onyx_snd_capture_source_info,
-       .get = onyx_snd_capture_source_get,
-       .put = onyx_snd_capture_source_put,
-};
-
-#define onyx_snd_mute_info     snd_ctl_boolean_stereo_info
-
-static int onyx_snd_mute_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 c;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c);
-       mutex_unlock(&onyx->mutex);
-
-       ucontrol->value.integer.value[0] = !(c & ONYX_MUTE_LEFT);
-       ucontrol->value.integer.value[1] = !(c & ONYX_MUTE_RIGHT);
-
-       return 0;
-}
-
-static int onyx_snd_mute_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 v = 0, c = 0;
-       int err = -EBUSY;
-
-       mutex_lock(&onyx->mutex);
-       if (onyx->analog_locked)
-               goto out_unlock;
-
-       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
-       c = v;
-       c &= ~(ONYX_MUTE_RIGHT | ONYX_MUTE_LEFT);
-       if (!ucontrol->value.integer.value[0])
-               c |= ONYX_MUTE_LEFT;
-       if (!ucontrol->value.integer.value[1])
-               c |= ONYX_MUTE_RIGHT;
-       err = onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, c);
-
- out_unlock:
-       mutex_unlock(&onyx->mutex);
-
-       return !err ? (v != c) : err;
-}
-
-static struct snd_kcontrol_new mute_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Master Playback Switch",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = onyx_snd_mute_info,
-       .get = onyx_snd_mute_get,
-       .put = onyx_snd_mute_put,
-};
-
-
-#define onyx_snd_single_bit_info       snd_ctl_boolean_mono_info
-
-#define FLAG_POLARITY_INVERT   1
-#define FLAG_SPDIFLOCK         2
-
-static int onyx_snd_single_bit_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 c;
-       long int pv = kcontrol->private_value;
-       u8 polarity = (pv >> 16) & FLAG_POLARITY_INVERT;
-       u8 address = (pv >> 8) & 0xff;
-       u8 mask = pv & 0xff;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, address, &c);
-       mutex_unlock(&onyx->mutex);
-
-       ucontrol->value.integer.value[0] = !!(c & mask) ^ polarity;
-
-       return 0;
-}
-
-static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 v = 0, c = 0;
-       int err;
-       long int pv = kcontrol->private_value;
-       u8 polarity = (pv >> 16) & FLAG_POLARITY_INVERT;
-       u8 spdiflock = (pv >> 16) & FLAG_SPDIFLOCK;
-       u8 address = (pv >> 8) & 0xff;
-       u8 mask = pv & 0xff;
-
-       mutex_lock(&onyx->mutex);
-       if (spdiflock && onyx->spdif_locked) {
-               /* even if alsamixer doesn't care.. */
-               err = -EBUSY;
-               goto out_unlock;
-       }
-       onyx_read_register(onyx, address, &v);
-       c = v;
-       c &= ~(mask);
-       if (!!ucontrol->value.integer.value[0] ^ polarity)
-               c |= mask;
-       err = onyx_write_register(onyx, address, c);
-
- out_unlock:
-       mutex_unlock(&onyx->mutex);
-
-       return !err ? (v != c) : err;
-}
-
-#define SINGLE_BIT(n, type, description, address, mask, flags)         \
-static struct snd_kcontrol_new n##_control = {                         \
-       .iface = SNDRV_CTL_ELEM_IFACE_##type,                           \
-       .name = description,                                            \
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,                      \
-       .info = onyx_snd_single_bit_info,                               \
-       .get = onyx_snd_single_bit_get,                                 \
-       .put = onyx_snd_single_bit_put,                                 \
-       .private_value = (flags << 16) | (address << 8) | mask          \
-}
-
-SINGLE_BIT(spdif,
-          MIXER,
-          SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH),
-          ONYX_REG_DIG_INFO4,
-          ONYX_SPDIF_ENABLE,
-          FLAG_SPDIFLOCK);
-SINGLE_BIT(ovr1,
-          MIXER,
-          "Oversampling Rate",
-          ONYX_REG_DAC_CONTROL,
-          ONYX_OVR1,
-          0);
-SINGLE_BIT(flt0,
-          MIXER,
-          "Fast Digital Filter Rolloff",
-          ONYX_REG_DAC_FILTER,
-          ONYX_ROLLOFF_FAST,
-          FLAG_POLARITY_INVERT);
-SINGLE_BIT(hpf,
-          MIXER,
-          "Highpass Filter",
-          ONYX_REG_ADC_HPF_BYPASS,
-          ONYX_HPF_DISABLE,
-          FLAG_POLARITY_INVERT);
-SINGLE_BIT(dm12,
-          MIXER,
-          "Digital De-Emphasis",
-          ONYX_REG_DAC_DEEMPH,
-          ONYX_DIGDEEMPH_CTRL,
-          0);
-
-static int onyx_spdif_info(struct snd_kcontrol *kcontrol,
-                          struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
-       uinfo->count = 1;
-       return 0;
-}
-
-static int onyx_spdif_mask_get(struct snd_kcontrol *kcontrol,
-                              struct snd_ctl_elem_value *ucontrol)
-{
-       /* datasheet page 30, all others are 0 */
-       ucontrol->value.iec958.status[0] = 0x3e;
-       ucontrol->value.iec958.status[1] = 0xff;
-
-       ucontrol->value.iec958.status[3] = 0x3f;
-       ucontrol->value.iec958.status[4] = 0x0f;
-       
-       return 0;
-}
-
-static struct snd_kcontrol_new onyx_spdif_mask = {
-       .access =       SNDRV_CTL_ELEM_ACCESS_READ,
-       .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
-       .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
-       .info =         onyx_spdif_info,
-       .get =          onyx_spdif_mask_get,
-};
-
-static int onyx_spdif_get(struct snd_kcontrol *kcontrol,
-                         struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 v;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
-       ucontrol->value.iec958.status[0] = v & 0x3e;
-
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO2, &v);
-       ucontrol->value.iec958.status[1] = v;
-
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
-       ucontrol->value.iec958.status[3] = v & 0x3f;
-
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
-       ucontrol->value.iec958.status[4] = v & 0x0f;
-       mutex_unlock(&onyx->mutex);
-
-       return 0;
-}
-
-static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
-                         struct snd_ctl_elem_value *ucontrol)
-{
-       struct onyx *onyx = snd_kcontrol_chip(kcontrol);
-       u8 v;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
-       v = (v & ~0x3e) | (ucontrol->value.iec958.status[0] & 0x3e);
-       onyx_write_register(onyx, ONYX_REG_DIG_INFO1, v);
-
-       v = ucontrol->value.iec958.status[1];
-       onyx_write_register(onyx, ONYX_REG_DIG_INFO2, v);
-
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
-       v = (v & ~0x3f) | (ucontrol->value.iec958.status[3] & 0x3f);
-       onyx_write_register(onyx, ONYX_REG_DIG_INFO3, v);
-
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
-       v = (v & ~0x0f) | (ucontrol->value.iec958.status[4] & 0x0f);
-       onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
-       mutex_unlock(&onyx->mutex);
-
-       return 1;
-}
-
-static struct snd_kcontrol_new onyx_spdif_ctrl = {
-       .access =       SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
-       .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
-       .info =         onyx_spdif_info,
-       .get =          onyx_spdif_get,
-       .put =          onyx_spdif_put,
-};
-
-/* our registers */
-
-static u8 register_map[] = {
-       ONYX_REG_DAC_ATTEN_LEFT,
-       ONYX_REG_DAC_ATTEN_RIGHT,
-       ONYX_REG_CONTROL,
-       ONYX_REG_DAC_CONTROL,
-       ONYX_REG_DAC_DEEMPH,
-       ONYX_REG_DAC_FILTER,
-       ONYX_REG_DAC_OUTPHASE,
-       ONYX_REG_ADC_CONTROL,
-       ONYX_REG_ADC_HPF_BYPASS,
-       ONYX_REG_DIG_INFO1,
-       ONYX_REG_DIG_INFO2,
-       ONYX_REG_DIG_INFO3,
-       ONYX_REG_DIG_INFO4
-};
-
-static u8 initial_values[ARRAY_SIZE(register_map)] = {
-       0x80, 0x80, /* muted */
-       ONYX_MRST | ONYX_SRST, /* but handled specially! */
-       ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT,
-       0, /* no deemphasis */
-       ONYX_DAC_FILTER_ALWAYS,
-       ONYX_OUTPHASE_INVERTED,
-       (-1 /*dB*/ + 8) & 0xF, /* line in selected, -1 dB gain*/
-       ONYX_ADC_HPF_ALWAYS,
-       (1<<2), /* pcm audio */
-       2,      /* category: pcm coder */
-       0,      /* sampling frequency 44.1 kHz, clock accuracy level II */
-       1       /* 24 bit depth */
-};
-
-/* reset registers of chip, either to initial or to previous values */
-static int onyx_register_init(struct onyx *onyx)
-{
-       int i;
-       u8 val;
-       u8 regs[sizeof(initial_values)];
-
-       if (!onyx->initialised) {
-               memcpy(regs, initial_values, sizeof(initial_values));
-               if (onyx_read_register(onyx, ONYX_REG_CONTROL, &val))
-                       return -1;
-               val &= ~ONYX_SILICONVERSION;
-               val |= initial_values[3];
-               regs[3] = val;
-       } else {
-               for (i=0; i<sizeof(register_map); i++)
-                       regs[i] = onyx->cache[register_map[i]-FIRSTREGISTER];
-       }
-
-       for (i=0; i<sizeof(register_map); i++) {
-               if (onyx_write_register(onyx, register_map[i], regs[i]))
-                       return -1;
-       }
-       onyx->initialised = 1;
-       return 0;
-}
-
-static struct transfer_info onyx_transfers[] = {
-       /* this is first so we can skip it if no input is present...
-        * No hardware exists with that, but it's here as an example
-        * of what to do :) */
-       {
-               /* analog input */
-               .formats = SNDRV_PCM_FMTBIT_S8 |
-                          SNDRV_PCM_FMTBIT_S16_BE |
-                          SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_8000_96000,
-               .transfer_in = 1,
-               .must_be_clock_source = 0,
-               .tag = 0,
-       },
-       {
-               /* if analog and digital are currently off, anything should go,
-                * so this entry describes everything we can do... */
-               .formats = SNDRV_PCM_FMTBIT_S8 |
-                          SNDRV_PCM_FMTBIT_S16_BE |
-                          SNDRV_PCM_FMTBIT_S24_BE
-#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
-                          | SNDRV_PCM_FMTBIT_COMPRESSED_16BE
-#endif
-               ,
-               .rates = SNDRV_PCM_RATE_8000_96000,
-               .tag = 0,
-       },
-       {
-               /* analog output */
-               .formats = SNDRV_PCM_FMTBIT_S8 |
-                          SNDRV_PCM_FMTBIT_S16_BE |
-                          SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_8000_96000,
-               .transfer_in = 0,
-               .must_be_clock_source = 0,
-               .tag = 1,
-       },
-       {
-               /* digital pcm output, also possible for analog out */
-               .formats = SNDRV_PCM_FMTBIT_S8 |
-                          SNDRV_PCM_FMTBIT_S16_BE |
-                          SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_32000 |
-                        SNDRV_PCM_RATE_44100 |
-                        SNDRV_PCM_RATE_48000,
-               .transfer_in = 0,
-               .must_be_clock_source = 0,
-               .tag = 2,
-       },
-#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
-       /* Once alsa gets supports for this kind of thing we can add it... */
-       {
-               /* digital compressed output */
-               .formats =  SNDRV_PCM_FMTBIT_COMPRESSED_16BE,
-               .rates = SNDRV_PCM_RATE_32000 |
-                        SNDRV_PCM_RATE_44100 |
-                        SNDRV_PCM_RATE_48000,
-               .tag = 2,
-       },
-#endif
-       {}
-};
-
-static int onyx_usable(struct codec_info_item *cii,
-                      struct transfer_info *ti,
-                      struct transfer_info *out)
-{
-       u8 v;
-       struct onyx *onyx = cii->codec_data;
-       int spdif_enabled, analog_enabled;
-
-       mutex_lock(&onyx->mutex);
-       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
-       spdif_enabled = !!(v & ONYX_SPDIF_ENABLE);
-       onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
-       analog_enabled = 
-               (v & (ONYX_MUTE_RIGHT|ONYX_MUTE_LEFT))
-                != (ONYX_MUTE_RIGHT|ONYX_MUTE_LEFT);
-       mutex_unlock(&onyx->mutex);
-
-       switch (ti->tag) {
-       case 0: return 1;
-       case 1: return analog_enabled;
-       case 2: return spdif_enabled;
-       }
-       return 1;
-}
-
-static int onyx_prepare(struct codec_info_item *cii,
-                       struct bus_info *bi,
-                       struct snd_pcm_substream *substream)
-{
-       u8 v;
-       struct onyx *onyx = cii->codec_data;
-       int err = -EBUSY;
-
-       mutex_lock(&onyx->mutex);
-
-#ifdef SNDRV_PCM_FMTBIT_COMPRESSED_16BE
-       if (substream->runtime->format == SNDRV_PCM_FMTBIT_COMPRESSED_16BE) {
-               /* mute and lock analog output */
-               onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
-               if (onyx_write_register(onyx,
-                                       ONYX_REG_DAC_CONTROL,
-                                       v | ONYX_MUTE_RIGHT | ONYX_MUTE_LEFT))
-                       goto out_unlock;
-               onyx->analog_locked = 1;
-               err = 0;
-               goto out_unlock;
-       }
-#endif
-       switch (substream->runtime->rate) {
-       case 32000:
-       case 44100:
-       case 48000:
-               /* these rates are ok for all outputs */
-               /* FIXME: program spdif channel control bits here so that
-                *        userspace doesn't have to if it only plays pcm! */
-               err = 0;
-               goto out_unlock;
-       default:
-               /* got some rate that the digital output can't do,
-                * so disable and lock it */
-               onyx_read_register(cii->codec_data, ONYX_REG_DIG_INFO4, &v);
-               if (onyx_write_register(onyx,
-                                       ONYX_REG_DIG_INFO4,
-                                       v & ~ONYX_SPDIF_ENABLE))
-                       goto out_unlock;
-               onyx->spdif_locked = 1;
-               err = 0;
-               goto out_unlock;
-       }
-
- out_unlock:
-       mutex_unlock(&onyx->mutex);
-
-       return err;
-}
-
-static int onyx_open(struct codec_info_item *cii,
-                    struct snd_pcm_substream *substream)
-{
-       struct onyx *onyx = cii->codec_data;
-
-       mutex_lock(&onyx->mutex);
-       onyx->open_count++;
-       mutex_unlock(&onyx->mutex);
-
-       return 0;
-}
-
-static int onyx_close(struct codec_info_item *cii,
-                     struct snd_pcm_substream *substream)
-{
-       struct onyx *onyx = cii->codec_data;
-
-       mutex_lock(&onyx->mutex);
-       onyx->open_count--;
-       if (!onyx->open_count)
-               onyx->spdif_locked = onyx->analog_locked = 0;
-       mutex_unlock(&onyx->mutex);
-
-       return 0;
-}
-
-static int onyx_switch_clock(struct codec_info_item *cii,
-                            enum clock_switch what)
-{
-       struct onyx *onyx = cii->codec_data;
-
-       mutex_lock(&onyx->mutex);
-       /* this *MUST* be more elaborate later... */
-       switch (what) {
-       case CLOCK_SWITCH_PREPARE_SLAVE:
-               onyx->codec.gpio->methods->all_amps_off(onyx->codec.gpio);
-               break;
-       case CLOCK_SWITCH_SLAVE:
-               onyx->codec.gpio->methods->all_amps_restore(onyx->codec.gpio);
-               break;
-       default: /* silence warning */
-               break;
-       }
-       mutex_unlock(&onyx->mutex);
-
-       return 0;
-}
-
-#ifdef CONFIG_PM
-
-static int onyx_suspend(struct codec_info_item *cii, pm_message_t state)
-{
-       struct onyx *onyx = cii->codec_data;
-       u8 v;
-       int err = -ENXIO;
-
-       mutex_lock(&onyx->mutex);
-       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
-               goto out_unlock;
-       onyx_write_register(onyx, ONYX_REG_CONTROL, v | ONYX_ADPSV | ONYX_DAPSV);
-       /* Apple does a sleep here but the datasheet says to do it on resume */
-       err = 0;
- out_unlock:
-       mutex_unlock(&onyx->mutex);
-
-       return err;
-}
-
-static int onyx_resume(struct codec_info_item *cii)
-{
-       struct onyx *onyx = cii->codec_data;
-       u8 v;
-       int err = -ENXIO;
-
-       mutex_lock(&onyx->mutex);
-
-       /* reset codec */
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
-       msleep(1);
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
-       msleep(1);
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
-       msleep(1);
-
-       /* take codec out of suspend (if it still is after reset) */
-       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
-               goto out_unlock;
-       onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
-       /* FIXME: should divide by sample rate, but 8k is the lowest we go */
-       msleep(2205000/8000);
-       /* reset all values */
-       onyx_register_init(onyx);
-       err = 0;
- out_unlock:
-       mutex_unlock(&onyx->mutex);
-
-       return err;
-}
-
-#endif /* CONFIG_PM */
-
-static struct codec_info onyx_codec_info = {
-       .transfers = onyx_transfers,
-       .sysclock_factor = 256,
-       .bus_factor = 64,
-       .owner = THIS_MODULE,
-       .usable = onyx_usable,
-       .prepare = onyx_prepare,
-       .open = onyx_open,
-       .close = onyx_close,
-       .switch_clock = onyx_switch_clock,
-#ifdef CONFIG_PM
-       .suspend = onyx_suspend,
-       .resume = onyx_resume,
-#endif
-};
-
-static int onyx_init_codec(struct aoa_codec *codec)
-{
-       struct onyx *onyx = codec_to_onyx(codec);
-       struct snd_kcontrol *ctl;
-       struct codec_info *ci = &onyx_codec_info;
-       u8 v;
-       int err;
-
-       if (!onyx->codec.gpio || !onyx->codec.gpio->methods) {
-               printk(KERN_ERR PFX "gpios not assigned!!\n");
-               return -EINVAL;
-       }
-
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
-       msleep(1);
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
-       msleep(1);
-       onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
-       msleep(1);
-       
-       if (onyx_register_init(onyx)) {
-               printk(KERN_ERR PFX "failed to initialise onyx registers\n");
-               return -ENODEV;
-       }
-
-       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, onyx, &ops)) {
-               printk(KERN_ERR PFX "failed to create onyx snd device!\n");
-               return -ENODEV;
-       }
-
-       /* nothing connected? what a joke! */
-       if ((onyx->codec.connected & 0xF) == 0)
-               return -ENOTCONN;
-
-       /* if no inputs are present... */
-       if ((onyx->codec.connected & 0xC) == 0) {
-               if (!onyx->codec_info)
-                       onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL);
-               if (!onyx->codec_info)
-                       return -ENOMEM;
-               ci = onyx->codec_info;
-               *ci = onyx_codec_info;
-               ci->transfers++;
-       }
-
-       /* if no outputs are present... */
-       if ((onyx->codec.connected & 3) == 0) {
-               if (!onyx->codec_info)
-                       onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL);
-               if (!onyx->codec_info)
-                       return -ENOMEM;
-               ci = onyx->codec_info;
-               /* this is fine as there have to be inputs
-                * if we end up in this part of the code */
-               *ci = onyx_codec_info;
-               ci->transfers[1].formats = 0;
-       }
-
-       if (onyx->codec.soundbus_dev->attach_codec(onyx->codec.soundbus_dev,
-                                                  aoa_get_card(),
-                                                  ci, onyx)) {
-               printk(KERN_ERR PFX "error creating onyx pcm\n");
-               return -ENODEV;
-       }
-#define ADDCTL(n)                                                      \
-       do {                                                            \
-               ctl = snd_ctl_new1(&n, onyx);                           \
-               if (ctl) {                                              \
-                       ctl->id.device =                                \
-                               onyx->codec.soundbus_dev->pcm->device;  \
-                       err = aoa_snd_ctl_add(ctl);                     \
-                       if (err)                                        \
-                               goto error;                             \
-               }                                                       \
-       } while (0)
-
-       if (onyx->codec.soundbus_dev->pcm) {
-               /* give the user appropriate controls
-                * depending on what inputs are connected */
-               if ((onyx->codec.connected & 0xC) == 0xC)
-                       ADDCTL(capture_source_control);
-               else if (onyx->codec.connected & 4)
-                       onyx_set_capture_source(onyx, 0);
-               else
-                       onyx_set_capture_source(onyx, 1);
-               if (onyx->codec.connected & 0xC)
-                       ADDCTL(inputgain_control);
-
-               /* depending on what output is connected,
-                * give the user appropriate controls */
-               if (onyx->codec.connected & 1) {
-                       ADDCTL(volume_control);
-                       ADDCTL(mute_control);
-                       ADDCTL(ovr1_control);
-                       ADDCTL(flt0_control);
-                       ADDCTL(hpf_control);
-                       ADDCTL(dm12_control);
-                       /* spdif control defaults to off */
-               }
-               if (onyx->codec.connected & 2) {
-                       ADDCTL(onyx_spdif_mask);
-                       ADDCTL(onyx_spdif_ctrl);
-               }
-               if ((onyx->codec.connected & 3) == 3)
-                       ADDCTL(spdif_control);
-               /* if only S/PDIF is connected, enable it unconditionally */
-               if ((onyx->codec.connected & 3) == 2) {
-                       onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
-                       v |= ONYX_SPDIF_ENABLE;
-                       onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
-               }
-       }
-#undef ADDCTL
-       printk(KERN_INFO PFX "attached to onyx codec via i2c\n");
-
-       return 0;
- error:
-       onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
-       snd_device_free(aoa_get_card(), onyx);
-       return err;
-}
-
-static void onyx_exit_codec(struct aoa_codec *codec)
-{
-       struct onyx *onyx = codec_to_onyx(codec);
-
-       if (!onyx->codec.soundbus_dev) {
-               printk(KERN_ERR PFX "onyx_exit_codec called without soundbus_dev!\n");
-               return;
-       }
-       onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
-}
-
-static struct i2c_driver onyx_driver;
-
-static int onyx_create(struct i2c_adapter *adapter,
-                      struct device_node *node,
-                      int addr)
-{
-       struct onyx *onyx;
-       u8 dummy;
-
-       onyx = kzalloc(sizeof(struct onyx), GFP_KERNEL);
-
-       if (!onyx)
-               return -ENOMEM;
-
-       mutex_init(&onyx->mutex);
-       onyx->i2c.driver = &onyx_driver;
-       onyx->i2c.adapter = adapter;
-       onyx->i2c.addr = addr & 0x7f;
-       strlcpy(onyx->i2c.name, "onyx audio codec", I2C_NAME_SIZE);
-
-       if (i2c_attach_client(&onyx->i2c)) {
-               printk(KERN_ERR PFX "failed to attach to i2c\n");
-               goto fail;
-       }
-
-       /* we try to read from register ONYX_REG_CONTROL
-        * to check if the codec is present */
-       if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) {
-               i2c_detach_client(&onyx->i2c);
-               printk(KERN_ERR PFX "failed to read control register\n");
-               goto fail;
-       }
-
-       strlcpy(onyx->codec.name, "onyx", MAX_CODEC_NAME_LEN);
-       onyx->codec.owner = THIS_MODULE;
-       onyx->codec.init = onyx_init_codec;
-       onyx->codec.exit = onyx_exit_codec;
-       onyx->codec.node = of_node_get(node);
-
-       if (aoa_codec_register(&onyx->codec)) {
-               i2c_detach_client(&onyx->i2c);
-               goto fail;
-       }
-       printk(KERN_DEBUG PFX "created and attached onyx instance\n");
-       return 0;
- fail:
-       kfree(onyx);
-       return -EINVAL;
-}
-
-static int onyx_i2c_attach(struct i2c_adapter *adapter)
-{
-       struct device_node *busnode, *dev = NULL;
-       struct pmac_i2c_bus *bus;
-
-       bus = pmac_i2c_adapter_to_bus(adapter);
-       if (bus == NULL)
-               return -ENODEV;
-       busnode = pmac_i2c_get_bus_node(bus);
-
-       while ((dev = of_get_next_child(busnode, dev)) != NULL) {
-               if (of_device_is_compatible(dev, "pcm3052")) {
-                       const u32 *addr;
-                       printk(KERN_DEBUG PFX "found pcm3052\n");
-                       addr = of_get_property(dev, "reg", NULL);
-                       if (!addr)
-                               return -ENODEV;
-                       return onyx_create(adapter, dev, (*addr)>>1);
-               }
-       }
-
-       /* if that didn't work, try desperate mode for older
-        * machines that have stuff missing from the device tree */
-       
-       if (!of_device_is_compatible(busnode, "k2-i2c"))
-               return -ENODEV;
-
-       printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n");
-       /* probe both possible addresses for the onyx chip */
-       if (onyx_create(adapter, NULL, 0x46) == 0)
-               return 0;
-       return onyx_create(adapter, NULL, 0x47);
-}
-
-static int onyx_i2c_detach(struct i2c_client *client)
-{
-       struct onyx *onyx = container_of(client, struct onyx, i2c);
-       int err;
-
-       if ((err = i2c_detach_client(client)))
-               return err;
-       aoa_codec_unregister(&onyx->codec);
-       of_node_put(onyx->codec.node);
-       if (onyx->codec_info)
-               kfree(onyx->codec_info);
-       kfree(onyx);
-       return 0;
-}
-
-static struct i2c_driver onyx_driver = {
-       .driver = {
-               .name = "aoa_codec_onyx",
-               .owner = THIS_MODULE,
-       },
-       .attach_adapter = onyx_i2c_attach,
-       .detach_client = onyx_i2c_detach,
-};
-
-static int __init onyx_init(void)
-{
-       return i2c_add_driver(&onyx_driver);
-}
-
-static void __exit onyx_exit(void)
-{
-       i2c_del_driver(&onyx_driver);
-}
-
-module_init(onyx_init);
-module_exit(onyx_exit);
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.h b/sound/aoa/codecs/snd-aoa-codec-onyx.h
deleted file mode 100644 (file)
index ffd2025..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Apple Onboard Audio driver for Onyx codec (header)
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-#ifndef __SND_AOA_CODEC_ONYX_H
-#define __SND_AOA_CODEC_ONYX_H
-#include <stddef.h>
-#include <linux/i2c.h>
-#include <asm/pmac_low_i2c.h>
-#include <asm/prom.h>
-
-/* PCM3052 register definitions */
-
-/* the attenuation registers take values from
- * -1 (0dB) to -127 (-63.0 dB) or others (muted) */
-#define ONYX_REG_DAC_ATTEN_LEFT                65
-#define FIRSTREGISTER                  ONYX_REG_DAC_ATTEN_LEFT
-#define ONYX_REG_DAC_ATTEN_RIGHT       66
-
-#define ONYX_REG_CONTROL               67
-#      define ONYX_MRST                (1<<7)
-#      define ONYX_SRST                (1<<6)
-#      define ONYX_ADPSV               (1<<5)
-#      define ONYX_DAPSV               (1<<4)
-#      define ONYX_SILICONVERSION      (1<<0)
-/* all others reserved */
-
-#define ONYX_REG_DAC_CONTROL           68
-#      define ONYX_OVR1                (1<<6)
-#      define ONYX_MUTE_RIGHT          (1<<1)
-#      define ONYX_MUTE_LEFT           (1<<0)
-
-#define ONYX_REG_DAC_DEEMPH            69
-#      define ONYX_DIGDEEMPH_SHIFT     5
-#      define ONYX_DIGDEEMPH_MASK      (3<<ONYX_DIGDEEMPH_SHIFT)
-#      define ONYX_DIGDEEMPH_CTRL      (1<<4)
-
-#define ONYX_REG_DAC_FILTER            70
-#      define ONYX_ROLLOFF_FAST        (1<<5)
-#      define ONYX_DAC_FILTER_ALWAYS   (1<<2)
-
-#define        ONYX_REG_DAC_OUTPHASE           71
-#      define ONYX_OUTPHASE_INVERTED   (1<<0)
-
-#define ONYX_REG_ADC_CONTROL           72
-#      define ONYX_ADC_INPUT_MIC       (1<<5)
-/* 8 + input gain in dB, valid range for input gain is -4 .. 20 dB */
-#      define ONYX_ADC_PGA_GAIN_MASK   0x1f
-
-#define ONYX_REG_ADC_HPF_BYPASS                75
-#      define ONYX_HPF_DISABLE         (1<<3)
-#      define ONYX_ADC_HPF_ALWAYS      (1<<2)
-
-#define ONYX_REG_DIG_INFO1             77
-#      define ONYX_MASK_DIN_TO_BPZ     (1<<7)
-/* bits 1-5 control channel bits 1-5 */
-#      define ONYX_DIGOUT_DISABLE      (1<<0)
-
-#define ONYX_REG_DIG_INFO2             78
-/* controls channel bits 8-15 */
-
-#define ONYX_REG_DIG_INFO3             79
-/* control channel bits 24-29, high 2 bits reserved */
-
-#define ONYX_REG_DIG_INFO4             80
-#      define ONYX_VALIDL              (1<<7)
-#      define ONYX_VALIDR              (1<<6)
-#      define ONYX_SPDIF_ENABLE        (1<<5)
-/* lower 4 bits control bits 32-35 of channel control and word length */
-#      define ONYX_WORDLEN_MASK        (0xF)
-
-#endif /* __SND_AOA_CODEC_ONYX_H */
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h b/sound/aoa/codecs/snd-aoa-codec-tas-basstreble.h
deleted file mode 100644 (file)
index 69b6113..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This file is only included exactly once!
- *
- * The tables here are derived from the tas3004 datasheet,
- * modulo typo corrections and some smoothing...
- */
-
-#define TAS3004_TREBLE_MIN     0
-#define TAS3004_TREBLE_MAX     72
-#define TAS3004_BASS_MIN       0
-#define TAS3004_BASS_MAX       72
-#define TAS3004_TREBLE_ZERO    36
-#define TAS3004_BASS_ZERO      36
-
-static u8 tas3004_treble_table[] = {
-       150, /* -18 dB */
-       149,
-       148,
-       147,
-       146,
-       145,
-       144,
-       143,
-       142,
-       141,
-       140,
-       139,
-       138,
-       137,
-       136,
-       135,
-       134,
-       133,
-       132,
-       131,
-       130,
-       129,
-       128,
-       127,
-       126,
-       125,
-       124,
-       123,
-       122,
-       121,
-       120,
-       119,
-       118,
-       117,
-       116,
-       115,
-       114, /* 0 dB */
-       113,
-       112,
-       111,
-       109,
-       108,
-       107,
-       105,
-       104,
-       103,
-       101,
-       99,
-       98,
-       96,
-       93,
-       91,
-       89,
-       86,
-       83,
-       81,
-       77,
-       74,
-       71,
-       67,
-       63,
-       59,
-       54,
-       49,
-       44,
-       38,
-       32,
-       26,
-       19,
-       10,
-       4,
-       2,
-       1, /* +18 dB */
-};
-
-static inline u8 tas3004_treble(int idx)
-{
-       return tas3004_treble_table[idx];
-}
-
-/* I only save the difference here to the treble table
- * so that the binary is smaller...
- * I have also ignored completely differences of
- * +/- 1
- */
-static s8 tas3004_bass_diff_to_treble[] = {
-       2, /* 7 dB, offset 50 */
-       2,
-       2,
-       2,
-       2,
-       1,
-       2,
-       2,
-       2,
-       3,
-       4,
-       4,
-       5,
-       6,
-       7,
-       8,
-       9,
-       10,
-       11,
-       14,
-       13,
-       8,
-       1, /* 18 dB */
-};
-
-static inline u8 tas3004_bass(int idx)
-{
-       u8 result = tas3004_treble_table[idx];
-
-       if (idx >= 50)
-               result += tas3004_bass_diff_to_treble[idx-50];
-       return result;
-}
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h b/sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h
deleted file mode 100644 (file)
index 4cfa675..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- This is the program used to generate below table.
-
-#include <stdio.h>
-#include <math.h>
-int main() {
-  int dB2;
-  printf("/" "* This file is only included exactly once!\n");
-  printf(" *\n");
-  printf(" * If they'd only tell us that generating this table was\n");
-  printf(" * as easy as calculating\n");
-  printf(" *      hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
-  printf(" * :) *" "/\n");
-  printf("static int tas_gaintable[] = {\n");
-  printf("     0x000000, /" "* -infinity dB *" "/\n");
-  for (dB2=-140;dB2<=36;dB2++)
-    printf("   0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
-  printf("};\n\n");
-}
-
-*/
-
-/* This file is only included exactly once!
- *
- * If they'd only tell us that generating this table was
- * as easy as calculating
- *      hwvalue = 1048576.0*exp(0.057564628*dB*2)
- * :) */
-static int tas_gaintable[] = {
-       0x000000, /* -infinity dB */
-       0x00014b, /* -70.0 dB */
-       0x00015f, /* -69.5 dB */
-       0x000174, /* -69.0 dB */
-       0x00018a, /* -68.5 dB */
-       0x0001a1, /* -68.0 dB */
-       0x0001ba, /* -67.5 dB */
-       0x0001d4, /* -67.0 dB */
-       0x0001f0, /* -66.5 dB */
-       0x00020d, /* -66.0 dB */
-       0x00022c, /* -65.5 dB */
-       0x00024d, /* -65.0 dB */
-       0x000270, /* -64.5 dB */
-       0x000295, /* -64.0 dB */
-       0x0002bc, /* -63.5 dB */
-       0x0002e6, /* -63.0 dB */
-       0x000312, /* -62.5 dB */
-       0x000340, /* -62.0 dB */
-       0x000372, /* -61.5 dB */
-       0x0003a6, /* -61.0 dB */
-       0x0003dd, /* -60.5 dB */
-       0x000418, /* -60.0 dB */
-       0x000456, /* -59.5 dB */
-       0x000498, /* -59.0 dB */
-       0x0004de, /* -58.5 dB */
-       0x000528, /* -58.0 dB */
-       0x000576, /* -57.5 dB */
-       0x0005c9, /* -57.0 dB */
-       0x000620, /* -56.5 dB */
-       0x00067d, /* -56.0 dB */
-       0x0006e0, /* -55.5 dB */
-       0x000748, /* -55.0 dB */
-       0x0007b7, /* -54.5 dB */
-       0x00082c, /* -54.0 dB */
-       0x0008a8, /* -53.5 dB */
-       0x00092b, /* -53.0 dB */
-       0x0009b6, /* -52.5 dB */
-       0x000a49, /* -52.0 dB */
-       0x000ae5, /* -51.5 dB */
-       0x000b8b, /* -51.0 dB */
-       0x000c3a, /* -50.5 dB */
-       0x000cf3, /* -50.0 dB */
-       0x000db8, /* -49.5 dB */
-       0x000e88, /* -49.0 dB */
-       0x000f64, /* -48.5 dB */
-       0x00104e, /* -48.0 dB */
-       0x001145, /* -47.5 dB */
-       0x00124b, /* -47.0 dB */
-       0x001361, /* -46.5 dB */
-       0x001487, /* -46.0 dB */
-       0x0015be, /* -45.5 dB */
-       0x001708, /* -45.0 dB */
-       0x001865, /* -44.5 dB */
-       0x0019d8, /* -44.0 dB */
-       0x001b60, /* -43.5 dB */
-       0x001cff, /* -43.0 dB */
-       0x001eb7, /* -42.5 dB */
-       0x002089, /* -42.0 dB */
-       0x002276, /* -41.5 dB */
-       0x002481, /* -41.0 dB */
-       0x0026ab, /* -40.5 dB */
-       0x0028f5, /* -40.0 dB */
-       0x002b63, /* -39.5 dB */
-       0x002df5, /* -39.0 dB */
-       0x0030ae, /* -38.5 dB */
-       0x003390, /* -38.0 dB */
-       0x00369e, /* -37.5 dB */
-       0x0039db, /* -37.0 dB */
-       0x003d49, /* -36.5 dB */
-       0x0040ea, /* -36.0 dB */
-       0x0044c3, /* -35.5 dB */
-       0x0048d6, /* -35.0 dB */
-       0x004d27, /* -34.5 dB */
-       0x0051b9, /* -34.0 dB */
-       0x005691, /* -33.5 dB */
-       0x005bb2, /* -33.0 dB */
-       0x006121, /* -32.5 dB */
-       0x0066e3, /* -32.0 dB */
-       0x006cfb, /* -31.5 dB */
-       0x007370, /* -31.0 dB */
-       0x007a48, /* -30.5 dB */
-       0x008186, /* -30.0 dB */
-       0x008933, /* -29.5 dB */
-       0x009154, /* -29.0 dB */
-       0x0099f1, /* -28.5 dB */
-       0x00a310, /* -28.0 dB */
-       0x00acba, /* -27.5 dB */
-       0x00b6f6, /* -27.0 dB */
-       0x00c1cd, /* -26.5 dB */
-       0x00cd49, /* -26.0 dB */
-       0x00d973, /* -25.5 dB */
-       0x00e655, /* -25.0 dB */
-       0x00f3fb, /* -24.5 dB */
-       0x010270, /* -24.0 dB */
-       0x0111c0, /* -23.5 dB */
-       0x0121f9, /* -23.0 dB */
-       0x013328, /* -22.5 dB */
-       0x01455b, /* -22.0 dB */
-       0x0158a2, /* -21.5 dB */
-       0x016d0e, /* -21.0 dB */
-       0x0182af, /* -20.5 dB */
-       0x019999, /* -20.0 dB */
-       0x01b1de, /* -19.5 dB */
-       0x01cb94, /* -19.0 dB */
-       0x01e6cf, /* -18.5 dB */
-       0x0203a7, /* -18.0 dB */
-       0x022235, /* -17.5 dB */
-       0x024293, /* -17.0 dB */
-       0x0264db, /* -16.5 dB */
-       0x02892c, /* -16.0 dB */
-       0x02afa3, /* -15.5 dB */
-       0x02d862, /* -15.0 dB */
-       0x03038a, /* -14.5 dB */
-       0x033142, /* -14.0 dB */
-       0x0361af, /* -13.5 dB */
-       0x0394fa, /* -13.0 dB */
-       0x03cb50, /* -12.5 dB */
-       0x0404de, /* -12.0 dB */
-       0x0441d5, /* -11.5 dB */
-       0x048268, /* -11.0 dB */
-       0x04c6d0, /* -10.5 dB */
-       0x050f44, /* -10.0 dB */
-       0x055c04, /* -9.5 dB */
-       0x05ad50, /* -9.0 dB */
-       0x06036e, /* -8.5 dB */
-       0x065ea5, /* -8.0 dB */
-       0x06bf44, /* -7.5 dB */
-       0x07259d, /* -7.0 dB */
-       0x079207, /* -6.5 dB */
-       0x0804dc, /* -6.0 dB */
-       0x087e80, /* -5.5 dB */
-       0x08ff59, /* -5.0 dB */
-       0x0987d5, /* -4.5 dB */
-       0x0a1866, /* -4.0 dB */
-       0x0ab189, /* -3.5 dB */
-       0x0b53be, /* -3.0 dB */
-       0x0bff91, /* -2.5 dB */
-       0x0cb591, /* -2.0 dB */
-       0x0d765a, /* -1.5 dB */
-       0x0e4290, /* -1.0 dB */
-       0x0f1adf, /* -0.5 dB */
-       0x100000, /* 0.0 dB */
-       0x10f2b4, /* 0.5 dB */
-       0x11f3c9, /* 1.0 dB */
-       0x13041a, /* 1.5 dB */
-       0x14248e, /* 2.0 dB */
-       0x15561a, /* 2.5 dB */
-       0x1699c0, /* 3.0 dB */
-       0x17f094, /* 3.5 dB */
-       0x195bb8, /* 4.0 dB */
-       0x1adc61, /* 4.5 dB */
-       0x1c73d5, /* 5.0 dB */
-       0x1e236d, /* 5.5 dB */
-       0x1fec98, /* 6.0 dB */
-       0x21d0d9, /* 6.5 dB */
-       0x23d1cd, /* 7.0 dB */
-       0x25f125, /* 7.5 dB */
-       0x2830af, /* 8.0 dB */
-       0x2a9254, /* 8.5 dB */
-       0x2d1818, /* 9.0 dB */
-       0x2fc420, /* 9.5 dB */
-       0x3298b0, /* 10.0 dB */
-       0x35982f, /* 10.5 dB */
-       0x38c528, /* 11.0 dB */
-       0x3c224c, /* 11.5 dB */
-       0x3fb278, /* 12.0 dB */
-       0x4378b0, /* 12.5 dB */
-       0x477829, /* 13.0 dB */
-       0x4bb446, /* 13.5 dB */
-       0x5030a1, /* 14.0 dB */
-       0x54f106, /* 14.5 dB */
-       0x59f980, /* 15.0 dB */
-       0x5f4e52, /* 15.5 dB */
-       0x64f403, /* 16.0 dB */
-       0x6aef5e, /* 16.5 dB */
-       0x714575, /* 17.0 dB */
-       0x77fbaa, /* 17.5 dB */
-       0x7f17af, /* 18.0 dB */
-};
-
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
deleted file mode 100644 (file)
index 6c515b2..0000000
+++ /dev/null
@@ -1,1012 +0,0 @@
-/*
- * Apple Onboard Audio driver for tas codec
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- *
- * Open questions:
- *  - How to distinguish between 3004 and versions?
- *
- * FIXMEs:
- *  - This codec driver doesn't honour the 'connected'
- *    property of the aoa_codec struct, hence if
- *    it is used in machines where not everything is
- *    connected it will display wrong mixer elements.
- *  - Driver assumes that the microphone is always
- *    monaureal and connected to the right channel of
- *    the input. This should also be a codec-dependent
- *    flag, maybe the codec should have 3 different
- *    bits for the three different possibilities how
- *    it can be hooked up...
- *    But as long as I don't see any hardware hooked
- *    up that way...
- *  - As Apple notes in their code, the tas3004 seems
- *    to delay the right channel by one sample. You can
- *    see this when for example recording stereo in
- *    audacity, or recording the tas output via cable
- *    on another machine (use a sinus generator or so).
- *    I tried programming the BiQuads but couldn't
- *    make the delay work, maybe someone can read the
- *    datasheet and fix it. The relevant Apple comment
- *    is in AppleTAS3004Audio.cpp lines 1637 ff. Note
- *    that their comment describing how they program
- *    the filters sucks...
- *
- * Other things:
- *  - this should actually register *two* aoa_codec
- *    structs since it has two inputs. Then it must
- *    use the prepare callback to forbid running the
- *    secondary output on a different clock.
- *    Also, whatever bus knows how to do this must
- *    provide two soundbus_dev devices and the fabric
- *    must be able to link them correctly.
- *
- *    I don't even know if Apple ever uses the second
- *    port on the tas3004 though, I don't think their
- *    i2s controllers can even do it. OTOH, they all
- *    derive the clocks from common clocks, so it
- *    might just be possible. The framework allows the
- *    codec to refine the transfer_info items in the
- *    usable callback, so we can simply remove the
- *    rates the second instance is not using when it
- *    actually is in use.
- *    Maybe we'll need to make the sound busses have
- *    a 'clock group id' value so the codec can
- *    determine if the two outputs can be driven at
- *    the same time. But that is likely overkill, up
- *    to the fabric to not link them up incorrectly,
- *    and up to the hardware designer to not wire
- *    them up in some weird unusable way.
- */
-#include <stddef.h>
-#include <linux/i2c.h>
-#include <asm/pmac_low_i2c.h>
-#include <asm/prom.h>
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("tas codec driver for snd-aoa");
-
-#include "snd-aoa-codec-tas.h"
-#include "snd-aoa-codec-tas-gain-table.h"
-#include "snd-aoa-codec-tas-basstreble.h"
-#include "../aoa.h"
-#include "../soundbus/soundbus.h"
-
-#define PFX "snd-aoa-codec-tas: "
-
-
-struct tas {
-       struct aoa_codec        codec;
-       struct i2c_client       i2c;
-       u32                     mute_l:1, mute_r:1 ,
-                               controls_created:1 ,
-                               drc_enabled:1,
-                               hw_enabled:1;
-       u8                      cached_volume_l, cached_volume_r;
-       u8                      mixer_l[3], mixer_r[3];
-       u8                      bass, treble;
-       u8                      acr;
-       int                     drc_range;
-       /* protects hardware access against concurrency from
-        * userspace when hitting controls and during
-        * codec init/suspend/resume */
-       struct mutex            mtx;
-};
-
-static int tas_reset_init(struct tas *tas);
-
-static struct tas *codec_to_tas(struct aoa_codec *codec)
-{
-       return container_of(codec, struct tas, codec);
-}
-
-static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data)
-{
-       if (len == 1)
-               return i2c_smbus_write_byte_data(&tas->i2c, reg, *data);
-       else
-               return i2c_smbus_write_i2c_block_data(&tas->i2c, reg, len, data);
-}
-
-static void tas3004_set_drc(struct tas *tas)
-{
-       unsigned char val[6];
-
-       if (tas->drc_enabled)
-               val[0] = 0x50; /* 3:1 above threshold */
-       else
-               val[0] = 0x51; /* disabled */
-       val[1] = 0x02; /* 1:1 below threshold */
-       if (tas->drc_range > 0xef)
-               val[2] = 0xef;
-       else if (tas->drc_range < 0)
-               val[2] = 0x00;
-       else
-               val[2] = tas->drc_range;
-       val[3] = 0xb0;
-       val[4] = 0x60;
-       val[5] = 0xa0;
-
-       tas_write_reg(tas, TAS_REG_DRC, 6, val);
-}
-
-static void tas_set_treble(struct tas *tas)
-{
-       u8 tmp;
-
-       tmp = tas3004_treble(tas->treble);
-       tas_write_reg(tas, TAS_REG_TREBLE, 1, &tmp);
-}
-
-static void tas_set_bass(struct tas *tas)
-{
-       u8 tmp;
-
-       tmp = tas3004_bass(tas->bass);
-       tas_write_reg(tas, TAS_REG_BASS, 1, &tmp);
-}
-
-static void tas_set_volume(struct tas *tas)
-{
-       u8 block[6];
-       int tmp;
-       u8 left, right;
-
-       left = tas->cached_volume_l;
-       right = tas->cached_volume_r;
-
-       if (left > 177) left = 177;
-       if (right > 177) right = 177;
-
-       if (tas->mute_l) left = 0;
-       if (tas->mute_r) right = 0;
-
-       /* analysing the volume and mixer tables shows
-        * that they are similar enough when we shift
-        * the mixer table down by 4 bits. The error
-        * is miniscule, in just one item the error
-        * is 1, at a value of 0x07f17b (mixer table
-        * value is 0x07f17a) */
-       tmp = tas_gaintable[left];
-       block[0] = tmp>>20;
-       block[1] = tmp>>12;
-       block[2] = tmp>>4;
-       tmp = tas_gaintable[right];
-       block[3] = tmp>>20;
-       block[4] = tmp>>12;
-       block[5] = tmp>>4;
-       tas_write_reg(tas, TAS_REG_VOL, 6, block);
-}
-
-static void tas_set_mixer(struct tas *tas)
-{
-       u8 block[9];
-       int tmp, i;
-       u8 val;
-
-       for (i=0;i<3;i++) {
-               val = tas->mixer_l[i];
-               if (val > 177) val = 177;
-               tmp = tas_gaintable[val];
-               block[3*i+0] = tmp>>16;
-               block[3*i+1] = tmp>>8;
-               block[3*i+2] = tmp;
-       }
-       tas_write_reg(tas, TAS_REG_LMIX, 9, block);
-
-       for (i=0;i<3;i++) {
-               val = tas->mixer_r[i];
-               if (val > 177) val = 177;
-               tmp = tas_gaintable[val];
-               block[3*i+0] = tmp>>16;
-               block[3*i+1] = tmp>>8;
-               block[3*i+2] = tmp;
-       }
-       tas_write_reg(tas, TAS_REG_RMIX, 9, block);
-}
-
-/* alsa stuff */
-
-static int tas_dev_register(struct snd_device *dev)
-{
-       return 0;
-}
-
-static struct snd_device_ops ops = {
-       .dev_register = tas_dev_register,
-};
-
-static int tas_snd_vol_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 2;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 177;
-       return 0;
-}
-
-static int tas_snd_vol_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->cached_volume_l;
-       ucontrol->value.integer.value[1] = tas->cached_volume_r;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       if (ucontrol->value.integer.value[0] < 0 ||
-           ucontrol->value.integer.value[0] > 177)
-               return -EINVAL;
-       if (ucontrol->value.integer.value[1] < 0 ||
-           ucontrol->value.integer.value[1] > 177)
-               return -EINVAL;
-
-       mutex_lock(&tas->mtx);
-       if (tas->cached_volume_l == ucontrol->value.integer.value[0]
-        && tas->cached_volume_r == ucontrol->value.integer.value[1]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->cached_volume_l = ucontrol->value.integer.value[0];
-       tas->cached_volume_r = ucontrol->value.integer.value[1];
-       if (tas->hw_enabled)
-               tas_set_volume(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new volume_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Master Playback Volume",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_vol_info,
-       .get = tas_snd_vol_get,
-       .put = tas_snd_vol_put,
-};
-
-#define tas_snd_mute_info      snd_ctl_boolean_stereo_info
-
-static int tas_snd_mute_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = !tas->mute_l;
-       ucontrol->value.integer.value[1] = !tas->mute_r;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       if (tas->mute_l == !ucontrol->value.integer.value[0]
-        && tas->mute_r == !ucontrol->value.integer.value[1]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->mute_l = !ucontrol->value.integer.value[0];
-       tas->mute_r = !ucontrol->value.integer.value[1];
-       if (tas->hw_enabled)
-               tas_set_volume(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new mute_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Master Playback Switch",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_mute_info,
-       .get = tas_snd_mute_get,
-       .put = tas_snd_mute_put,
-};
-
-static int tas_snd_mixer_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 2;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 177;
-       return 0;
-}
-
-static int tas_snd_mixer_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-       int idx = kcontrol->private_value;
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->mixer_l[idx];
-       ucontrol->value.integer.value[1] = tas->mixer_r[idx];
-       mutex_unlock(&tas->mtx);
-
-       return 0;
-}
-
-static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-       int idx = kcontrol->private_value;
-
-       mutex_lock(&tas->mtx);
-       if (tas->mixer_l[idx] == ucontrol->value.integer.value[0]
-        && tas->mixer_r[idx] == ucontrol->value.integer.value[1]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->mixer_l[idx] = ucontrol->value.integer.value[0];
-       tas->mixer_r[idx] = ucontrol->value.integer.value[1];
-
-       if (tas->hw_enabled)
-               tas_set_mixer(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-#define MIXER_CONTROL(n,descr,idx)                     \
-static struct snd_kcontrol_new n##_control = {         \
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,            \
-       .name = descr " Playback Volume",               \
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,      \
-       .info = tas_snd_mixer_info,                     \
-       .get = tas_snd_mixer_get,                       \
-       .put = tas_snd_mixer_put,                       \
-       .private_value = idx,                           \
-}
-
-MIXER_CONTROL(pcm1, "PCM", 0);
-MIXER_CONTROL(monitor, "Monitor", 2);
-
-static int tas_snd_drc_range_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = TAS3004_DRC_MAX;
-       return 0;
-}
-
-static int tas_snd_drc_range_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->drc_range;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       if (ucontrol->value.integer.value[0] < 0 ||
-           ucontrol->value.integer.value[0] > TAS3004_DRC_MAX)
-               return -EINVAL;
-
-       mutex_lock(&tas->mtx);
-       if (tas->drc_range == ucontrol->value.integer.value[0]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->drc_range = ucontrol->value.integer.value[0];
-       if (tas->hw_enabled)
-               tas3004_set_drc(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new drc_range_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "DRC Range",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_drc_range_info,
-       .get = tas_snd_drc_range_get,
-       .put = tas_snd_drc_range_put,
-};
-
-#define tas_snd_drc_switch_info                snd_ctl_boolean_mono_info
-
-static int tas_snd_drc_switch_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->drc_enabled;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_drc_switch_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       if (tas->drc_enabled == ucontrol->value.integer.value[0]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->drc_enabled = !!ucontrol->value.integer.value[0];
-       if (tas->hw_enabled)
-               tas3004_set_drc(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new drc_switch_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "DRC Range Switch",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_drc_switch_info,
-       .get = tas_snd_drc_switch_get,
-       .put = tas_snd_drc_switch_put,
-};
-
-static int tas_snd_capture_source_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       static char *texts[] = { "Line-In", "Microphone" };
-
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-       uinfo->count = 1;
-       uinfo->value.enumerated.items = 2;
-       if (uinfo->value.enumerated.item > 1)
-               uinfo->value.enumerated.item = 1;
-       strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
-       return 0;
-}
-
-static int tas_snd_capture_source_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.enumerated.item[0] = !!(tas->acr & TAS_ACR_INPUT_B);
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-       int oldacr;
-
-       if (ucontrol->value.enumerated.item[0] > 1)
-               return -EINVAL;
-       mutex_lock(&tas->mtx);
-       oldacr = tas->acr;
-
-       /*
-        * Despite what the data sheet says in one place, the
-        * TAS_ACR_B_MONAUREAL bit forces mono output even when
-        * input A (line in) is selected.
-        */
-       tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
-       if (ucontrol->value.enumerated.item[0])
-               tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
-                     TAS_ACR_B_MON_SEL_RIGHT;
-       if (oldacr == tas->acr) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-       if (tas->hw_enabled)
-               tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new capture_source_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       /* If we name this 'Input Source', it properly shows up in
-        * alsamixer as a selection, * but it's shown under the
-        * 'Playback' category.
-        * If I name it 'Capture Source', it shows up in strange
-        * ways (two bools of which one can be selected at a
-        * time) but at least it's shown in the 'Capture'
-        * category.
-        * I was told that this was due to backward compatibility,
-        * but I don't understand then why the mangling is *not*
-        * done when I name it "Input Source".....
-        */
-       .name = "Capture Source",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_capture_source_info,
-       .get = tas_snd_capture_source_get,
-       .put = tas_snd_capture_source_put,
-};
-
-static int tas_snd_treble_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 1;
-       uinfo->value.integer.min = TAS3004_TREBLE_MIN;
-       uinfo->value.integer.max = TAS3004_TREBLE_MAX;
-       return 0;
-}
-
-static int tas_snd_treble_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->treble;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       if (ucontrol->value.integer.value[0] < TAS3004_TREBLE_MIN ||
-           ucontrol->value.integer.value[0] > TAS3004_TREBLE_MAX)
-               return -EINVAL;
-       mutex_lock(&tas->mtx);
-       if (tas->treble == ucontrol->value.integer.value[0]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->treble = ucontrol->value.integer.value[0];
-       if (tas->hw_enabled)
-               tas_set_treble(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new treble_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Treble",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_treble_info,
-       .get = tas_snd_treble_get,
-       .put = tas_snd_treble_put,
-};
-
-static int tas_snd_bass_info(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-       uinfo->count = 1;
-       uinfo->value.integer.min = TAS3004_BASS_MIN;
-       uinfo->value.integer.max = TAS3004_BASS_MAX;
-       return 0;
-}
-
-static int tas_snd_bass_get(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       mutex_lock(&tas->mtx);
-       ucontrol->value.integer.value[0] = tas->bass;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
-       struct snd_ctl_elem_value *ucontrol)
-{
-       struct tas *tas = snd_kcontrol_chip(kcontrol);
-
-       if (ucontrol->value.integer.value[0] < TAS3004_BASS_MIN ||
-           ucontrol->value.integer.value[0] > TAS3004_BASS_MAX)
-               return -EINVAL;
-       mutex_lock(&tas->mtx);
-       if (tas->bass == ucontrol->value.integer.value[0]) {
-               mutex_unlock(&tas->mtx);
-               return 0;
-       }
-
-       tas->bass = ucontrol->value.integer.value[0];
-       if (tas->hw_enabled)
-               tas_set_bass(tas);
-       mutex_unlock(&tas->mtx);
-       return 1;
-}
-
-static struct snd_kcontrol_new bass_control = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Bass",
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .info = tas_snd_bass_info,
-       .get = tas_snd_bass_get,
-       .put = tas_snd_bass_put,
-};
-
-static struct transfer_info tas_transfers[] = {
-       {
-               /* input */
-               .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
-               .transfer_in = 1,
-       },
-       {
-               /* output */
-               .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
-               .transfer_in = 0,
-       },
-       {}
-};
-
-static int tas_usable(struct codec_info_item *cii,
-                     struct transfer_info *ti,
-                     struct transfer_info *out)
-{
-       return 1;
-}
-
-static int tas_reset_init(struct tas *tas)
-{
-       u8 tmp;
-
-       tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
-       msleep(5);
-       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
-       msleep(5);
-       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 1);
-       msleep(20);
-       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
-       msleep(10);
-       tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
-
-       tmp = TAS_MCS_SCLK64 | TAS_MCS_SPORT_MODE_I2S | TAS_MCS_SPORT_WL_24BIT;
-       if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
-               goto outerr;
-
-       tas->acr |= TAS_ACR_ANALOG_PDOWN;
-       if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
-               goto outerr;
-
-       tmp = 0;
-       if (tas_write_reg(tas, TAS_REG_MCS2, 1, &tmp))
-               goto outerr;
-
-       tas3004_set_drc(tas);
-
-       /* Set treble & bass to 0dB */
-       tas->treble = TAS3004_TREBLE_ZERO;
-       tas->bass = TAS3004_BASS_ZERO;
-       tas_set_treble(tas);
-       tas_set_bass(tas);
-
-       tas->acr &= ~TAS_ACR_ANALOG_PDOWN;
-       if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
-               goto outerr;
-
-       return 0;
- outerr:
-       return -ENODEV;
-}
-
-static int tas_switch_clock(struct codec_info_item *cii, enum clock_switch clock)
-{
-       struct tas *tas = cii->codec_data;
-
-       switch(clock) {
-       case CLOCK_SWITCH_PREPARE_SLAVE:
-               /* Clocks are going away, mute mute mute */
-               tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
-               tas->hw_enabled = 0;
-               break;
-       case CLOCK_SWITCH_SLAVE:
-               /* Clocks are back, re-init the codec */
-               mutex_lock(&tas->mtx);
-               tas_reset_init(tas);
-               tas_set_volume(tas);
-               tas_set_mixer(tas);
-               tas->hw_enabled = 1;
-               tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
-               mutex_unlock(&tas->mtx);
-               break;
-       default:
-               /* doesn't happen as of now */
-               return -EINVAL;
-       }
-       return 0;
-}
-
-#ifdef CONFIG_PM
-/* we are controlled via i2c and assume that is always up
- * If that wasn't the case, we'd have to suspend once
- * our i2c device is suspended, and then take note of that! */
-static int tas_suspend(struct tas *tas)
-{
-       mutex_lock(&tas->mtx);
-       tas->hw_enabled = 0;
-       tas->acr |= TAS_ACR_ANALOG_PDOWN;
-       tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int tas_resume(struct tas *tas)
-{
-       /* reset codec */
-       mutex_lock(&tas->mtx);
-       tas_reset_init(tas);
-       tas_set_volume(tas);
-       tas_set_mixer(tas);
-       tas->hw_enabled = 1;
-       mutex_unlock(&tas->mtx);
-       return 0;
-}
-
-static int _tas_suspend(struct codec_info_item *cii, pm_message_t state)
-{
-       return tas_suspend(cii->codec_data);
-}
-
-static int _tas_resume(struct codec_info_item *cii)
-{
-       return tas_resume(cii->codec_data);
-}
-#else /* CONFIG_PM */
-#define _tas_suspend   NULL
-#define _tas_resume    NULL
-#endif /* CONFIG_PM */
-
-static struct codec_info tas_codec_info = {
-       .transfers = tas_transfers,
-       /* in theory, we can drive it at 512 too...
-        * but so far the framework doesn't allow
-        * for that and I don't see much point in it. */
-       .sysclock_factor = 256,
-       /* same here, could be 32 for just one 16 bit format */
-       .bus_factor = 64,
-       .owner = THIS_MODULE,
-       .usable = tas_usable,
-       .switch_clock = tas_switch_clock,
-       .suspend = _tas_suspend,
-       .resume = _tas_resume,
-};
-
-static int tas_init_codec(struct aoa_codec *codec)
-{
-       struct tas *tas = codec_to_tas(codec);
-       int err;
-
-       if (!tas->codec.gpio || !tas->codec.gpio->methods) {
-               printk(KERN_ERR PFX "gpios not assigned!!\n");
-               return -EINVAL;
-       }
-
-       mutex_lock(&tas->mtx);
-       if (tas_reset_init(tas)) {
-               printk(KERN_ERR PFX "tas failed to initialise\n");
-               mutex_unlock(&tas->mtx);
-               return -ENXIO;
-       }
-       tas->hw_enabled = 1;
-       mutex_unlock(&tas->mtx);
-
-       if (tas->codec.soundbus_dev->attach_codec(tas->codec.soundbus_dev,
-                                                  aoa_get_card(),
-                                                  &tas_codec_info, tas)) {
-               printk(KERN_ERR PFX "error attaching tas to soundbus\n");
-               return -ENODEV;
-       }
-
-       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, tas, &ops)) {
-               printk(KERN_ERR PFX "failed to create tas snd device!\n");
-               return -ENODEV;
-       }
-       err = aoa_snd_ctl_add(snd_ctl_new1(&volume_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&mute_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&pcm1_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&monitor_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&capture_source_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&drc_range_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&drc_switch_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&treble_control, tas));
-       if (err)
-               goto error;
-
-       err = aoa_snd_ctl_add(snd_ctl_new1(&bass_control, tas));
-       if (err)
-               goto error;
-
-       return 0;
- error:
-       tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas);
-       snd_device_free(aoa_get_card(), tas);
-       return err;
-}
-
-static void tas_exit_codec(struct aoa_codec *codec)
-{
-       struct tas *tas = codec_to_tas(codec);
-
-       if (!tas->codec.soundbus_dev)
-               return;
-       tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas);
-}
-       
-
-static struct i2c_driver tas_driver;
-
-static int tas_create(struct i2c_adapter *adapter,
-                      struct device_node *node,
-                      int addr)
-{
-       struct tas *tas;
-
-       tas = kzalloc(sizeof(struct tas), GFP_KERNEL);
-
-       if (!tas)
-               return -ENOMEM;
-
-       mutex_init(&tas->mtx);
-       tas->i2c.driver = &tas_driver;
-       tas->i2c.adapter = adapter;
-       tas->i2c.addr = addr;
-       /* seems that half is a saner default */
-       tas->drc_range = TAS3004_DRC_MAX / 2;
-       strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE);
-
-       if (i2c_attach_client(&tas->i2c)) {
-               printk(KERN_ERR PFX "failed to attach to i2c\n");
-               goto fail;
-       }
-
-       strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN);
-       tas->codec.owner = THIS_MODULE;
-       tas->codec.init = tas_init_codec;
-       tas->codec.exit = tas_exit_codec;
-       tas->codec.node = of_node_get(node);
-
-       if (aoa_codec_register(&tas->codec)) {
-               goto detach;
-       }
-       printk(KERN_DEBUG
-              "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n",
-              addr, node->full_name);
-       return 0;
- detach:
-       i2c_detach_client(&tas->i2c);
- fail:
-       mutex_destroy(&tas->mtx);
-       kfree(tas);
-       return -EINVAL;
-}
-
-static int tas_i2c_attach(struct i2c_adapter *adapter)
-{
-       struct device_node *busnode, *dev = NULL;
-       struct pmac_i2c_bus *bus;
-
-       bus = pmac_i2c_adapter_to_bus(adapter);
-       if (bus == NULL)
-               return -ENODEV;
-       busnode = pmac_i2c_get_bus_node(bus);
-
-       while ((dev = of_get_next_child(busnode, dev)) != NULL) {
-               if (of_device_is_compatible(dev, "tas3004")) {
-                       const u32 *addr;
-                       printk(KERN_DEBUG PFX "found tas3004\n");
-                       addr = of_get_property(dev, "reg", NULL);
-                       if (!addr)
-                               continue;
-                       return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
-               }
-               /* older machines have no 'codec' node with a 'compatible'
-                * property that says 'tas3004', they just have a 'deq'
-                * node without any such property... */
-               if (strcmp(dev->name, "deq") == 0) {
-                       const u32 *_addr;
-                       u32 addr;
-                       printk(KERN_DEBUG PFX "found 'deq' node\n");
-                       _addr = of_get_property(dev, "i2c-address", NULL);
-                       if (!_addr)
-                               continue;
-                       addr = ((*_addr) >> 1) & 0x7f;
-                       /* now, if the address doesn't match any of the two
-                        * that a tas3004 can have, we cannot handle this.
-                        * I doubt it ever happens but hey. */
-                       if (addr != 0x34 && addr != 0x35)
-                               continue;
-                       return tas_create(adapter, dev, addr);
-               }
-       }
-       return -ENODEV;
-}
-
-static int tas_i2c_detach(struct i2c_client *client)
-{
-       struct tas *tas = container_of(client, struct tas, i2c);
-       int err;
-       u8 tmp = TAS_ACR_ANALOG_PDOWN;
-
-       if ((err = i2c_detach_client(client)))
-               return err;
-       aoa_codec_unregister(&tas->codec);
-       of_node_put(tas->codec.node);
-
-       /* power down codec chip */
-       tas_write_reg(tas, TAS_REG_ACR, 1, &tmp);
-
-       mutex_destroy(&tas->mtx);
-       kfree(tas);
-       return 0;
-}
-
-static struct i2c_driver tas_driver = {
-       .driver = {
-               .name = "aoa_codec_tas",
-               .owner = THIS_MODULE,
-       },
-       .attach_adapter = tas_i2c_attach,
-       .detach_client = tas_i2c_detach,
-};
-
-static int __init tas_init(void)
-{
-       return i2c_add_driver(&tas_driver);
-}
-
-static void __exit tas_exit(void)
-{
-       i2c_del_driver(&tas_driver);
-}
-
-module_init(tas_init);
-module_exit(tas_exit);
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.h b/sound/aoa/codecs/snd-aoa-codec-tas.h
deleted file mode 100644 (file)
index ae177e3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Apple Onboard Audio driver for tas codec (header)
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-#ifndef __SND_AOA_CODECTASH
-#define __SND_AOA_CODECTASH
-
-#define TAS_REG_MCS    0x01    /* main control */
-#      define TAS_MCS_FASTLOAD         (1<<7)
-#      define TAS_MCS_SCLK64           (1<<6)
-#      define TAS_MCS_SPORT_MODE_MASK  (3<<4)
-#      define TAS_MCS_SPORT_MODE_I2S   (2<<4)
-#      define TAS_MCS_SPORT_MODE_RJ    (1<<4)
-#      define TAS_MCS_SPORT_MODE_LJ    (0<<4)
-#      define TAS_MCS_SPORT_WL_MASK    (3<<0)
-#      define TAS_MCS_SPORT_WL_16BIT   (0<<0)
-#      define TAS_MCS_SPORT_WL_18BIT   (1<<0)
-#      define TAS_MCS_SPORT_WL_20BIT   (2<<0)
-#      define TAS_MCS_SPORT_WL_24BIT   (3<<0)
-
-#define TAS_REG_DRC    0x02
-#define TAS_REG_VOL    0x04
-#define TAS_REG_TREBLE 0x05
-#define TAS_REG_BASS   0x06
-#define TAS_REG_LMIX   0x07
-#define TAS_REG_RMIX   0x08
-
-#define TAS_REG_ACR    0x40    /* analog control */
-#      define TAS_ACR_B_MONAUREAL      (1<<7)
-#      define TAS_ACR_B_MON_SEL_RIGHT  (1<<6)
-#      define TAS_ACR_DEEMPH_MASK      (3<<2)
-#      define TAS_ACR_DEEMPH_OFF       (0<<2)
-#      define TAS_ACR_DEEMPH_48KHz     (1<<2)
-#      define TAS_ACR_DEEMPH_44KHz     (2<<2)
-#      define TAS_ACR_INPUT_B          (1<<1)
-#      define TAS_ACR_ANALOG_PDOWN     (1<<0)
-
-#define TAS_REG_MCS2   0x43    /* main control 2 */
-#      define TAS_MCS2_ALLPASS         (1<<1)
-
-#define TAS_REG_LEFT_BIQUAD6   0x10
-#define TAS_REG_RIGHT_BIQUAD6  0x19
-
-#define TAS_REG_LEFT_LOUDNESS          0x21
-#define TAS_REG_RIGHT_LOUDNESS         0x22
-#define TAS_REG_LEFT_LOUDNESS_GAIN     0x23
-#define TAS_REG_RIGHT_LOUDNESS_GAIN    0x24
-
-#define TAS3001_DRC_MAX                0x5f
-#define TAS3004_DRC_MAX                0xef
-
-#endif /* __SND_AOA_CODECTASH */
diff --git a/sound/aoa/codecs/snd-aoa-codec-toonie.c b/sound/aoa/codecs/snd-aoa-codec-toonie.c
deleted file mode 100644 (file)
index 3c7d1d8..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Apple Onboard Audio driver for Toonie codec
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- *
- *
- * This is a driver for the toonie codec chip. This chip is present
- * on the Mac Mini and is nothing but a DAC.
- */
-#include <linux/delay.h>
-#include <linux/module.h>
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("toonie codec driver for snd-aoa");
-
-#include "../aoa.h"
-#include "../soundbus/soundbus.h"
-
-
-#define PFX "snd-aoa-codec-toonie: "
-
-struct toonie {
-       struct aoa_codec        codec;
-};
-#define codec_to_toonie(c) container_of(c, struct toonie, codec)
-
-static int toonie_dev_register(struct snd_device *dev)
-{
-       return 0;
-}
-
-static struct snd_device_ops ops = {
-       .dev_register = toonie_dev_register,
-};
-
-static struct transfer_info toonie_transfers[] = {
-       /* This thing *only* has analog output,
-        * the rates are taken from Info.plist
-        * from Darwin. */
-       {
-               .formats = SNDRV_PCM_FMTBIT_S16_BE |
-                          SNDRV_PCM_FMTBIT_S24_BE,
-               .rates = SNDRV_PCM_RATE_32000 |
-                        SNDRV_PCM_RATE_44100 |
-                        SNDRV_PCM_RATE_48000 |
-                        SNDRV_PCM_RATE_88200 |
-                        SNDRV_PCM_RATE_96000,
-       },
-       {}
-};
-
-static int toonie_usable(struct codec_info_item *cii,
-                        struct transfer_info *ti,
-                        struct transfer_info *out)
-{
-       return 1;
-}
-
-#ifdef CONFIG_PM
-static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
-{
-       /* can we turn it off somehow? */
-       return 0;
-}
-
-static int toonie_resume(struct codec_info_item *cii)
-{
-       return 0;
-}
-#endif /* CONFIG_PM */
-
-static struct codec_info toonie_codec_info = {
-       .transfers = toonie_transfers,
-       .sysclock_factor = 256,
-       .bus_factor = 64,
-       .owner = THIS_MODULE,
-       .usable = toonie_usable,
-#ifdef CONFIG_PM
-       .suspend = toonie_suspend,
-       .resume = toonie_resume,
-#endif
-};
-
-static int toonie_init_codec(struct aoa_codec *codec)
-{
-       struct toonie *toonie = codec_to_toonie(codec);
-
-       /* nothing connected? what a joke! */
-       if (toonie->codec.connected != 1)
-               return -ENOTCONN;
-
-       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
-               printk(KERN_ERR PFX "failed to create toonie snd device!\n");
-               return -ENODEV;
-       }
-
-       if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
-                                                    aoa_get_card(),
-                                                    &toonie_codec_info, toonie)) {
-               printk(KERN_ERR PFX "error creating toonie pcm\n");
-               snd_device_free(aoa_get_card(), toonie);
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
-static void toonie_exit_codec(struct aoa_codec *codec)
-{
-       struct toonie *toonie = codec_to_toonie(codec);
-
-       if (!toonie->codec.soundbus_dev) {
-               printk(KERN_ERR PFX "toonie_exit_codec called without soundbus_dev!\n");
-               return;
-       }
-       toonie->codec.soundbus_dev->detach_codec(toonie->codec.soundbus_dev, toonie);
-}
-
-static struct toonie *toonie;
-
-static int __init toonie_init(void)
-{
-       toonie = kzalloc(sizeof(struct toonie), GFP_KERNEL);
-
-       if (!toonie)
-               return -ENOMEM;
-
-       strlcpy(toonie->codec.name, "toonie", sizeof(toonie->codec.name));
-       toonie->codec.owner = THIS_MODULE;
-       toonie->codec.init = toonie_init_codec;
-       toonie->codec.exit = toonie_exit_codec;
-                                        
-       if (aoa_codec_register(&toonie->codec)) {
-               kfree(toonie);
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-static void __exit toonie_exit(void)
-{
-       aoa_codec_unregister(&toonie->codec);
-       kfree(toonie);
-}
-
-module_init(toonie_init);
-module_exit(toonie_exit);
diff --git a/sound/aoa/codecs/tas-basstreble.h b/sound/aoa/codecs/tas-basstreble.h
new file mode 100644 (file)
index 0000000..69b6113
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * This file is only included exactly once!
+ *
+ * The tables here are derived from the tas3004 datasheet,
+ * modulo typo corrections and some smoothing...
+ */
+
+#define TAS3004_TREBLE_MIN     0
+#define TAS3004_TREBLE_MAX     72
+#define TAS3004_BASS_MIN       0
+#define TAS3004_BASS_MAX       72
+#define TAS3004_TREBLE_ZERO    36
+#define TAS3004_BASS_ZERO      36
+
+static u8 tas3004_treble_table[] = {
+       150, /* -18 dB */
+       149,
+       148,
+       147,
+       146,
+       145,
+       144,
+       143,
+       142,
+       141,
+       140,
+       139,
+       138,
+       137,
+       136,
+       135,
+       134,
+       133,
+       132,
+       131,
+       130,
+       129,
+       128,
+       127,
+       126,
+       125,
+       124,
+       123,
+       122,
+       121,
+       120,
+       119,
+       118,
+       117,
+       116,
+       115,
+       114, /* 0 dB */
+       113,
+       112,
+       111,
+       109,
+       108,
+       107,
+       105,
+       104,
+       103,
+       101,
+       99,
+       98,
+       96,
+       93,
+       91,
+       89,
+       86,
+       83,
+       81,
+       77,
+       74,
+       71,
+       67,
+       63,
+       59,
+       54,
+       49,
+       44,
+       38,
+       32,
+       26,
+       19,
+       10,
+       4,
+       2,
+       1, /* +18 dB */
+};
+
+static inline u8 tas3004_treble(int idx)
+{
+       return tas3004_treble_table[idx];
+}
+
+/* I only save the difference here to the treble table
+ * so that the binary is smaller...
+ * I have also ignored completely differences of
+ * +/- 1
+ */
+static s8 tas3004_bass_diff_to_treble[] = {
+       2, /* 7 dB, offset 50 */
+       2,
+       2,
+       2,
+       2,
+       1,
+       2,
+       2,
+       2,
+       3,
+       4,
+       4,
+       5,
+       6,
+       7,
+       8,
+       9,
+       10,
+       11,
+       14,
+       13,
+       8,
+       1, /* 18 dB */
+};
+
+static inline u8 tas3004_bass(int idx)
+{
+       u8 result = tas3004_treble_table[idx];
+
+       if (idx >= 50)
+               result += tas3004_bass_diff_to_treble[idx-50];
+       return result;
+}
diff --git a/sound/aoa/codecs/tas-gain-table.h b/sound/aoa/codecs/tas-gain-table.h
new file mode 100644 (file)
index 0000000..4cfa675
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ This is the program used to generate below table.
+
+#include <stdio.h>
+#include <math.h>
+int main() {
+  int dB2;
+  printf("/" "* This file is only included exactly once!\n");
+  printf(" *\n");
+  printf(" * If they'd only tell us that generating this table was\n");
+  printf(" * as easy as calculating\n");
+  printf(" *      hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
+  printf(" * :) *" "/\n");
+  printf("static int tas_gaintable[] = {\n");
+  printf("     0x000000, /" "* -infinity dB *" "/\n");
+  for (dB2=-140;dB2<=36;dB2++)
+    printf("   0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
+  printf("};\n\n");
+}
+
+*/
+
+/* This file is only included exactly once!
+ *
+ * If they'd only tell us that generating this table was
+ * as easy as calculating
+ *      hwvalue = 1048576.0*exp(0.057564628*dB*2)
+ * :) */
+static int tas_gaintable[] = {
+       0x000000, /* -infinity dB */
+       0x00014b, /* -70.0 dB */
+       0x00015f, /* -69.5 dB */
+       0x000174, /* -69.0 dB */
+       0x00018a, /* -68.5 dB */
+       0x0001a1, /* -68.0 dB */
+       0x0001ba, /* -67.5 dB */
+       0x0001d4, /* -67.0 dB */
+       0x0001f0, /* -66.5 dB */
+       0x00020d, /* -66.0 dB */
+       0x00022c, /* -65.5 dB */
+       0x00024d, /* -65.0 dB */
+       0x000270, /* -64.5 dB */
+       0x000295, /* -64.0 dB */
+       0x0002bc, /* -63.5 dB */
+       0x0002e6, /* -63.0 dB */
+       0x000312, /* -62.5 dB */
+       0x000340, /* -62.0 dB */
+       0x000372, /* -61.5 dB */
+       0x0003a6, /* -61.0 dB */
+       0x0003dd, /* -60.5 dB */
+       0x000418, /* -60.0 dB */
+       0x000456, /* -59.5 dB */
+       0x000498, /* -59.0 dB */
+       0x0004de, /* -58.5 dB */
+       0x000528, /* -58.0 dB */
+       0x000576, /* -57.5 dB */
+       0x0005c9, /* -57.0 dB */
+       0x000620, /* -56.5 dB */
+       0x00067d, /* -56.0 dB */
+       0x0006e0, /* -55.5 dB */
+       0x000748, /* -55.0 dB */
+       0x0007b7, /* -54.5 dB */
+       0x00082c, /* -54.0 dB */
+       0x0008a8, /* -53.5 dB */
+       0x00092b, /* -53.0 dB */
+       0x0009b6, /* -52.5 dB */
+       0x000a49, /* -52.0 dB */
+       0x000ae5, /* -51.5 dB */
+       0x000b8b, /* -51.0 dB */
+       0x000c3a, /* -50.5 dB */
+       0x000cf3, /* -50.0 dB */
+       0x000db8, /* -49.5 dB */
+       0x000e88, /* -49.0 dB */
+       0x000f64, /* -48.5 dB */
+       0x00104e, /* -48.0 dB */
+       0x001145, /* -47.5 dB */
+       0x00124b, /* -47.0 dB */
+       0x001361, /* -46.5 dB */
+       0x001487, /* -46.0 dB */
+       0x0015be, /* -45.5 dB */
+       0x001708, /* -45.0 dB */
+       0x001865, /* -44.5 dB */
+       0x0019d8, /* -44.0 dB */
+       0x001b60, /* -43.5 dB */
+       0x001cff, /* -43.0 dB */
+       0x001eb7, /* -42.5 dB */
+       0x002089, /* -42.0 dB */
+       0x002276, /* -41.5 dB */
+       0x002481, /* -41.0 dB */
+       0x0026ab, /* -40.5 dB */
+       0x0028f5, /* -40.0 dB */
+       0x002b63, /* -39.5 dB */
+       0x002df5, /* -39.0 dB */
+       0x0030ae, /* -38.5 dB */
+       0x003390, /* -38.0 dB */
+       0x00369e, /* -37.5 dB */
+       0x0039db, /* -37.0 dB */
+       0x003d49, /* -36.5 dB */
+       0x0040ea, /* -36.0 dB */
+       0x0044c3, /* -35.5 dB */
+       0x0048d6, /* -35.0 dB */
+       0x004d27, /* -34.5 dB */
+       0x0051b9, /* -34.0 dB */
+       0x005691, /* -33.5 dB */
+       0x005bb2, /* -33.0 dB */
+       0x006121, /* -32.5 dB */
+       0x0066e3, /* -32.0 dB */
+       0x006cfb, /* -31.5 dB */
+       0x007370, /* -31.0 dB */
+       0x007a48, /* -30.5 dB */
+       0x008186, /* -30.0 dB */
+       0x008933, /* -29.5 dB */
+       0x009154, /* -29.0 dB */
+       0x0099f1, /* -28.5 dB */
+       0x00a310, /* -28.0 dB */
+       0x00acba, /* -27.5 dB */
+       0x00b6f6, /* -27.0 dB */
+       0x00c1cd, /* -26.5 dB */
+       0x00cd49, /* -26.0 dB */
+       0x00d973, /* -25.5 dB */
+       0x00e655, /* -25.0 dB */
+       0x00f3fb, /* -24.5 dB */
+       0x010270, /* -24.0 dB */
+       0x0111c0, /* -23.5 dB */
+       0x0121f9, /* -23.0 dB */
+       0x013328, /* -22.5 dB */
+       0x01455b, /* -22.0 dB */
+       0x0158a2, /* -21.5 dB */
+       0x016d0e, /* -21.0 dB */
+       0x0182af, /* -20.5 dB */
+       0x019999, /* -20.0 dB */
+       0x01b1de, /* -19.5 dB */
+       0x01cb94, /* -19.0 dB */
+       0x01e6cf, /* -18.5 dB */
+       0x0203a7, /* -18.0 dB */
+       0x022235, /* -17.5 dB */
+       0x024293, /* -17.0 dB */
+       0x0264db, /* -16.5 dB */
+       0x02892c, /* -16.0 dB */
+       0x02afa3, /* -15.5 dB */
+       0x02d862, /* -15.0 dB */
+       0x03038a, /* -14.5 dB */
+       0x033142, /* -14.0 dB */
+       0x0361af, /* -13.5 dB */
+       0x0394fa, /* -13.0 dB */
+       0x03cb50, /* -12.5 dB */
+       0x0404de, /* -12.0 dB */
+       0x0441d5, /* -11.5 dB */
+       0x048268, /* -11.0 dB */
+       0x04c6d0, /* -10.5 dB */
+       0x050f44, /* -10.0 dB */
+       0x055c04, /* -9.5 dB */
+       0x05ad50, /* -9.0 dB */
+       0x06036e, /* -8.5 dB */
+       0x065ea5, /* -8.0 dB */
+       0x06bf44, /* -7.5 dB */
+       0x07259d, /* -7.0 dB */
+       0x079207, /* -6.5 dB */
+       0x0804dc, /* -6.0 dB */
+       0x087e80, /* -5.5 dB */
+       0x08ff59, /* -5.0 dB */
+       0x0987d5, /* -4.5 dB */
+       0x0a1866, /* -4.0 dB */
+       0x0ab189, /* -3.5 dB */
+       0x0b53be, /* -3.0 dB */
+       0x0bff91, /* -2.5 dB */
+       0x0cb591, /* -2.0 dB */
+       0x0d765a, /* -1.5 dB */
+       0x0e4290, /* -1.0 dB */
+       0x0f1adf, /* -0.5 dB */
+       0x100000, /* 0.0 dB */
+       0x10f2b4, /* 0.5 dB */
+       0x11f3c9, /* 1.0 dB */
+       0x13041a, /* 1.5 dB */
+       0x14248e, /* 2.0 dB */
+       0x15561a, /* 2.5 dB */
+       0x1699c0, /* 3.0 dB */
+       0x17f094, /* 3.5 dB */
+       0x195bb8, /* 4.0 dB */
+       0x1adc61, /* 4.5 dB */
+       0x1c73d5, /* 5.0 dB */
+       0x1e236d, /* 5.5 dB */
+       0x1fec98, /* 6.0 dB */
+       0x21d0d9, /* 6.5 dB */
+       0x23d1cd, /* 7.0 dB */
+       0x25f125, /* 7.5 dB */
+       0x2830af, /* 8.0 dB */
+       0x2a9254, /* 8.5 dB */
+       0x2d1818, /* 9.0 dB */
+       0x2fc420, /* 9.5 dB */
+       0x3298b0, /* 10.0 dB */
+       0x35982f, /* 10.5 dB */
+       0x38c528, /* 11.0 dB */
+       0x3c224c, /* 11.5 dB */
+       0x3fb278, /* 12.0 dB */
+       0x4378b0, /* 12.5 dB */
+       0x477829, /* 13.0 dB */
+       0x4bb446, /* 13.5 dB */
+       0x5030a1, /* 14.0 dB */
+       0x54f106, /* 14.5 dB */
+       0x59f980, /* 15.0 dB */
+       0x5f4e52, /* 15.5 dB */
+       0x64f403, /* 16.0 dB */
+       0x6aef5e, /* 16.5 dB */
+       0x714575, /* 17.0 dB */
+       0x77fbaa, /* 17.5 dB */
+       0x7f17af, /* 18.0 dB */
+};
+
diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c
new file mode 100644 (file)
index 0000000..008e0f8
--- /dev/null
@@ -0,0 +1,1012 @@
+/*
+ * Apple Onboard Audio driver for tas codec
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ * Open questions:
+ *  - How to distinguish between 3004 and versions?
+ *
+ * FIXMEs:
+ *  - This codec driver doesn't honour the 'connected'
+ *    property of the aoa_codec struct, hence if
+ *    it is used in machines where not everything is
+ *    connected it will display wrong mixer elements.
+ *  - Driver assumes that the microphone is always
+ *    monaureal and connected to the right channel of
+ *    the input. This should also be a codec-dependent
+ *    flag, maybe the codec should have 3 different
+ *    bits for the three different possibilities how
+ *    it can be hooked up...
+ *    But as long as I don't see any hardware hooked
+ *    up that way...
+ *  - As Apple notes in their code, the tas3004 seems
+ *    to delay the right channel by one sample. You can
+ *    see this when for example recording stereo in
+ *    audacity, or recording the tas output via cable
+ *    on another machine (use a sinus generator or so).
+ *    I tried programming the BiQuads but couldn't
+ *    make the delay work, maybe someone can read the
+ *    datasheet and fix it. The relevant Apple comment
+ *    is in AppleTAS3004Audio.cpp lines 1637 ff. Note
+ *    that their comment describing how they program
+ *    the filters sucks...
+ *
+ * Other things:
+ *  - this should actually register *two* aoa_codec
+ *    structs since it has two inputs. Then it must
+ *    use the prepare callback to forbid running the
+ *    secondary output on a different clock.
+ *    Also, whatever bus knows how to do this must
+ *    provide two soundbus_dev devices and the fabric
+ *    must be able to link them correctly.
+ *
+ *    I don't even know if Apple ever uses the second
+ *    port on the tas3004 though, I don't think their
+ *    i2s controllers can even do it. OTOH, they all
+ *    derive the clocks from common clocks, so it
+ *    might just be possible. The framework allows the
+ *    codec to refine the transfer_info items in the
+ *    usable callback, so we can simply remove the
+ *    rates the second instance is not using when it
+ *    actually is in use.
+ *    Maybe we'll need to make the sound busses have
+ *    a 'clock group id' value so the codec can
+ *    determine if the two outputs can be driven at
+ *    the same time. But that is likely overkill, up
+ *    to the fabric to not link them up incorrectly,
+ *    and up to the hardware designer to not wire
+ *    them up in some weird unusable way.
+ */
+#include <stddef.h>
+#include <linux/i2c.h>
+#include <asm/pmac_low_i2c.h>
+#include <asm/prom.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("tas codec driver for snd-aoa");
+
+#include "tas.h"
+#include "tas-gain-table.h"
+#include "tas-basstreble.h"
+#include "../aoa.h"
+#include "../soundbus/soundbus.h"
+
+#define PFX "snd-aoa-codec-tas: "
+
+
+struct tas {
+       struct aoa_codec        codec;
+       struct i2c_client       i2c;
+       u32                     mute_l:1, mute_r:1 ,
+                               controls_created:1 ,
+                               drc_enabled:1,
+                               hw_enabled:1;
+       u8                      cached_volume_l, cached_volume_r;
+       u8                      mixer_l[3], mixer_r[3];
+       u8                      bass, treble;
+       u8                      acr;
+       int                     drc_range;
+       /* protects hardware access against concurrency from
+        * userspace when hitting controls and during
+        * codec init/suspend/resume */
+       struct mutex            mtx;
+};
+
+static int tas_reset_init(struct tas *tas);
+
+static struct tas *codec_to_tas(struct aoa_codec *codec)
+{
+       return container_of(codec, struct tas, codec);
+}
+
+static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data)
+{
+       if (len == 1)
+               return i2c_smbus_write_byte_data(&tas->i2c, reg, *data);
+       else
+               return i2c_smbus_write_i2c_block_data(&tas->i2c, reg, len, data);
+}
+
+static void tas3004_set_drc(struct tas *tas)
+{
+       unsigned char val[6];
+
+       if (tas->drc_enabled)
+               val[0] = 0x50; /* 3:1 above threshold */
+       else
+               val[0] = 0x51; /* disabled */
+       val[1] = 0x02; /* 1:1 below threshold */
+       if (tas->drc_range > 0xef)
+               val[2] = 0xef;
+       else if (tas->drc_range < 0)
+               val[2] = 0x00;
+       else
+               val[2] = tas->drc_range;
+       val[3] = 0xb0;
+       val[4] = 0x60;
+       val[5] = 0xa0;
+
+       tas_write_reg(tas, TAS_REG_DRC, 6, val);
+}
+
+static void tas_set_treble(struct tas *tas)
+{
+       u8 tmp;
+
+       tmp = tas3004_treble(tas->treble);
+       tas_write_reg(tas, TAS_REG_TREBLE, 1, &tmp);
+}
+
+static void tas_set_bass(struct tas *tas)
+{
+       u8 tmp;
+
+       tmp = tas3004_bass(tas->bass);
+       tas_write_reg(tas, TAS_REG_BASS, 1, &tmp);
+}
+
+static void tas_set_volume(struct tas *tas)
+{
+       u8 block[6];
+       int tmp;
+       u8 left, right;
+
+       left = tas->cached_volume_l;
+       right = tas->cached_volume_r;
+
+       if (left > 177) left = 177;
+       if (right > 177) right = 177;
+
+       if (tas->mute_l) left = 0;
+       if (tas->mute_r) right = 0;
+
+       /* analysing the volume and mixer tables shows
+        * that they are similar enough when we shift
+        * the mixer table down by 4 bits. The error
+        * is miniscule, in just one item the error
+        * is 1, at a value of 0x07f17b (mixer table
+        * value is 0x07f17a) */
+       tmp = tas_gaintable[left];
+       block[0] = tmp>>20;
+       block[1] = tmp>>12;
+       block[2] = tmp>>4;
+       tmp = tas_gaintable[right];
+       block[3] = tmp>>20;
+       block[4] = tmp>>12;
+       block[5] = tmp>>4;
+       tas_write_reg(tas, TAS_REG_VOL, 6, block);
+}
+
+static void tas_set_mixer(struct tas *tas)
+{
+       u8 block[9];
+       int tmp, i;
+       u8 val;
+
+       for (i=0;i<3;i++) {
+               val = tas->mixer_l[i];
+               if (val > 177) val = 177;
+               tmp = tas_gaintable[val];
+               block[3*i+0] = tmp>>16;
+               block[3*i+1] = tmp>>8;
+               block[3*i+2] = tmp;
+       }
+       tas_write_reg(tas, TAS_REG_LMIX, 9, block);
+
+       for (i=0;i<3;i++) {
+               val = tas->mixer_r[i];
+               if (val > 177) val = 177;
+               tmp = tas_gaintable[val];
+               block[3*i+0] = tmp>>16;
+               block[3*i+1] = tmp>>8;
+               block[3*i+2] = tmp;
+       }
+       tas_write_reg(tas, TAS_REG_RMIX, 9, block);
+}
+
+/* alsa stuff */
+
+static int tas_dev_register(struct snd_device *dev)
+{
+       return 0;
+}
+
+static struct snd_device_ops ops = {
+       .dev_register = tas_dev_register,
+};
+
+static int tas_snd_vol_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 2;
+       uinfo->value.integer.min = 0;
+       uinfo->value.integer.max = 177;
+       return 0;
+}
+
+static int tas_snd_vol_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->cached_volume_l;
+       ucontrol->value.integer.value[1] = tas->cached_volume_r;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       if (ucontrol->value.integer.value[0] < 0 ||
+           ucontrol->value.integer.value[0] > 177)
+               return -EINVAL;
+       if (ucontrol->value.integer.value[1] < 0 ||
+           ucontrol->value.integer.value[1] > 177)
+               return -EINVAL;
+
+       mutex_lock(&tas->mtx);
+       if (tas->cached_volume_l == ucontrol->value.integer.value[0]
+        && tas->cached_volume_r == ucontrol->value.integer.value[1]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->cached_volume_l = ucontrol->value.integer.value[0];
+       tas->cached_volume_r = ucontrol->value.integer.value[1];
+       if (tas->hw_enabled)
+               tas_set_volume(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new volume_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Master Playback Volume",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_vol_info,
+       .get = tas_snd_vol_get,
+       .put = tas_snd_vol_put,
+};
+
+#define tas_snd_mute_info      snd_ctl_boolean_stereo_info
+
+static int tas_snd_mute_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = !tas->mute_l;
+       ucontrol->value.integer.value[1] = !tas->mute_r;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       if (tas->mute_l == !ucontrol->value.integer.value[0]
+        && tas->mute_r == !ucontrol->value.integer.value[1]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->mute_l = !ucontrol->value.integer.value[0];
+       tas->mute_r = !ucontrol->value.integer.value[1];
+       if (tas->hw_enabled)
+               tas_set_volume(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new mute_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Master Playback Switch",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_mute_info,
+       .get = tas_snd_mute_get,
+       .put = tas_snd_mute_put,
+};
+
+static int tas_snd_mixer_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 2;
+       uinfo->value.integer.min = 0;
+       uinfo->value.integer.max = 177;
+       return 0;
+}
+
+static int tas_snd_mixer_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+       int idx = kcontrol->private_value;
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->mixer_l[idx];
+       ucontrol->value.integer.value[1] = tas->mixer_r[idx];
+       mutex_unlock(&tas->mtx);
+
+       return 0;
+}
+
+static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+       int idx = kcontrol->private_value;
+
+       mutex_lock(&tas->mtx);
+       if (tas->mixer_l[idx] == ucontrol->value.integer.value[0]
+        && tas->mixer_r[idx] == ucontrol->value.integer.value[1]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->mixer_l[idx] = ucontrol->value.integer.value[0];
+       tas->mixer_r[idx] = ucontrol->value.integer.value[1];
+
+       if (tas->hw_enabled)
+               tas_set_mixer(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+#define MIXER_CONTROL(n,descr,idx)                     \
+static struct snd_kcontrol_new n##_control = {         \
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,            \
+       .name = descr " Playback Volume",               \
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,      \
+       .info = tas_snd_mixer_info,                     \
+       .get = tas_snd_mixer_get,                       \
+       .put = tas_snd_mixer_put,                       \
+       .private_value = idx,                           \
+}
+
+MIXER_CONTROL(pcm1, "PCM", 0);
+MIXER_CONTROL(monitor, "Monitor", 2);
+
+static int tas_snd_drc_range_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 1;
+       uinfo->value.integer.min = 0;
+       uinfo->value.integer.max = TAS3004_DRC_MAX;
+       return 0;
+}
+
+static int tas_snd_drc_range_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->drc_range;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       if (ucontrol->value.integer.value[0] < 0 ||
+           ucontrol->value.integer.value[0] > TAS3004_DRC_MAX)
+               return -EINVAL;
+
+       mutex_lock(&tas->mtx);
+       if (tas->drc_range == ucontrol->value.integer.value[0]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->drc_range = ucontrol->value.integer.value[0];
+       if (tas->hw_enabled)
+               tas3004_set_drc(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new drc_range_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "DRC Range",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_drc_range_info,
+       .get = tas_snd_drc_range_get,
+       .put = tas_snd_drc_range_put,
+};
+
+#define tas_snd_drc_switch_info                snd_ctl_boolean_mono_info
+
+static int tas_snd_drc_switch_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->drc_enabled;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_drc_switch_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       if (tas->drc_enabled == ucontrol->value.integer.value[0]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->drc_enabled = !!ucontrol->value.integer.value[0];
+       if (tas->hw_enabled)
+               tas3004_set_drc(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new drc_switch_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "DRC Range Switch",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_drc_switch_info,
+       .get = tas_snd_drc_switch_get,
+       .put = tas_snd_drc_switch_put,
+};
+
+static int tas_snd_capture_source_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       static char *texts[] = { "Line-In", "Microphone" };
+
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+       uinfo->count = 1;
+       uinfo->value.enumerated.items = 2;
+       if (uinfo->value.enumerated.item > 1)
+               uinfo->value.enumerated.item = 1;
+       strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+       return 0;
+}
+
+static int tas_snd_capture_source_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.enumerated.item[0] = !!(tas->acr & TAS_ACR_INPUT_B);
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+       int oldacr;
+
+       if (ucontrol->value.enumerated.item[0] > 1)
+               return -EINVAL;
+       mutex_lock(&tas->mtx);
+       oldacr = tas->acr;
+
+       /*
+        * Despite what the data sheet says in one place, the
+        * TAS_ACR_B_MONAUREAL bit forces mono output even when
+        * input A (line in) is selected.
+        */
+       tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
+       if (ucontrol->value.enumerated.item[0])
+               tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
+                     TAS_ACR_B_MON_SEL_RIGHT;
+       if (oldacr == tas->acr) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+       if (tas->hw_enabled)
+               tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new capture_source_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       /* If we name this 'Input Source', it properly shows up in
+        * alsamixer as a selection, * but it's shown under the
+        * 'Playback' category.
+        * If I name it 'Capture Source', it shows up in strange
+        * ways (two bools of which one can be selected at a
+        * time) but at least it's shown in the 'Capture'
+        * category.
+        * I was told that this was due to backward compatibility,
+        * but I don't understand then why the mangling is *not*
+        * done when I name it "Input Source".....
+        */
+       .name = "Capture Source",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_capture_source_info,
+       .get = tas_snd_capture_source_get,
+       .put = tas_snd_capture_source_put,
+};
+
+static int tas_snd_treble_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 1;
+       uinfo->value.integer.min = TAS3004_TREBLE_MIN;
+       uinfo->value.integer.max = TAS3004_TREBLE_MAX;
+       return 0;
+}
+
+static int tas_snd_treble_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->treble;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       if (ucontrol->value.integer.value[0] < TAS3004_TREBLE_MIN ||
+           ucontrol->value.integer.value[0] > TAS3004_TREBLE_MAX)
+               return -EINVAL;
+       mutex_lock(&tas->mtx);
+       if (tas->treble == ucontrol->value.integer.value[0]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->treble = ucontrol->value.integer.value[0];
+       if (tas->hw_enabled)
+               tas_set_treble(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new treble_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Treble",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_treble_info,
+       .get = tas_snd_treble_get,
+       .put = tas_snd_treble_put,
+};
+
+static int tas_snd_bass_info(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_info *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = 1;
+       uinfo->value.integer.min = TAS3004_BASS_MIN;
+       uinfo->value.integer.max = TAS3004_BASS_MAX;
+       return 0;
+}
+
+static int tas_snd_bass_get(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       mutex_lock(&tas->mtx);
+       ucontrol->value.integer.value[0] = tas->bass;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct tas *tas = snd_kcontrol_chip(kcontrol);
+
+       if (ucontrol->value.integer.value[0] < TAS3004_BASS_MIN ||
+           ucontrol->value.integer.value[0] > TAS3004_BASS_MAX)
+               return -EINVAL;
+       mutex_lock(&tas->mtx);
+       if (tas->bass == ucontrol->value.integer.value[0]) {
+               mutex_unlock(&tas->mtx);
+               return 0;
+       }
+
+       tas->bass = ucontrol->value.integer.value[0];
+       if (tas->hw_enabled)
+               tas_set_bass(tas);
+       mutex_unlock(&tas->mtx);
+       return 1;
+}
+
+static struct snd_kcontrol_new bass_control = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Bass",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .info = tas_snd_bass_info,
+       .get = tas_snd_bass_get,
+       .put = tas_snd_bass_put,
+};
+
+static struct transfer_info tas_transfers[] = {
+       {
+               /* input */
+               .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
+               .transfer_in = 1,
+       },
+       {
+               /* output */
+               .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
+               .transfer_in = 0,
+       },
+       {}
+};
+
+static int tas_usable(struct codec_info_item *cii,
+                     struct transfer_info *ti,
+                     struct transfer_info *out)
+{
+       return 1;
+}
+
+static int tas_reset_init(struct tas *tas)
+{
+       u8 tmp;
+
+       tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
+       msleep(5);
+       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
+       msleep(5);
+       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 1);
+       msleep(20);
+       tas->codec.gpio->methods->set_hw_reset(tas->codec.gpio, 0);
+       msleep(10);
+       tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
+
+       tmp = TAS_MCS_SCLK64 | TAS_MCS_SPORT_MODE_I2S | TAS_MCS_SPORT_WL_24BIT;
+       if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
+               goto outerr;
+
+       tas->acr |= TAS_ACR_ANALOG_PDOWN;
+       if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
+               goto outerr;
+
+       tmp = 0;
+       if (tas_write_reg(tas, TAS_REG_MCS2, 1, &tmp))
+               goto outerr;
+
+       tas3004_set_drc(tas);
+
+       /* Set treble & bass to 0dB */
+       tas->treble = TAS3004_TREBLE_ZERO;
+       tas->bass = TAS3004_BASS_ZERO;
+       tas_set_treble(tas);
+       tas_set_bass(tas);
+
+       tas->acr &= ~TAS_ACR_ANALOG_PDOWN;
+       if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
+               goto outerr;
+
+       return 0;
+ outerr:
+       return -ENODEV;
+}
+
+static int tas_switch_clock(struct codec_info_item *cii, enum clock_switch clock)
+{
+       struct tas *tas = cii->codec_data;
+
+       switch(clock) {
+       case CLOCK_SWITCH_PREPARE_SLAVE:
+               /* Clocks are going away, mute mute mute */
+               tas->codec.gpio->methods->all_amps_off(tas->codec.gpio);
+               tas->hw_enabled = 0;
+               break;
+       case CLOCK_SWITCH_SLAVE:
+               /* Clocks are back, re-init the codec */
+               mutex_lock(&tas->mtx);
+               tas_reset_init(tas);
+               tas_set_volume(tas);
+               tas_set_mixer(tas);
+               tas->hw_enabled = 1;
+               tas->codec.gpio->methods->all_amps_restore(tas->codec.gpio);
+               mutex_unlock(&tas->mtx);
+               break;
+       default:
+               /* doesn't happen as of now */
+               return -EINVAL;
+       }
+       return 0;
+}
+
+#ifdef CONFIG_PM
+/* we are controlled via i2c and assume that is always up
+ * If that wasn't the case, we'd have to suspend once
+ * our i2c device is suspended, and then take note of that! */
+static int tas_suspend(struct tas *tas)
+{
+       mutex_lock(&tas->mtx);
+       tas->hw_enabled = 0;
+       tas->acr |= TAS_ACR_ANALOG_PDOWN;
+       tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr);
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int tas_resume(struct tas *tas)
+{
+       /* reset codec */
+       mutex_lock(&tas->mtx);
+       tas_reset_init(tas);
+       tas_set_volume(tas);
+       tas_set_mixer(tas);
+       tas->hw_enabled = 1;
+       mutex_unlock(&tas->mtx);
+       return 0;
+}
+
+static int _tas_suspend(struct codec_info_item *cii, pm_message_t state)
+{
+       return tas_suspend(cii->codec_data);
+}
+
+static int _tas_resume(struct codec_info_item *cii)
+{
+       return tas_resume(cii->codec_data);
+}
+#else /* CONFIG_PM */
+#define _tas_suspend   NULL
+#define _tas_resume    NULL
+#endif /* CONFIG_PM */
+
+static struct codec_info tas_codec_info = {
+       .transfers = tas_transfers,
+       /* in theory, we can drive it at 512 too...
+        * but so far the framework doesn't allow
+        * for that and I don't see much point in it. */
+       .sysclock_factor = 256,
+       /* same here, could be 32 for just one 16 bit format */
+       .bus_factor = 64,
+       .owner = THIS_MODULE,
+       .usable = tas_usable,
+       .switch_clock = tas_switch_clock,
+       .suspend = _tas_suspend,
+       .resume = _tas_resume,
+};
+
+static int tas_init_codec(struct aoa_codec *codec)
+{
+       struct tas *tas = codec_to_tas(codec);
+       int err;
+
+       if (!tas->codec.gpio || !tas->codec.gpio->methods) {
+               printk(KERN_ERR PFX "gpios not assigned!!\n");
+               return -EINVAL;
+       }
+
+       mutex_lock(&tas->mtx);
+       if (tas_reset_init(tas)) {
+               printk(KERN_ERR PFX "tas failed to initialise\n");
+               mutex_unlock(&tas->mtx);
+               return -ENXIO;
+       }
+       tas->hw_enabled = 1;
+       mutex_unlock(&tas->mtx);
+
+       if (tas->codec.soundbus_dev->attach_codec(tas->codec.soundbus_dev,
+                                                  aoa_get_card(),
+                                                  &tas_codec_info, tas)) {
+               printk(KERN_ERR PFX "error attaching tas to soundbus\n");
+               return -ENODEV;
+       }
+
+       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, tas, &ops)) {
+               printk(KERN_ERR PFX "failed to create tas snd device!\n");
+               return -ENODEV;
+       }
+       err = aoa_snd_ctl_add(snd_ctl_new1(&volume_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&mute_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&pcm1_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&monitor_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&capture_source_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&drc_range_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&drc_switch_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&treble_control, tas));
+       if (err)
+               goto error;
+
+       err = aoa_snd_ctl_add(snd_ctl_new1(&bass_control, tas));
+       if (err)
+               goto error;
+
+       return 0;
+ error:
+       tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas);
+       snd_device_free(aoa_get_card(), tas);
+       return err;
+}
+
+static void tas_exit_codec(struct aoa_codec *codec)
+{
+       struct tas *tas = codec_to_tas(codec);
+
+       if (!tas->codec.soundbus_dev)
+               return;
+       tas->codec.soundbus_dev->detach_codec(tas->codec.soundbus_dev, tas);
+}
+
+
+static struct i2c_driver tas_driver;
+
+static int tas_create(struct i2c_adapter *adapter,
+                      struct device_node *node,
+                      int addr)
+{
+       struct tas *tas;
+
+       tas = kzalloc(sizeof(struct tas), GFP_KERNEL);
+
+       if (!tas)
+               return -ENOMEM;
+
+       mutex_init(&tas->mtx);
+       tas->i2c.driver = &tas_driver;
+       tas->i2c.adapter = adapter;
+       tas->i2c.addr = addr;
+       /* seems that half is a saner default */
+       tas->drc_range = TAS3004_DRC_MAX / 2;
+       strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE);
+
+       if (i2c_attach_client(&tas->i2c)) {
+               printk(KERN_ERR PFX "failed to attach to i2c\n");
+               goto fail;
+       }
+
+       strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN);
+       tas->codec.owner = THIS_MODULE;
+       tas->codec.init = tas_init_codec;
+       tas->codec.exit = tas_exit_codec;
+       tas->codec.node = of_node_get(node);
+
+       if (aoa_codec_register(&tas->codec)) {
+               goto detach;
+       }
+       printk(KERN_DEBUG
+              "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n",
+              addr, node->full_name);
+       return 0;
+ detach:
+       i2c_detach_client(&tas->i2c);
+ fail:
+       mutex_destroy(&tas->mtx);
+       kfree(tas);
+       return -EINVAL;
+}
+
+static int tas_i2c_attach(struct i2c_adapter *adapter)
+{
+       struct device_node *busnode, *dev = NULL;
+       struct pmac_i2c_bus *bus;
+
+       bus = pmac_i2c_adapter_to_bus(adapter);
+       if (bus == NULL)
+               return -ENODEV;
+       busnode = pmac_i2c_get_bus_node(bus);
+
+       while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+               if (of_device_is_compatible(dev, "tas3004")) {
+                       const u32 *addr;
+                       printk(KERN_DEBUG PFX "found tas3004\n");
+                       addr = of_get_property(dev, "reg", NULL);
+                       if (!addr)
+                               continue;
+                       return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
+               }
+               /* older machines have no 'codec' node with a 'compatible'
+                * property that says 'tas3004', they just have a 'deq'
+                * node without any such property... */
+               if (strcmp(dev->name, "deq") == 0) {
+                       const u32 *_addr;
+                       u32 addr;
+                       printk(KERN_DEBUG PFX "found 'deq' node\n");
+                       _addr = of_get_property(dev, "i2c-address", NULL);
+                       if (!_addr)
+                               continue;
+                       addr = ((*_addr) >> 1) & 0x7f;
+                       /* now, if the address doesn't match any of the two
+                        * that a tas3004 can have, we cannot handle this.
+                        * I doubt it ever happens but hey. */
+                       if (addr != 0x34 && addr != 0x35)
+                               continue;
+                       return tas_create(adapter, dev, addr);
+               }
+       }
+       return -ENODEV;
+}
+
+static int tas_i2c_detach(struct i2c_client *client)
+{
+       struct tas *tas = container_of(client, struct tas, i2c);
+       int err;
+       u8 tmp = TAS_ACR_ANALOG_PDOWN;
+
+       if ((err = i2c_detach_client(client)))
+               return err;
+       aoa_codec_unregister(&tas->codec);
+       of_node_put(tas->codec.node);
+
+       /* power down codec chip */
+       tas_write_reg(tas, TAS_REG_ACR, 1, &tmp);
+
+       mutex_destroy(&tas->mtx);
+       kfree(tas);
+       return 0;
+}
+
+static struct i2c_driver tas_driver = {
+       .driver = {
+               .name = "aoa_codec_tas",
+               .owner = THIS_MODULE,
+       },
+       .attach_adapter = tas_i2c_attach,
+       .detach_client = tas_i2c_detach,
+};
+
+static int __init tas_init(void)
+{
+       return i2c_add_driver(&tas_driver);
+}
+
+static void __exit tas_exit(void)
+{
+       i2c_del_driver(&tas_driver);
+}
+
+module_init(tas_init);
+module_exit(tas_exit);
diff --git a/sound/aoa/codecs/tas.h b/sound/aoa/codecs/tas.h
new file mode 100644 (file)
index 0000000..ae177e3
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Apple Onboard Audio driver for tas codec (header)
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#ifndef __SND_AOA_CODECTASH
+#define __SND_AOA_CODECTASH
+
+#define TAS_REG_MCS    0x01    /* main control */
+#      define TAS_MCS_FASTLOAD         (1<<7)
+#      define TAS_MCS_SCLK64           (1<<6)
+#      define TAS_MCS_SPORT_MODE_MASK  (3<<4)
+#      define TAS_MCS_SPORT_MODE_I2S   (2<<4)
+#      define TAS_MCS_SPORT_MODE_RJ    (1<<4)
+#      define TAS_MCS_SPORT_MODE_LJ    (0<<4)
+#      define TAS_MCS_SPORT_WL_MASK    (3<<0)
+#      define TAS_MCS_SPORT_WL_16BIT   (0<<0)
+#      define TAS_MCS_SPORT_WL_18BIT   (1<<0)
+#      define TAS_MCS_SPORT_WL_20BIT   (2<<0)
+#      define TAS_MCS_SPORT_WL_24BIT   (3<<0)
+
+#define TAS_REG_DRC    0x02
+#define TAS_REG_VOL    0x04
+#define TAS_REG_TREBLE 0x05
+#define TAS_REG_BASS   0x06
+#define TAS_REG_LMIX   0x07
+#define TAS_REG_RMIX   0x08
+
+#define TAS_REG_ACR    0x40    /* analog control */
+#      define TAS_ACR_B_MONAUREAL      (1<<7)
+#      define TAS_ACR_B_MON_SEL_RIGHT  (1<<6)
+#      define TAS_ACR_DEEMPH_MASK      (3<<2)
+#      define TAS_ACR_DEEMPH_OFF       (0<<2)
+#      define TAS_ACR_DEEMPH_48KHz     (1<<2)
+#      define TAS_ACR_DEEMPH_44KHz     (2<<2)
+#      define TAS_ACR_INPUT_B          (1<<1)
+#      define TAS_ACR_ANALOG_PDOWN     (1<<0)
+
+#define TAS_REG_MCS2   0x43    /* main control 2 */
+#      define TAS_MCS2_ALLPASS         (1<<1)
+
+#define TAS_REG_LEFT_BIQUAD6   0x10
+#define TAS_REG_RIGHT_BIQUAD6  0x19
+
+#define TAS_REG_LEFT_LOUDNESS          0x21
+#define TAS_REG_RIGHT_LOUDNESS         0x22
+#define TAS_REG_LEFT_LOUDNESS_GAIN     0x23
+#define TAS_REG_RIGHT_LOUDNESS_GAIN    0x24
+
+#define TAS3001_DRC_MAX                0x5f
+#define TAS3004_DRC_MAX                0xef
+
+#endif /* __SND_AOA_CODECTASH */
diff --git a/sound/aoa/codecs/toonie.c b/sound/aoa/codecs/toonie.c
new file mode 100644 (file)
index 0000000..f13827e
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Apple Onboard Audio driver for Toonie codec
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ *
+ * This is a driver for the toonie codec chip. This chip is present
+ * on the Mac Mini and is nothing but a DAC.
+ */
+#include <linux/delay.h>
+#include <linux/module.h>
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("toonie codec driver for snd-aoa");
+
+#include "../aoa.h"
+#include "../soundbus/soundbus.h"
+
+
+#define PFX "snd-aoa-codec-toonie: "
+
+struct toonie {
+       struct aoa_codec        codec;
+};
+#define codec_to_toonie(c) container_of(c, struct toonie, codec)
+
+static int toonie_dev_register(struct snd_device *dev)
+{
+       return 0;
+}
+
+static struct snd_device_ops ops = {
+       .dev_register = toonie_dev_register,
+};
+
+static struct transfer_info toonie_transfers[] = {
+       /* This thing *only* has analog output,
+        * the rates are taken from Info.plist
+        * from Darwin. */
+       {
+               .formats = SNDRV_PCM_FMTBIT_S16_BE |
+                          SNDRV_PCM_FMTBIT_S24_BE,
+               .rates = SNDRV_PCM_RATE_32000 |
+                        SNDRV_PCM_RATE_44100 |
+                        SNDRV_PCM_RATE_48000 |
+                        SNDRV_PCM_RATE_88200 |
+                        SNDRV_PCM_RATE_96000,
+       },
+       {}
+};
+
+static int toonie_usable(struct codec_info_item *cii,
+                        struct transfer_info *ti,
+                        struct transfer_info *out)
+{
+       return 1;
+}
+
+#ifdef CONFIG_PM
+static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
+{
+       /* can we turn it off somehow? */
+       return 0;
+}
+
+static int toonie_resume(struct codec_info_item *cii)
+{
+       return 0;
+}
+#endif /* CONFIG_PM */
+
+static struct codec_info toonie_codec_info = {
+       .transfers = toonie_transfers,
+       .sysclock_factor = 256,
+       .bus_factor = 64,
+       .owner = THIS_MODULE,
+       .usable = toonie_usable,
+#ifdef CONFIG_PM
+       .suspend = toonie_suspend,
+       .resume = toonie_resume,
+#endif
+};
+
+static int toonie_init_codec(struct aoa_codec *codec)
+{
+       struct toonie *toonie = codec_to_toonie(codec);
+
+       /* nothing connected? what a joke! */
+       if (toonie->codec.connected != 1)
+               return -ENOTCONN;
+
+       if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
+               printk(KERN_ERR PFX "failed to create toonie snd device!\n");
+               return -ENODEV;
+       }
+
+       if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
+                                                    aoa_get_card(),
+                                                    &toonie_codec_info, toonie)) {
+               printk(KERN_ERR PFX "error creating toonie pcm\n");
+               snd_device_free(aoa_get_card(), toonie);
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+static void toonie_exit_codec(struct aoa_codec *codec)
+{
+       struct toonie *toonie = codec_to_toonie(codec);
+
+       if (!toonie->codec.soundbus_dev) {
+               printk(KERN_ERR PFX "toonie_exit_codec called without soundbus_dev!\n");
+               return;
+       }
+       toonie->codec.soundbus_dev->detach_codec(toonie->codec.soundbus_dev, toonie);
+}
+
+static struct toonie *toonie;
+
+static int __init toonie_init(void)
+{
+       toonie = kzalloc(sizeof(struct toonie), GFP_KERNEL);
+
+       if (!toonie)
+               return -ENOMEM;
+
+       strlcpy(toonie->codec.name, "toonie", sizeof(toonie->codec.name));
+       toonie->codec.owner = THIS_MODULE;
+       toonie->codec.init = toonie_init_codec;
+       toonie->codec.exit = toonie_exit_codec;
+
+       if (aoa_codec_register(&toonie->codec)) {
+               kfree(toonie);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static void __exit toonie_exit(void)
+{
+       aoa_codec_unregister(&toonie->codec);
+       kfree(toonie);
+}
+
+module_init(toonie_init);
+module_exit(toonie_exit);
index 62dc7287f66315382b5dd4918e9b28027857bd82..a1596e88c718ceb808c15765229a0ddee00cfc51 100644 (file)
@@ -1,5 +1,5 @@
 obj-$(CONFIG_SND_AOA) += snd-aoa.o
-snd-aoa-objs := snd-aoa-core.o \
-               snd-aoa-alsa.o \
-               snd-aoa-gpio-pmf.o \
-               snd-aoa-gpio-feature.o
+snd-aoa-objs := core.o \
+               alsa.o \
+               gpio-pmf.o \
+               gpio-feature.o
diff --git a/sound/aoa/core/alsa.c b/sound/aoa/core/alsa.c
new file mode 100644 (file)
index 0000000..6178504
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Apple Onboard Audio Alsa helpers
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#include <linux/module.h>
+#include "alsa.h"
+
+static int index = -1;
+module_param(index, int, 0444);
+MODULE_PARM_DESC(index, "index for AOA sound card.");
+
+static struct aoa_card *aoa_card;
+
+int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
+{
+       struct snd_card *alsa_card;
+       int err;
+
+       if (aoa_card)
+               /* cannot be EEXIST due to usage in aoa_fabric_register */
+               return -EBUSY;
+
+       alsa_card = snd_card_new(index, name, mod, sizeof(struct aoa_card));
+       if (!alsa_card)
+               return -ENOMEM;
+       aoa_card = alsa_card->private_data;
+       aoa_card->alsa_card = alsa_card;
+       alsa_card->dev = dev;
+       strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver));
+       strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname));
+       strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname));
+       strlcpy(alsa_card->mixername, name, sizeof(alsa_card->mixername));
+       err = snd_card_register(aoa_card->alsa_card);
+       if (err < 0) {
+               printk(KERN_ERR "snd-aoa: couldn't register alsa card\n");
+               snd_card_free(aoa_card->alsa_card);
+               aoa_card = NULL;
+               return err;
+       }
+       return 0;
+}
+
+struct snd_card *aoa_get_card(void)
+{
+       if (aoa_card)
+               return aoa_card->alsa_card;
+       return NULL;
+}
+EXPORT_SYMBOL_GPL(aoa_get_card);
+
+void aoa_alsa_cleanup(void)
+{
+       if (aoa_card) {
+               snd_card_free(aoa_card->alsa_card);
+               aoa_card = NULL;
+       }
+}
+
+int aoa_snd_device_new(snd_device_type_t type,
+                      void * device_data, struct snd_device_ops * ops)
+{
+       struct snd_card *card = aoa_get_card();
+       int err;
+
+       if (!card) return -ENOMEM;
+
+       err = snd_device_new(card, type, device_data, ops);
+       if (err) {
+               printk(KERN_ERR "snd-aoa: failed to create snd device (%d)\n", err);
+               return err;
+       }
+       err = snd_device_register(card, device_data);
+       if (err) {
+               printk(KERN_ERR "snd-aoa: failed to register "
+                               "snd device (%d)\n", err);
+               printk(KERN_ERR "snd-aoa: have you forgotten the "
+                               "dev_register callback?\n");
+               snd_device_free(card, device_data);
+       }
+       return err;
+}
+EXPORT_SYMBOL_GPL(aoa_snd_device_new);
+
+int aoa_snd_ctl_add(struct snd_kcontrol* control)
+{
+       int err;
+
+       if (!aoa_card) return -ENODEV;
+
+       err = snd_ctl_add(aoa_card->alsa_card, control);
+       if (err)
+               printk(KERN_ERR "snd-aoa: failed to add alsa control (%d)\n",
+                      err);
+       return err;
+}
+EXPORT_SYMBOL_GPL(aoa_snd_ctl_add);
diff --git a/sound/aoa/core/alsa.h b/sound/aoa/core/alsa.h
new file mode 100644 (file)
index 0000000..9669e44
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Apple Onboard Audio Alsa private helpers
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#ifndef __SND_AOA_ALSA_H
+#define __SND_AOA_ALSA_H
+#include "../aoa.h"
+
+extern int aoa_alsa_init(char *name, struct module *mod, struct device *dev);
+extern void aoa_alsa_cleanup(void);
+
+#endif /* __SND_AOA_ALSA_H */
diff --git a/sound/aoa/core/core.c b/sound/aoa/core/core.c
new file mode 100644 (file)
index 0000000..10bec6c
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Apple Onboard Audio driver core
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/list.h>
+#include "../aoa.h"
+#include "alsa.h"
+
+MODULE_DESCRIPTION("Apple Onboard Audio Sound Driver");
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_LICENSE("GPL");
+
+/* We allow only one fabric. This simplifies things,
+ * and more don't really make that much sense */
+static struct aoa_fabric *fabric;
+static LIST_HEAD(codec_list);
+
+static int attach_codec_to_fabric(struct aoa_codec *c)
+{
+       int err;
+
+       if (!try_module_get(c->owner))
+               return -EBUSY;
+       /* found_codec has to be assigned */
+       err = -ENOENT;
+       if (fabric->found_codec)
+               err = fabric->found_codec(c);
+       if (err) {
+               module_put(c->owner);
+               printk(KERN_ERR "snd-aoa: fabric didn't like codec %s\n",
+                               c->name);
+               return err;
+       }
+       c->fabric = fabric;
+
+       err = 0;
+       if (c->init)
+               err = c->init(c);
+       if (err) {
+               printk(KERN_ERR "snd-aoa: codec %s didn't init\n", c->name);
+               c->fabric = NULL;
+               if (fabric->remove_codec)
+                       fabric->remove_codec(c);
+               module_put(c->owner);
+               return err;
+       }
+       if (fabric->attached_codec)
+               fabric->attached_codec(c);
+       return 0;
+}
+
+int aoa_codec_register(struct aoa_codec *codec)
+{
+       int err = 0;
+
+       /* if there's a fabric already, we can tell if we
+        * will want to have this codec, so propagate error
+        * through. Otherwise, this will happen later... */
+       if (fabric)
+               err = attach_codec_to_fabric(codec);
+       if (!err)
+               list_add(&codec->list, &codec_list);
+       return err;
+}
+EXPORT_SYMBOL_GPL(aoa_codec_register);
+
+void aoa_codec_unregister(struct aoa_codec *codec)
+{
+       list_del(&codec->list);
+       if (codec->fabric && codec->exit)
+               codec->exit(codec);
+       if (fabric && fabric->remove_codec)
+               fabric->remove_codec(codec);
+       codec->fabric = NULL;
+       module_put(codec->owner);
+}
+EXPORT_SYMBOL_GPL(aoa_codec_unregister);
+
+int aoa_fabric_register(struct aoa_fabric *new_fabric, struct device *dev)
+{
+       struct aoa_codec *c;
+       int err;
+
+       /* allow querying for presence of fabric
+        * (i.e. do this test first!) */
+       if (new_fabric == fabric) {
+               err = -EALREADY;
+               goto attach;
+       }
+       if (fabric)
+               return -EEXIST;
+       if (!new_fabric)
+               return -EINVAL;
+
+       err = aoa_alsa_init(new_fabric->name, new_fabric->owner, dev);
+       if (err)
+               return err;
+
+       fabric = new_fabric;
+
+ attach:
+       list_for_each_entry(c, &codec_list, list) {
+               if (c->fabric != fabric)
+                       attach_codec_to_fabric(c);
+       }
+       return err;
+}
+EXPORT_SYMBOL_GPL(aoa_fabric_register);
+
+void aoa_fabric_unregister(struct aoa_fabric *old_fabric)
+{
+       struct aoa_codec *c;
+
+       if (fabric != old_fabric)
+               return;
+
+       list_for_each_entry(c, &codec_list, list) {
+               if (c->fabric)
+                       aoa_fabric_unlink_codec(c);
+       }
+
+       aoa_alsa_cleanup();
+
+       fabric = NULL;
+}
+EXPORT_SYMBOL_GPL(aoa_fabric_unregister);
+
+void aoa_fabric_unlink_codec(struct aoa_codec *codec)
+{
+       if (!codec->fabric) {
+               printk(KERN_ERR "snd-aoa: fabric unassigned "
+                               "in aoa_fabric_unlink_codec\n");
+               dump_stack();
+               return;
+       }
+       if (codec->exit)
+               codec->exit(codec);
+       if (codec->fabric->remove_codec)
+               codec->fabric->remove_codec(codec);
+       codec->fabric = NULL;
+       module_put(codec->owner);
+}
+EXPORT_SYMBOL_GPL(aoa_fabric_unlink_codec);
+
+static int __init aoa_init(void)
+{
+       return 0;
+}
+
+static void __exit aoa_exit(void)
+{
+       aoa_alsa_cleanup();
+}
+
+module_init(aoa_init);
+module_exit(aoa_exit);
diff --git a/sound/aoa/core/gpio-feature.c b/sound/aoa/core/gpio-feature.c
new file mode 100644 (file)
index 0000000..c93ad5d
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * Apple Onboard Audio feature call GPIO control
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ * This file contains the GPIO control routines for
+ * direct (through feature calls) access to the GPIO
+ * registers.
+ */
+
+#include <asm/pmac_feature.h>
+#include <linux/interrupt.h>
+#include "../aoa.h"
+
+/* TODO: these are 20 global variables
+ * that aren't used on most machines...
+ * Move them into a dynamically allocated
+ * structure and use that.
+ */
+
+/* these are the GPIO numbers (register addresses as offsets into
+ * the GPIO space) */
+static int headphone_mute_gpio;
+static int amp_mute_gpio;
+static int lineout_mute_gpio;
+static int hw_reset_gpio;
+static int lineout_detect_gpio;
+static int headphone_detect_gpio;
+static int linein_detect_gpio;
+
+/* see the SWITCH_GPIO macro */
+static int headphone_mute_gpio_activestate;
+static int amp_mute_gpio_activestate;
+static int lineout_mute_gpio_activestate;
+static int hw_reset_gpio_activestate;
+static int lineout_detect_gpio_activestate;
+static int headphone_detect_gpio_activestate;
+static int linein_detect_gpio_activestate;
+
+/* node pointers that we save when getting the GPIO number
+ * to get the interrupt later */
+static struct device_node *lineout_detect_node;
+static struct device_node *linein_detect_node;
+static struct device_node *headphone_detect_node;
+
+static int lineout_detect_irq;
+static int linein_detect_irq;
+static int headphone_detect_irq;
+
+static struct device_node *get_gpio(char *name,
+                                   char *altname,
+                                   int *gpioptr,
+                                   int *gpioactiveptr)
+{
+       struct device_node *np, *gpio;
+       const u32 *reg;
+       const char *audio_gpio;
+
+       *gpioptr = -1;
+
+       /* check if we can get it the easy way ... */
+       np = of_find_node_by_name(NULL, name);
+       if (!np) {
+               /* some machines have only gpioX/extint-gpioX nodes,
+                * and an audio-gpio property saying what it is ...
+                * So what we have to do is enumerate all children
+                * of the gpio node and check them all. */
+               gpio = of_find_node_by_name(NULL, "gpio");
+               if (!gpio)
+                       return NULL;
+               while ((np = of_get_next_child(gpio, np))) {
+                       audio_gpio = of_get_property(np, "audio-gpio", NULL);
+                       if (!audio_gpio)
+                               continue;
+                       if (strcmp(audio_gpio, name) == 0)
+                               break;
+                       if (altname && (strcmp(audio_gpio, altname) == 0))
+                               break;
+               }
+               /* still not found, assume not there */
+               if (!np)
+                       return NULL;
+       }
+
+       reg = of_get_property(np, "reg", NULL);
+       if (!reg)
+               return NULL;
+
+       *gpioptr = *reg;
+
+       /* this is a hack, usually the GPIOs 'reg' property
+        * should have the offset based from the GPIO space
+        * which is at 0x50, but apparently not always... */
+       if (*gpioptr < 0x50)
+               *gpioptr += 0x50;
+
+       reg = of_get_property(np, "audio-gpio-active-state", NULL);
+       if (!reg)
+               /* Apple seems to default to 1, but
+                * that doesn't seem right at least on most
+                * machines. So until proven that the opposite
+                * is necessary, we default to 0
+                * (which, incidentally, snd-powermac also does...) */
+               *gpioactiveptr = 0;
+       else
+               *gpioactiveptr = *reg;
+
+       return np;
+}
+
+static void get_irq(struct device_node * np, int *irqptr)
+{
+       if (np)
+               *irqptr = irq_of_parse_and_map(np, 0);
+       else
+               *irqptr = NO_IRQ;
+}
+
+/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
+#define SWITCH_GPIO(name, v, on)                               \
+       (((v)&~1) | ((on)?                                      \
+                       (name##_gpio_activestate==0?4:5):       \
+                       (name##_gpio_activestate==0?5:4)))
+
+#define FTR_GPIO(name, bit)                                    \
+static void ftr_gpio_set_##name(struct gpio_runtime *rt, int on)\
+{                                                              \
+       int v;                                                  \
+                                                               \
+       if (unlikely(!rt)) return;                              \
+                                                               \
+       if (name##_mute_gpio < 0)                               \
+               return;                                         \
+                                                               \
+       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL,         \
+                             name##_mute_gpio,                 \
+                             0);                               \
+                                                               \
+       /* muted = !on... */                                    \
+       v = SWITCH_GPIO(name##_mute, v, !on);                   \
+                                                               \
+       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL,            \
+                         name##_mute_gpio, v);                 \
+                                                               \
+       rt->implementation_private &= ~(1<<bit);                \
+       rt->implementation_private |= (!!on << bit);            \
+}                                                              \
+static int ftr_gpio_get_##name(struct gpio_runtime *rt)                \
+{                                                              \
+       if (unlikely(!rt)) return 0;                            \
+       return (rt->implementation_private>>bit)&1;             \
+}
+
+FTR_GPIO(headphone, 0);
+FTR_GPIO(amp, 1);
+FTR_GPIO(lineout, 2);
+
+static void ftr_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
+{
+       int v;
+
+       if (unlikely(!rt)) return;
+       if (hw_reset_gpio < 0)
+               return;
+
+       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL,
+                             hw_reset_gpio, 0);
+       v = SWITCH_GPIO(hw_reset, v, on);
+       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL,
+                         hw_reset_gpio, v);
+}
+
+static void ftr_gpio_all_amps_off(struct gpio_runtime *rt)
+{
+       int saved;
+
+       if (unlikely(!rt)) return;
+       saved = rt->implementation_private;
+       ftr_gpio_set_headphone(rt, 0);
+       ftr_gpio_set_amp(rt, 0);
+       ftr_gpio_set_lineout(rt, 0);
+       rt->implementation_private = saved;
+}
+
+static void ftr_gpio_all_amps_restore(struct gpio_runtime *rt)
+{
+       int s;
+
+       if (unlikely(!rt)) return;
+       s = rt->implementation_private;
+       ftr_gpio_set_headphone(rt, (s>>0)&1);
+       ftr_gpio_set_amp(rt, (s>>1)&1);
+       ftr_gpio_set_lineout(rt, (s>>2)&1);
+}
+
+static void ftr_handle_notify(struct work_struct *work)
+{
+       struct gpio_notification *notif =
+               container_of(work, struct gpio_notification, work.work);
+
+       mutex_lock(&notif->mutex);
+       if (notif->notify)
+               notif->notify(notif->data);
+       mutex_unlock(&notif->mutex);
+}
+
+static void gpio_enable_dual_edge(int gpio)
+{
+       int v;
+
+       if (gpio == -1)
+               return;
+       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio, 0);
+       v |= 0x80; /* enable dual edge */
+       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio, v);
+}
+
+static void ftr_gpio_init(struct gpio_runtime *rt)
+{
+       get_gpio("headphone-mute", NULL,
+                &headphone_mute_gpio,
+                &headphone_mute_gpio_activestate);
+       get_gpio("amp-mute", NULL,
+                &amp_mute_gpio,
+                &amp_mute_gpio_activestate);
+       get_gpio("lineout-mute", NULL,
+                &lineout_mute_gpio,
+                &lineout_mute_gpio_activestate);
+       get_gpio("hw-reset", "audio-hw-reset",
+                &hw_reset_gpio,
+                &hw_reset_gpio_activestate);
+
+       headphone_detect_node = get_gpio("headphone-detect", NULL,
+                                        &headphone_detect_gpio,
+                                        &headphone_detect_gpio_activestate);
+       /* go Apple, and thanks for giving these different names
+        * across the board... */
+       lineout_detect_node = get_gpio("lineout-detect", "line-output-detect",
+                                      &lineout_detect_gpio,
+                                      &lineout_detect_gpio_activestate);
+       linein_detect_node = get_gpio("linein-detect", "line-input-detect",
+                                     &linein_detect_gpio,
+                                     &linein_detect_gpio_activestate);
+
+       gpio_enable_dual_edge(headphone_detect_gpio);
+       gpio_enable_dual_edge(lineout_detect_gpio);
+       gpio_enable_dual_edge(linein_detect_gpio);
+
+       get_irq(headphone_detect_node, &headphone_detect_irq);
+       get_irq(lineout_detect_node, &lineout_detect_irq);
+       get_irq(linein_detect_node, &linein_detect_irq);
+
+       ftr_gpio_all_amps_off(rt);
+       rt->implementation_private = 0;
+       INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify);
+       INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify);
+       INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify);
+       mutex_init(&rt->headphone_notify.mutex);
+       mutex_init(&rt->line_in_notify.mutex);
+       mutex_init(&rt->line_out_notify.mutex);
+}
+
+static void ftr_gpio_exit(struct gpio_runtime *rt)
+{
+       ftr_gpio_all_amps_off(rt);
+       rt->implementation_private = 0;
+       if (rt->headphone_notify.notify)
+               free_irq(headphone_detect_irq, &rt->headphone_notify);
+       if (rt->line_in_notify.gpio_private)
+               free_irq(linein_detect_irq, &rt->line_in_notify);
+       if (rt->line_out_notify.gpio_private)
+               free_irq(lineout_detect_irq, &rt->line_out_notify);
+       cancel_delayed_work(&rt->headphone_notify.work);
+       cancel_delayed_work(&rt->line_in_notify.work);
+       cancel_delayed_work(&rt->line_out_notify.work);
+       flush_scheduled_work();
+       mutex_destroy(&rt->headphone_notify.mutex);
+       mutex_destroy(&rt->line_in_notify.mutex);
+       mutex_destroy(&rt->line_out_notify.mutex);
+}
+
+static irqreturn_t ftr_handle_notify_irq(int xx, void *data)
+{
+       struct gpio_notification *notif = data;
+
+       schedule_delayed_work(&notif->work, 0);
+
+       return IRQ_HANDLED;
+}
+
+static int ftr_set_notify(struct gpio_runtime *rt,
+                         enum notify_type type,
+                         notify_func_t notify,
+                         void *data)
+{
+       struct gpio_notification *notif;
+       notify_func_t old;
+       int irq;
+       char *name;
+       int err = -EBUSY;
+
+       switch (type) {
+       case AOA_NOTIFY_HEADPHONE:
+               notif = &rt->headphone_notify;
+               name = "headphone-detect";
+               irq = headphone_detect_irq;
+               break;
+       case AOA_NOTIFY_LINE_IN:
+               notif = &rt->line_in_notify;
+               name = "linein-detect";
+               irq = linein_detect_irq;
+               break;
+       case AOA_NOTIFY_LINE_OUT:
+               notif = &rt->line_out_notify;
+               name = "lineout-detect";
+               irq = lineout_detect_irq;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (irq == NO_IRQ)
+               return -ENODEV;
+
+       mutex_lock(&notif->mutex);
+
+       old = notif->notify;
+
+       if (!old && !notify) {
+               err = 0;
+               goto out_unlock;
+       }
+
+       if (old && notify) {
+               if (old == notify && notif->data == data)
+                       err = 0;
+               goto out_unlock;
+       }
+
+       if (old && !notify)
+               free_irq(irq, notif);
+
+       if (!old && notify) {
+               err = request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
+               if (err)
+                       goto out_unlock;
+       }
+
+       notif->notify = notify;
+       notif->data = data;
+
+       err = 0;
+ out_unlock:
+       mutex_unlock(&notif->mutex);
+       return err;
+}
+
+static int ftr_get_detect(struct gpio_runtime *rt,
+                         enum notify_type type)
+{
+       int gpio, ret, active;
+
+       switch (type) {
+       case AOA_NOTIFY_HEADPHONE:
+               gpio = headphone_detect_gpio;
+               active = headphone_detect_gpio_activestate;
+               break;
+       case AOA_NOTIFY_LINE_IN:
+               gpio = linein_detect_gpio;
+               active = linein_detect_gpio_activestate;
+               break;
+       case AOA_NOTIFY_LINE_OUT:
+               gpio = lineout_detect_gpio;
+               active = lineout_detect_gpio_activestate;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (gpio == -1)
+               return -ENODEV;
+
+       ret = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio, 0);
+       if (ret < 0)
+               return ret;
+       return ((ret >> 1) & 1) == active;
+}
+
+static struct gpio_methods methods = {
+       .init                   = ftr_gpio_init,
+       .exit                   = ftr_gpio_exit,
+       .all_amps_off           = ftr_gpio_all_amps_off,
+       .all_amps_restore       = ftr_gpio_all_amps_restore,
+       .set_headphone          = ftr_gpio_set_headphone,
+       .set_speakers           = ftr_gpio_set_amp,
+       .set_lineout            = ftr_gpio_set_lineout,
+       .set_hw_reset           = ftr_gpio_set_hw_reset,
+       .get_headphone          = ftr_gpio_get_headphone,
+       .get_speakers           = ftr_gpio_get_amp,
+       .get_lineout            = ftr_gpio_get_lineout,
+       .set_notify             = ftr_set_notify,
+       .get_detect             = ftr_get_detect,
+};
+
+struct gpio_methods *ftr_gpio_methods = &methods;
+EXPORT_SYMBOL_GPL(ftr_gpio_methods);
diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c
new file mode 100644 (file)
index 0000000..5ca2220
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * Apple Onboard Audio pmf GPIOs
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#include <asm/pmac_feature.h>
+#include <asm/pmac_pfunc.h>
+#include "../aoa.h"
+
+#define PMF_GPIO(name, bit)                                    \
+static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
+{                                                              \
+       struct pmf_args args = { .count = 1, .u[0].v = !on };   \
+       int rc;                                                 \
+                                                       \
+       if (unlikely(!rt)) return;                              \
+       rc = pmf_call_function(rt->node, #name "-mute", &args); \
+       if (rc && rc != -ENODEV)                                \
+               printk(KERN_WARNING "pmf_gpio_set_" #name       \
+               " failed, rc: %d\n", rc);                       \
+       rt->implementation_private &= ~(1<<bit);                \
+       rt->implementation_private |= (!!on << bit);            \
+}                                                              \
+static int pmf_gpio_get_##name(struct gpio_runtime *rt)                \
+{                                                              \
+       if (unlikely(!rt)) return 0;                            \
+       return (rt->implementation_private>>bit)&1;             \
+}
+
+PMF_GPIO(headphone, 0);
+PMF_GPIO(amp, 1);
+PMF_GPIO(lineout, 2);
+
+static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
+{
+       struct pmf_args args = { .count = 1, .u[0].v = !!on };
+       int rc;
+
+       if (unlikely(!rt)) return;
+       rc = pmf_call_function(rt->node, "hw-reset", &args);
+       if (rc)
+               printk(KERN_WARNING "pmf_gpio_set_hw_reset"
+                      " failed, rc: %d\n", rc);
+}
+
+static void pmf_gpio_all_amps_off(struct gpio_runtime *rt)
+{
+       int saved;
+
+       if (unlikely(!rt)) return;
+       saved = rt->implementation_private;
+       pmf_gpio_set_headphone(rt, 0);
+       pmf_gpio_set_amp(rt, 0);
+       pmf_gpio_set_lineout(rt, 0);
+       rt->implementation_private = saved;
+}
+
+static void pmf_gpio_all_amps_restore(struct gpio_runtime *rt)
+{
+       int s;
+
+       if (unlikely(!rt)) return;
+       s = rt->implementation_private;
+       pmf_gpio_set_headphone(rt, (s>>0)&1);
+       pmf_gpio_set_amp(rt, (s>>1)&1);
+       pmf_gpio_set_lineout(rt, (s>>2)&1);
+}
+
+static void pmf_handle_notify(struct work_struct *work)
+{
+       struct gpio_notification *notif =
+               container_of(work, struct gpio_notification, work.work);
+
+       mutex_lock(&notif->mutex);
+       if (notif->notify)
+               notif->notify(notif->data);
+       mutex_unlock(&notif->mutex);
+}
+
+static void pmf_gpio_init(struct gpio_runtime *rt)
+{
+       pmf_gpio_all_amps_off(rt);
+       rt->implementation_private = 0;
+       INIT_DELAYED_WORK(&rt->headphone_notify.work, pmf_handle_notify);
+       INIT_DELAYED_WORK(&rt->line_in_notify.work, pmf_handle_notify);
+       INIT_DELAYED_WORK(&rt->line_out_notify.work, pmf_handle_notify);
+       mutex_init(&rt->headphone_notify.mutex);
+       mutex_init(&rt->line_in_notify.mutex);
+       mutex_init(&rt->line_out_notify.mutex);
+}
+
+static void pmf_gpio_exit(struct gpio_runtime *rt)
+{
+       pmf_gpio_all_amps_off(rt);
+       rt->implementation_private = 0;
+
+       if (rt->headphone_notify.gpio_private)
+               pmf_unregister_irq_client(rt->headphone_notify.gpio_private);
+       if (rt->line_in_notify.gpio_private)
+               pmf_unregister_irq_client(rt->line_in_notify.gpio_private);
+       if (rt->line_out_notify.gpio_private)
+               pmf_unregister_irq_client(rt->line_out_notify.gpio_private);
+
+       /* make sure no work is pending before freeing
+        * all things */
+       cancel_delayed_work(&rt->headphone_notify.work);
+       cancel_delayed_work(&rt->line_in_notify.work);
+       cancel_delayed_work(&rt->line_out_notify.work);
+       flush_scheduled_work();
+
+       mutex_destroy(&rt->headphone_notify.mutex);
+       mutex_destroy(&rt->line_in_notify.mutex);
+       mutex_destroy(&rt->line_out_notify.mutex);
+
+       if (rt->headphone_notify.gpio_private)
+               kfree(rt->headphone_notify.gpio_private);
+       if (rt->line_in_notify.gpio_private)
+               kfree(rt->line_in_notify.gpio_private);
+       if (rt->line_out_notify.gpio_private)
+               kfree(rt->line_out_notify.gpio_private);
+}
+
+static void pmf_handle_notify_irq(void *data)
+{
+       struct gpio_notification *notif = data;
+
+       schedule_delayed_work(&notif->work, 0);
+}
+
+static int pmf_set_notify(struct gpio_runtime *rt,
+                         enum notify_type type,
+                         notify_func_t notify,
+                         void *data)
+{
+       struct gpio_notification *notif;
+       notify_func_t old;
+       struct pmf_irq_client *irq_client;
+       char *name;
+       int err = -EBUSY;
+
+       switch (type) {
+       case AOA_NOTIFY_HEADPHONE:
+               notif = &rt->headphone_notify;
+               name = "headphone-detect";
+               break;
+       case AOA_NOTIFY_LINE_IN:
+               notif = &rt->line_in_notify;
+               name = "linein-detect";
+               break;
+       case AOA_NOTIFY_LINE_OUT:
+               notif = &rt->line_out_notify;
+               name = "lineout-detect";
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       mutex_lock(&notif->mutex);
+
+       old = notif->notify;
+
+       if (!old && !notify) {
+               err = 0;
+               goto out_unlock;
+       }
+
+       if (old && notify) {
+               if (old == notify && notif->data == data)
+                       err = 0;
+               goto out_unlock;
+       }
+
+       if (old && !notify) {
+               irq_client = notif->gpio_private;
+               pmf_unregister_irq_client(irq_client);
+               kfree(irq_client);
+               notif->gpio_private = NULL;
+       }
+       if (!old && notify) {
+               irq_client = kzalloc(sizeof(struct pmf_irq_client),
+                                    GFP_KERNEL);
+               irq_client->data = notif;
+               irq_client->handler = pmf_handle_notify_irq;
+               irq_client->owner = THIS_MODULE;
+               err = pmf_register_irq_client(rt->node,
+                                             name,
+                                             irq_client);
+               if (err) {
+                       printk(KERN_ERR "snd-aoa: gpio layer failed to"
+                                       " register %s irq (%d)\n", name, err);
+                       kfree(irq_client);
+                       goto out_unlock;
+               }
+               notif->gpio_private = irq_client;
+       }
+       notif->notify = notify;
+       notif->data = data;
+
+       err = 0;
+ out_unlock:
+       mutex_unlock(&notif->mutex);
+       return err;
+}
+
+static int pmf_get_detect(struct gpio_runtime *rt,
+                         enum notify_type type)
+{
+       char *name;
+       int err = -EBUSY, ret;
+       struct pmf_args args = { .count = 1, .u[0].p = &ret };
+
+       switch (type) {
+       case AOA_NOTIFY_HEADPHONE:
+               name = "headphone-detect";
+               break;
+       case AOA_NOTIFY_LINE_IN:
+               name = "linein-detect";
+               break;
+       case AOA_NOTIFY_LINE_OUT:
+               name = "lineout-detect";
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       err = pmf_call_function(rt->node, name, &args);
+       if (err)
+               return err;
+       return ret;
+}
+
+static struct gpio_methods methods = {
+       .init                   = pmf_gpio_init,
+       .exit                   = pmf_gpio_exit,
+       .all_amps_off           = pmf_gpio_all_amps_off,
+       .all_amps_restore       = pmf_gpio_all_amps_restore,
+       .set_headphone          = pmf_gpio_set_headphone,
+       .set_speakers           = pmf_gpio_set_amp,
+       .set_lineout            = pmf_gpio_set_lineout,
+       .set_hw_reset           = pmf_gpio_set_hw_reset,
+       .get_headphone          = pmf_gpio_get_headphone,
+       .get_speakers           = pmf_gpio_get_amp,
+       .get_lineout            = pmf_gpio_get_lineout,
+       .set_notify             = pmf_set_notify,
+       .get_detect             = pmf_get_detect,
+};
+
+struct gpio_methods *pmf_gpio_methods = &methods;
+EXPORT_SYMBOL_GPL(pmf_gpio_methods);
diff --git a/sound/aoa/core/snd-aoa-alsa.c b/sound/aoa/core/snd-aoa-alsa.c
deleted file mode 100644 (file)
index 17fe689..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Apple Onboard Audio Alsa helpers
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-#include <linux/module.h>
-#include "snd-aoa-alsa.h"
-
-static int index = -1;
-module_param(index, int, 0444);
-MODULE_PARM_DESC(index, "index for AOA sound card.");
-
-static struct aoa_card *aoa_card;
-
-int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
-{
-       struct snd_card *alsa_card;
-       int err;
-
-       if (aoa_card)
-               /* cannot be EEXIST due to usage in aoa_fabric_register */
-               return -EBUSY;
-
-       alsa_card = snd_card_new(index, name, mod, sizeof(struct aoa_card));
-       if (!alsa_card)
-               return -ENOMEM;
-       aoa_card = alsa_card->private_data;
-       aoa_card->alsa_card = alsa_card;
-       alsa_card->dev = dev;
-       strlcpy(alsa_card->driver, "AppleOnbdAudio", sizeof(alsa_card->driver));
-       strlcpy(alsa_card->shortname, name, sizeof(alsa_card->shortname));
-       strlcpy(alsa_card->longname, name, sizeof(alsa_card->longname));
-       strlcpy(alsa_card->mixername, name, sizeof(alsa_card->mixername));
-       err = snd_card_register(aoa_card->alsa_card);
-       if (err < 0) {
-               printk(KERN_ERR "snd-aoa: couldn't register alsa card\n");
-               snd_card_free(aoa_card->alsa_card);
-               aoa_card = NULL;
-               return err;
-       }
-       return 0;
-}
-
-struct snd_card *aoa_get_card(void)
-{
-       if (aoa_card)
-               return aoa_card->alsa_card;
-       return NULL;
-}
-EXPORT_SYMBOL_GPL(aoa_get_card);
-
-void aoa_alsa_cleanup(void)
-{
-       if (aoa_card) {
-               snd_card_free(aoa_card->alsa_card);
-               aoa_card = NULL;
-       }
-}
-
-int aoa_snd_device_new(snd_device_type_t type,
-                      void * device_data, struct snd_device_ops * ops)
-{
-       struct snd_card *card = aoa_get_card();
-       int err;
-       
-       if (!card) return -ENOMEM;
-
-       err = snd_device_new(card, type, device_data, ops);
-       if (err) {
-               printk(KERN_ERR "snd-aoa: failed to create snd device (%d)\n", err);
-               return err;
-       }
-       err = snd_device_register(card, device_data);
-       if (err) {
-               printk(KERN_ERR "snd-aoa: failed to register "
-                               "snd device (%d)\n", err);
-               printk(KERN_ERR "snd-aoa: have you forgotten the "
-                               "dev_register callback?\n");
-               snd_device_free(card, device_data);
-       }
-       return err;
-}
-EXPORT_SYMBOL_GPL(aoa_snd_device_new);
-
-int aoa_snd_ctl_add(struct snd_kcontrol* control)
-{
-       int err;
-
-       if (!aoa_card) return -ENODEV;
-
-       err = snd_ctl_add(aoa_card->alsa_card, control);
-       if (err)
-               printk(KERN_ERR "snd-aoa: failed to add alsa control (%d)\n",
-                      err);
-       return err;
-}
-EXPORT_SYMBOL_GPL(aoa_snd_ctl_add);
diff --git a/sound/aoa/core/snd-aoa-alsa.h b/sound/aoa/core/snd-aoa-alsa.h
deleted file mode 100644 (file)
index 9669e44..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Apple Onboard Audio Alsa private helpers
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#ifndef __SND_AOA_ALSA_H
-#define __SND_AOA_ALSA_H
-#include "../aoa.h"
-
-extern int aoa_alsa_init(char *name, struct module *mod, struct device *dev);
-extern void aoa_alsa_cleanup(void);
-
-#endif /* __SND_AOA_ALSA_H */
diff --git a/sound/aoa/core/snd-aoa-core.c b/sound/aoa/core/snd-aoa-core.c
deleted file mode 100644 (file)
index 19fdae4..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Apple Onboard Audio driver core
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/list.h>
-#include "../aoa.h"
-#include "snd-aoa-alsa.h"
-
-MODULE_DESCRIPTION("Apple Onboard Audio Sound Driver");
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_LICENSE("GPL");
-
-/* We allow only one fabric. This simplifies things,
- * and more don't really make that much sense */
-static struct aoa_fabric *fabric;
-static LIST_HEAD(codec_list);
-
-static int attach_codec_to_fabric(struct aoa_codec *c)
-{
-       int err;
-
-       if (!try_module_get(c->owner))
-               return -EBUSY;
-       /* found_codec has to be assigned */
-       err = -ENOENT;
-       if (fabric->found_codec)
-               err = fabric->found_codec(c);
-       if (err) {
-               module_put(c->owner);
-               printk(KERN_ERR "snd-aoa: fabric didn't like codec %s\n",
-                               c->name);
-               return err;
-       }
-       c->fabric = fabric;
-
-       err = 0;
-       if (c->init)
-               err = c->init(c);
-       if (err) {
-               printk(KERN_ERR "snd-aoa: codec %s didn't init\n", c->name);
-               c->fabric = NULL;
-               if (fabric->remove_codec)
-                       fabric->remove_codec(c);
-               module_put(c->owner);
-               return err;
-       }
-       if (fabric->attached_codec)
-               fabric->attached_codec(c);
-       return 0;
-}
-
-int aoa_codec_register(struct aoa_codec *codec)
-{
-       int err = 0;
-
-       /* if there's a fabric already, we can tell if we
-        * will want to have this codec, so propagate error
-        * through. Otherwise, this will happen later... */
-       if (fabric)
-               err = attach_codec_to_fabric(codec);
-       if (!err)
-               list_add(&codec->list, &codec_list);
-       return err;
-}
-EXPORT_SYMBOL_GPL(aoa_codec_register);
-
-void aoa_codec_unregister(struct aoa_codec *codec)
-{
-       list_del(&codec->list);
-       if (codec->fabric && codec->exit)
-               codec->exit(codec);
-       if (fabric && fabric->remove_codec)
-               fabric->remove_codec(codec);
-       codec->fabric = NULL;
-       module_put(codec->owner);
-}
-EXPORT_SYMBOL_GPL(aoa_codec_unregister);
-
-int aoa_fabric_register(struct aoa_fabric *new_fabric, struct device *dev)
-{
-       struct aoa_codec *c;
-       int err;
-
-       /* allow querying for presence of fabric
-        * (i.e. do this test first!) */
-       if (new_fabric == fabric) {
-               err = -EALREADY;
-               goto attach;
-       }
-       if (fabric)
-               return -EEXIST;
-       if (!new_fabric)
-               return -EINVAL;
-
-       err = aoa_alsa_init(new_fabric->name, new_fabric->owner, dev);
-       if (err)
-               return err;
-
-       fabric = new_fabric;
-
- attach:
-       list_for_each_entry(c, &codec_list, list) {
-               if (c->fabric != fabric)
-                       attach_codec_to_fabric(c);
-       }
-       return err;
-}
-EXPORT_SYMBOL_GPL(aoa_fabric_register);
-
-void aoa_fabric_unregister(struct aoa_fabric *old_fabric)
-{
-       struct aoa_codec *c;
-
-       if (fabric != old_fabric)
-               return;
-
-       list_for_each_entry(c, &codec_list, list) {
-               if (c->fabric)
-                       aoa_fabric_unlink_codec(c);
-       }
-
-       aoa_alsa_cleanup();
-
-       fabric = NULL;
-}
-EXPORT_SYMBOL_GPL(aoa_fabric_unregister);
-
-void aoa_fabric_unlink_codec(struct aoa_codec *codec)
-{
-       if (!codec->fabric) {
-               printk(KERN_ERR "snd-aoa: fabric unassigned "
-                               "in aoa_fabric_unlink_codec\n");
-               dump_stack();
-               return;
-       }
-       if (codec->exit)
-               codec->exit(codec);
-       if (codec->fabric->remove_codec)
-               codec->fabric->remove_codec(codec);
-       codec->fabric = NULL;
-       module_put(codec->owner);
-}
-EXPORT_SYMBOL_GPL(aoa_fabric_unlink_codec);
-
-static int __init aoa_init(void)
-{
-       return 0;
-}
-
-static void __exit aoa_exit(void)
-{
-       aoa_alsa_cleanup();
-}
-
-module_init(aoa_init);
-module_exit(aoa_exit);
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
deleted file mode 100644 (file)
index 805dcbf..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Apple Onboard Audio feature call GPIO control
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- *
- * This file contains the GPIO control routines for 
- * direct (through feature calls) access to the GPIO
- * registers.
- */
-
-#include <asm/pmac_feature.h>
-#include <linux/interrupt.h>
-#include "../aoa.h"
-
-/* TODO: these are 20 global variables
- * that aren't used on most machines...
- * Move them into a dynamically allocated
- * structure and use that.
- */
-
-/* these are the GPIO numbers (register addresses as offsets into
- * the GPIO space) */
-static int headphone_mute_gpio;
-static int amp_mute_gpio;
-static int lineout_mute_gpio;
-static int hw_reset_gpio;
-static int lineout_detect_gpio;
-static int headphone_detect_gpio;
-static int linein_detect_gpio;
-
-/* see the SWITCH_GPIO macro */
-static int headphone_mute_gpio_activestate;
-static int amp_mute_gpio_activestate;
-static int lineout_mute_gpio_activestate;
-static int hw_reset_gpio_activestate;
-static int lineout_detect_gpio_activestate;
-static int headphone_detect_gpio_activestate;
-static int linein_detect_gpio_activestate;
-
-/* node pointers that we save when getting the GPIO number
- * to get the interrupt later */
-static struct device_node *lineout_detect_node;
-static struct device_node *linein_detect_node;
-static struct device_node *headphone_detect_node;
-
-static int lineout_detect_irq;
-static int linein_detect_irq;
-static int headphone_detect_irq;
-
-static struct device_node *get_gpio(char *name,
-                                   char *altname,
-                                   int *gpioptr,
-                                   int *gpioactiveptr)
-{
-       struct device_node *np, *gpio;
-       const u32 *reg;
-       const char *audio_gpio;
-
-       *gpioptr = -1;
-
-       /* check if we can get it the easy way ... */
-       np = of_find_node_by_name(NULL, name);
-       if (!np) {
-               /* some machines have only gpioX/extint-gpioX nodes,
-                * and an audio-gpio property saying what it is ...
-                * So what we have to do is enumerate all children
-                * of the gpio node and check them all. */
-               gpio = of_find_node_by_name(NULL, "gpio");
-               if (!gpio)
-                       return NULL;
-               while ((np = of_get_next_child(gpio, np))) {
-                       audio_gpio = of_get_property(np, "audio-gpio", NULL);
-                       if (!audio_gpio)
-                               continue;
-                       if (strcmp(audio_gpio, name) == 0)
-                               break;
-                       if (altname && (strcmp(audio_gpio, altname) == 0))
-                               break;
-               }
-               /* still not found, assume not there */
-               if (!np)
-                       return NULL;
-       }
-
-       reg = of_get_property(np, "reg", NULL);
-       if (!reg)
-               return NULL;
-
-       *gpioptr = *reg;
-
-       /* this is a hack, usually the GPIOs 'reg' property
-        * should have the offset based from the GPIO space
-        * which is at 0x50, but apparently not always... */
-       if (*gpioptr < 0x50)
-               *gpioptr += 0x50;
-
-       reg = of_get_property(np, "audio-gpio-active-state", NULL);
-       if (!reg)
-               /* Apple seems to default to 1, but
-                * that doesn't seem right at least on most
-                * machines. So until proven that the opposite
-                * is necessary, we default to 0
-                * (which, incidentally, snd-powermac also does...) */
-               *gpioactiveptr = 0;
-       else
-               *gpioactiveptr = *reg;
-
-       return np;
-}
-
-static void get_irq(struct device_node * np, int *irqptr)
-{
-       if (np)
-               *irqptr = irq_of_parse_and_map(np, 0);
-       else
-               *irqptr = NO_IRQ;
-}
-
-/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
-#define SWITCH_GPIO(name, v, on)                               \
-       (((v)&~1) | ((on)?                                      \
-                       (name##_gpio_activestate==0?4:5):       \
-                       (name##_gpio_activestate==0?5:4)))
-
-#define FTR_GPIO(name, bit)                                    \
-static void ftr_gpio_set_##name(struct gpio_runtime *rt, int on)\
-{                                                              \
-       int v;                                                  \
-                                                               \
-       if (unlikely(!rt)) return;                              \
-                                                               \
-       if (name##_mute_gpio < 0)                               \
-               return;                                         \
-                                                               \
-       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL,         \
-                             name##_mute_gpio,                 \
-                             0);                               \
-                                                               \
-       /* muted = !on... */                                    \
-       v = SWITCH_GPIO(name##_mute, v, !on);                   \
-                                                               \
-       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL,            \
-                         name##_mute_gpio, v);                 \
-                                                               \
-       rt->implementation_private &= ~(1<<bit);                \
-       rt->implementation_private |= (!!on << bit);            \
-}                                                              \
-static int ftr_gpio_get_##name(struct gpio_runtime *rt)                \
-{                                                              \
-       if (unlikely(!rt)) return 0;                            \
-       return (rt->implementation_private>>bit)&1;             \
-}
-
-FTR_GPIO(headphone, 0);
-FTR_GPIO(amp, 1);
-FTR_GPIO(lineout, 2);
-
-static void ftr_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
-{
-       int v;
-
-       if (unlikely(!rt)) return;
-       if (hw_reset_gpio < 0)
-               return;
-
-       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL,
-                             hw_reset_gpio, 0);
-       v = SWITCH_GPIO(hw_reset, v, on);
-       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL,
-                         hw_reset_gpio, v);
-}
-
-static void ftr_gpio_all_amps_off(struct gpio_runtime *rt)
-{
-       int saved;
-
-       if (unlikely(!rt)) return;
-       saved = rt->implementation_private;
-       ftr_gpio_set_headphone(rt, 0);
-       ftr_gpio_set_amp(rt, 0);
-       ftr_gpio_set_lineout(rt, 0);
-       rt->implementation_private = saved;
-}
-
-static void ftr_gpio_all_amps_restore(struct gpio_runtime *rt)
-{
-       int s;
-
-       if (unlikely(!rt)) return;
-       s = rt->implementation_private;
-       ftr_gpio_set_headphone(rt, (s>>0)&1);
-       ftr_gpio_set_amp(rt, (s>>1)&1);
-       ftr_gpio_set_lineout(rt, (s>>2)&1);
-}
-
-static void ftr_handle_notify(struct work_struct *work)
-{
-       struct gpio_notification *notif =
-               container_of(work, struct gpio_notification, work.work);
-
-       mutex_lock(&notif->mutex);
-       if (notif->notify)
-               notif->notify(notif->data);
-       mutex_unlock(&notif->mutex);
-}
-
-static void gpio_enable_dual_edge(int gpio)
-{
-       int v;
-
-       if (gpio == -1)
-               return;
-       v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio, 0);
-       v |= 0x80; /* enable dual edge */
-       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio, v);
-}
-
-static void ftr_gpio_init(struct gpio_runtime *rt)
-{
-       get_gpio("headphone-mute", NULL,
-                &headphone_mute_gpio,
-                &headphone_mute_gpio_activestate);
-       get_gpio("amp-mute", NULL,
-                &amp_mute_gpio,
-                &amp_mute_gpio_activestate);
-       get_gpio("lineout-mute", NULL,
-                &lineout_mute_gpio,
-                &lineout_mute_gpio_activestate);
-       get_gpio("hw-reset", "audio-hw-reset",
-                &hw_reset_gpio,
-                &hw_reset_gpio_activestate);
-
-       headphone_detect_node = get_gpio("headphone-detect", NULL,
-                                        &headphone_detect_gpio,
-                                        &headphone_detect_gpio_activestate);
-       /* go Apple, and thanks for giving these different names
-        * across the board... */
-       lineout_detect_node = get_gpio("lineout-detect", "line-output-detect",
-                                      &lineout_detect_gpio,
-                                      &lineout_detect_gpio_activestate);
-       linein_detect_node = get_gpio("linein-detect", "line-input-detect",
-                                     &linein_detect_gpio,
-                                     &linein_detect_gpio_activestate);
-
-       gpio_enable_dual_edge(headphone_detect_gpio);
-       gpio_enable_dual_edge(lineout_detect_gpio);
-       gpio_enable_dual_edge(linein_detect_gpio);
-
-       get_irq(headphone_detect_node, &headphone_detect_irq);
-       get_irq(lineout_detect_node, &lineout_detect_irq);
-       get_irq(linein_detect_node, &linein_detect_irq);
-
-       ftr_gpio_all_amps_off(rt);
-       rt->implementation_private = 0;
-       INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify);
-       INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify);
-       INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify);
-       mutex_init(&rt->headphone_notify.mutex);
-       mutex_init(&rt->line_in_notify.mutex);
-       mutex_init(&rt->line_out_notify.mutex);
-}
-
-static void ftr_gpio_exit(struct gpio_runtime *rt)
-{
-       ftr_gpio_all_amps_off(rt);
-       rt->implementation_private = 0;
-       if (rt->headphone_notify.notify)
-               free_irq(headphone_detect_irq, &rt->headphone_notify);
-       if (rt->line_in_notify.gpio_private)
-               free_irq(linein_detect_irq, &rt->line_in_notify);
-       if (rt->line_out_notify.gpio_private)
-               free_irq(lineout_detect_irq, &rt->line_out_notify);
-       cancel_delayed_work(&rt->headphone_notify.work);
-       cancel_delayed_work(&rt->line_in_notify.work);
-       cancel_delayed_work(&rt->line_out_notify.work);
-       flush_scheduled_work();
-       mutex_destroy(&rt->headphone_notify.mutex);
-       mutex_destroy(&rt->line_in_notify.mutex);
-       mutex_destroy(&rt->line_out_notify.mutex);
-}
-
-static irqreturn_t ftr_handle_notify_irq(int xx, void *data)
-{
-       struct gpio_notification *notif = data;
-
-       schedule_delayed_work(&notif->work, 0);
-
-       return IRQ_HANDLED;
-}
-
-static int ftr_set_notify(struct gpio_runtime *rt,
-                         enum notify_type type,
-                         notify_func_t notify,
-                         void *data)
-{
-       struct gpio_notification *notif;
-       notify_func_t old;
-       int irq;
-       char *name;
-       int err = -EBUSY;
-
-       switch (type) {
-       case AOA_NOTIFY_HEADPHONE:
-               notif = &rt->headphone_notify;
-               name = "headphone-detect";
-               irq = headphone_detect_irq;
-               break;
-       case AOA_NOTIFY_LINE_IN:
-               notif = &rt->line_in_notify;
-               name = "linein-detect";
-               irq = linein_detect_irq;
-               break;
-       case AOA_NOTIFY_LINE_OUT:
-               notif = &rt->line_out_notify;
-               name = "lineout-detect";
-               irq = lineout_detect_irq;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       if (irq == NO_IRQ)
-               return -ENODEV;
-
-       mutex_lock(&notif->mutex);
-
-       old = notif->notify;
-
-       if (!old && !notify) {
-               err = 0;
-               goto out_unlock;
-       }
-
-       if (old && notify) {
-               if (old == notify && notif->data == data)
-                       err = 0;
-               goto out_unlock;
-       }
-
-       if (old && !notify)
-               free_irq(irq, notif);
-
-       if (!old && notify) {
-               err = request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
-               if (err)
-                       goto out_unlock;
-       }
-
-       notif->notify = notify;
-       notif->data = data;
-
-       err = 0;
- out_unlock:
-       mutex_unlock(&notif->mutex);
-       return err;
-}
-
-static int ftr_get_detect(struct gpio_runtime *rt,
-                         enum notify_type type)
-{
-       int gpio, ret, active;
-
-       switch (type) {
-       case AOA_NOTIFY_HEADPHONE:
-               gpio = headphone_detect_gpio;
-               active = headphone_detect_gpio_activestate;
-               break;
-       case AOA_NOTIFY_LINE_IN:
-               gpio = linein_detect_gpio;
-               active = linein_detect_gpio_activestate;
-               break;
-       case AOA_NOTIFY_LINE_OUT:
-               gpio = lineout_detect_gpio;
-               active = lineout_detect_gpio_activestate;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       if (gpio == -1)
-               return -ENODEV;
-
-       ret = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio, 0);
-       if (ret < 0)
-               return ret;
-       return ((ret >> 1) & 1) == active;
-}
-
-static struct gpio_methods methods = {
-       .init                   = ftr_gpio_init,
-       .exit                   = ftr_gpio_exit,
-       .all_amps_off           = ftr_gpio_all_amps_off,
-       .all_amps_restore       = ftr_gpio_all_amps_restore,
-       .set_headphone          = ftr_gpio_set_headphone,
-       .set_speakers           = ftr_gpio_set_amp,
-       .set_lineout            = ftr_gpio_set_lineout,
-       .set_hw_reset           = ftr_gpio_set_hw_reset,
-       .get_headphone          = ftr_gpio_get_headphone,
-       .get_speakers           = ftr_gpio_get_amp,
-       .get_lineout            = ftr_gpio_get_lineout,
-       .set_notify             = ftr_set_notify,
-       .get_detect             = ftr_get_detect,
-};
-
-struct gpio_methods *ftr_gpio_methods = &methods;
-EXPORT_SYMBOL_GPL(ftr_gpio_methods);
diff --git a/sound/aoa/core/snd-aoa-gpio-pmf.c b/sound/aoa/core/snd-aoa-gpio-pmf.c
deleted file mode 100644 (file)
index 5ca2220..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Apple Onboard Audio pmf GPIOs
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#include <asm/pmac_feature.h>
-#include <asm/pmac_pfunc.h>
-#include "../aoa.h"
-
-#define PMF_GPIO(name, bit)                                    \
-static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
-{                                                              \
-       struct pmf_args args = { .count = 1, .u[0].v = !on };   \
-       int rc;                                                 \
-                                                       \
-       if (unlikely(!rt)) return;                              \
-       rc = pmf_call_function(rt->node, #name "-mute", &args); \
-       if (rc && rc != -ENODEV)                                \
-               printk(KERN_WARNING "pmf_gpio_set_" #name       \
-               " failed, rc: %d\n", rc);                       \
-       rt->implementation_private &= ~(1<<bit);                \
-       rt->implementation_private |= (!!on << bit);            \
-}                                                              \
-static int pmf_gpio_get_##name(struct gpio_runtime *rt)                \
-{                                                              \
-       if (unlikely(!rt)) return 0;                            \
-       return (rt->implementation_private>>bit)&1;             \
-}
-
-PMF_GPIO(headphone, 0);
-PMF_GPIO(amp, 1);
-PMF_GPIO(lineout, 2);
-
-static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
-{
-       struct pmf_args args = { .count = 1, .u[0].v = !!on };
-       int rc;
-
-       if (unlikely(!rt)) return;
-       rc = pmf_call_function(rt->node, "hw-reset", &args);
-       if (rc)
-               printk(KERN_WARNING "pmf_gpio_set_hw_reset"
-                      " failed, rc: %d\n", rc);
-}
-
-static void pmf_gpio_all_amps_off(struct gpio_runtime *rt)
-{
-       int saved;
-
-       if (unlikely(!rt)) return;
-       saved = rt->implementation_private;
-       pmf_gpio_set_headphone(rt, 0);
-       pmf_gpio_set_amp(rt, 0);
-       pmf_gpio_set_lineout(rt, 0);
-       rt->implementation_private = saved;
-}
-
-static void pmf_gpio_all_amps_restore(struct gpio_runtime *rt)
-{
-       int s;
-
-       if (unlikely(!rt)) return;
-       s = rt->implementation_private;
-       pmf_gpio_set_headphone(rt, (s>>0)&1);
-       pmf_gpio_set_amp(rt, (s>>1)&1);
-       pmf_gpio_set_lineout(rt, (s>>2)&1);
-}
-
-static void pmf_handle_notify(struct work_struct *work)
-{
-       struct gpio_notification *notif =
-               container_of(work, struct gpio_notification, work.work);
-
-       mutex_lock(&notif->mutex);
-       if (notif->notify)
-               notif->notify(notif->data);
-       mutex_unlock(&notif->mutex);
-}
-
-static void pmf_gpio_init(struct gpio_runtime *rt)
-{
-       pmf_gpio_all_amps_off(rt);
-       rt->implementation_private = 0;
-       INIT_DELAYED_WORK(&rt->headphone_notify.work, pmf_handle_notify);
-       INIT_DELAYED_WORK(&rt->line_in_notify.work, pmf_handle_notify);
-       INIT_DELAYED_WORK(&rt->line_out_notify.work, pmf_handle_notify);
-       mutex_init(&rt->headphone_notify.mutex);
-       mutex_init(&rt->line_in_notify.mutex);
-       mutex_init(&rt->line_out_notify.mutex);
-}
-
-static void pmf_gpio_exit(struct gpio_runtime *rt)
-{
-       pmf_gpio_all_amps_off(rt);
-       rt->implementation_private = 0;
-
-       if (rt->headphone_notify.gpio_private)
-               pmf_unregister_irq_client(rt->headphone_notify.gpio_private);
-       if (rt->line_in_notify.gpio_private)
-               pmf_unregister_irq_client(rt->line_in_notify.gpio_private);
-       if (rt->line_out_notify.gpio_private)
-               pmf_unregister_irq_client(rt->line_out_notify.gpio_private);
-
-       /* make sure no work is pending before freeing
-        * all things */
-       cancel_delayed_work(&rt->headphone_notify.work);
-       cancel_delayed_work(&rt->line_in_notify.work);
-       cancel_delayed_work(&rt->line_out_notify.work);
-       flush_scheduled_work();
-
-       mutex_destroy(&rt->headphone_notify.mutex);
-       mutex_destroy(&rt->line_in_notify.mutex);
-       mutex_destroy(&rt->line_out_notify.mutex);
-
-       if (rt->headphone_notify.gpio_private)
-               kfree(rt->headphone_notify.gpio_private);
-       if (rt->line_in_notify.gpio_private)
-               kfree(rt->line_in_notify.gpio_private);
-       if (rt->line_out_notify.gpio_private)
-               kfree(rt->line_out_notify.gpio_private);
-}
-
-static void pmf_handle_notify_irq(void *data)
-{
-       struct gpio_notification *notif = data;
-
-       schedule_delayed_work(&notif->work, 0);
-}
-
-static int pmf_set_notify(struct gpio_runtime *rt,
-                         enum notify_type type,
-                         notify_func_t notify,
-                         void *data)
-{
-       struct gpio_notification *notif;
-       notify_func_t old;
-       struct pmf_irq_client *irq_client;
-       char *name;
-       int err = -EBUSY;
-
-       switch (type) {
-       case AOA_NOTIFY_HEADPHONE:
-               notif = &rt->headphone_notify;
-               name = "headphone-detect";
-               break;
-       case AOA_NOTIFY_LINE_IN:
-               notif = &rt->line_in_notify;
-               name = "linein-detect";
-               break;
-       case AOA_NOTIFY_LINE_OUT:
-               notif = &rt->line_out_notify;
-               name = "lineout-detect";
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       mutex_lock(&notif->mutex);
-
-       old = notif->notify;
-
-       if (!old && !notify) {
-               err = 0;
-               goto out_unlock;
-       }
-
-       if (old && notify) {
-               if (old == notify && notif->data == data)
-                       err = 0;
-               goto out_unlock;
-       }
-
-       if (old && !notify) {
-               irq_client = notif->gpio_private;
-               pmf_unregister_irq_client(irq_client);
-               kfree(irq_client);
-               notif->gpio_private = NULL;
-       }
-       if (!old && notify) {
-               irq_client = kzalloc(sizeof(struct pmf_irq_client),
-                                    GFP_KERNEL);
-               irq_client->data = notif;
-               irq_client->handler = pmf_handle_notify_irq;
-               irq_client->owner = THIS_MODULE;
-               err = pmf_register_irq_client(rt->node,
-                                             name,
-                                             irq_client);
-               if (err) {
-                       printk(KERN_ERR "snd-aoa: gpio layer failed to"
-                                       " register %s irq (%d)\n", name, err);
-                       kfree(irq_client);
-                       goto out_unlock;
-               }
-               notif->gpio_private = irq_client;
-       }
-       notif->notify = notify;
-       notif->data = data;
-
-       err = 0;
- out_unlock:
-       mutex_unlock(&notif->mutex);
-       return err;
-}
-
-static int pmf_get_detect(struct gpio_runtime *rt,
-                         enum notify_type type)
-{
-       char *name;
-       int err = -EBUSY, ret;
-       struct pmf_args args = { .count = 1, .u[0].p = &ret };
-
-       switch (type) {
-       case AOA_NOTIFY_HEADPHONE:
-               name = "headphone-detect";
-               break;
-       case AOA_NOTIFY_LINE_IN:
-               name = "linein-detect";
-               break;
-       case AOA_NOTIFY_LINE_OUT:
-               name = "lineout-detect";
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       err = pmf_call_function(rt->node, name, &args);
-       if (err)
-               return err;
-       return ret;
-}
-
-static struct gpio_methods methods = {
-       .init                   = pmf_gpio_init,
-       .exit                   = pmf_gpio_exit,
-       .all_amps_off           = pmf_gpio_all_amps_off,
-       .all_amps_restore       = pmf_gpio_all_amps_restore,
-       .set_headphone          = pmf_gpio_set_headphone,
-       .set_speakers           = pmf_gpio_set_amp,
-       .set_lineout            = pmf_gpio_set_lineout,
-       .set_hw_reset           = pmf_gpio_set_hw_reset,
-       .get_headphone          = pmf_gpio_get_headphone,
-       .get_speakers           = pmf_gpio_get_amp,
-       .get_lineout            = pmf_gpio_get_lineout,
-       .set_notify             = pmf_set_notify,
-       .get_detect             = pmf_get_detect,
-};
-
-struct gpio_methods *pmf_gpio_methods = &methods;
-EXPORT_SYMBOL_GPL(pmf_gpio_methods);
index 55fc5e7e52cfa0da563e1987c38494c35d63402c..da37c10eca51087bac1d08e5984f13720f29bd25 100644 (file)
@@ -1 +1,3 @@
+snd-aoa-fabric-layout-objs += layout.o
+
 obj-$(CONFIG_SND_AOA_FABRIC_LAYOUT) += snd-aoa-fabric-layout.o
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
new file mode 100644 (file)
index 0000000..ad60f5d
--- /dev/null
@@ -0,0 +1,1120 @@
+/*
+ * Apple Onboard Audio driver -- layout fabric
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ *
+ * This fabric module looks for sound codecs
+ * based on the layout-id property in the device tree.
+ *
+ */
+
+#include <asm/prom.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include "../aoa.h"
+#include "../soundbus/soundbus.h"
+
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Layout-ID fabric for snd-aoa");
+
+#define MAX_CODECS_PER_BUS     2
+
+/* These are the connections the layout fabric
+ * knows about. It doesn't really care about the
+ * input ones, but I thought I'd separate them
+ * to give them proper names. The thing is that
+ * Apple usually will distinguish the active output
+ * by GPIOs, while the active input is set directly
+ * on the codec. Hence we here tell the codec what
+ * we think is connected. This information is hard-
+ * coded below ... */
+#define CC_SPEAKERS    (1<<0)
+#define CC_HEADPHONE   (1<<1)
+#define CC_LINEOUT     (1<<2)
+#define CC_DIGITALOUT  (1<<3)
+#define CC_LINEIN      (1<<4)
+#define CC_MICROPHONE  (1<<5)
+#define CC_DIGITALIN   (1<<6)
+/* pretty bogus but users complain...
+ * This is a flag saying that the LINEOUT
+ * should be renamed to HEADPHONE.
+ * be careful with input detection! */
+#define CC_LINEOUT_LABELLED_HEADPHONE  (1<<7)
+
+struct codec_connection {
+       /* CC_ flags from above */
+       int connected;
+       /* codec dependent bit to be set in the aoa_codec.connected field.
+        * This intentionally doesn't have any generic flags because the
+        * fabric has to know the codec anyway and all codecs might have
+        * different connectors */
+       int codec_bit;
+};
+
+struct codec_connect_info {
+       char *name;
+       struct codec_connection *connections;
+};
+
+#define LAYOUT_FLAG_COMBO_LINEOUT_SPDIF        (1<<0)
+
+struct layout {
+       unsigned int layout_id;
+       struct codec_connect_info codecs[MAX_CODECS_PER_BUS];
+       int flags;
+
+       /* if busname is not assigned, we use 'Master' below,
+        * so that our layout table doesn't need to be filled
+        * too much.
+        * We only assign these two if we expect to find more
+        * than one soundbus, i.e. on those machines with
+        * multiple layout-ids */
+       char *busname;
+       int pcmid;
+};
+
+MODULE_ALIAS("sound-layout-36");
+MODULE_ALIAS("sound-layout-41");
+MODULE_ALIAS("sound-layout-45");
+MODULE_ALIAS("sound-layout-47");
+MODULE_ALIAS("sound-layout-48");
+MODULE_ALIAS("sound-layout-49");
+MODULE_ALIAS("sound-layout-50");
+MODULE_ALIAS("sound-layout-51");
+MODULE_ALIAS("sound-layout-56");
+MODULE_ALIAS("sound-layout-57");
+MODULE_ALIAS("sound-layout-58");
+MODULE_ALIAS("sound-layout-60");
+MODULE_ALIAS("sound-layout-61");
+MODULE_ALIAS("sound-layout-62");
+MODULE_ALIAS("sound-layout-64");
+MODULE_ALIAS("sound-layout-65");
+MODULE_ALIAS("sound-layout-66");
+MODULE_ALIAS("sound-layout-67");
+MODULE_ALIAS("sound-layout-68");
+MODULE_ALIAS("sound-layout-69");
+MODULE_ALIAS("sound-layout-70");
+MODULE_ALIAS("sound-layout-72");
+MODULE_ALIAS("sound-layout-76");
+MODULE_ALIAS("sound-layout-80");
+MODULE_ALIAS("sound-layout-82");
+MODULE_ALIAS("sound-layout-84");
+MODULE_ALIAS("sound-layout-86");
+MODULE_ALIAS("sound-layout-90");
+MODULE_ALIAS("sound-layout-92");
+MODULE_ALIAS("sound-layout-94");
+MODULE_ALIAS("sound-layout-96");
+MODULE_ALIAS("sound-layout-98");
+MODULE_ALIAS("sound-layout-100");
+
+/* onyx with all but microphone connected */
+static struct codec_connection onyx_connections_nomic[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_DIGITALOUT,
+               .codec_bit = 1,
+       },
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* onyx on machines without headphone */
+static struct codec_connection onyx_connections_noheadphones[] = {
+       {
+               .connected = CC_SPEAKERS | CC_LINEOUT |
+                            CC_LINEOUT_LABELLED_HEADPHONE,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_DIGITALOUT,
+               .codec_bit = 1,
+       },
+       /* FIXME: are these correct? probably not for all the machines
+        * below ... If not this will need separating. */
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {
+               .connected = CC_MICROPHONE,
+               .codec_bit = 3,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* onyx on machines with real line-out */
+static struct codec_connection onyx_connections_reallineout[] = {
+       {
+               .connected = CC_SPEAKERS | CC_LINEOUT | CC_HEADPHONE,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_DIGITALOUT,
+               .codec_bit = 1,
+       },
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* tas on machines without line out */
+static struct codec_connection tas_connections_nolineout[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {
+               .connected = CC_MICROPHONE,
+               .codec_bit = 3,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* tas on machines with neither line out nor line in */
+static struct codec_connection tas_connections_noline[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_MICROPHONE,
+               .codec_bit = 3,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* tas on machines without microphone */
+static struct codec_connection tas_connections_nomic[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+/* tas on machines with everything connected */
+static struct codec_connection tas_connections_all[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_LINEIN,
+               .codec_bit = 2,
+       },
+       {
+               .connected = CC_MICROPHONE,
+               .codec_bit = 3,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+static struct codec_connection toonie_connections[] = {
+       {
+               .connected = CC_SPEAKERS | CC_HEADPHONE,
+               .codec_bit = 0,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+static struct codec_connection topaz_input[] = {
+       {
+               .connected = CC_DIGITALIN,
+               .codec_bit = 0,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+static struct codec_connection topaz_output[] = {
+       {
+               .connected = CC_DIGITALOUT,
+               .codec_bit = 1,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+static struct codec_connection topaz_inout[] = {
+       {
+               .connected = CC_DIGITALIN,
+               .codec_bit = 0,
+       },
+       {
+               .connected = CC_DIGITALOUT,
+               .codec_bit = 1,
+       },
+       {} /* terminate array by .connected == 0 */
+};
+
+static struct layout layouts[] = {
+       /* last PowerBooks (15" Oct 2005) */
+       { .layout_id = 82,
+         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* PowerMac9,1 */
+       { .layout_id = 60,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_reallineout,
+         },
+       },
+       /* PowerMac9,1 */
+       { .layout_id = 61,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* PowerBook5,7 */
+       { .layout_id = 64,
+         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       /* PowerBook5,7 */
+       { .layout_id = 65,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* PowerBook5,9 [17" Oct 2005] */
+       { .layout_id = 84,
+         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* PowerMac8,1 */
+       { .layout_id = 45,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* Quad PowerMac (analog in, analog/digital out) */
+       { .layout_id = 68,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_nomic,
+         },
+       },
+       /* Quad PowerMac (digital in) */
+       { .layout_id = 69,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+         .busname = "digital in", .pcmid = 1 },
+       /* Early 2005 PowerBook (PowerBook 5,6) */
+       { .layout_id = 70,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nolineout,
+         },
+       },
+       /* PowerBook 5,4 */
+       { .layout_id = 51,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nolineout,
+         },
+       },
+       /* PowerBook6,7 */
+       { .layout_id = 80,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_noline,
+         },
+       },
+       /* PowerBook6,8 */
+       { .layout_id = 72,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nolineout,
+         },
+       },
+       /* PowerMac8,2 */
+       { .layout_id = 86,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_nomic,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       /* PowerBook6,7 */
+       { .layout_id = 92,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nolineout,
+         },
+       },
+       /* PowerMac10,1 (Mac Mini) */
+       { .layout_id = 58,
+         .codecs[0] = {
+               .name = "toonie",
+               .connections = toonie_connections,
+         },
+       },
+       {
+         .layout_id = 96,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       /* unknown, untested, but this comes from Apple */
+       { .layout_id = 41,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_all,
+         },
+       },
+       { .layout_id = 36,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nomic,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_inout,
+         },
+       },
+       { .layout_id = 47,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       { .layout_id = 48,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       { .layout_id = 49,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_nomic,
+         },
+       },
+       { .layout_id = 50,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       { .layout_id = 56,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       { .layout_id = 57,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       { .layout_id = 62,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_output,
+         },
+       },
+       { .layout_id = 66,
+         .codecs[0] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       { .layout_id = 67,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+       },
+       { .layout_id = 76,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_nomic,
+         },
+         .codecs[1] = {
+               .name = "topaz",
+               .connections = topaz_inout,
+         },
+       },
+       { .layout_id = 90,
+         .codecs[0] = {
+               .name = "tas",
+               .connections = tas_connections_noline,
+         },
+       },
+       { .layout_id = 94,
+         .codecs[0] = {
+               .name = "onyx",
+               /* but it has an external mic?? how to select? */
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       { .layout_id = 98,
+         .codecs[0] = {
+               .name = "toonie",
+               .connections = toonie_connections,
+         },
+       },
+       { .layout_id = 100,
+         .codecs[0] = {
+               .name = "topaz",
+               .connections = topaz_input,
+         },
+         .codecs[1] = {
+               .name = "onyx",
+               .connections = onyx_connections_noheadphones,
+         },
+       },
+       {}
+};
+
+static struct layout *find_layout_by_id(unsigned int id)
+{
+       struct layout *l;
+
+       l = layouts;
+       while (l->layout_id) {
+               if (l->layout_id == id)
+                       return l;
+               l++;
+       }
+       return NULL;
+}
+
+static void use_layout(struct layout *l)
+{
+       int i;
+
+       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
+               if (l->codecs[i].name) {
+                       request_module("snd-aoa-codec-%s", l->codecs[i].name);
+               }
+       }
+       /* now we wait for the codecs to call us back */
+}
+
+struct layout_dev;
+
+struct layout_dev_ptr {
+       struct layout_dev *ptr;
+};
+
+struct layout_dev {
+       struct list_head list;
+       struct soundbus_dev *sdev;
+       struct device_node *sound;
+       struct aoa_codec *codecs[MAX_CODECS_PER_BUS];
+       struct layout *layout;
+       struct gpio_runtime gpio;
+
+       /* we need these for headphone/lineout detection */
+       struct snd_kcontrol *headphone_ctrl;
+       struct snd_kcontrol *lineout_ctrl;
+       struct snd_kcontrol *speaker_ctrl;
+       struct snd_kcontrol *headphone_detected_ctrl;
+       struct snd_kcontrol *lineout_detected_ctrl;
+
+       struct layout_dev_ptr selfptr_headphone;
+       struct layout_dev_ptr selfptr_lineout;
+
+       u32 have_lineout_detect:1,
+           have_headphone_detect:1,
+           switch_on_headphone:1,
+           switch_on_lineout:1;
+};
+
+static LIST_HEAD(layouts_list);
+static int layouts_list_items;
+/* this can go away but only if we allow multiple cards,
+ * make the fabric handle all the card stuff, etc... */
+static struct layout_dev *layout_device;
+
+#define control_info   snd_ctl_boolean_mono_info
+
+#define AMP_CONTROL(n, description)                                    \
+static int n##_control_get(struct snd_kcontrol *kcontrol,              \
+                          struct snd_ctl_elem_value *ucontrol)         \
+{                                                                      \
+       struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);        \
+       if (gpio->methods && gpio->methods->get_##n)                    \
+               ucontrol->value.integer.value[0] =                      \
+                       gpio->methods->get_##n(gpio);                   \
+       return 0;                                                       \
+}                                                                      \
+static int n##_control_put(struct snd_kcontrol *kcontrol,              \
+                          struct snd_ctl_elem_value *ucontrol)         \
+{                                                                      \
+       struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);        \
+       if (gpio->methods && gpio->methods->get_##n)                    \
+               gpio->methods->set_##n(gpio,                            \
+                       !!ucontrol->value.integer.value[0]);            \
+       return 1;                                                       \
+}                                                                      \
+static struct snd_kcontrol_new n##_ctl = {                             \
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,                            \
+       .name = description,                                            \
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,                      \
+       .info = control_info,                                           \
+       .get = n##_control_get,                                         \
+       .put = n##_control_put,                                         \
+}
+
+AMP_CONTROL(headphone, "Headphone Switch");
+AMP_CONTROL(speakers, "Speakers Switch");
+AMP_CONTROL(lineout, "Line-Out Switch");
+
+static int detect_choice_get(struct snd_kcontrol *kcontrol,
+                            struct snd_ctl_elem_value *ucontrol)
+{
+       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
+
+       switch (kcontrol->private_value) {
+       case 0:
+               ucontrol->value.integer.value[0] = ldev->switch_on_headphone;
+               break;
+       case 1:
+               ucontrol->value.integer.value[0] = ldev->switch_on_lineout;
+               break;
+       default:
+               return -ENODEV;
+       }
+       return 0;
+}
+
+static int detect_choice_put(struct snd_kcontrol *kcontrol,
+                            struct snd_ctl_elem_value *ucontrol)
+{
+       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
+
+       switch (kcontrol->private_value) {
+       case 0:
+               ldev->switch_on_headphone = !!ucontrol->value.integer.value[0];
+               break;
+       case 1:
+               ldev->switch_on_lineout = !!ucontrol->value.integer.value[0];
+               break;
+       default:
+               return -ENODEV;
+       }
+       return 1;
+}
+
+static struct snd_kcontrol_new headphone_detect_choice = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Headphone Detect Autoswitch",
+       .info = control_info,
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .get = detect_choice_get,
+       .put = detect_choice_put,
+       .private_value = 0,
+};
+
+static struct snd_kcontrol_new lineout_detect_choice = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Line-Out Detect Autoswitch",
+       .info = control_info,
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+       .get = detect_choice_get,
+       .put = detect_choice_put,
+       .private_value = 1,
+};
+
+static int detected_get(struct snd_kcontrol *kcontrol,
+                       struct snd_ctl_elem_value *ucontrol)
+{
+       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
+       int v;
+
+       switch (kcontrol->private_value) {
+       case 0:
+               v = ldev->gpio.methods->get_detect(&ldev->gpio,
+                                                  AOA_NOTIFY_HEADPHONE);
+               break;
+       case 1:
+               v = ldev->gpio.methods->get_detect(&ldev->gpio,
+                                                  AOA_NOTIFY_LINE_OUT);
+               break;
+       default:
+               return -ENODEV;
+       }
+       ucontrol->value.integer.value[0] = v;
+       return 0;
+}
+
+static struct snd_kcontrol_new headphone_detected = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Headphone Detected",
+       .info = control_info,
+       .access = SNDRV_CTL_ELEM_ACCESS_READ,
+       .get = detected_get,
+       .private_value = 0,
+};
+
+static struct snd_kcontrol_new lineout_detected = {
+       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name = "Line-Out Detected",
+       .info = control_info,
+       .access = SNDRV_CTL_ELEM_ACCESS_READ,
+       .get = detected_get,
+       .private_value = 1,
+};
+
+static int check_codec(struct aoa_codec *codec,
+                      struct layout_dev *ldev,
+                      struct codec_connect_info *cci)
+{
+       const u32 *ref;
+       char propname[32];
+       struct codec_connection *cc;
+
+       /* if the codec has a 'codec' node, we require a reference */
+       if (codec->node && (strcmp(codec->node->name, "codec") == 0)) {
+               snprintf(propname, sizeof(propname),
+                        "platform-%s-codec-ref", codec->name);
+               ref = of_get_property(ldev->sound, propname, NULL);
+               if (!ref) {
+                       printk(KERN_INFO "snd-aoa-fabric-layout: "
+                               "required property %s not present\n", propname);
+                       return -ENODEV;
+               }
+               if (*ref != codec->node->linux_phandle) {
+                       printk(KERN_INFO "snd-aoa-fabric-layout: "
+                               "%s doesn't match!\n", propname);
+                       return -ENODEV;
+               }
+       } else {
+               if (layouts_list_items != 1) {
+                       printk(KERN_INFO "snd-aoa-fabric-layout: "
+                               "more than one soundbus, but no references.\n");
+                       return -ENODEV;
+               }
+       }
+       codec->soundbus_dev = ldev->sdev;
+       codec->gpio = &ldev->gpio;
+
+       cc = cci->connections;
+       if (!cc)
+               return -EINVAL;
+
+       printk(KERN_INFO "snd-aoa-fabric-layout: can use this codec\n");
+
+       codec->connected = 0;
+       codec->fabric_data = cc;
+
+       while (cc->connected) {
+               codec->connected |= 1<<cc->codec_bit;
+               cc++;
+       }
+
+       return 0;
+}
+
+static int layout_found_codec(struct aoa_codec *codec)
+{
+       struct layout_dev *ldev;
+       int i;
+
+       list_for_each_entry(ldev, &layouts_list, list) {
+               for (i=0; i<MAX_CODECS_PER_BUS; i++) {
+                       if (!ldev->layout->codecs[i].name)
+                               continue;
+                       if (strcmp(ldev->layout->codecs[i].name, codec->name) == 0) {
+                               if (check_codec(codec,
+                                               ldev,
+                                               &ldev->layout->codecs[i]) == 0)
+                                       return 0;
+                       }
+               }
+       }
+       return -ENODEV;
+}
+
+static void layout_remove_codec(struct aoa_codec *codec)
+{
+       int i;
+       /* here remove the codec from the layout dev's
+        * codec reference */
+
+       codec->soundbus_dev = NULL;
+       codec->gpio = NULL;
+       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
+       }
+}
+
+static void layout_notify(void *data)
+{
+       struct layout_dev_ptr *dptr = data;
+       struct layout_dev *ldev;
+       int v, update;
+       struct snd_kcontrol *detected, *c;
+       struct snd_card *card = aoa_get_card();
+
+       ldev = dptr->ptr;
+       if (data == &ldev->selfptr_headphone) {
+               v = ldev->gpio.methods->get_detect(&ldev->gpio, AOA_NOTIFY_HEADPHONE);
+               detected = ldev->headphone_detected_ctrl;
+               update = ldev->switch_on_headphone;
+               if (update) {
+                       ldev->gpio.methods->set_speakers(&ldev->gpio, !v);
+                       ldev->gpio.methods->set_headphone(&ldev->gpio, v);
+                       ldev->gpio.methods->set_lineout(&ldev->gpio, 0);
+               }
+       } else if (data == &ldev->selfptr_lineout) {
+               v = ldev->gpio.methods->get_detect(&ldev->gpio, AOA_NOTIFY_LINE_OUT);
+               detected = ldev->lineout_detected_ctrl;
+               update = ldev->switch_on_lineout;
+               if (update) {
+                       ldev->gpio.methods->set_speakers(&ldev->gpio, !v);
+                       ldev->gpio.methods->set_headphone(&ldev->gpio, 0);
+                       ldev->gpio.methods->set_lineout(&ldev->gpio, v);
+               }
+       } else
+               return;
+
+       if (detected)
+               snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &detected->id);
+       if (update) {
+               c = ldev->headphone_ctrl;
+               if (c)
+                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
+               c = ldev->speaker_ctrl;
+               if (c)
+                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
+               c = ldev->lineout_ctrl;
+               if (c)
+                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
+       }
+}
+
+static void layout_attached_codec(struct aoa_codec *codec)
+{
+       struct codec_connection *cc;
+       struct snd_kcontrol *ctl;
+       int headphones, lineout;
+       struct layout_dev *ldev = layout_device;
+
+       /* need to add this codec to our codec array! */
+
+       cc = codec->fabric_data;
+
+       headphones = codec->gpio->methods->get_detect(codec->gpio,
+                                                     AOA_NOTIFY_HEADPHONE);
+       lineout = codec->gpio->methods->get_detect(codec->gpio,
+                                                  AOA_NOTIFY_LINE_OUT);
+
+       while (cc->connected) {
+               if (cc->connected & CC_SPEAKERS) {
+                       if (headphones <= 0 && lineout <= 0)
+                               ldev->gpio.methods->set_speakers(codec->gpio, 1);
+                       ctl = snd_ctl_new1(&speakers_ctl, codec->gpio);
+                       ldev->speaker_ctrl = ctl;
+                       aoa_snd_ctl_add(ctl);
+               }
+               if (cc->connected & CC_HEADPHONE) {
+                       if (headphones == 1)
+                               ldev->gpio.methods->set_headphone(codec->gpio, 1);
+                       ctl = snd_ctl_new1(&headphone_ctl, codec->gpio);
+                       ldev->headphone_ctrl = ctl;
+                       aoa_snd_ctl_add(ctl);
+                       ldev->have_headphone_detect =
+                               !ldev->gpio.methods
+                                       ->set_notify(&ldev->gpio,
+                                                    AOA_NOTIFY_HEADPHONE,
+                                                    layout_notify,
+                                                    &ldev->selfptr_headphone);
+                       if (ldev->have_headphone_detect) {
+                               ctl = snd_ctl_new1(&headphone_detect_choice,
+                                                  ldev);
+                               aoa_snd_ctl_add(ctl);
+                               ctl = snd_ctl_new1(&headphone_detected,
+                                                  ldev);
+                               ldev->headphone_detected_ctrl = ctl;
+                               aoa_snd_ctl_add(ctl);
+                       }
+               }
+               if (cc->connected & CC_LINEOUT) {
+                       if (lineout == 1)
+                               ldev->gpio.methods->set_lineout(codec->gpio, 1);
+                       ctl = snd_ctl_new1(&lineout_ctl, codec->gpio);
+                       if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
+                               strlcpy(ctl->id.name,
+                                       "Headphone Switch", sizeof(ctl->id.name));
+                       ldev->lineout_ctrl = ctl;
+                       aoa_snd_ctl_add(ctl);
+                       ldev->have_lineout_detect =
+                               !ldev->gpio.methods
+                                       ->set_notify(&ldev->gpio,
+                                                    AOA_NOTIFY_LINE_OUT,
+                                                    layout_notify,
+                                                    &ldev->selfptr_lineout);
+                       if (ldev->have_lineout_detect) {
+                               ctl = snd_ctl_new1(&lineout_detect_choice,
+                                                  ldev);
+                               if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
+                                       strlcpy(ctl->id.name,
+                                               "Headphone Detect Autoswitch",
+                                               sizeof(ctl->id.name));
+                               aoa_snd_ctl_add(ctl);
+                               ctl = snd_ctl_new1(&lineout_detected,
+                                                  ldev);
+                               if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
+                                       strlcpy(ctl->id.name,
+                                               "Headphone Detected",
+                                               sizeof(ctl->id.name));
+                               ldev->lineout_detected_ctrl = ctl;
+                               aoa_snd_ctl_add(ctl);
+                       }
+               }
+               cc++;
+       }
+       /* now update initial state */
+       if (ldev->have_headphone_detect)
+               layout_notify(&ldev->selfptr_headphone);
+       if (ldev->have_lineout_detect)
+               layout_notify(&ldev->selfptr_lineout);
+}
+
+static struct aoa_fabric layout_fabric = {
+       .name = "SoundByLayout",
+       .owner = THIS_MODULE,
+       .found_codec = layout_found_codec,
+       .remove_codec = layout_remove_codec,
+       .attached_codec = layout_attached_codec,
+};
+
+static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
+{
+       struct device_node *sound = NULL;
+       const unsigned int *layout_id;
+       struct layout *layout;
+       struct layout_dev *ldev = NULL;
+       int err;
+
+       /* hm, currently we can only have one ... */
+       if (layout_device)
+               return -ENODEV;
+
+       /* by breaking out we keep a reference */
+       while ((sound = of_get_next_child(sdev->ofdev.node, sound))) {
+               if (sound->type && strcasecmp(sound->type, "soundchip") == 0)
+                       break;
+       }
+       if (!sound) return -ENODEV;
+
+       layout_id = of_get_property(sound, "layout-id", NULL);
+       if (!layout_id)
+               goto outnodev;
+       printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n",
+              *layout_id);
+
+       layout = find_layout_by_id(*layout_id);
+       if (!layout) {
+               printk(KERN_ERR "snd-aoa-fabric-layout: unknown layout\n");
+               goto outnodev;
+       }
+
+       ldev = kzalloc(sizeof(struct layout_dev), GFP_KERNEL);
+       if (!ldev)
+               goto outnodev;
+
+       layout_device = ldev;
+       ldev->sdev = sdev;
+       ldev->sound = sound;
+       ldev->layout = layout;
+       ldev->gpio.node = sound->parent;
+       switch (layout->layout_id) {
+       case 41: /* that unknown machine no one seems to have */
+       case 51: /* PowerBook5,4 */
+       case 58: /* Mac Mini */
+               ldev->gpio.methods = ftr_gpio_methods;
+               printk(KERN_DEBUG
+                      "snd-aoa-fabric-layout: Using direct GPIOs\n");
+               break;
+       default:
+               ldev->gpio.methods = pmf_gpio_methods;
+               printk(KERN_DEBUG
+                      "snd-aoa-fabric-layout: Using PMF GPIOs\n");
+       }
+       ldev->selfptr_headphone.ptr = ldev;
+       ldev->selfptr_lineout.ptr = ldev;
+       sdev->ofdev.dev.driver_data = ldev;
+       list_add(&ldev->list, &layouts_list);
+       layouts_list_items++;
+
+       /* assign these before registering ourselves, so
+        * callbacks that are done during registration
+        * already have the values */
+       sdev->pcmid = ldev->layout->pcmid;
+       if (ldev->layout->busname) {
+               sdev->pcmname = ldev->layout->busname;
+       } else {
+               sdev->pcmname = "Master";
+       }
+
+       ldev->gpio.methods->init(&ldev->gpio);
+
+       err = aoa_fabric_register(&layout_fabric, &sdev->ofdev.dev);
+       if (err && err != -EALREADY) {
+               printk(KERN_INFO "snd-aoa-fabric-layout: can't use,"
+                                " another fabric is active!\n");
+               goto outlistdel;
+       }
+
+       use_layout(layout);
+       ldev->switch_on_headphone = 1;
+       ldev->switch_on_lineout = 1;
+       return 0;
+ outlistdel:
+       /* we won't be using these then... */
+       ldev->gpio.methods->exit(&ldev->gpio);
+       /* reset if we didn't use it */
+       sdev->pcmname = NULL;
+       sdev->pcmid = -1;
+       list_del(&ldev->list);
+       layouts_list_items--;
+ outnodev:
+       of_node_put(sound);
+       layout_device = NULL;
+       kfree(ldev);
+       return -ENODEV;
+}
+
+static int aoa_fabric_layout_remove(struct soundbus_dev *sdev)
+{
+       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
+       int i;
+
+       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
+               if (ldev->codecs[i]) {
+                       aoa_fabric_unlink_codec(ldev->codecs[i]);
+               }
+               ldev->codecs[i] = NULL;
+       }
+       list_del(&ldev->list);
+       layouts_list_items--;
+       of_node_put(ldev->sound);
+
+       ldev->gpio.methods->set_notify(&ldev->gpio,
+                                      AOA_NOTIFY_HEADPHONE,
+                                      NULL,
+                                      NULL);
+       ldev->gpio.methods->set_notify(&ldev->gpio,
+                                      AOA_NOTIFY_LINE_OUT,
+                                      NULL,
+                                      NULL);
+
+       ldev->gpio.methods->exit(&ldev->gpio);
+       layout_device = NULL;
+       kfree(ldev);
+       sdev->pcmid = -1;
+       sdev->pcmname = NULL;
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t state)
+{
+       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
+
+       if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
+               ldev->gpio.methods->all_amps_off(&ldev->gpio);
+
+       return 0;
+}
+
+static int aoa_fabric_layout_resume(struct soundbus_dev *sdev)
+{
+       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
+
+       if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
+               ldev->gpio.methods->all_amps_restore(&ldev->gpio);
+
+       return 0;
+}
+#endif
+
+static struct soundbus_driver aoa_soundbus_driver = {
+       .name = "snd_aoa_soundbus_drv",
+       .owner = THIS_MODULE,
+       .probe = aoa_fabric_layout_probe,
+       .remove = aoa_fabric_layout_remove,
+#ifdef CONFIG_PM
+       .suspend = aoa_fabric_layout_suspend,
+       .resume = aoa_fabric_layout_resume,
+#endif
+       .driver = {
+               .owner = THIS_MODULE,
+       }
+};
+
+static int __init aoa_fabric_layout_init(void)
+{
+       int err;
+
+       err = soundbus_register_driver(&aoa_soundbus_driver);
+       if (err)
+               return err;
+       return 0;
+}
+
+static void __exit aoa_fabric_layout_exit(void)
+{
+       soundbus_unregister_driver(&aoa_soundbus_driver);
+       aoa_fabric_unregister(&layout_fabric);
+}
+
+module_init(aoa_fabric_layout_init);
+module_exit(aoa_fabric_layout_exit);
diff --git a/sound/aoa/fabrics/snd-aoa-fabric-layout.c b/sound/aoa/fabrics/snd-aoa-fabric-layout.c
deleted file mode 100644 (file)
index dea7abb..0000000
+++ /dev/null
@@ -1,1120 +0,0 @@
-/*
- * Apple Onboard Audio driver -- layout fabric
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- *
- *
- * This fabric module looks for sound codecs
- * based on the layout-id property in the device tree.
- *
- */
-
-#include <asm/prom.h>
-#include <linux/list.h>
-#include <linux/module.h>
-#include "../aoa.h"
-#include "../soundbus/soundbus.h"
-
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Layout-ID fabric for snd-aoa");
-
-#define MAX_CODECS_PER_BUS     2
-
-/* These are the connections the layout fabric
- * knows about. It doesn't really care about the
- * input ones, but I thought I'd separate them
- * to give them proper names. The thing is that
- * Apple usually will distinguish the active output
- * by GPIOs, while the active input is set directly
- * on the codec. Hence we here tell the codec what
- * we think is connected. This information is hard-
- * coded below ... */
-#define CC_SPEAKERS    (1<<0)
-#define CC_HEADPHONE   (1<<1)
-#define CC_LINEOUT     (1<<2)
-#define CC_DIGITALOUT  (1<<3)
-#define CC_LINEIN      (1<<4)
-#define CC_MICROPHONE  (1<<5)
-#define CC_DIGITALIN   (1<<6)
-/* pretty bogus but users complain...
- * This is a flag saying that the LINEOUT
- * should be renamed to HEADPHONE.
- * be careful with input detection! */
-#define CC_LINEOUT_LABELLED_HEADPHONE  (1<<7)
-
-struct codec_connection {
-       /* CC_ flags from above */
-       int connected;
-       /* codec dependent bit to be set in the aoa_codec.connected field.
-        * This intentionally doesn't have any generic flags because the
-        * fabric has to know the codec anyway and all codecs might have
-        * different connectors */
-       int codec_bit;
-};
-
-struct codec_connect_info {
-       char *name;
-       struct codec_connection *connections;
-};
-
-#define LAYOUT_FLAG_COMBO_LINEOUT_SPDIF        (1<<0)
-
-struct layout {
-       unsigned int layout_id;
-       struct codec_connect_info codecs[MAX_CODECS_PER_BUS];
-       int flags;
-       
-       /* if busname is not assigned, we use 'Master' below,
-        * so that our layout table doesn't need to be filled
-        * too much.
-        * We only assign these two if we expect to find more
-        * than one soundbus, i.e. on those machines with
-        * multiple layout-ids */
-       char *busname;
-       int pcmid;
-};
-
-MODULE_ALIAS("sound-layout-36");
-MODULE_ALIAS("sound-layout-41");
-MODULE_ALIAS("sound-layout-45");
-MODULE_ALIAS("sound-layout-47");
-MODULE_ALIAS("sound-layout-48");
-MODULE_ALIAS("sound-layout-49");
-MODULE_ALIAS("sound-layout-50");
-MODULE_ALIAS("sound-layout-51");
-MODULE_ALIAS("sound-layout-56");
-MODULE_ALIAS("sound-layout-57");
-MODULE_ALIAS("sound-layout-58");
-MODULE_ALIAS("sound-layout-60");
-MODULE_ALIAS("sound-layout-61");
-MODULE_ALIAS("sound-layout-62");
-MODULE_ALIAS("sound-layout-64");
-MODULE_ALIAS("sound-layout-65");
-MODULE_ALIAS("sound-layout-66");
-MODULE_ALIAS("sound-layout-67");
-MODULE_ALIAS("sound-layout-68");
-MODULE_ALIAS("sound-layout-69");
-MODULE_ALIAS("sound-layout-70");
-MODULE_ALIAS("sound-layout-72");
-MODULE_ALIAS("sound-layout-76");
-MODULE_ALIAS("sound-layout-80");
-MODULE_ALIAS("sound-layout-82");
-MODULE_ALIAS("sound-layout-84");
-MODULE_ALIAS("sound-layout-86");
-MODULE_ALIAS("sound-layout-90");
-MODULE_ALIAS("sound-layout-92");
-MODULE_ALIAS("sound-layout-94");
-MODULE_ALIAS("sound-layout-96");
-MODULE_ALIAS("sound-layout-98");
-MODULE_ALIAS("sound-layout-100");
-
-/* onyx with all but microphone connected */
-static struct codec_connection onyx_connections_nomic[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_DIGITALOUT,
-               .codec_bit = 1,
-       },
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* onyx on machines without headphone */
-static struct codec_connection onyx_connections_noheadphones[] = {
-       {
-               .connected = CC_SPEAKERS | CC_LINEOUT |
-                            CC_LINEOUT_LABELLED_HEADPHONE,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_DIGITALOUT,
-               .codec_bit = 1,
-       },
-       /* FIXME: are these correct? probably not for all the machines
-        * below ... If not this will need separating. */
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {
-               .connected = CC_MICROPHONE,
-               .codec_bit = 3,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* onyx on machines with real line-out */
-static struct codec_connection onyx_connections_reallineout[] = {
-       {
-               .connected = CC_SPEAKERS | CC_LINEOUT | CC_HEADPHONE,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_DIGITALOUT,
-               .codec_bit = 1,
-       },
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* tas on machines without line out */
-static struct codec_connection tas_connections_nolineout[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {
-               .connected = CC_MICROPHONE,
-               .codec_bit = 3,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* tas on machines with neither line out nor line in */
-static struct codec_connection tas_connections_noline[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_MICROPHONE,
-               .codec_bit = 3,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* tas on machines without microphone */
-static struct codec_connection tas_connections_nomic[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-/* tas on machines with everything connected */
-static struct codec_connection tas_connections_all[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE | CC_LINEOUT,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_LINEIN,
-               .codec_bit = 2,
-       },
-       {
-               .connected = CC_MICROPHONE,
-               .codec_bit = 3,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-static struct codec_connection toonie_connections[] = {
-       {
-               .connected = CC_SPEAKERS | CC_HEADPHONE,
-               .codec_bit = 0,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-static struct codec_connection topaz_input[] = {
-       {
-               .connected = CC_DIGITALIN,
-               .codec_bit = 0,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-static struct codec_connection topaz_output[] = {
-       {
-               .connected = CC_DIGITALOUT,
-               .codec_bit = 1,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-static struct codec_connection topaz_inout[] = {
-       {
-               .connected = CC_DIGITALIN,
-               .codec_bit = 0,
-       },
-       {
-               .connected = CC_DIGITALOUT,
-               .codec_bit = 1,
-       },
-       {} /* terminate array by .connected == 0 */
-};
-
-static struct layout layouts[] = {
-       /* last PowerBooks (15" Oct 2005) */
-       { .layout_id = 82,
-         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* PowerMac9,1 */
-       { .layout_id = 60,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_reallineout,
-         },
-       },
-       /* PowerMac9,1 */
-       { .layout_id = 61,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* PowerBook5,7 */
-       { .layout_id = 64,
-         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       /* PowerBook5,7 */
-       { .layout_id = 65,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* PowerBook5,9 [17" Oct 2005] */
-       { .layout_id = 84,
-         .flags = LAYOUT_FLAG_COMBO_LINEOUT_SPDIF,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* PowerMac8,1 */
-       { .layout_id = 45,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* Quad PowerMac (analog in, analog/digital out) */
-       { .layout_id = 68,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_nomic,
-         },
-       },
-       /* Quad PowerMac (digital in) */
-       { .layout_id = 69,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-         .busname = "digital in", .pcmid = 1 },
-       /* Early 2005 PowerBook (PowerBook 5,6) */
-       { .layout_id = 70,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nolineout,
-         },
-       },
-       /* PowerBook 5,4 */
-       { .layout_id = 51,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nolineout,
-         },
-       },
-       /* PowerBook6,7 */
-       { .layout_id = 80,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_noline,
-         },
-       },
-       /* PowerBook6,8 */
-       { .layout_id = 72,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nolineout,
-         },
-       },
-       /* PowerMac8,2 */
-       { .layout_id = 86,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_nomic,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       /* PowerBook6,7 */
-       { .layout_id = 92,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nolineout,
-         },
-       },
-       /* PowerMac10,1 (Mac Mini) */
-       { .layout_id = 58,
-         .codecs[0] = {
-               .name = "toonie",
-               .connections = toonie_connections,
-         },
-       },
-       {
-         .layout_id = 96,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       /* unknown, untested, but this comes from Apple */
-       { .layout_id = 41,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_all,
-         },
-       },
-       { .layout_id = 36,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nomic,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_inout,
-         },
-       },
-       { .layout_id = 47,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       { .layout_id = 48,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       { .layout_id = 49,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_nomic,
-         },
-       },
-       { .layout_id = 50,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       { .layout_id = 56,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       { .layout_id = 57,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       { .layout_id = 62,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_output,
-         },
-       },
-       { .layout_id = 66,
-         .codecs[0] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       { .layout_id = 67,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-       },
-       { .layout_id = 76,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_nomic,
-         },
-         .codecs[1] = {
-               .name = "topaz",
-               .connections = topaz_inout,
-         },
-       },
-       { .layout_id = 90,
-         .codecs[0] = {
-               .name = "tas",
-               .connections = tas_connections_noline,
-         },
-       },
-       { .layout_id = 94,
-         .codecs[0] = {
-               .name = "onyx",
-               /* but it has an external mic?? how to select? */
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       { .layout_id = 98,
-         .codecs[0] = {
-               .name = "toonie",
-               .connections = toonie_connections,
-         },
-       },
-       { .layout_id = 100,
-         .codecs[0] = {
-               .name = "topaz",
-               .connections = topaz_input,
-         },
-         .codecs[1] = {
-               .name = "onyx",
-               .connections = onyx_connections_noheadphones,
-         },
-       },
-       {}
-};
-
-static struct layout *find_layout_by_id(unsigned int id)
-{
-       struct layout *l;
-
-       l = layouts;
-       while (l->layout_id) {
-               if (l->layout_id == id)
-                       return l;
-               l++;
-       }
-       return NULL;
-}
-
-static void use_layout(struct layout *l)
-{
-       int i;
-
-       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
-               if (l->codecs[i].name) {
-                       request_module("snd-aoa-codec-%s", l->codecs[i].name);
-               }
-       }
-       /* now we wait for the codecs to call us back */
-}
-
-struct layout_dev;
-
-struct layout_dev_ptr {
-       struct layout_dev *ptr;
-};
-
-struct layout_dev {
-       struct list_head list;
-       struct soundbus_dev *sdev;
-       struct device_node *sound;
-       struct aoa_codec *codecs[MAX_CODECS_PER_BUS];
-       struct layout *layout;
-       struct gpio_runtime gpio;
-
-       /* we need these for headphone/lineout detection */
-       struct snd_kcontrol *headphone_ctrl;
-       struct snd_kcontrol *lineout_ctrl;
-       struct snd_kcontrol *speaker_ctrl;
-       struct snd_kcontrol *headphone_detected_ctrl;
-       struct snd_kcontrol *lineout_detected_ctrl;
-
-       struct layout_dev_ptr selfptr_headphone;
-       struct layout_dev_ptr selfptr_lineout;
-
-       u32 have_lineout_detect:1,
-           have_headphone_detect:1,
-           switch_on_headphone:1,
-           switch_on_lineout:1;
-};
-
-static LIST_HEAD(layouts_list);
-static int layouts_list_items;
-/* this can go away but only if we allow multiple cards,
- * make the fabric handle all the card stuff, etc... */
-static struct layout_dev *layout_device;
-
-#define control_info   snd_ctl_boolean_mono_info
-
-#define AMP_CONTROL(n, description)                                    \
-static int n##_control_get(struct snd_kcontrol *kcontrol,              \
-                          struct snd_ctl_elem_value *ucontrol)         \
-{                                                                      \
-       struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);        \
-       if (gpio->methods && gpio->methods->get_##n)                    \
-               ucontrol->value.integer.value[0] =                      \
-                       gpio->methods->get_##n(gpio);                   \
-       return 0;                                                       \
-}                                                                      \
-static int n##_control_put(struct snd_kcontrol *kcontrol,              \
-                          struct snd_ctl_elem_value *ucontrol)         \
-{                                                                      \
-       struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);        \
-       if (gpio->methods && gpio->methods->get_##n)                    \
-               gpio->methods->set_##n(gpio,                            \
-                       !!ucontrol->value.integer.value[0]);            \
-       return 1;                                                       \
-}                                                                      \
-static struct snd_kcontrol_new n##_ctl = {                             \
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,                            \
-       .name = description,                                            \
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,                      \
-       .info = control_info,                                           \
-       .get = n##_control_get,                                         \
-       .put = n##_control_put,                                         \
-}
-
-AMP_CONTROL(headphone, "Headphone Switch");
-AMP_CONTROL(speakers, "Speakers Switch");
-AMP_CONTROL(lineout, "Line-Out Switch");
-
-static int detect_choice_get(struct snd_kcontrol *kcontrol,
-                            struct snd_ctl_elem_value *ucontrol)
-{
-       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
-
-       switch (kcontrol->private_value) {
-       case 0:
-               ucontrol->value.integer.value[0] = ldev->switch_on_headphone;
-               break;
-       case 1:
-               ucontrol->value.integer.value[0] = ldev->switch_on_lineout;
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 0;
-}
-
-static int detect_choice_put(struct snd_kcontrol *kcontrol,
-                            struct snd_ctl_elem_value *ucontrol)
-{
-       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
-
-       switch (kcontrol->private_value) {
-       case 0:
-               ldev->switch_on_headphone = !!ucontrol->value.integer.value[0];
-               break;
-       case 1:
-               ldev->switch_on_lineout = !!ucontrol->value.integer.value[0];
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 1;
-}
-
-static struct snd_kcontrol_new headphone_detect_choice = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Headphone Detect Autoswitch",
-       .info = control_info,
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .get = detect_choice_get,
-       .put = detect_choice_put,
-       .private_value = 0,
-};
-
-static struct snd_kcontrol_new lineout_detect_choice = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Line-Out Detect Autoswitch",
-       .info = control_info,
-       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
-       .get = detect_choice_get,
-       .put = detect_choice_put,
-       .private_value = 1,
-};
-
-static int detected_get(struct snd_kcontrol *kcontrol,
-                       struct snd_ctl_elem_value *ucontrol)
-{
-       struct layout_dev *ldev = snd_kcontrol_chip(kcontrol);
-       int v;
-
-       switch (kcontrol->private_value) {
-       case 0:
-               v = ldev->gpio.methods->get_detect(&ldev->gpio,
-                                                  AOA_NOTIFY_HEADPHONE);
-               break;
-       case 1:
-               v = ldev->gpio.methods->get_detect(&ldev->gpio,
-                                                  AOA_NOTIFY_LINE_OUT);
-               break;
-       default:
-               return -ENODEV;
-       }
-       ucontrol->value.integer.value[0] = v;
-       return 0;
-}
-
-static struct snd_kcontrol_new headphone_detected = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Headphone Detected",
-       .info = control_info,
-       .access = SNDRV_CTL_ELEM_ACCESS_READ,
-       .get = detected_get,
-       .private_value = 0,
-};
-
-static struct snd_kcontrol_new lineout_detected = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "Line-Out Detected",
-       .info = control_info,
-       .access = SNDRV_CTL_ELEM_ACCESS_READ,
-       .get = detected_get,
-       .private_value = 1,
-};
-
-static int check_codec(struct aoa_codec *codec,
-                      struct layout_dev *ldev,
-                      struct codec_connect_info *cci)
-{
-       const u32 *ref;
-       char propname[32];
-       struct codec_connection *cc;
-
-       /* if the codec has a 'codec' node, we require a reference */
-       if (codec->node && (strcmp(codec->node->name, "codec") == 0)) {
-               snprintf(propname, sizeof(propname),
-                        "platform-%s-codec-ref", codec->name);
-               ref = of_get_property(ldev->sound, propname, NULL);
-               if (!ref) {
-                       printk(KERN_INFO "snd-aoa-fabric-layout: "
-                               "required property %s not present\n", propname);
-                       return -ENODEV;
-               }
-               if (*ref != codec->node->linux_phandle) {
-                       printk(KERN_INFO "snd-aoa-fabric-layout: "
-                               "%s doesn't match!\n", propname);
-                       return -ENODEV;
-               }
-       } else {
-               if (layouts_list_items != 1) {
-                       printk(KERN_INFO "snd-aoa-fabric-layout: "
-                               "more than one soundbus, but no references.\n");
-                       return -ENODEV;
-               }
-       }
-       codec->soundbus_dev = ldev->sdev;
-       codec->gpio = &ldev->gpio;
-
-       cc = cci->connections;
-       if (!cc)
-               return -EINVAL;
-
-       printk(KERN_INFO "snd-aoa-fabric-layout: can use this codec\n");
-
-       codec->connected = 0;
-       codec->fabric_data = cc;
-
-       while (cc->connected) {
-               codec->connected |= 1<<cc->codec_bit;
-               cc++;
-       }
-
-       return 0;
-}
-
-static int layout_found_codec(struct aoa_codec *codec)
-{
-       struct layout_dev *ldev;
-       int i;
-
-       list_for_each_entry(ldev, &layouts_list, list) {
-               for (i=0; i<MAX_CODECS_PER_BUS; i++) {
-                       if (!ldev->layout->codecs[i].name)
-                               continue;
-                       if (strcmp(ldev->layout->codecs[i].name, codec->name) == 0) {
-                               if (check_codec(codec,
-                                               ldev,
-                                               &ldev->layout->codecs[i]) == 0)
-                                       return 0;
-                       }
-               }
-       }
-       return -ENODEV;
-}
-
-static void layout_remove_codec(struct aoa_codec *codec)
-{
-       int i;
-       /* here remove the codec from the layout dev's
-        * codec reference */
-
-       codec->soundbus_dev = NULL;
-       codec->gpio = NULL;
-       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
-       }
-}
-
-static void layout_notify(void *data)
-{
-       struct layout_dev_ptr *dptr = data;
-       struct layout_dev *ldev;
-       int v, update;
-       struct snd_kcontrol *detected, *c;
-       struct snd_card *card = aoa_get_card();
-
-       ldev = dptr->ptr;
-       if (data == &ldev->selfptr_headphone) {
-               v = ldev->gpio.methods->get_detect(&ldev->gpio, AOA_NOTIFY_HEADPHONE);
-               detected = ldev->headphone_detected_ctrl;
-               update = ldev->switch_on_headphone;
-               if (update) {
-                       ldev->gpio.methods->set_speakers(&ldev->gpio, !v);
-                       ldev->gpio.methods->set_headphone(&ldev->gpio, v);
-                       ldev->gpio.methods->set_lineout(&ldev->gpio, 0);
-               }
-       } else if (data == &ldev->selfptr_lineout) {
-               v = ldev->gpio.methods->get_detect(&ldev->gpio, AOA_NOTIFY_LINE_OUT);
-               detected = ldev->lineout_detected_ctrl;
-               update = ldev->switch_on_lineout;
-               if (update) {
-                       ldev->gpio.methods->set_speakers(&ldev->gpio, !v);
-                       ldev->gpio.methods->set_headphone(&ldev->gpio, 0);
-                       ldev->gpio.methods->set_lineout(&ldev->gpio, v);
-               }
-       } else
-               return;
-
-       if (detected)
-               snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &detected->id);
-       if (update) {
-               c = ldev->headphone_ctrl;
-               if (c)
-                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
-               c = ldev->speaker_ctrl;
-               if (c)
-                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
-               c = ldev->lineout_ctrl;
-               if (c)
-                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &c->id);
-       }
-}
-
-static void layout_attached_codec(struct aoa_codec *codec)
-{
-       struct codec_connection *cc;
-       struct snd_kcontrol *ctl;
-       int headphones, lineout;
-       struct layout_dev *ldev = layout_device;
-
-       /* need to add this codec to our codec array! */
-
-       cc = codec->fabric_data;
-
-       headphones = codec->gpio->methods->get_detect(codec->gpio,
-                                                     AOA_NOTIFY_HEADPHONE);
-       lineout = codec->gpio->methods->get_detect(codec->gpio,
-                                                  AOA_NOTIFY_LINE_OUT);
-
-       while (cc->connected) {
-               if (cc->connected & CC_SPEAKERS) {
-                       if (headphones <= 0 && lineout <= 0)
-                               ldev->gpio.methods->set_speakers(codec->gpio, 1);
-                       ctl = snd_ctl_new1(&speakers_ctl, codec->gpio);
-                       ldev->speaker_ctrl = ctl;
-                       aoa_snd_ctl_add(ctl);
-               }
-               if (cc->connected & CC_HEADPHONE) {
-                       if (headphones == 1)
-                               ldev->gpio.methods->set_headphone(codec->gpio, 1);
-                       ctl = snd_ctl_new1(&headphone_ctl, codec->gpio);
-                       ldev->headphone_ctrl = ctl;
-                       aoa_snd_ctl_add(ctl);
-                       ldev->have_headphone_detect =
-                               !ldev->gpio.methods
-                                       ->set_notify(&ldev->gpio,
-                                                    AOA_NOTIFY_HEADPHONE,
-                                                    layout_notify,
-                                                    &ldev->selfptr_headphone);
-                       if (ldev->have_headphone_detect) {
-                               ctl = snd_ctl_new1(&headphone_detect_choice,
-                                                  ldev);
-                               aoa_snd_ctl_add(ctl);
-                               ctl = snd_ctl_new1(&headphone_detected,
-                                                  ldev);
-                               ldev->headphone_detected_ctrl = ctl;
-                               aoa_snd_ctl_add(ctl);
-                       }
-               }
-               if (cc->connected & CC_LINEOUT) {
-                       if (lineout == 1)
-                               ldev->gpio.methods->set_lineout(codec->gpio, 1);
-                       ctl = snd_ctl_new1(&lineout_ctl, codec->gpio);
-                       if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
-                               strlcpy(ctl->id.name,
-                                       "Headphone Switch", sizeof(ctl->id.name));
-                       ldev->lineout_ctrl = ctl;
-                       aoa_snd_ctl_add(ctl);
-                       ldev->have_lineout_detect =
-                               !ldev->gpio.methods
-                                       ->set_notify(&ldev->gpio,
-                                                    AOA_NOTIFY_LINE_OUT,
-                                                    layout_notify,
-                                                    &ldev->selfptr_lineout);
-                       if (ldev->have_lineout_detect) {
-                               ctl = snd_ctl_new1(&lineout_detect_choice,
-                                                  ldev);
-                               if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
-                                       strlcpy(ctl->id.name,
-                                               "Headphone Detect Autoswitch",
-                                               sizeof(ctl->id.name));
-                               aoa_snd_ctl_add(ctl);
-                               ctl = snd_ctl_new1(&lineout_detected,
-                                                  ldev);
-                               if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE)
-                                       strlcpy(ctl->id.name,
-                                               "Headphone Detected",
-                                               sizeof(ctl->id.name));
-                               ldev->lineout_detected_ctrl = ctl;
-                               aoa_snd_ctl_add(ctl);
-                       }
-               }
-               cc++;
-       }
-       /* now update initial state */
-       if (ldev->have_headphone_detect)
-               layout_notify(&ldev->selfptr_headphone);
-       if (ldev->have_lineout_detect)
-               layout_notify(&ldev->selfptr_lineout);
-}
-
-static struct aoa_fabric layout_fabric = {
-       .name = "SoundByLayout",
-       .owner = THIS_MODULE,
-       .found_codec = layout_found_codec,
-       .remove_codec = layout_remove_codec,
-       .attached_codec = layout_attached_codec,
-};
-
-static int aoa_fabric_layout_probe(struct soundbus_dev *sdev)
-{
-       struct device_node *sound = NULL;
-       const unsigned int *layout_id;
-       struct layout *layout;
-       struct layout_dev *ldev = NULL;
-       int err;
-
-       /* hm, currently we can only have one ... */
-       if (layout_device)
-               return -ENODEV;
-
-       /* by breaking out we keep a reference */
-       while ((sound = of_get_next_child(sdev->ofdev.node, sound))) {
-               if (sound->type && strcasecmp(sound->type, "soundchip") == 0)
-                       break;
-       }
-       if (!sound) return -ENODEV;
-
-       layout_id = of_get_property(sound, "layout-id", NULL);
-       if (!layout_id)
-               goto outnodev;
-       printk(KERN_INFO "snd-aoa-fabric-layout: found bus with layout %d\n",
-              *layout_id);
-
-       layout = find_layout_by_id(*layout_id);
-       if (!layout) {
-               printk(KERN_ERR "snd-aoa-fabric-layout: unknown layout\n");
-               goto outnodev;
-       }
-
-       ldev = kzalloc(sizeof(struct layout_dev), GFP_KERNEL);
-       if (!ldev)
-               goto outnodev;
-
-       layout_device = ldev;
-       ldev->sdev = sdev;
-       ldev->sound = sound;
-       ldev->layout = layout;
-       ldev->gpio.node = sound->parent;
-       switch (layout->layout_id) {
-       case 41: /* that unknown machine no one seems to have */
-       case 51: /* PowerBook5,4 */
-       case 58: /* Mac Mini */
-               ldev->gpio.methods = ftr_gpio_methods;
-               printk(KERN_DEBUG
-                      "snd-aoa-fabric-layout: Using direct GPIOs\n");
-               break;
-       default:
-               ldev->gpio.methods = pmf_gpio_methods;
-               printk(KERN_DEBUG
-                      "snd-aoa-fabric-layout: Using PMF GPIOs\n");
-       }
-       ldev->selfptr_headphone.ptr = ldev;
-       ldev->selfptr_lineout.ptr = ldev;
-       sdev->ofdev.dev.driver_data = ldev;
-       list_add(&ldev->list, &layouts_list);
-       layouts_list_items++;
-
-       /* assign these before registering ourselves, so
-        * callbacks that are done during registration
-        * already have the values */
-       sdev->pcmid = ldev->layout->pcmid;
-       if (ldev->layout->busname) {
-               sdev->pcmname = ldev->layout->busname;
-       } else {
-               sdev->pcmname = "Master";
-       }
-
-       ldev->gpio.methods->init(&ldev->gpio);
-
-       err = aoa_fabric_register(&layout_fabric, &sdev->ofdev.dev);
-       if (err && err != -EALREADY) {
-               printk(KERN_INFO "snd-aoa-fabric-layout: can't use,"
-                                " another fabric is active!\n");
-               goto outlistdel;
-       }
-
-       use_layout(layout);
-       ldev->switch_on_headphone = 1;
-       ldev->switch_on_lineout = 1;
-       return 0;
- outlistdel:
-       /* we won't be using these then... */
-       ldev->gpio.methods->exit(&ldev->gpio);
-       /* reset if we didn't use it */
-       sdev->pcmname = NULL;
-       sdev->pcmid = -1;
-       list_del(&ldev->list);
-       layouts_list_items--;
- outnodev:
-       of_node_put(sound);
-       layout_device = NULL;
-       kfree(ldev);
-       return -ENODEV;
-}
-
-static int aoa_fabric_layout_remove(struct soundbus_dev *sdev)
-{
-       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
-       int i;
-
-       for (i=0; i<MAX_CODECS_PER_BUS; i++) {
-               if (ldev->codecs[i]) {
-                       aoa_fabric_unlink_codec(ldev->codecs[i]);
-               }
-               ldev->codecs[i] = NULL;
-       }
-       list_del(&ldev->list);
-       layouts_list_items--;
-       of_node_put(ldev->sound);
-
-       ldev->gpio.methods->set_notify(&ldev->gpio,
-                                      AOA_NOTIFY_HEADPHONE,
-                                      NULL,
-                                      NULL);
-       ldev->gpio.methods->set_notify(&ldev->gpio,
-                                      AOA_NOTIFY_LINE_OUT,
-                                      NULL,
-                                      NULL);
-
-       ldev->gpio.methods->exit(&ldev->gpio);
-       layout_device = NULL;
-       kfree(ldev);
-       sdev->pcmid = -1;
-       sdev->pcmname = NULL;
-       return 0;
-}
-
-#ifdef CONFIG_PM
-static int aoa_fabric_layout_suspend(struct soundbus_dev *sdev, pm_message_t state)
-{
-       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
-
-       if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
-               ldev->gpio.methods->all_amps_off(&ldev->gpio);
-
-       return 0;
-}
-
-static int aoa_fabric_layout_resume(struct soundbus_dev *sdev)
-{
-       struct layout_dev *ldev = sdev->ofdev.dev.driver_data;
-
-       if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
-               ldev->gpio.methods->all_amps_restore(&ldev->gpio);
-
-       return 0;
-}
-#endif
-
-static struct soundbus_driver aoa_soundbus_driver = {
-       .name = "snd_aoa_soundbus_drv",
-       .owner = THIS_MODULE,
-       .probe = aoa_fabric_layout_probe,
-       .remove = aoa_fabric_layout_remove,
-#ifdef CONFIG_PM
-       .suspend = aoa_fabric_layout_suspend,
-       .resume = aoa_fabric_layout_resume,
-#endif
-       .driver = {
-               .owner = THIS_MODULE,
-       }
-};
-
-static int __init aoa_fabric_layout_init(void)
-{
-       int err;
-
-       err = soundbus_register_driver(&aoa_soundbus_driver);
-       if (err)
-               return err;
-       return 0;
-}
-
-static void __exit aoa_fabric_layout_exit(void)
-{
-       soundbus_unregister_driver(&aoa_soundbus_driver);
-       aoa_fabric_unregister(&layout_fabric);
-}
-
-module_init(aoa_fabric_layout_init);
-module_exit(aoa_fabric_layout_exit);
index e57a5cf65655b4eee4f4a2f162c77a0a3380c0ba..1b949b2a402814d021febb71349a43370a6f5af4 100644 (file)
@@ -1,2 +1,2 @@
 obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += snd-aoa-i2sbus.o
-snd-aoa-i2sbus-objs := i2sbus-core.o i2sbus-pcm.o i2sbus-control.o
+snd-aoa-i2sbus-objs := core.o pcm.o control.o
diff --git a/sound/aoa/soundbus/i2sbus/control.c b/sound/aoa/soundbus/i2sbus/control.c
new file mode 100644 (file)
index 0000000..87beb4a
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * i2sbus driver -- bus control routines
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#include <linux/kernel.h>
+#include <linux/delay.h>
+
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/macio.h>
+#include <asm/pmac_feature.h>
+#include <asm/pmac_pfunc.h>
+#include <asm/keylargo.h>
+
+#include "i2sbus.h"
+
+int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c)
+{
+       *c = kzalloc(sizeof(struct i2sbus_control), GFP_KERNEL);
+       if (!*c)
+               return -ENOMEM;
+
+       INIT_LIST_HEAD(&(*c)->list);
+
+       (*c)->macio = dev->bus->chip;
+       return 0;
+}
+
+void i2sbus_control_destroy(struct i2sbus_control *c)
+{
+       kfree(c);
+}
+
+/* this is serialised externally */
+int i2sbus_control_add_dev(struct i2sbus_control *c,
+                          struct i2sbus_dev *i2sdev)
+{
+       struct device_node *np;
+
+       np = i2sdev->sound.ofdev.node;
+       i2sdev->enable = pmf_find_function(np, "enable");
+       i2sdev->cell_enable = pmf_find_function(np, "cell-enable");
+       i2sdev->clock_enable = pmf_find_function(np, "clock-enable");
+       i2sdev->cell_disable = pmf_find_function(np, "cell-disable");
+       i2sdev->clock_disable = pmf_find_function(np, "clock-disable");
+
+       /* if the bus number is not 0 or 1 we absolutely need to use
+        * the platform functions -- there's nothing in Darwin that
+        * would allow seeing a system behind what the FCRs are then,
+        * and I don't want to go parsing a bunch of platform functions
+        * by hand to try finding a system... */
+       if (i2sdev->bus_number != 0 && i2sdev->bus_number != 1 &&
+           (!i2sdev->enable ||
+            !i2sdev->cell_enable || !i2sdev->clock_enable ||
+            !i2sdev->cell_disable || !i2sdev->clock_disable)) {
+               pmf_put_function(i2sdev->enable);
+               pmf_put_function(i2sdev->cell_enable);
+               pmf_put_function(i2sdev->clock_enable);
+               pmf_put_function(i2sdev->cell_disable);
+               pmf_put_function(i2sdev->clock_disable);
+               return -ENODEV;
+       }
+
+       list_add(&i2sdev->item, &c->list);
+
+       return 0;
+}
+
+void i2sbus_control_remove_dev(struct i2sbus_control *c,
+                              struct i2sbus_dev *i2sdev)
+{
+       /* this is serialised externally */
+       list_del(&i2sdev->item);
+       if (list_empty(&c->list))
+               i2sbus_control_destroy(c);
+}
+
+int i2sbus_control_enable(struct i2sbus_control *c,
+                         struct i2sbus_dev *i2sdev)
+{
+       struct pmf_args args = { .count = 0 };
+       struct macio_chip *macio = c->macio;
+
+       if (i2sdev->enable)
+               return pmf_call_one(i2sdev->enable, &args);
+
+       if (macio == NULL || macio->base == NULL)
+               return -ENODEV;
+
+       switch (i2sdev->bus_number) {
+       case 0:
+               /* these need to be locked or done through
+                * newly created feature calls! */
+               MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_ENABLE);
+               break;
+       case 1:
+               MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_ENABLE);
+               break;
+       default:
+               return -ENODEV;
+       }
+       return 0;
+}
+
+int i2sbus_control_cell(struct i2sbus_control *c,
+                       struct i2sbus_dev *i2sdev,
+                       int enable)
+{
+       struct pmf_args args = { .count = 0 };
+       struct macio_chip *macio = c->macio;
+
+       switch (enable) {
+       case 0:
+               if (i2sdev->cell_disable)
+                       return pmf_call_one(i2sdev->cell_disable, &args);
+               break;
+       case 1:
+               if (i2sdev->cell_enable)
+                       return pmf_call_one(i2sdev->cell_enable, &args);
+               break;
+       default:
+               printk(KERN_ERR "i2sbus: INVALID CELL ENABLE VALUE\n");
+               return -ENODEV;
+       }
+
+       if (macio == NULL || macio->base == NULL)
+               return -ENODEV;
+
+       switch (i2sdev->bus_number) {
+       case 0:
+               if (enable)
+                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
+               else
+                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
+               break;
+       case 1:
+               if (enable)
+                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
+               else
+                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
+               break;
+       default:
+               return -ENODEV;
+       }
+       return 0;
+}
+
+int i2sbus_control_clock(struct i2sbus_control *c,
+                        struct i2sbus_dev *i2sdev,
+                        int enable)
+{
+       struct pmf_args args = { .count = 0 };
+       struct macio_chip *macio = c->macio;
+
+       switch (enable) {
+       case 0:
+               if (i2sdev->clock_disable)
+                       return pmf_call_one(i2sdev->clock_disable, &args);
+               break;
+       case 1:
+               if (i2sdev->clock_enable)
+                       return pmf_call_one(i2sdev->clock_enable, &args);
+               break;
+       default:
+               printk(KERN_ERR "i2sbus: INVALID CLOCK ENABLE VALUE\n");
+               return -ENODEV;
+       }
+
+       if (macio == NULL || macio->base == NULL)
+               return -ENODEV;
+
+       switch (i2sdev->bus_number) {
+       case 0:
+               if (enable)
+                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
+               else
+                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
+               break;
+       case 1:
+               if (enable)
+                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
+               else
+                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
+               break;
+       default:
+               return -ENODEV;
+       }
+       return 0;
+}
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
new file mode 100644 (file)
index 0000000..be468ed
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * i2sbus driver
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
+
+#include <sound/core.h>
+
+#include <asm/macio.h>
+#include <asm/dbdma.h>
+
+#include "../soundbus.h"
+#include "i2sbus.h"
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
+MODULE_DESCRIPTION("Apple Soundbus: I2S support");
+
+static int force;
+module_param(force, int, 0444);
+MODULE_PARM_DESC(force, "Force loading i2sbus even when"
+                       " no layout-id property is present");
+
+static struct of_device_id i2sbus_match[] = {
+       { .name = "i2s" },
+       { }
+};
+
+MODULE_DEVICE_TABLE(of, i2sbus_match);
+
+static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
+                                      struct dbdma_command_mem *r,
+                                      int numcmds)
+{
+       /* one more for rounding, one for branch back, one for stop command */
+       r->size = (numcmds + 3) * sizeof(struct dbdma_cmd);
+       /* We use the PCI APIs for now until the generic one gets fixed
+        * enough or until we get some macio-specific versions
+        */
+       r->space = dma_alloc_coherent(
+                       &macio_get_pci_dev(i2sdev->macio)->dev,
+                       r->size,
+                       &r->bus_addr,
+                       GFP_KERNEL);
+
+       if (!r->space) return -ENOMEM;
+
+       memset(r->space, 0, r->size);
+       r->cmds = (void*)DBDMA_ALIGN(r->space);
+       r->bus_cmd_start = r->bus_addr +
+                          (dma_addr_t)((char*)r->cmds - (char*)r->space);
+
+       return 0;
+}
+
+static void free_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
+                                      struct dbdma_command_mem *r)
+{
+       if (!r->space) return;
+
+       dma_free_coherent(&macio_get_pci_dev(i2sdev->macio)->dev,
+                           r->size, r->space, r->bus_addr);
+}
+
+static void i2sbus_release_dev(struct device *dev)
+{
+       struct i2sbus_dev *i2sdev;
+       int i;
+
+       i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
+
+       if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
+       if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
+       if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
+       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
+               if (i2sdev->allocated_resource[i])
+                       release_and_free_resource(i2sdev->allocated_resource[i]);
+       free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
+       free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring);
+       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
+               free_irq(i2sdev->interrupts[i], i2sdev);
+       i2sbus_control_remove_dev(i2sdev->control, i2sdev);
+       mutex_destroy(&i2sdev->lock);
+       kfree(i2sdev);
+}
+
+static irqreturn_t i2sbus_bus_intr(int irq, void *devid)
+{
+       struct i2sbus_dev *dev = devid;
+       u32 intreg;
+
+       spin_lock(&dev->low_lock);
+       intreg = in_le32(&dev->intfregs->intr_ctl);
+
+       /* acknowledge interrupt reasons */
+       out_le32(&dev->intfregs->intr_ctl, intreg);
+
+       spin_unlock(&dev->low_lock);
+
+       return IRQ_HANDLED;
+}
+
+
+/*
+ * XXX FIXME: We test the layout_id's here to get the proper way of
+ * mapping in various registers, thanks to bugs in Apple device-trees.
+ * We could instead key off the machine model and the name of the i2s
+ * node (i2s-a). This we'll do when we move it all to macio_asic.c
+ * and have that export items for each sub-node too.
+ */
+static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
+                                    int layout, struct resource *res)
+{
+       struct device_node *parent;
+       int pindex, rc = -ENXIO;
+       const u32 *reg;
+
+       /* Machines with layout 76 and 36 (K2 based) have a weird device
+        * tree what we need to special case.
+        * Normal machines just fetch the resource from the i2s-X node.
+        * Darwin further divides normal machines into old and new layouts
+        * with a subtely different code path but that doesn't seem necessary
+        * in practice, they just bloated it. In addition, even on our K2
+        * case the i2s-modem node, if we ever want to handle it, uses the
+        * normal layout
+        */
+       if (layout != 76 && layout != 36)
+               return of_address_to_resource(np, index, res);
+
+       parent = of_get_parent(np);
+       pindex = (index == aoa_resource_i2smmio) ? 0 : 1;
+       rc = of_address_to_resource(parent, pindex, res);
+       if (rc)
+               goto bail;
+       reg = of_get_property(np, "reg", NULL);
+       if (reg == NULL) {
+               rc = -ENXIO;
+               goto bail;
+       }
+       res->start += reg[index * 2];
+       res->end = res->start + reg[index * 2 + 1] - 1;
+ bail:
+       of_node_put(parent);
+       return rc;
+}
+
+/* FIXME: look at device node refcounting */
+static int i2sbus_add_dev(struct macio_dev *macio,
+                         struct i2sbus_control *control,
+                         struct device_node *np)
+{
+       struct i2sbus_dev *dev;
+       struct device_node *child = NULL, *sound = NULL;
+       struct resource *r;
+       int i, layout = 0, rlen, ok = force;
+       static const char *rnames[] = { "i2sbus: %s (control)",
+                                       "i2sbus: %s (tx)",
+                                       "i2sbus: %s (rx)" };
+       static irq_handler_t ints[] = {
+               i2sbus_bus_intr,
+               i2sbus_tx_intr,
+               i2sbus_rx_intr
+       };
+
+       if (strlen(np->name) != 5)
+               return 0;
+       if (strncmp(np->name, "i2s-", 4))
+               return 0;
+
+       dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
+       if (!dev)
+               return 0;
+
+       i = 0;
+       while ((child = of_get_next_child(np, child))) {
+               if (strcmp(child->name, "sound") == 0) {
+                       i++;
+                       sound = child;
+               }
+       }
+       if (i == 1) {
+               const u32 *layout_id =
+                       of_get_property(sound, "layout-id", NULL);
+               if (layout_id) {
+                       layout = *layout_id;
+                       snprintf(dev->sound.modalias, 32,
+                                "sound-layout-%d", layout);
+                       ok = 1;
+               }
+       }
+       /* for the time being, until we can handle non-layout-id
+        * things in some fabric, refuse to attach if there is no
+        * layout-id property or we haven't been forced to attach.
+        * When there are two i2s busses and only one has a layout-id,
+        * then this depends on the order, but that isn't important
+        * either as the second one in that case is just a modem. */
+       if (!ok) {
+               kfree(dev);
+               return -ENODEV;
+       }
+
+       mutex_init(&dev->lock);
+       spin_lock_init(&dev->low_lock);
+       dev->sound.ofdev.node = np;
+       dev->sound.ofdev.dma_mask = macio->ofdev.dma_mask;
+       dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.dma_mask;
+       dev->sound.ofdev.dev.parent = &macio->ofdev.dev;
+       dev->sound.ofdev.dev.release = i2sbus_release_dev;
+       dev->sound.attach_codec = i2sbus_attach_codec;
+       dev->sound.detach_codec = i2sbus_detach_codec;
+       dev->sound.pcmid = -1;
+       dev->macio = macio;
+       dev->control = control;
+       dev->bus_number = np->name[4] - 'a';
+       INIT_LIST_HEAD(&dev->sound.codec_list);
+
+       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
+               dev->interrupts[i] = -1;
+               snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
+                        rnames[i], np->name);
+       }
+       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
+               int irq = irq_of_parse_and_map(np, i);
+               if (request_irq(irq, ints[i], 0, dev->rnames[i], dev))
+                       goto err;
+               dev->interrupts[i] = irq;
+       }
+
+
+       /* Resource handling is problematic as some device-trees contain
+        * useless crap (ugh ugh ugh). We work around that here by calling
+        * specific functions for calculating the appropriate resources.
+        *
+        * This will all be moved to macio_asic.c at one point
+        */
+       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
+               if (i2sbus_get_and_fixup_rsrc(np,i,layout,&dev->resources[i]))
+                       goto err;
+               /* If only we could use our resource dev->resources[i]...
+                * but request_resource doesn't know about parents and
+                * contained resources...
+                */
+               dev->allocated_resource[i] =
+                       request_mem_region(dev->resources[i].start,
+                                          dev->resources[i].end -
+                                          dev->resources[i].start + 1,
+                                          dev->rnames[i]);
+               if (!dev->allocated_resource[i]) {
+                       printk(KERN_ERR "i2sbus: failed to claim resource %d!\n", i);
+                       goto err;
+               }
+       }
+
+       r = &dev->resources[aoa_resource_i2smmio];
+       rlen = r->end - r->start + 1;
+       if (rlen < sizeof(struct i2s_interface_regs))
+               goto err;
+       dev->intfregs = ioremap(r->start, rlen);
+
+       r = &dev->resources[aoa_resource_txdbdma];
+       rlen = r->end - r->start + 1;
+       if (rlen < sizeof(struct dbdma_regs))
+               goto err;
+       dev->out.dbdma = ioremap(r->start, rlen);
+
+       r = &dev->resources[aoa_resource_rxdbdma];
+       rlen = r->end - r->start + 1;
+       if (rlen < sizeof(struct dbdma_regs))
+               goto err;
+       dev->in.dbdma = ioremap(r->start, rlen);
+
+       if (!dev->intfregs || !dev->out.dbdma || !dev->in.dbdma)
+               goto err;
+
+       if (alloc_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring,
+                                       MAX_DBDMA_COMMANDS))
+               goto err;
+       if (alloc_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring,
+                                       MAX_DBDMA_COMMANDS))
+               goto err;
+
+       if (i2sbus_control_add_dev(dev->control, dev)) {
+               printk(KERN_ERR "i2sbus: control layer didn't like bus\n");
+               goto err;
+       }
+
+       if (soundbus_add_one(&dev->sound)) {
+               printk(KERN_DEBUG "i2sbus: device registration error!\n");
+               goto err;
+       }
+
+       /* enable this cell */
+       i2sbus_control_cell(dev->control, dev, 1);
+       i2sbus_control_enable(dev->control, dev);
+       i2sbus_control_clock(dev->control, dev, 1);
+
+       return 1;
+ err:
+       for (i=0;i<3;i++)
+               if (dev->interrupts[i] != -1)
+                       free_irq(dev->interrupts[i], dev);
+       free_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring);
+       free_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring);
+       if (dev->intfregs) iounmap(dev->intfregs);
+       if (dev->out.dbdma) iounmap(dev->out.dbdma);
+       if (dev->in.dbdma) iounmap(dev->in.dbdma);
+       for (i=0;i<3;i++)
+               if (dev->allocated_resource[i])
+                       release_and_free_resource(dev->allocated_resource[i]);
+       mutex_destroy(&dev->lock);
+       kfree(dev);
+       return 0;
+}
+
+static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
+{
+       struct device_node *np = NULL;
+       int got = 0, err;
+       struct i2sbus_control *control = NULL;
+
+       err = i2sbus_control_init(dev, &control);
+       if (err)
+               return err;
+       if (!control) {
+               printk(KERN_ERR "i2sbus_control_init API breakage\n");
+               return -ENODEV;
+       }
+
+       while ((np = of_get_next_child(dev->ofdev.node, np))) {
+               if (of_device_is_compatible(np, "i2sbus") ||
+                   of_device_is_compatible(np, "i2s-modem")) {
+                       got += i2sbus_add_dev(dev, control, np);
+               }
+       }
+
+       if (!got) {
+               /* found none, clean up */
+               i2sbus_control_destroy(control);
+               return -ENODEV;
+       }
+
+       dev->ofdev.dev.driver_data = control;
+
+       return 0;
+}
+
+static int i2sbus_remove(struct macio_dev* dev)
+{
+       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
+       struct i2sbus_dev *i2sdev, *tmp;
+
+       list_for_each_entry_safe(i2sdev, tmp, &control->list, item)
+               soundbus_remove_one(&i2sdev->sound);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state)
+{
+       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
+       struct codec_info_item *cii;
+       struct i2sbus_dev* i2sdev;
+       int err, ret = 0;
+
+       list_for_each_entry(i2sdev, &control->list, item) {
+               /* Notify Alsa */
+               if (i2sdev->sound.pcm) {
+                       /* Suspend PCM streams */
+                       snd_pcm_suspend_all(i2sdev->sound.pcm);
+               }
+
+               /* Notify codecs */
+               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+                       err = 0;
+                       if (cii->codec->suspend)
+                               err = cii->codec->suspend(cii, state);
+                       if (err)
+                               ret = err;
+               }
+
+               /* wait until streams are stopped */
+               i2sbus_wait_for_stop_both(i2sdev);
+       }
+
+       return ret;
+}
+
+static int i2sbus_resume(struct macio_dev* dev)
+{
+       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
+       struct codec_info_item *cii;
+       struct i2sbus_dev* i2sdev;
+       int err, ret = 0;
+
+       list_for_each_entry(i2sdev, &control->list, item) {
+               /* reset i2s bus format etc. */
+               i2sbus_pcm_prepare_both(i2sdev);
+
+               /* Notify codecs so they can re-initialize */
+               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+                       err = 0;
+                       if (cii->codec->resume)
+                               err = cii->codec->resume(cii);
+                       if (err)
+                               ret = err;
+               }
+       }
+
+       return ret;
+}
+#endif /* CONFIG_PM */
+
+static int i2sbus_shutdown(struct macio_dev* dev)
+{
+       return 0;
+}
+
+static struct macio_driver i2sbus_drv = {
+       .name = "soundbus-i2s",
+       .owner = THIS_MODULE,
+       .match_table = i2sbus_match,
+       .probe = i2sbus_probe,
+       .remove = i2sbus_remove,
+#ifdef CONFIG_PM
+       .suspend = i2sbus_suspend,
+       .resume = i2sbus_resume,
+#endif
+       .shutdown = i2sbus_shutdown,
+};
+
+static int __init soundbus_i2sbus_init(void)
+{
+       return macio_register_driver(&i2sbus_drv);
+}
+
+static void __exit soundbus_i2sbus_exit(void)
+{
+       macio_unregister_driver(&i2sbus_drv);
+}
+
+module_init(soundbus_i2sbus_init);
+module_exit(soundbus_i2sbus_exit);
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-control.c b/sound/aoa/soundbus/i2sbus/i2sbus-control.c
deleted file mode 100644 (file)
index 87beb4a..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * i2sbus driver -- bus control routines
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#include <linux/kernel.h>
-#include <linux/delay.h>
-
-#include <asm/io.h>
-#include <asm/prom.h>
-#include <asm/macio.h>
-#include <asm/pmac_feature.h>
-#include <asm/pmac_pfunc.h>
-#include <asm/keylargo.h>
-
-#include "i2sbus.h"
-
-int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c)
-{
-       *c = kzalloc(sizeof(struct i2sbus_control), GFP_KERNEL);
-       if (!*c)
-               return -ENOMEM;
-
-       INIT_LIST_HEAD(&(*c)->list);
-
-       (*c)->macio = dev->bus->chip;
-       return 0;
-}
-
-void i2sbus_control_destroy(struct i2sbus_control *c)
-{
-       kfree(c);
-}
-
-/* this is serialised externally */
-int i2sbus_control_add_dev(struct i2sbus_control *c,
-                          struct i2sbus_dev *i2sdev)
-{
-       struct device_node *np;
-
-       np = i2sdev->sound.ofdev.node;
-       i2sdev->enable = pmf_find_function(np, "enable");
-       i2sdev->cell_enable = pmf_find_function(np, "cell-enable");
-       i2sdev->clock_enable = pmf_find_function(np, "clock-enable");
-       i2sdev->cell_disable = pmf_find_function(np, "cell-disable");
-       i2sdev->clock_disable = pmf_find_function(np, "clock-disable");
-
-       /* if the bus number is not 0 or 1 we absolutely need to use
-        * the platform functions -- there's nothing in Darwin that
-        * would allow seeing a system behind what the FCRs are then,
-        * and I don't want to go parsing a bunch of platform functions
-        * by hand to try finding a system... */
-       if (i2sdev->bus_number != 0 && i2sdev->bus_number != 1 &&
-           (!i2sdev->enable ||
-            !i2sdev->cell_enable || !i2sdev->clock_enable ||
-            !i2sdev->cell_disable || !i2sdev->clock_disable)) {
-               pmf_put_function(i2sdev->enable);
-               pmf_put_function(i2sdev->cell_enable);
-               pmf_put_function(i2sdev->clock_enable);
-               pmf_put_function(i2sdev->cell_disable);
-               pmf_put_function(i2sdev->clock_disable);
-               return -ENODEV;
-       }
-
-       list_add(&i2sdev->item, &c->list);
-
-       return 0;
-}
-
-void i2sbus_control_remove_dev(struct i2sbus_control *c,
-                              struct i2sbus_dev *i2sdev)
-{
-       /* this is serialised externally */
-       list_del(&i2sdev->item);
-       if (list_empty(&c->list))
-               i2sbus_control_destroy(c);
-}
-
-int i2sbus_control_enable(struct i2sbus_control *c,
-                         struct i2sbus_dev *i2sdev)
-{
-       struct pmf_args args = { .count = 0 };
-       struct macio_chip *macio = c->macio;
-
-       if (i2sdev->enable)
-               return pmf_call_one(i2sdev->enable, &args);
-
-       if (macio == NULL || macio->base == NULL)
-               return -ENODEV;
-
-       switch (i2sdev->bus_number) {
-       case 0:
-               /* these need to be locked or done through
-                * newly created feature calls! */
-               MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_ENABLE);
-               break;
-       case 1:
-               MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_ENABLE);
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 0;
-}
-
-int i2sbus_control_cell(struct i2sbus_control *c,
-                       struct i2sbus_dev *i2sdev,
-                       int enable)
-{
-       struct pmf_args args = { .count = 0 };
-       struct macio_chip *macio = c->macio;
-
-       switch (enable) {
-       case 0:
-               if (i2sdev->cell_disable)
-                       return pmf_call_one(i2sdev->cell_disable, &args);
-               break;
-       case 1:
-               if (i2sdev->cell_enable)
-                       return pmf_call_one(i2sdev->cell_enable, &args);
-               break;
-       default:
-               printk(KERN_ERR "i2sbus: INVALID CELL ENABLE VALUE\n");
-               return -ENODEV;
-       }
-
-       if (macio == NULL || macio->base == NULL)
-               return -ENODEV;
-
-       switch (i2sdev->bus_number) {
-       case 0:
-               if (enable)
-                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
-               else
-                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CELL_ENABLE);
-               break;
-       case 1:
-               if (enable)
-                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
-               else
-                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CELL_ENABLE);
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 0;
-}
-
-int i2sbus_control_clock(struct i2sbus_control *c,
-                        struct i2sbus_dev *i2sdev,
-                        int enable)
-{
-       struct pmf_args args = { .count = 0 };
-       struct macio_chip *macio = c->macio;
-
-       switch (enable) {
-       case 0:
-               if (i2sdev->clock_disable)
-                       return pmf_call_one(i2sdev->clock_disable, &args);
-               break;
-       case 1:
-               if (i2sdev->clock_enable)
-                       return pmf_call_one(i2sdev->clock_enable, &args);
-               break;
-       default:
-               printk(KERN_ERR "i2sbus: INVALID CLOCK ENABLE VALUE\n");
-               return -ENODEV;
-       }
-
-       if (macio == NULL || macio->base == NULL)
-               return -ENODEV;
-
-       switch (i2sdev->bus_number) {
-       case 0:
-               if (enable)
-                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
-               else
-                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S0_CLK_ENABLE_BIT);
-               break;
-       case 1:
-               if (enable)
-                       MACIO_BIS(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
-               else
-                       MACIO_BIC(KEYLARGO_FCR1, KL1_I2S1_CLK_ENABLE_BIT);
-               break;
-       default:
-               return -ENODEV;
-       }
-       return 0;
-}
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
deleted file mode 100644 (file)
index b4590df..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * i2sbus driver
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/interrupt.h>
-#include <linux/dma-mapping.h>
-
-#include <sound/core.h>
-
-#include <asm/macio.h>
-#include <asm/dbdma.h>
-
-#include "../soundbus.h"
-#include "i2sbus.h"
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
-MODULE_DESCRIPTION("Apple Soundbus: I2S support");
-
-static int force;
-module_param(force, int, 0444);
-MODULE_PARM_DESC(force, "Force loading i2sbus even when"
-                       " no layout-id property is present");
-
-static struct of_device_id i2sbus_match[] = {
-       { .name = "i2s" },
-       { }
-};
-
-MODULE_DEVICE_TABLE(of, i2sbus_match);
-
-static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
-                                      struct dbdma_command_mem *r,
-                                      int numcmds)
-{
-       /* one more for rounding, one for branch back, one for stop command */
-       r->size = (numcmds + 3) * sizeof(struct dbdma_cmd);
-       /* We use the PCI APIs for now until the generic one gets fixed
-        * enough or until we get some macio-specific versions
-        */
-       r->space = dma_alloc_coherent(
-                       &macio_get_pci_dev(i2sdev->macio)->dev,
-                       r->size,
-                       &r->bus_addr,
-                       GFP_KERNEL);
-
-       if (!r->space) return -ENOMEM;
-
-       memset(r->space, 0, r->size);
-       r->cmds = (void*)DBDMA_ALIGN(r->space);
-       r->bus_cmd_start = r->bus_addr +
-                          (dma_addr_t)((char*)r->cmds - (char*)r->space);
-
-       return 0;
-}
-
-static void free_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
-                                      struct dbdma_command_mem *r)
-{
-       if (!r->space) return;
-       
-       dma_free_coherent(&macio_get_pci_dev(i2sdev->macio)->dev,
-                           r->size, r->space, r->bus_addr);
-}
-
-static void i2sbus_release_dev(struct device *dev)
-{
-       struct i2sbus_dev *i2sdev;
-       int i;
-
-       i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
-
-       if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
-       if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
-       if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
-       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
-               if (i2sdev->allocated_resource[i])
-                       release_and_free_resource(i2sdev->allocated_resource[i]);
-       free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
-       free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring);
-       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
-               free_irq(i2sdev->interrupts[i], i2sdev);
-       i2sbus_control_remove_dev(i2sdev->control, i2sdev);
-       mutex_destroy(&i2sdev->lock);
-       kfree(i2sdev);
-}
-
-static irqreturn_t i2sbus_bus_intr(int irq, void *devid)
-{
-       struct i2sbus_dev *dev = devid;
-       u32 intreg;
-
-       spin_lock(&dev->low_lock);
-       intreg = in_le32(&dev->intfregs->intr_ctl);
-
-       /* acknowledge interrupt reasons */
-       out_le32(&dev->intfregs->intr_ctl, intreg);
-
-       spin_unlock(&dev->low_lock);
-
-       return IRQ_HANDLED;
-}
-
-
-/*
- * XXX FIXME: We test the layout_id's here to get the proper way of
- * mapping in various registers, thanks to bugs in Apple device-trees.
- * We could instead key off the machine model and the name of the i2s
- * node (i2s-a). This we'll do when we move it all to macio_asic.c
- * and have that export items for each sub-node too.
- */
-static int i2sbus_get_and_fixup_rsrc(struct device_node *np, int index,
-                                    int layout, struct resource *res)
-{
-       struct device_node *parent;
-       int pindex, rc = -ENXIO;
-       const u32 *reg;
-
-       /* Machines with layout 76 and 36 (K2 based) have a weird device
-        * tree what we need to special case.
-        * Normal machines just fetch the resource from the i2s-X node.
-        * Darwin further divides normal machines into old and new layouts
-        * with a subtely different code path but that doesn't seem necessary
-        * in practice, they just bloated it. In addition, even on our K2
-        * case the i2s-modem node, if we ever want to handle it, uses the
-        * normal layout
-        */
-       if (layout != 76 && layout != 36)
-               return of_address_to_resource(np, index, res);
-
-       parent = of_get_parent(np);
-       pindex = (index == aoa_resource_i2smmio) ? 0 : 1;
-       rc = of_address_to_resource(parent, pindex, res);
-       if (rc)
-               goto bail;
-       reg = of_get_property(np, "reg", NULL);
-       if (reg == NULL) {
-               rc = -ENXIO;
-               goto bail;
-       }
-       res->start += reg[index * 2];
-       res->end = res->start + reg[index * 2 + 1] - 1;
- bail:
-       of_node_put(parent);
-       return rc;
-}
-
-/* FIXME: look at device node refcounting */
-static int i2sbus_add_dev(struct macio_dev *macio,
-                         struct i2sbus_control *control,
-                         struct device_node *np)
-{
-       struct i2sbus_dev *dev;
-       struct device_node *child = NULL, *sound = NULL;
-       struct resource *r;
-       int i, layout = 0, rlen, ok = force;
-       static const char *rnames[] = { "i2sbus: %s (control)",
-                                       "i2sbus: %s (tx)",
-                                       "i2sbus: %s (rx)" };
-       static irq_handler_t ints[] = {
-               i2sbus_bus_intr,
-               i2sbus_tx_intr,
-               i2sbus_rx_intr
-       };
-
-       if (strlen(np->name) != 5)
-               return 0;
-       if (strncmp(np->name, "i2s-", 4))
-               return 0;
-
-       dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
-       if (!dev)
-               return 0;
-
-       i = 0;
-       while ((child = of_get_next_child(np, child))) {
-               if (strcmp(child->name, "sound") == 0) {
-                       i++;
-                       sound = child;
-               }
-       }
-       if (i == 1) {
-               const u32 *layout_id =
-                       of_get_property(sound, "layout-id", NULL);
-               if (layout_id) {
-                       layout = *layout_id;
-                       snprintf(dev->sound.modalias, 32,
-                                "sound-layout-%d", layout);
-                       ok = 1;
-               }
-       }
-       /* for the time being, until we can handle non-layout-id
-        * things in some fabric, refuse to attach if there is no
-        * layout-id property or we haven't been forced to attach.
-        * When there are two i2s busses and only one has a layout-id,
-        * then this depends on the order, but that isn't important
-        * either as the second one in that case is just a modem. */
-       if (!ok) {
-               kfree(dev);
-               return -ENODEV;
-       }
-
-       mutex_init(&dev->lock);
-       spin_lock_init(&dev->low_lock);
-       dev->sound.ofdev.node = np;
-       dev->sound.ofdev.dma_mask = macio->ofdev.dma_mask;
-       dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.dma_mask;
-       dev->sound.ofdev.dev.parent = &macio->ofdev.dev;
-       dev->sound.ofdev.dev.release = i2sbus_release_dev;
-       dev->sound.attach_codec = i2sbus_attach_codec;
-       dev->sound.detach_codec = i2sbus_detach_codec;
-       dev->sound.pcmid = -1;
-       dev->macio = macio;
-       dev->control = control;
-       dev->bus_number = np->name[4] - 'a';
-       INIT_LIST_HEAD(&dev->sound.codec_list);
-
-       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
-               dev->interrupts[i] = -1;
-               snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
-                        rnames[i], np->name);
-       }
-       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
-               int irq = irq_of_parse_and_map(np, i);
-               if (request_irq(irq, ints[i], 0, dev->rnames[i], dev))
-                       goto err;
-               dev->interrupts[i] = irq;
-       }
-
-
-       /* Resource handling is problematic as some device-trees contain
-        * useless crap (ugh ugh ugh). We work around that here by calling
-        * specific functions for calculating the appropriate resources.
-        *
-        * This will all be moved to macio_asic.c at one point
-        */
-       for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
-               if (i2sbus_get_and_fixup_rsrc(np,i,layout,&dev->resources[i]))
-                       goto err;
-               /* If only we could use our resource dev->resources[i]...
-                * but request_resource doesn't know about parents and
-                * contained resources...
-                */
-               dev->allocated_resource[i] = 
-                       request_mem_region(dev->resources[i].start,
-                                          dev->resources[i].end -
-                                          dev->resources[i].start + 1,
-                                          dev->rnames[i]);
-               if (!dev->allocated_resource[i]) {
-                       printk(KERN_ERR "i2sbus: failed to claim resource %d!\n", i);
-                       goto err;
-               }
-       }
-
-       r = &dev->resources[aoa_resource_i2smmio];
-       rlen = r->end - r->start + 1;
-       if (rlen < sizeof(struct i2s_interface_regs))
-               goto err;
-       dev->intfregs = ioremap(r->start, rlen);
-
-       r = &dev->resources[aoa_resource_txdbdma];
-       rlen = r->end - r->start + 1;
-       if (rlen < sizeof(struct dbdma_regs))
-               goto err;
-       dev->out.dbdma = ioremap(r->start, rlen);
-
-       r = &dev->resources[aoa_resource_rxdbdma];
-       rlen = r->end - r->start + 1;
-       if (rlen < sizeof(struct dbdma_regs))
-               goto err;
-       dev->in.dbdma = ioremap(r->start, rlen);
-
-       if (!dev->intfregs || !dev->out.dbdma || !dev->in.dbdma)
-               goto err;
-
-       if (alloc_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring,
-                                       MAX_DBDMA_COMMANDS))
-               goto err;
-       if (alloc_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring,
-                                       MAX_DBDMA_COMMANDS))
-               goto err;
-
-       if (i2sbus_control_add_dev(dev->control, dev)) {
-               printk(KERN_ERR "i2sbus: control layer didn't like bus\n");
-               goto err;
-       }
-
-       if (soundbus_add_one(&dev->sound)) {
-               printk(KERN_DEBUG "i2sbus: device registration error!\n");
-               goto err;
-       }
-
-       /* enable this cell */
-       i2sbus_control_cell(dev->control, dev, 1);
-       i2sbus_control_enable(dev->control, dev);
-       i2sbus_control_clock(dev->control, dev, 1);
-
-       return 1;
- err:
-       for (i=0;i<3;i++)
-               if (dev->interrupts[i] != -1)
-                       free_irq(dev->interrupts[i], dev);
-       free_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring);
-       free_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring);
-       if (dev->intfregs) iounmap(dev->intfregs);
-       if (dev->out.dbdma) iounmap(dev->out.dbdma);
-       if (dev->in.dbdma) iounmap(dev->in.dbdma);
-       for (i=0;i<3;i++)
-               if (dev->allocated_resource[i])
-                       release_and_free_resource(dev->allocated_resource[i]);
-       mutex_destroy(&dev->lock);
-       kfree(dev);
-       return 0;
-}
-
-static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
-{
-       struct device_node *np = NULL;
-       int got = 0, err;
-       struct i2sbus_control *control = NULL;
-
-       err = i2sbus_control_init(dev, &control);
-       if (err)
-               return err;
-       if (!control) {
-               printk(KERN_ERR "i2sbus_control_init API breakage\n");
-               return -ENODEV;
-       }
-
-       while ((np = of_get_next_child(dev->ofdev.node, np))) {
-               if (of_device_is_compatible(np, "i2sbus") ||
-                   of_device_is_compatible(np, "i2s-modem")) {
-                       got += i2sbus_add_dev(dev, control, np);
-               }
-       }
-
-       if (!got) {
-               /* found none, clean up */
-               i2sbus_control_destroy(control);
-               return -ENODEV;
-       }
-
-       dev->ofdev.dev.driver_data = control;
-
-       return 0;
-}
-
-static int i2sbus_remove(struct macio_dev* dev)
-{
-       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
-       struct i2sbus_dev *i2sdev, *tmp;
-
-       list_for_each_entry_safe(i2sdev, tmp, &control->list, item)
-               soundbus_remove_one(&i2sdev->sound);
-
-       return 0;
-}
-
-#ifdef CONFIG_PM
-static int i2sbus_suspend(struct macio_dev* dev, pm_message_t state)
-{
-       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
-       struct codec_info_item *cii;
-       struct i2sbus_dev* i2sdev;
-       int err, ret = 0;
-
-       list_for_each_entry(i2sdev, &control->list, item) {
-               /* Notify Alsa */
-               if (i2sdev->sound.pcm) {
-                       /* Suspend PCM streams */
-                       snd_pcm_suspend_all(i2sdev->sound.pcm);
-               }
-
-               /* Notify codecs */
-               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-                       err = 0;
-                       if (cii->codec->suspend)
-                               err = cii->codec->suspend(cii, state);
-                       if (err)
-                               ret = err;
-               }
-
-               /* wait until streams are stopped */
-               i2sbus_wait_for_stop_both(i2sdev);
-       }
-
-       return ret;
-}
-
-static int i2sbus_resume(struct macio_dev* dev)
-{
-       struct i2sbus_control *control = dev->ofdev.dev.driver_data;
-       struct codec_info_item *cii;
-       struct i2sbus_dev* i2sdev;
-       int err, ret = 0;
-
-       list_for_each_entry(i2sdev, &control->list, item) {
-               /* reset i2s bus format etc. */
-               i2sbus_pcm_prepare_both(i2sdev);
-
-               /* Notify codecs so they can re-initialize */
-               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-                       err = 0;
-                       if (cii->codec->resume)
-                               err = cii->codec->resume(cii);
-                       if (err)
-                               ret = err;
-               }
-       }
-
-       return ret;
-}
-#endif /* CONFIG_PM */
-
-static int i2sbus_shutdown(struct macio_dev* dev)
-{
-       return 0;
-}
-
-static struct macio_driver i2sbus_drv = {
-       .name = "soundbus-i2s",
-       .owner = THIS_MODULE,
-       .match_table = i2sbus_match,
-       .probe = i2sbus_probe,
-       .remove = i2sbus_remove,
-#ifdef CONFIG_PM
-       .suspend = i2sbus_suspend,
-       .resume = i2sbus_resume,
-#endif
-       .shutdown = i2sbus_shutdown,
-};
-
-static int __init soundbus_i2sbus_init(void)
-{
-       return macio_register_driver(&i2sbus_drv);
-}
-
-static void __exit soundbus_i2sbus_exit(void)
-{
-       macio_unregister_driver(&i2sbus_drv);
-}
-
-module_init(soundbus_i2sbus_init);
-module_exit(soundbus_i2sbus_exit);
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-interface.h b/sound/aoa/soundbus/i2sbus/i2sbus-interface.h
deleted file mode 100644 (file)
index c6b5f54..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * i2sbus driver -- interface register definitions
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-#ifndef __I2SBUS_INTERFACE_H
-#define __I2SBUS_INTERFACE_H
-
-/* i2s bus control registers, at least what we know about them */
-
-#define __PAD(m,n) u8 __pad##m[n]
-#define _PAD(line, n) __PAD(line, n)
-#define PAD(n) _PAD(__LINE__, (n))
-struct i2s_interface_regs {
-       __le32 intr_ctl;        /* 0x00 */
-       PAD(12);
-       __le32 serial_format;   /* 0x10 */
-       PAD(12);
-       __le32 codec_msg_out;   /* 0x20 */
-       PAD(12);
-       __le32 codec_msg_in;    /* 0x30 */
-       PAD(12);
-       __le32 frame_count;     /* 0x40 */
-       PAD(12);
-       __le32 frame_match;     /* 0x50 */
-       PAD(12);
-       __le32 data_word_sizes; /* 0x60 */
-       PAD(12);
-       __le32 peak_level_sel;  /* 0x70 */
-       PAD(12);
-       __le32 peak_level_in0;  /* 0x80 */
-       PAD(12);
-       __le32 peak_level_in1;  /* 0x90 */
-       PAD(12);
-       /* total size: 0x100 bytes */
-}  __attribute__((__packed__));
-
-/* interrupt register is just a bitfield with
- * interrupt enable and pending bits */
-#define I2S_REG_INTR_CTL               0x00
-#      define I2S_INT_FRAME_COUNT              (1<<31)
-#      define I2S_PENDING_FRAME_COUNT          (1<<30)
-#      define I2S_INT_MESSAGE_FLAG             (1<<29)
-#      define I2S_PENDING_MESSAGE_FLAG         (1<<28)
-#      define I2S_INT_NEW_PEAK                 (1<<27)
-#      define I2S_PENDING_NEW_PEAK             (1<<26)
-#      define I2S_INT_CLOCKS_STOPPED           (1<<25)
-#      define I2S_PENDING_CLOCKS_STOPPED       (1<<24)
-#      define I2S_INT_EXTERNAL_SYNC_ERROR      (1<<23)
-#      define I2S_PENDING_EXTERNAL_SYNC_ERROR  (1<<22)
-#      define I2S_INT_EXTERNAL_SYNC_OK         (1<<21)
-#      define I2S_PENDING_EXTERNAL_SYNC_OK     (1<<20)
-#      define I2S_INT_NEW_SAMPLE_RATE          (1<<19)
-#      define I2S_PENDING_NEW_SAMPLE_RATE      (1<<18)
-#      define I2S_INT_STATUS_FLAG              (1<<17)
-#      define I2S_PENDING_STATUS_FLAG          (1<<16)
-
-/* serial format register is more interesting :)
- * It contains:
- *  - clock source
- *  - MClk divisor
- *  - SClk divisor
- *  - SClk master flag
- *  - serial format (sony, i2s 64x, i2s 32x, dav, silabs)
- *  - external sample frequency interrupt (don't understand)
- *  - external sample frequency
- */
-#define I2S_REG_SERIAL_FORMAT          0x10
-/* clock source. You get either 18.432, 45.1584 or 49.1520 MHz */
-#      define I2S_SF_CLOCK_SOURCE_SHIFT        30
-#      define I2S_SF_CLOCK_SOURCE_MASK         (3<<I2S_SF_CLOCK_SOURCE_SHIFT)
-#      define I2S_SF_CLOCK_SOURCE_18MHz        (0<<I2S_SF_CLOCK_SOURCE_SHIFT)
-#      define I2S_SF_CLOCK_SOURCE_45MHz        (1<<I2S_SF_CLOCK_SOURCE_SHIFT)
-#      define I2S_SF_CLOCK_SOURCE_49MHz        (2<<I2S_SF_CLOCK_SOURCE_SHIFT)
-/* also, let's define the exact clock speeds here, in Hz */
-#define I2S_CLOCK_SPEED_18MHz  18432000
-#define I2S_CLOCK_SPEED_45MHz  45158400
-#define I2S_CLOCK_SPEED_49MHz  49152000
-/* MClk is the clock that drives the codec, usually called its 'system clock'.
- * It is derived by taking only every 'divisor' tick of the clock.
- */
-#      define I2S_SF_MCLKDIV_SHIFT             24
-#      define I2S_SF_MCLKDIV_MASK              (0x1F<<I2S_SF_MCLKDIV_SHIFT)
-#      define I2S_SF_MCLKDIV_1                 (0x14<<I2S_SF_MCLKDIV_SHIFT)
-#      define I2S_SF_MCLKDIV_3                 (0x13<<I2S_SF_MCLKDIV_SHIFT)
-#      define I2S_SF_MCLKDIV_5                 (0x12<<I2S_SF_MCLKDIV_SHIFT)
-#      define I2S_SF_MCLKDIV_14                (0x0E<<I2S_SF_MCLKDIV_SHIFT)
-#      define I2S_SF_MCLKDIV_OTHER(div)        (((div/2-1)<<I2S_SF_MCLKDIV_SHIFT)&I2S_SF_MCLKDIV_MASK)
-static inline int i2s_sf_mclkdiv(int div, int *out)
-{
-       int d;
-
-       switch(div) {
-       case 1: *out |= I2S_SF_MCLKDIV_1; return 0;
-       case 3: *out |= I2S_SF_MCLKDIV_3; return 0;
-       case 5: *out |= I2S_SF_MCLKDIV_5; return 0;
-       case 14: *out |= I2S_SF_MCLKDIV_14; return 0;
-       default:
-               if (div%2) return -1;
-               d = div/2-1;
-               if (d == 0x14 || d == 0x13 || d == 0x12 || d == 0x0E)
-                       return -1;
-               *out |= I2S_SF_MCLKDIV_OTHER(div);
-               return 0;
-       }
-}
-/* SClk is the clock that drives the i2s wire bus. Note that it is
- * derived from the MClk above by taking only every 'divisor' tick
- * of MClk.
- */
-#      define I2S_SF_SCLKDIV_SHIFT             20
-#      define I2S_SF_SCLKDIV_MASK              (0xF<<I2S_SF_SCLKDIV_SHIFT)
-#      define I2S_SF_SCLKDIV_1                 (8<<I2S_SF_SCLKDIV_SHIFT)
-#      define I2S_SF_SCLKDIV_3                 (9<<I2S_SF_SCLKDIV_SHIFT)
-#      define I2S_SF_SCLKDIV_OTHER(div)        (((div/2-1)<<I2S_SF_SCLKDIV_SHIFT)&I2S_SF_SCLKDIV_MASK)
-static inline int i2s_sf_sclkdiv(int div, int *out)
-{
-       int d;
-
-       switch(div) {
-       case 1: *out |= I2S_SF_SCLKDIV_1; return 0;
-       case 3: *out |= I2S_SF_SCLKDIV_3; return 0;
-       default:
-               if (div%2) return -1;
-               d = div/2-1;
-               if (d == 8 || d == 9) return -1;
-               *out |= I2S_SF_SCLKDIV_OTHER(div);
-               return 0;
-       }
-}
-#      define I2S_SF_SCLK_MASTER               (1<<19)
-/* serial format is the way the data is put to the i2s wire bus */
-#      define I2S_SF_SERIAL_FORMAT_SHIFT       16
-#      define I2S_SF_SERIAL_FORMAT_MASK        (7<<I2S_SF_SERIAL_FORMAT_SHIFT)
-#      define I2S_SF_SERIAL_FORMAT_SONY        (0<<I2S_SF_SERIAL_FORMAT_SHIFT)
-#      define I2S_SF_SERIAL_FORMAT_I2S_64X     (1<<I2S_SF_SERIAL_FORMAT_SHIFT)
-#      define I2S_SF_SERIAL_FORMAT_I2S_32X     (2<<I2S_SF_SERIAL_FORMAT_SHIFT)
-#      define I2S_SF_SERIAL_FORMAT_I2S_DAV     (4<<I2S_SF_SERIAL_FORMAT_SHIFT)
-#      define I2S_SF_SERIAL_FORMAT_I2S_SILABS  (5<<I2S_SF_SERIAL_FORMAT_SHIFT)
-/* unknown */
-#      define I2S_SF_EXT_SAMPLE_FREQ_INT_SHIFT 12
-#      define I2S_SF_EXT_SAMPLE_FREQ_INT_MASK  (0xF<<I2S_SF_SAMPLE_FREQ_INT_SHIFT)
-/* probably gives external frequency? */
-#      define I2S_SF_EXT_SAMPLE_FREQ_MASK      0xFFF
-
-/* used to send codec messages, but how isn't clear */
-#define I2S_REG_CODEC_MSG_OUT          0x20
-
-/* used to receive codec messages, but how isn't clear */
-#define I2S_REG_CODEC_MSG_IN           0x30
-
-/* frame count reg isn't clear to me yet, but probably useful */
-#define I2S_REG_FRAME_COUNT            0x40
-
-/* program to some value, and get interrupt if frame count reaches it */
-#define I2S_REG_FRAME_MATCH            0x50
-
-/* this register describes how the bus transfers data */
-#define I2S_REG_DATA_WORD_SIZES                0x60
-/* number of interleaved input channels */
-#      define I2S_DWS_NUM_CHANNELS_IN_SHIFT    24
-#      define I2S_DWS_NUM_CHANNELS_IN_MASK     (0x1F<<I2S_DWS_NUM_CHANNELS_IN_SHIFT)
-/* word size of input data */
-#      define I2S_DWS_DATA_IN_SIZE_SHIFT       16
-#      define I2S_DWS_DATA_IN_16BIT            (0<<I2S_DWS_DATA_IN_SIZE_SHIFT)
-#      define I2S_DWS_DATA_IN_24BIT            (3<<I2S_DWS_DATA_IN_SIZE_SHIFT)
-/* number of interleaved output channels */
-#      define I2S_DWS_NUM_CHANNELS_OUT_SHIFT   8
-#      define I2S_DWS_NUM_CHANNELS_OUT_MASK    (0x1F<<I2S_DWS_NUM_CHANNELS_OUT_SHIFT)
-/* word size of output data */
-#      define I2S_DWS_DATA_OUT_SIZE_SHIFT      0
-#      define I2S_DWS_DATA_OUT_16BIT           (0<<I2S_DWS_DATA_OUT_SIZE_SHIFT)
-#      define I2S_DWS_DATA_OUT_24BIT           (3<<I2S_DWS_DATA_OUT_SIZE_SHIFT)
-
-
-/* unknown */
-#define I2S_REG_PEAK_LEVEL_SEL         0x70
-
-/* unknown */
-#define I2S_REG_PEAK_LEVEL_IN0         0x80
-
-/* unknown */
-#define I2S_REG_PEAK_LEVEL_IN1         0x90
-
-#endif /* __I2SBUS_INTERFACE_H */
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-pcm.c b/sound/aoa/soundbus/i2sbus/i2sbus-pcm.c
deleted file mode 100644 (file)
index 59bacd3..0000000
+++ /dev/null
@@ -1,1062 +0,0 @@
-/*
- * i2sbus driver -- pcm routines
- *
- * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
- *
- * GPL v2, can be found in COPYING.
- */
-
-#include <asm/io.h>
-#include <linux/delay.h>
-#include <sound/core.h>
-#include <asm/macio.h>
-#include <linux/pci.h>
-#include "../soundbus.h"
-#include "i2sbus.h"
-
-static inline void get_pcm_info(struct i2sbus_dev *i2sdev, int in,
-                               struct pcm_info **pi, struct pcm_info **other)
-{
-       if (in) {
-               if (pi)
-                       *pi = &i2sdev->in;
-               if (other)
-                       *other = &i2sdev->out;
-       } else {
-               if (pi)
-                       *pi = &i2sdev->out;
-               if (other)
-                       *other = &i2sdev->in;
-       }
-}
-
-static int clock_and_divisors(int mclk, int sclk, int rate, int *out)
-{
-       /* sclk must be derived from mclk! */
-       if (mclk % sclk)
-               return -1;
-       /* derive sclk register value */
-       if (i2s_sf_sclkdiv(mclk / sclk, out))
-               return -1;
-
-       if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
-               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / (rate * mclk), out)) {
-                       *out |= I2S_SF_CLOCK_SOURCE_18MHz;
-                       return 0;
-               }
-       }
-       if (I2S_CLOCK_SPEED_45MHz % (rate * mclk) == 0) {
-               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_45MHz / (rate * mclk), out)) {
-                       *out |= I2S_SF_CLOCK_SOURCE_45MHz;
-                       return 0;
-               }
-       }
-       if (I2S_CLOCK_SPEED_49MHz % (rate * mclk) == 0) {
-               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_49MHz / (rate * mclk), out)) {
-                       *out |= I2S_SF_CLOCK_SOURCE_49MHz;
-                       return 0;
-               }
-       }
-       return -1;
-}
-
-#define CHECK_RATE(rate)                                               \
-       do { if (rates & SNDRV_PCM_RATE_ ##rate) {                      \
-               int dummy;                                              \
-               if (clock_and_divisors(sysclock_factor,                 \
-                                      bus_factor, rate, &dummy))       \
-                       rates &= ~SNDRV_PCM_RATE_ ##rate;               \
-       } } while (0)
-
-static int i2sbus_pcm_open(struct i2sbus_dev *i2sdev, int in)
-{
-       struct pcm_info *pi, *other;
-       struct soundbus_dev *sdev;
-       int masks_inited = 0, err;
-       struct codec_info_item *cii, *rev;
-       struct snd_pcm_hardware *hw;
-       u64 formats = 0;
-       unsigned int rates = 0;
-       struct transfer_info v;
-       int result = 0;
-       int bus_factor = 0, sysclock_factor = 0;
-       int found_this;
-
-       mutex_lock(&i2sdev->lock);
-
-       get_pcm_info(i2sdev, in, &pi, &other);
-
-       hw = &pi->substream->runtime->hw;
-       sdev = &i2sdev->sound;
-
-       if (pi->active) {
-               /* alsa messed up */
-               result = -EBUSY;
-               goto out_unlock;
-       }
-
-       /* we now need to assign the hw */
-       list_for_each_entry(cii, &sdev->codec_list, list) {
-               struct transfer_info *ti = cii->codec->transfers;
-               bus_factor = cii->codec->bus_factor;
-               sysclock_factor = cii->codec->sysclock_factor;
-               while (ti->formats && ti->rates) {
-                       v = *ti;
-                       if (ti->transfer_in == in
-                           && cii->codec->usable(cii, ti, &v)) {
-                               if (masks_inited) {
-                                       formats &= v.formats;
-                                       rates &= v.rates;
-                               } else {
-                                       formats = v.formats;
-                                       rates = v.rates;
-                                       masks_inited = 1;
-                               }
-                       }
-                       ti++;
-               }
-       }
-       if (!masks_inited || !bus_factor || !sysclock_factor) {
-               result = -ENODEV;
-               goto out_unlock;
-       }
-       /* bus dependent stuff */
-       hw->info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
-                  SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME |
-                  SNDRV_PCM_INFO_JOINT_DUPLEX;
-
-       CHECK_RATE(5512);
-       CHECK_RATE(8000);
-       CHECK_RATE(11025);
-       CHECK_RATE(16000);
-       CHECK_RATE(22050);
-       CHECK_RATE(32000);
-       CHECK_RATE(44100);
-       CHECK_RATE(48000);
-       CHECK_RATE(64000);
-       CHECK_RATE(88200);
-       CHECK_RATE(96000);
-       CHECK_RATE(176400);
-       CHECK_RATE(192000);
-       hw->rates = rates;
-
-       /* well. the codec might want 24 bits only, and we'll
-        * ever only transfer 24 bits, but they are top-aligned!
-        * So for alsa, we claim that we're doing full 32 bit
-        * while in reality we'll ignore the lower 8 bits of
-        * that when doing playback (they're transferred as 0
-        * as far as I know, no codecs we have are 32-bit capable
-        * so I can't really test) and when doing recording we'll
-        * always have those lower 8 bits recorded as 0 */
-       if (formats & SNDRV_PCM_FMTBIT_S24_BE)
-               formats |= SNDRV_PCM_FMTBIT_S32_BE;
-       if (formats & SNDRV_PCM_FMTBIT_U24_BE)
-               formats |= SNDRV_PCM_FMTBIT_U32_BE;
-       /* now mask off what we can support. I suppose we could
-        * also support S24_3LE and some similar formats, but I
-        * doubt there's a codec that would be able to use that,
-        * so we don't support it here. */
-       hw->formats = formats & (SNDRV_PCM_FMTBIT_S16_BE |
-                                SNDRV_PCM_FMTBIT_U16_BE |
-                                SNDRV_PCM_FMTBIT_S32_BE |
-                                SNDRV_PCM_FMTBIT_U32_BE);
-
-       /* we need to set the highest and lowest rate possible.
-        * These are the highest and lowest rates alsa can
-        * support properly in its bitfield.
-        * Below, we'll use that to restrict to the rate
-        * currently in use (if any). */
-       hw->rate_min = 5512;
-       hw->rate_max = 192000;
-       /* if the other stream is active, then we can only
-        * support what it is currently using.
-        * FIXME: I lied. This comment is wrong. We can support
-        * anything that works with the same serial format, ie.
-        * when recording 24 bit sound we can well play 16 bit
-        * sound at the same time iff using the same transfer mode.
-        */
-       if (other->active) {
-               /* FIXME: is this guaranteed by the alsa api? */
-               hw->formats &= (1ULL << i2sdev->format);
-               /* see above, restrict rates to the one we already have */
-               hw->rate_min = i2sdev->rate;
-               hw->rate_max = i2sdev->rate;
-       }
-
-       hw->channels_min = 2;
-       hw->channels_max = 2;
-       /* these are somewhat arbitrary */
-       hw->buffer_bytes_max = 131072;
-       hw->period_bytes_min = 256;
-       hw->period_bytes_max = 16384;
-       hw->periods_min = 3;
-       hw->periods_max = MAX_DBDMA_COMMANDS;
-       err = snd_pcm_hw_constraint_integer(pi->substream->runtime,
-                                           SNDRV_PCM_HW_PARAM_PERIODS);
-       if (err < 0) {
-               result = err;
-               goto out_unlock;
-       }
-       list_for_each_entry(cii, &sdev->codec_list, list) {
-               if (cii->codec->open) {
-                       err = cii->codec->open(cii, pi->substream);
-                       if (err) {
-                               result = err;
-                               /* unwind */
-                               found_this = 0;
-                               list_for_each_entry_reverse(rev,
-                                   &sdev->codec_list, list) {
-                                       if (found_this && rev->codec->close) {
-                                               rev->codec->close(rev,
-                                                               pi->substream);
-                                       }
-                                       if (rev == cii)
-                                               found_this = 1;
-                               }
-                               goto out_unlock;
-                       }
-               }
-       }
-
- out_unlock:
-       mutex_unlock(&i2sdev->lock);
-       return result;
-}
-
-#undef CHECK_RATE
-
-static int i2sbus_pcm_close(struct i2sbus_dev *i2sdev, int in)
-{
-       struct codec_info_item *cii;
-       struct pcm_info *pi;
-       int err = 0, tmp;
-
-       mutex_lock(&i2sdev->lock);
-
-       get_pcm_info(i2sdev, in, &pi, NULL);
-
-       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-               if (cii->codec->close) {
-                       tmp = cii->codec->close(cii, pi->substream);
-                       if (tmp)
-                               err = tmp;
-               }
-       }
-
-       pi->substream = NULL;
-       pi->active = 0;
-       mutex_unlock(&i2sdev->lock);
-       return err;
-}
-
-static void i2sbus_wait_for_stop(struct i2sbus_dev *i2sdev,
-                                struct pcm_info *pi)
-{
-       unsigned long flags;
-       struct completion done;
-       long timeout;
-
-       spin_lock_irqsave(&i2sdev->low_lock, flags);
-       if (pi->dbdma_ring.stopping) {
-               init_completion(&done);
-               pi->stop_completion = &done;
-               spin_unlock_irqrestore(&i2sdev->low_lock, flags);
-               timeout = wait_for_completion_timeout(&done, HZ);
-               spin_lock_irqsave(&i2sdev->low_lock, flags);
-               pi->stop_completion = NULL;
-               if (timeout == 0) {
-                       /* timeout expired, stop dbdma forcefully */
-                       printk(KERN_ERR "i2sbus_wait_for_stop: timed out\n");
-                       /* make sure RUN, PAUSE and S0 bits are cleared */
-                       out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
-                       pi->dbdma_ring.stopping = 0;
-                       timeout = 10;
-                       while (in_le32(&pi->dbdma->status) & ACTIVE) {
-                               if (--timeout <= 0)
-                                       break;
-                               udelay(1);
-                       }
-               }
-       }
-       spin_unlock_irqrestore(&i2sdev->low_lock, flags);
-}
-
-#ifdef CONFIG_PM
-void i2sbus_wait_for_stop_both(struct i2sbus_dev *i2sdev)
-{
-       struct pcm_info *pi;
-
-       get_pcm_info(i2sdev, 0, &pi, NULL);
-       i2sbus_wait_for_stop(i2sdev, pi);
-       get_pcm_info(i2sdev, 1, &pi, NULL);
-       i2sbus_wait_for_stop(i2sdev, pi);
-}
-#endif
-
-static int i2sbus_hw_params(struct snd_pcm_substream *substream,
-                           struct snd_pcm_hw_params *params)
-{
-       return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
-}
-
-static inline int i2sbus_hw_free(struct snd_pcm_substream *substream, int in)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-       struct pcm_info *pi;
-
-       get_pcm_info(i2sdev, in, &pi, NULL);
-       if (pi->dbdma_ring.stopping)
-               i2sbus_wait_for_stop(i2sdev, pi);
-       snd_pcm_lib_free_pages(substream);
-       return 0;
-}
-
-static int i2sbus_playback_hw_free(struct snd_pcm_substream *substream)
-{
-       return i2sbus_hw_free(substream, 0);
-}
-
-static int i2sbus_record_hw_free(struct snd_pcm_substream *substream)
-{
-       return i2sbus_hw_free(substream, 1);
-}
-
-static int i2sbus_pcm_prepare(struct i2sbus_dev *i2sdev, int in)
-{
-       /* whee. Hard work now. The user has selected a bitrate
-        * and bit format, so now we have to program our
-        * I2S controller appropriately. */
-       struct snd_pcm_runtime *runtime;
-       struct dbdma_cmd *command;
-       int i, periodsize, nperiods;
-       dma_addr_t offset;
-       struct bus_info bi;
-       struct codec_info_item *cii;
-       int sfr = 0;            /* serial format register */
-       int dws = 0;            /* data word sizes reg */
-       int input_16bit;
-       struct pcm_info *pi, *other;
-       int cnt;
-       int result = 0;
-       unsigned int cmd, stopaddr;
-
-       mutex_lock(&i2sdev->lock);
-
-       get_pcm_info(i2sdev, in, &pi, &other);
-
-       if (pi->dbdma_ring.running) {
-               result = -EBUSY;
-               goto out_unlock;
-       }
-       if (pi->dbdma_ring.stopping)
-               i2sbus_wait_for_stop(i2sdev, pi);
-
-       if (!pi->substream || !pi->substream->runtime) {
-               result = -EINVAL;
-               goto out_unlock;
-       }
-
-       runtime = pi->substream->runtime;
-       pi->active = 1;
-       if (other->active &&
-           ((i2sdev->format != runtime->format)
-            || (i2sdev->rate != runtime->rate))) {
-               result = -EINVAL;
-               goto out_unlock;
-       }
-
-       i2sdev->format = runtime->format;
-       i2sdev->rate = runtime->rate;
-
-       periodsize = snd_pcm_lib_period_bytes(pi->substream);
-       nperiods = pi->substream->runtime->periods;
-       pi->current_period = 0;
-
-       /* generate dbdma command ring first */
-       command = pi->dbdma_ring.cmds;
-       memset(command, 0, (nperiods + 2) * sizeof(struct dbdma_cmd));
-
-       /* commands to DMA to/from the ring */
-       /*
-        * For input, we need to do a graceful stop; if we abort
-        * the DMA, we end up with leftover bytes that corrupt
-        * the next recording.  To do this we set the S0 status
-        * bit and wait for the DMA controller to stop.  Each
-        * command has a branch condition to
-        * make it branch to a stop command if S0 is set.
-        * On input we also need to wait for the S7 bit to be
-        * set before turning off the DMA controller.
-        * In fact we do the graceful stop for output as well.
-        */
-       offset = runtime->dma_addr;
-       cmd = (in? INPUT_MORE: OUTPUT_MORE) | BR_IFSET | INTR_ALWAYS;
-       stopaddr = pi->dbdma_ring.bus_cmd_start +
-               (nperiods + 1) * sizeof(struct dbdma_cmd);
-       for (i = 0; i < nperiods; i++, command++, offset += periodsize) {
-               command->command = cpu_to_le16(cmd);
-               command->cmd_dep = cpu_to_le32(stopaddr);
-               command->phy_addr = cpu_to_le32(offset);
-               command->req_count = cpu_to_le16(periodsize);
-       }
-
-       /* branch back to beginning of ring */
-       command->command = cpu_to_le16(DBDMA_NOP | BR_ALWAYS);
-       command->cmd_dep = cpu_to_le32(pi->dbdma_ring.bus_cmd_start);
-       command++;
-
-       /* set stop command */
-       command->command = cpu_to_le16(DBDMA_STOP);
-
-       /* ok, let's set the serial format and stuff */
-       switch (runtime->format) {
-       /* 16 bit formats */
-       case SNDRV_PCM_FORMAT_S16_BE:
-       case SNDRV_PCM_FORMAT_U16_BE:
-               /* FIXME: if we add different bus factors we need to
-                * do more here!! */
-               bi.bus_factor = 0;
-               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-                       bi.bus_factor = cii->codec->bus_factor;
-                       break;
-               }
-               if (!bi.bus_factor) {
-                       result = -ENODEV;
-                       goto out_unlock;
-               }
-               input_16bit = 1;
-               break;
-       case SNDRV_PCM_FORMAT_S32_BE:
-       case SNDRV_PCM_FORMAT_U32_BE:
-               /* force 64x bus speed, otherwise the data cannot be
-                * transferred quickly enough! */
-               bi.bus_factor = 64;
-               input_16bit = 0;
-               break;
-       default:
-               result = -EINVAL;
-               goto out_unlock;
-       }
-       /* we assume all sysclocks are the same! */
-       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-               bi.sysclock_factor = cii->codec->sysclock_factor;
-               break;
-       }
-
-       if (clock_and_divisors(bi.sysclock_factor,
-                              bi.bus_factor,
-                              runtime->rate,
-                              &sfr) < 0) {
-               result = -EINVAL;
-               goto out_unlock;
-       }
-       switch (bi.bus_factor) {
-       case 32:
-               sfr |= I2S_SF_SERIAL_FORMAT_I2S_32X;
-               break;
-       case 64:
-               sfr |= I2S_SF_SERIAL_FORMAT_I2S_64X;
-               break;
-       }
-       /* FIXME: THIS ASSUMES MASTER ALL THE TIME */
-       sfr |= I2S_SF_SCLK_MASTER;
-
-       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
-               int err = 0;
-               if (cii->codec->prepare)
-                       err = cii->codec->prepare(cii, &bi, pi->substream);
-               if (err) {
-                       result = err;
-                       goto out_unlock;
-               }
-       }
-       /* codecs are fine with it, so set our clocks */
-       if (input_16bit)
-               dws =   (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) |
-                       (2 << I2S_DWS_NUM_CHANNELS_OUT_SHIFT) |
-                       I2S_DWS_DATA_IN_16BIT | I2S_DWS_DATA_OUT_16BIT;
-       else
-               dws =   (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) |
-                       (2 << I2S_DWS_NUM_CHANNELS_OUT_SHIFT) |
-                       I2S_DWS_DATA_IN_24BIT | I2S_DWS_DATA_OUT_24BIT;
-
-       /* early exit if already programmed correctly */
-       /* not locking these is fine since we touch them only in this function */
-       if (in_le32(&i2sdev->intfregs->serial_format) == sfr
-        && in_le32(&i2sdev->intfregs->data_word_sizes) == dws)
-               goto out_unlock;
-
-       /* let's notify the codecs about clocks going away.
-        * For now we only do mastering on the i2s cell... */
-       list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
-               if (cii->codec->switch_clock)
-                       cii->codec->switch_clock(cii, CLOCK_SWITCH_PREPARE_SLAVE);
-
-       i2sbus_control_enable(i2sdev->control, i2sdev);
-       i2sbus_control_cell(i2sdev->control, i2sdev, 1);
-
-       out_le32(&i2sdev->intfregs->intr_ctl, I2S_PENDING_CLOCKS_STOPPED);
-
-       i2sbus_control_clock(i2sdev->control, i2sdev, 0);
-
-       msleep(1);
-
-       /* wait for clock stopped. This can apparently take a while... */
-       cnt = 100;
-       while (cnt-- &&
-           !(in_le32(&i2sdev->intfregs->intr_ctl) & I2S_PENDING_CLOCKS_STOPPED)) {
-               msleep(5);
-       }
-       out_le32(&i2sdev->intfregs->intr_ctl, I2S_PENDING_CLOCKS_STOPPED);
-
-       /* not locking these is fine since we touch them only in this function */
-       out_le32(&i2sdev->intfregs->serial_format, sfr);
-       out_le32(&i2sdev->intfregs->data_word_sizes, dws);
-
-        i2sbus_control_enable(i2sdev->control, i2sdev);
-        i2sbus_control_cell(i2sdev->control, i2sdev, 1);
-        i2sbus_control_clock(i2sdev->control, i2sdev, 1);
-       msleep(1);
-
-       list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
-               if (cii->codec->switch_clock)
-                       cii->codec->switch_clock(cii, CLOCK_SWITCH_SLAVE);
-
- out_unlock:
-       mutex_unlock(&i2sdev->lock);
-       return result;
-}
-
-#ifdef CONFIG_PM
-void i2sbus_pcm_prepare_both(struct i2sbus_dev *i2sdev)
-{
-       i2sbus_pcm_prepare(i2sdev, 0);
-       i2sbus_pcm_prepare(i2sdev, 1);
-}
-#endif
-
-static int i2sbus_pcm_trigger(struct i2sbus_dev *i2sdev, int in, int cmd)
-{
-       struct codec_info_item *cii;
-       struct pcm_info *pi;
-       int result = 0;
-       unsigned long flags;
-
-       spin_lock_irqsave(&i2sdev->low_lock, flags);
-
-       get_pcm_info(i2sdev, in, &pi, NULL);
-
-       switch (cmd) {
-       case SNDRV_PCM_TRIGGER_START:
-       case SNDRV_PCM_TRIGGER_RESUME:
-               if (pi->dbdma_ring.running) {
-                       result = -EALREADY;
-                       goto out_unlock;
-               }
-               list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
-                       if (cii->codec->start)
-                               cii->codec->start(cii, pi->substream);
-               pi->dbdma_ring.running = 1;
-
-               if (pi->dbdma_ring.stopping) {
-                       /* Clear the S0 bit, then see if we stopped yet */
-                       out_le32(&pi->dbdma->control, 1 << 16);
-                       if (in_le32(&pi->dbdma->status) & ACTIVE) {
-                               /* possible race here? */
-                               udelay(10);
-                               if (in_le32(&pi->dbdma->status) & ACTIVE) {
-                                       pi->dbdma_ring.stopping = 0;
-                                       goto out_unlock; /* keep running */
-                               }
-                       }
-               }
-
-               /* make sure RUN, PAUSE and S0 bits are cleared */
-               out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
-
-               /* set branch condition select register */
-               out_le32(&pi->dbdma->br_sel, (1 << 16) | 1);
-
-               /* write dma command buffer address to the dbdma chip */
-               out_le32(&pi->dbdma->cmdptr, pi->dbdma_ring.bus_cmd_start);
-
-               /* initialize the frame count and current period */
-               pi->current_period = 0;
-               pi->frame_count = in_le32(&i2sdev->intfregs->frame_count);
-
-               /* set the DMA controller running */
-               out_le32(&pi->dbdma->control, (RUN << 16) | RUN);
-
-               /* off you go! */
-               break;
-
-       case SNDRV_PCM_TRIGGER_STOP:
-       case SNDRV_PCM_TRIGGER_SUSPEND:
-               if (!pi->dbdma_ring.running) {
-                       result = -EALREADY;
-                       goto out_unlock;
-               }
-               pi->dbdma_ring.running = 0;
-
-               /* Set the S0 bit to make the DMA branch to the stop cmd */
-               out_le32(&pi->dbdma->control, (1 << 16) | 1);
-               pi->dbdma_ring.stopping = 1;
-
-               list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
-                       if (cii->codec->stop)
-                               cii->codec->stop(cii, pi->substream);
-               break;
-       default:
-               result = -EINVAL;
-               goto out_unlock;
-       }
-
- out_unlock:
-       spin_unlock_irqrestore(&i2sdev->low_lock, flags);
-       return result;
-}
-
-static snd_pcm_uframes_t i2sbus_pcm_pointer(struct i2sbus_dev *i2sdev, int in)
-{
-       struct pcm_info *pi;
-       u32 fc;
-
-       get_pcm_info(i2sdev, in, &pi, NULL);
-
-       fc = in_le32(&i2sdev->intfregs->frame_count);
-       fc = fc - pi->frame_count;
-
-       if (fc >= pi->substream->runtime->buffer_size)
-               fc %= pi->substream->runtime->buffer_size;
-       return fc;
-}
-
-static inline void handle_interrupt(struct i2sbus_dev *i2sdev, int in)
-{
-       struct pcm_info *pi;
-       u32 fc, nframes;
-       u32 status;
-       int timeout, i;
-       int dma_stopped = 0;
-       struct snd_pcm_runtime *runtime;
-
-       spin_lock(&i2sdev->low_lock);
-       get_pcm_info(i2sdev, in, &pi, NULL);
-       if (!pi->dbdma_ring.running && !pi->dbdma_ring.stopping)
-               goto out_unlock;
-
-       i = pi->current_period;
-       runtime = pi->substream->runtime;
-       while (pi->dbdma_ring.cmds[i].xfer_status) {
-               if (le16_to_cpu(pi->dbdma_ring.cmds[i].xfer_status) & BT)
-                       /*
-                        * BT is the branch taken bit.  If it took a branch
-                        * it is because we set the S0 bit to make it
-                        * branch to the stop command.
-                        */
-                       dma_stopped = 1;
-               pi->dbdma_ring.cmds[i].xfer_status = 0;
-
-               if (++i >= runtime->periods) {
-                       i = 0;
-                       pi->frame_count += runtime->buffer_size;
-               }
-               pi->current_period = i;
-
-               /*
-                * Check the frame count.  The DMA tends to get a bit
-                * ahead of the frame counter, which confuses the core.
-                */
-               fc = in_le32(&i2sdev->intfregs->frame_count);
-               nframes = i * runtime->period_size;
-               if (fc < pi->frame_count + nframes)
-                       pi->frame_count = fc - nframes;
-       }
-
-       if (dma_stopped) {
-               timeout = 1000;
-               for (;;) {
-                       status = in_le32(&pi->dbdma->status);
-                       if (!(status & ACTIVE) && (!in || (status & 0x80)))
-                               break;
-                       if (--timeout <= 0) {
-                               printk(KERN_ERR "i2sbus: timed out "
-                                      "waiting for DMA to stop!\n");
-                               break;
-                       }
-                       udelay(1);
-               }
-
-               /* Turn off DMA controller, clear S0 bit */
-               out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
-
-               pi->dbdma_ring.stopping = 0;
-               if (pi->stop_completion)
-                       complete(pi->stop_completion);
-       }
-
-       if (!pi->dbdma_ring.running)
-               goto out_unlock;
-       spin_unlock(&i2sdev->low_lock);
-       /* may call _trigger again, hence needs to be unlocked */
-       snd_pcm_period_elapsed(pi->substream);
-       return;
-
- out_unlock:
-       spin_unlock(&i2sdev->low_lock);
-}
-
-irqreturn_t i2sbus_tx_intr(int irq, void *devid)
-{
-       handle_interrupt((struct i2sbus_dev *)devid, 0);
-       return IRQ_HANDLED;
-}
-
-irqreturn_t i2sbus_rx_intr(int irq, void *devid)
-{
-       handle_interrupt((struct i2sbus_dev *)devid, 1);
-       return IRQ_HANDLED;
-}
-
-static int i2sbus_playback_open(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       i2sdev->out.substream = substream;
-       return i2sbus_pcm_open(i2sdev, 0);
-}
-
-static int i2sbus_playback_close(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-       int err;
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->out.substream != substream)
-               return -EINVAL;
-       err = i2sbus_pcm_close(i2sdev, 0);
-       if (!err)
-               i2sdev->out.substream = NULL;
-       return err;
-}
-
-static int i2sbus_playback_prepare(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->out.substream != substream)
-               return -EINVAL;
-       return i2sbus_pcm_prepare(i2sdev, 0);
-}
-
-static int i2sbus_playback_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->out.substream != substream)
-               return -EINVAL;
-       return i2sbus_pcm_trigger(i2sdev, 0, cmd);
-}
-
-static snd_pcm_uframes_t i2sbus_playback_pointer(struct snd_pcm_substream
-                                                *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->out.substream != substream)
-               return 0;
-       return i2sbus_pcm_pointer(i2sdev, 0);
-}
-
-static struct snd_pcm_ops i2sbus_playback_ops = {
-       .open =         i2sbus_playback_open,
-       .close =        i2sbus_playback_close,
-       .ioctl =        snd_pcm_lib_ioctl,
-       .hw_params =    i2sbus_hw_params,
-       .hw_free =      i2sbus_playback_hw_free,
-       .prepare =      i2sbus_playback_prepare,
-       .trigger =      i2sbus_playback_trigger,
-       .pointer =      i2sbus_playback_pointer,
-};
-
-static int i2sbus_record_open(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       i2sdev->in.substream = substream;
-       return i2sbus_pcm_open(i2sdev, 1);
-}
-
-static int i2sbus_record_close(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-       int err;
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->in.substream != substream)
-               return -EINVAL;
-       err = i2sbus_pcm_close(i2sdev, 1);
-       if (!err)
-               i2sdev->in.substream = NULL;
-       return err;
-}
-
-static int i2sbus_record_prepare(struct snd_pcm_substream *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->in.substream != substream)
-               return -EINVAL;
-       return i2sbus_pcm_prepare(i2sdev, 1);
-}
-
-static int i2sbus_record_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->in.substream != substream)
-               return -EINVAL;
-       return i2sbus_pcm_trigger(i2sdev, 1, cmd);
-}
-
-static snd_pcm_uframes_t i2sbus_record_pointer(struct snd_pcm_substream
-                                              *substream)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
-
-       if (!i2sdev)
-               return -EINVAL;
-       if (i2sdev->in.substream != substream)
-               return 0;
-       return i2sbus_pcm_pointer(i2sdev, 1);
-}
-
-static struct snd_pcm_ops i2sbus_record_ops = {
-       .open =         i2sbus_record_open,
-       .close =        i2sbus_record_close,
-       .ioctl =        snd_pcm_lib_ioctl,
-       .hw_params =    i2sbus_hw_params,
-       .hw_free =      i2sbus_record_hw_free,
-       .prepare =      i2sbus_record_prepare,
-       .trigger =      i2sbus_record_trigger,
-       .pointer =      i2sbus_record_pointer,
-};
-
-static void i2sbus_private_free(struct snd_pcm *pcm)
-{
-       struct i2sbus_dev *i2sdev = snd_pcm_chip(pcm);
-       struct codec_info_item *p, *tmp;
-
-       i2sdev->sound.pcm = NULL;
-       i2sdev->out.created = 0;
-       i2sdev->in.created = 0;
-       list_for_each_entry_safe(p, tmp, &i2sdev->sound.codec_list, list) {
-               printk(KERN_ERR "i2sbus: a codec didn't unregister!\n");
-               list_del(&p->list);
-               module_put(p->codec->owner);
-               kfree(p);
-       }
-       soundbus_dev_put(&i2sdev->sound);
-       module_put(THIS_MODULE);
-}
-
-int
-i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
-                   struct codec_info *ci, void *data)
-{
-       int err, in = 0, out = 0;
-       struct transfer_info *tmp;
-       struct i2sbus_dev *i2sdev = soundbus_dev_to_i2sbus_dev(dev);
-       struct codec_info_item *cii;
-
-       if (!dev->pcmname || dev->pcmid == -1) {
-               printk(KERN_ERR "i2sbus: pcm name and id must be set!\n");
-               return -EINVAL;
-       }
-
-       list_for_each_entry(cii, &dev->codec_list, list) {
-               if (cii->codec_data == data)
-                       return -EALREADY;
-       }
-
-       if (!ci->transfers || !ci->transfers->formats
-           || !ci->transfers->rates || !ci->usable)
-               return -EINVAL;
-
-       /* we currently code the i2s transfer on the clock, and support only
-        * 32 and 64 */
-       if (ci->bus_factor != 32 && ci->bus_factor != 64)
-               return -EINVAL;
-
-       /* If you want to fix this, you need to keep track of what transport infos
-        * are to be used, which codecs they belong to, and then fix all the
-        * sysclock/busclock stuff above to depend on which is usable */
-       list_for_each_entry(cii, &dev->codec_list, list) {
-               if (cii->codec->sysclock_factor != ci->sysclock_factor) {
-                       printk(KERN_DEBUG
-                              "cannot yet handle multiple different sysclocks!\n");
-                       return -EINVAL;
-               }
-               if (cii->codec->bus_factor != ci->bus_factor) {
-                       printk(KERN_DEBUG
-                              "cannot yet handle multiple different bus clocks!\n");
-                       return -EINVAL;
-               }
-       }
-
-       tmp = ci->transfers;
-       while (tmp->formats && tmp->rates) {
-               if (tmp->transfer_in)
-                       in = 1;
-               else
-                       out = 1;
-               tmp++;
-       }
-
-       cii = kzalloc(sizeof(struct codec_info_item), GFP_KERNEL);
-       if (!cii) {
-               printk(KERN_DEBUG "i2sbus: failed to allocate cii\n");
-               return -ENOMEM;
-       }
-
-       /* use the private data to point to the codec info */
-       cii->sdev = soundbus_dev_get(dev);
-       cii->codec = ci;
-       cii->codec_data = data;
-
-       if (!cii->sdev) {
-               printk(KERN_DEBUG
-                      "i2sbus: failed to get soundbus dev reference\n");
-               err = -ENODEV;
-               goto out_free_cii;
-       }
-
-       if (!try_module_get(THIS_MODULE)) {
-               printk(KERN_DEBUG "i2sbus: failed to get module reference!\n");
-               err = -EBUSY;
-               goto out_put_sdev;
-       }
-
-       if (!try_module_get(ci->owner)) {
-               printk(KERN_DEBUG
-                      "i2sbus: failed to get module reference to codec owner!\n");
-               err = -EBUSY;
-               goto out_put_this_module;
-       }
-
-       if (!dev->pcm) {
-               err = snd_pcm_new(card, dev->pcmname, dev->pcmid, 0, 0,
-                                 &dev->pcm);
-               if (err) {
-                       printk(KERN_DEBUG "i2sbus: failed to create pcm\n");
-                       goto out_put_ci_module;
-               }
-               dev->pcm->dev = &dev->ofdev.dev;
-       }
-
-       /* ALSA yet again sucks.
-        * If it is ever fixed, remove this line. See below. */
-       out = in = 1;
-
-       if (!i2sdev->out.created && out) {
-               if (dev->pcm->card != card) {
-                       /* eh? */
-                       printk(KERN_ERR
-                              "Can't attach same bus to different cards!\n");
-                       err = -EINVAL;
-                       goto out_put_ci_module;
-               }
-               err = snd_pcm_new_stream(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK, 1);
-               if (err)
-                       goto out_put_ci_module;
-               snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK,
-                               &i2sbus_playback_ops);
-               i2sdev->out.created = 1;
-       }
-
-       if (!i2sdev->in.created && in) {
-               if (dev->pcm->card != card) {
-                       printk(KERN_ERR
-                              "Can't attach same bus to different cards!\n");
-                       err = -EINVAL;
-                       goto out_put_ci_module;
-               }
-               err = snd_pcm_new_stream(dev->pcm, SNDRV_PCM_STREAM_CAPTURE, 1);
-               if (err)
-                       goto out_put_ci_module;
-               snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_CAPTURE,
-                               &i2sbus_record_ops);
-               i2sdev->in.created = 1;
-       }
-
-       /* so we have to register the pcm after adding any substream
-        * to it because alsa doesn't create the devices for the
-        * substreams when we add them later.
-        * Therefore, force in and out on both busses (above) and
-        * register the pcm now instead of just after creating it.
-        */
-       err = snd_device_register(card, dev->pcm);
-       if (err) {
-               printk(KERN_ERR "i2sbus: error registering new pcm\n");
-               goto out_put_ci_module;
-       }
-       /* no errors any more, so let's add this to our list */
-       list_add(&cii->list, &dev->codec_list);
-
-       dev->pcm->private_data = i2sdev;
-       dev->pcm->private_free = i2sbus_private_free;
-
-       /* well, we really should support scatter/gather DMA */
-       snd_pcm_lib_preallocate_pages_for_all(
-               dev->pcm, SNDRV_DMA_TYPE_DEV,
-               snd_dma_pci_data(macio_get_pci_dev(i2sdev->macio)),
-               64 * 1024, 64 * 1024);
-
-       return 0;
- out_put_ci_module:
-       module_put(ci->owner);
- out_put_this_module:
-       module_put(THIS_MODULE);
- out_put_sdev:
-       soundbus_dev_put(dev);
- out_free_cii:
-       kfree(cii);
-       return err;
-}
-
-void i2sbus_detach_codec(struct soundbus_dev *dev, void *data)
-{
-       struct codec_info_item *cii = NULL, *i;
-
-       list_for_each_entry(i, &dev->codec_list, list) {
-               if (i->codec_data == data) {
-                       cii = i;
-                       break;
-               }
-       }
-       if (cii) {
-               list_del(&cii->list);
-               module_put(cii->codec->owner);
-               kfree(cii);
-       }
-       /* no more codecs, but still a pcm? */
-       if (list_empty(&dev->codec_list) && dev->pcm) {
-               /* the actual cleanup is done by the callback above! */
-               snd_device_free(dev->pcm->card, dev->pcm);
-       }
-}
index ff29654782c96efdee2c3f9ba21064ea49bba393..befefd99e271a525a9a5175768501d199aa64887 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/pmac_feature.h>
 #include <asm/dbdma.h>
 
-#include "i2sbus-interface.h"
+#include "interface.h"
 #include "../soundbus.h"
 
 struct i2sbus_control {
diff --git a/sound/aoa/soundbus/i2sbus/interface.h b/sound/aoa/soundbus/i2sbus/interface.h
new file mode 100644 (file)
index 0000000..c6b5f54
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * i2sbus driver -- interface register definitions
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#ifndef __I2SBUS_INTERFACE_H
+#define __I2SBUS_INTERFACE_H
+
+/* i2s bus control registers, at least what we know about them */
+
+#define __PAD(m,n) u8 __pad##m[n]
+#define _PAD(line, n) __PAD(line, n)
+#define PAD(n) _PAD(__LINE__, (n))
+struct i2s_interface_regs {
+       __le32 intr_ctl;        /* 0x00 */
+       PAD(12);
+       __le32 serial_format;   /* 0x10 */
+       PAD(12);
+       __le32 codec_msg_out;   /* 0x20 */
+       PAD(12);
+       __le32 codec_msg_in;    /* 0x30 */
+       PAD(12);
+       __le32 frame_count;     /* 0x40 */
+       PAD(12);
+       __le32 frame_match;     /* 0x50 */
+       PAD(12);
+       __le32 data_word_sizes; /* 0x60 */
+       PAD(12);
+       __le32 peak_level_sel;  /* 0x70 */
+       PAD(12);
+       __le32 peak_level_in0;  /* 0x80 */
+       PAD(12);
+       __le32 peak_level_in1;  /* 0x90 */
+       PAD(12);
+       /* total size: 0x100 bytes */
+}  __attribute__((__packed__));
+
+/* interrupt register is just a bitfield with
+ * interrupt enable and pending bits */
+#define I2S_REG_INTR_CTL               0x00
+#      define I2S_INT_FRAME_COUNT              (1<<31)
+#      define I2S_PENDING_FRAME_COUNT          (1<<30)
+#      define I2S_INT_MESSAGE_FLAG             (1<<29)
+#      define I2S_PENDING_MESSAGE_FLAG         (1<<28)
+#      define I2S_INT_NEW_PEAK                 (1<<27)
+#      define I2S_PENDING_NEW_PEAK             (1<<26)
+#      define I2S_INT_CLOCKS_STOPPED           (1<<25)
+#      define I2S_PENDING_CLOCKS_STOPPED       (1<<24)
+#      define I2S_INT_EXTERNAL_SYNC_ERROR      (1<<23)
+#      define I2S_PENDING_EXTERNAL_SYNC_ERROR  (1<<22)
+#      define I2S_INT_EXTERNAL_SYNC_OK         (1<<21)
+#      define I2S_PENDING_EXTERNAL_SYNC_OK     (1<<20)
+#      define I2S_INT_NEW_SAMPLE_RATE          (1<<19)
+#      define I2S_PENDING_NEW_SAMPLE_RATE      (1<<18)
+#      define I2S_INT_STATUS_FLAG              (1<<17)
+#      define I2S_PENDING_STATUS_FLAG          (1<<16)
+
+/* serial format register is more interesting :)
+ * It contains:
+ *  - clock source
+ *  - MClk divisor
+ *  - SClk divisor
+ *  - SClk master flag
+ *  - serial format (sony, i2s 64x, i2s 32x, dav, silabs)
+ *  - external sample frequency interrupt (don't understand)
+ *  - external sample frequency
+ */
+#define I2S_REG_SERIAL_FORMAT          0x10
+/* clock source. You get either 18.432, 45.1584 or 49.1520 MHz */
+#      define I2S_SF_CLOCK_SOURCE_SHIFT        30
+#      define I2S_SF_CLOCK_SOURCE_MASK         (3<<I2S_SF_CLOCK_SOURCE_SHIFT)
+#      define I2S_SF_CLOCK_SOURCE_18MHz        (0<<I2S_SF_CLOCK_SOURCE_SHIFT)
+#      define I2S_SF_CLOCK_SOURCE_45MHz        (1<<I2S_SF_CLOCK_SOURCE_SHIFT)
+#      define I2S_SF_CLOCK_SOURCE_49MHz        (2<<I2S_SF_CLOCK_SOURCE_SHIFT)
+/* also, let's define the exact clock speeds here, in Hz */
+#define I2S_CLOCK_SPEED_18MHz  18432000
+#define I2S_CLOCK_SPEED_45MHz  45158400
+#define I2S_CLOCK_SPEED_49MHz  49152000
+/* MClk is the clock that drives the codec, usually called its 'system clock'.
+ * It is derived by taking only every 'divisor' tick of the clock.
+ */
+#      define I2S_SF_MCLKDIV_SHIFT             24
+#      define I2S_SF_MCLKDIV_MASK              (0x1F<<I2S_SF_MCLKDIV_SHIFT)
+#      define I2S_SF_MCLKDIV_1                 (0x14<<I2S_SF_MCLKDIV_SHIFT)
+#      define I2S_SF_MCLKDIV_3                 (0x13<<I2S_SF_MCLKDIV_SHIFT)
+#      define I2S_SF_MCLKDIV_5                 (0x12<<I2S_SF_MCLKDIV_SHIFT)
+#      define I2S_SF_MCLKDIV_14                (0x0E<<I2S_SF_MCLKDIV_SHIFT)
+#      define I2S_SF_MCLKDIV_OTHER(div)        (((div/2-1)<<I2S_SF_MCLKDIV_SHIFT)&I2S_SF_MCLKDIV_MASK)
+static inline int i2s_sf_mclkdiv(int div, int *out)
+{
+       int d;
+
+       switch(div) {
+       case 1: *out |= I2S_SF_MCLKDIV_1; return 0;
+       case 3: *out |= I2S_SF_MCLKDIV_3; return 0;
+       case 5: *out |= I2S_SF_MCLKDIV_5; return 0;
+       case 14: *out |= I2S_SF_MCLKDIV_14; return 0;
+       default:
+               if (div%2) return -1;
+               d = div/2-1;
+               if (d == 0x14 || d == 0x13 || d == 0x12 || d == 0x0E)
+                       return -1;
+               *out |= I2S_SF_MCLKDIV_OTHER(div);
+               return 0;
+       }
+}
+/* SClk is the clock that drives the i2s wire bus. Note that it is
+ * derived from the MClk above by taking only every 'divisor' tick
+ * of MClk.
+ */
+#      define I2S_SF_SCLKDIV_SHIFT             20
+#      define I2S_SF_SCLKDIV_MASK              (0xF<<I2S_SF_SCLKDIV_SHIFT)
+#      define I2S_SF_SCLKDIV_1                 (8<<I2S_SF_SCLKDIV_SHIFT)
+#      define I2S_SF_SCLKDIV_3                 (9<<I2S_SF_SCLKDIV_SHIFT)
+#      define I2S_SF_SCLKDIV_OTHER(div)        (((div/2-1)<<I2S_SF_SCLKDIV_SHIFT)&I2S_SF_SCLKDIV_MASK)
+static inline int i2s_sf_sclkdiv(int div, int *out)
+{
+       int d;
+
+       switch(div) {
+       case 1: *out |= I2S_SF_SCLKDIV_1; return 0;
+       case 3: *out |= I2S_SF_SCLKDIV_3; return 0;
+       default:
+               if (div%2) return -1;
+               d = div/2-1;
+               if (d == 8 || d == 9) return -1;
+               *out |= I2S_SF_SCLKDIV_OTHER(div);
+               return 0;
+       }
+}
+#      define I2S_SF_SCLK_MASTER               (1<<19)
+/* serial format is the way the data is put to the i2s wire bus */
+#      define I2S_SF_SERIAL_FORMAT_SHIFT       16
+#      define I2S_SF_SERIAL_FORMAT_MASK        (7<<I2S_SF_SERIAL_FORMAT_SHIFT)
+#      define I2S_SF_SERIAL_FORMAT_SONY        (0<<I2S_SF_SERIAL_FORMAT_SHIFT)
+#      define I2S_SF_SERIAL_FORMAT_I2S_64X     (1<<I2S_SF_SERIAL_FORMAT_SHIFT)
+#      define I2S_SF_SERIAL_FORMAT_I2S_32X     (2<<I2S_SF_SERIAL_FORMAT_SHIFT)
+#      define I2S_SF_SERIAL_FORMAT_I2S_DAV     (4<<I2S_SF_SERIAL_FORMAT_SHIFT)
+#      define I2S_SF_SERIAL_FORMAT_I2S_SILABS  (5<<I2S_SF_SERIAL_FORMAT_SHIFT)
+/* unknown */
+#      define I2S_SF_EXT_SAMPLE_FREQ_INT_SHIFT 12
+#      define I2S_SF_EXT_SAMPLE_FREQ_INT_MASK  (0xF<<I2S_SF_SAMPLE_FREQ_INT_SHIFT)
+/* probably gives external frequency? */
+#      define I2S_SF_EXT_SAMPLE_FREQ_MASK      0xFFF
+
+/* used to send codec messages, but how isn't clear */
+#define I2S_REG_CODEC_MSG_OUT          0x20
+
+/* used to receive codec messages, but how isn't clear */
+#define I2S_REG_CODEC_MSG_IN           0x30
+
+/* frame count reg isn't clear to me yet, but probably useful */
+#define I2S_REG_FRAME_COUNT            0x40
+
+/* program to some value, and get interrupt if frame count reaches it */
+#define I2S_REG_FRAME_MATCH            0x50
+
+/* this register describes how the bus transfers data */
+#define I2S_REG_DATA_WORD_SIZES                0x60
+/* number of interleaved input channels */
+#      define I2S_DWS_NUM_CHANNELS_IN_SHIFT    24
+#      define I2S_DWS_NUM_CHANNELS_IN_MASK     (0x1F<<I2S_DWS_NUM_CHANNELS_IN_SHIFT)
+/* word size of input data */
+#      define I2S_DWS_DATA_IN_SIZE_SHIFT       16
+#      define I2S_DWS_DATA_IN_16BIT            (0<<I2S_DWS_DATA_IN_SIZE_SHIFT)
+#      define I2S_DWS_DATA_IN_24BIT            (3<<I2S_DWS_DATA_IN_SIZE_SHIFT)
+/* number of interleaved output channels */
+#      define I2S_DWS_NUM_CHANNELS_OUT_SHIFT   8
+#      define I2S_DWS_NUM_CHANNELS_OUT_MASK    (0x1F<<I2S_DWS_NUM_CHANNELS_OUT_SHIFT)
+/* word size of output data */
+#      define I2S_DWS_DATA_OUT_SIZE_SHIFT      0
+#      define I2S_DWS_DATA_OUT_16BIT           (0<<I2S_DWS_DATA_OUT_SIZE_SHIFT)
+#      define I2S_DWS_DATA_OUT_24BIT           (3<<I2S_DWS_DATA_OUT_SIZE_SHIFT)
+
+
+/* unknown */
+#define I2S_REG_PEAK_LEVEL_SEL         0x70
+
+/* unknown */
+#define I2S_REG_PEAK_LEVEL_IN0         0x80
+
+/* unknown */
+#define I2S_REG_PEAK_LEVEL_IN1         0x90
+
+#endif /* __I2SBUS_INTERFACE_H */
diff --git a/sound/aoa/soundbus/i2sbus/pcm.c b/sound/aoa/soundbus/i2sbus/pcm.c
new file mode 100644 (file)
index 0000000..59bacd3
--- /dev/null
@@ -0,0 +1,1062 @@
+/*
+ * i2sbus driver -- pcm routines
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#include <asm/io.h>
+#include <linux/delay.h>
+#include <sound/core.h>
+#include <asm/macio.h>
+#include <linux/pci.h>
+#include "../soundbus.h"
+#include "i2sbus.h"
+
+static inline void get_pcm_info(struct i2sbus_dev *i2sdev, int in,
+                               struct pcm_info **pi, struct pcm_info **other)
+{
+       if (in) {
+               if (pi)
+                       *pi = &i2sdev->in;
+               if (other)
+                       *other = &i2sdev->out;
+       } else {
+               if (pi)
+                       *pi = &i2sdev->out;
+               if (other)
+                       *other = &i2sdev->in;
+       }
+}
+
+static int clock_and_divisors(int mclk, int sclk, int rate, int *out)
+{
+       /* sclk must be derived from mclk! */
+       if (mclk % sclk)
+               return -1;
+       /* derive sclk register value */
+       if (i2s_sf_sclkdiv(mclk / sclk, out))
+               return -1;
+
+       if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
+               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / (rate * mclk), out)) {
+                       *out |= I2S_SF_CLOCK_SOURCE_18MHz;
+                       return 0;
+               }
+       }
+       if (I2S_CLOCK_SPEED_45MHz % (rate * mclk) == 0) {
+               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_45MHz / (rate * mclk), out)) {
+                       *out |= I2S_SF_CLOCK_SOURCE_45MHz;
+                       return 0;
+               }
+       }
+       if (I2S_CLOCK_SPEED_49MHz % (rate * mclk) == 0) {
+               if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_49MHz / (rate * mclk), out)) {
+                       *out |= I2S_SF_CLOCK_SOURCE_49MHz;
+                       return 0;
+               }
+       }
+       return -1;
+}
+
+#define CHECK_RATE(rate)                                               \
+       do { if (rates & SNDRV_PCM_RATE_ ##rate) {                      \
+               int dummy;                                              \
+               if (clock_and_divisors(sysclock_factor,                 \
+                                      bus_factor, rate, &dummy))       \
+                       rates &= ~SNDRV_PCM_RATE_ ##rate;               \
+       } } while (0)
+
+static int i2sbus_pcm_open(struct i2sbus_dev *i2sdev, int in)
+{
+       struct pcm_info *pi, *other;
+       struct soundbus_dev *sdev;
+       int masks_inited = 0, err;
+       struct codec_info_item *cii, *rev;
+       struct snd_pcm_hardware *hw;
+       u64 formats = 0;
+       unsigned int rates = 0;
+       struct transfer_info v;
+       int result = 0;
+       int bus_factor = 0, sysclock_factor = 0;
+       int found_this;
+
+       mutex_lock(&i2sdev->lock);
+
+       get_pcm_info(i2sdev, in, &pi, &other);
+
+       hw = &pi->substream->runtime->hw;
+       sdev = &i2sdev->sound;
+
+       if (pi->active) {
+               /* alsa messed up */
+               result = -EBUSY;
+               goto out_unlock;
+       }
+
+       /* we now need to assign the hw */
+       list_for_each_entry(cii, &sdev->codec_list, list) {
+               struct transfer_info *ti = cii->codec->transfers;
+               bus_factor = cii->codec->bus_factor;
+               sysclock_factor = cii->codec->sysclock_factor;
+               while (ti->formats && ti->rates) {
+                       v = *ti;
+                       if (ti->transfer_in == in
+                           && cii->codec->usable(cii, ti, &v)) {
+                               if (masks_inited) {
+                                       formats &= v.formats;
+                                       rates &= v.rates;
+                               } else {
+                                       formats = v.formats;
+                                       rates = v.rates;
+                                       masks_inited = 1;
+                               }
+                       }
+                       ti++;
+               }
+       }
+       if (!masks_inited || !bus_factor || !sysclock_factor) {
+               result = -ENODEV;
+               goto out_unlock;
+       }
+       /* bus dependent stuff */
+       hw->info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
+                  SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME |
+                  SNDRV_PCM_INFO_JOINT_DUPLEX;
+
+       CHECK_RATE(5512);
+       CHECK_RATE(8000);
+       CHECK_RATE(11025);
+       CHECK_RATE(16000);
+       CHECK_RATE(22050);
+       CHECK_RATE(32000);
+       CHECK_RATE(44100);
+       CHECK_RATE(48000);
+       CHECK_RATE(64000);
+       CHECK_RATE(88200);
+       CHECK_RATE(96000);
+       CHECK_RATE(176400);
+       CHECK_RATE(192000);
+       hw->rates = rates;
+
+       /* well. the codec might want 24 bits only, and we'll
+        * ever only transfer 24 bits, but they are top-aligned!
+        * So for alsa, we claim that we're doing full 32 bit
+        * while in reality we'll ignore the lower 8 bits of
+        * that when doing playback (they're transferred as 0
+        * as far as I know, no codecs we have are 32-bit capable
+        * so I can't really test) and when doing recording we'll
+        * always have those lower 8 bits recorded as 0 */
+       if (formats & SNDRV_PCM_FMTBIT_S24_BE)
+               formats |= SNDRV_PCM_FMTBIT_S32_BE;
+       if (formats & SNDRV_PCM_FMTBIT_U24_BE)
+               formats |= SNDRV_PCM_FMTBIT_U32_BE;
+       /* now mask off what we can support. I suppose we could
+        * also support S24_3LE and some similar formats, but I
+        * doubt there's a codec that would be able to use that,
+        * so we don't support it here. */
+       hw->formats = formats & (SNDRV_PCM_FMTBIT_S16_BE |
+                                SNDRV_PCM_FMTBIT_U16_BE |
+                                SNDRV_PCM_FMTBIT_S32_BE |
+                                SNDRV_PCM_FMTBIT_U32_BE);
+
+       /* we need to set the highest and lowest rate possible.
+        * These are the highest and lowest rates alsa can
+        * support properly in its bitfield.
+        * Below, we'll use that to restrict to the rate
+        * currently in use (if any). */
+       hw->rate_min = 5512;
+       hw->rate_max = 192000;
+       /* if the other stream is active, then we can only
+        * support what it is currently using.
+        * FIXME: I lied. This comment is wrong. We can support
+        * anything that works with the same serial format, ie.
+        * when recording 24 bit sound we can well play 16 bit
+        * sound at the same time iff using the same transfer mode.
+        */
+       if (other->active) {
+               /* FIXME: is this guaranteed by the alsa api? */
+               hw->formats &= (1ULL << i2sdev->format);
+               /* see above, restrict rates to the one we already have */
+               hw->rate_min = i2sdev->rate;
+               hw->rate_max = i2sdev->rate;
+       }
+
+       hw->channels_min = 2;
+       hw->channels_max = 2;
+       /* these are somewhat arbitrary */
+       hw->buffer_bytes_max = 131072;
+       hw->period_bytes_min = 256;
+       hw->period_bytes_max = 16384;
+       hw->periods_min = 3;
+       hw->periods_max = MAX_DBDMA_COMMANDS;
+       err = snd_pcm_hw_constraint_integer(pi->substream->runtime,
+                                           SNDRV_PCM_HW_PARAM_PERIODS);
+       if (err < 0) {
+               result = err;
+               goto out_unlock;
+       }
+       list_for_each_entry(cii, &sdev->codec_list, list) {
+               if (cii->codec->open) {
+                       err = cii->codec->open(cii, pi->substream);
+                       if (err) {
+                               result = err;
+                               /* unwind */
+                               found_this = 0;
+                               list_for_each_entry_reverse(rev,
+                                   &sdev->codec_list, list) {
+                                       if (found_this && rev->codec->close) {
+                                               rev->codec->close(rev,
+                                                               pi->substream);
+                                       }
+                                       if (rev == cii)
+                                               found_this = 1;
+                               }
+                               goto out_unlock;
+                       }
+               }
+       }
+
+ out_unlock:
+       mutex_unlock(&i2sdev->lock);
+       return result;
+}
+
+#undef CHECK_RATE
+
+static int i2sbus_pcm_close(struct i2sbus_dev *i2sdev, int in)
+{
+       struct codec_info_item *cii;
+       struct pcm_info *pi;
+       int err = 0, tmp;
+
+       mutex_lock(&i2sdev->lock);
+
+       get_pcm_info(i2sdev, in, &pi, NULL);
+
+       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+               if (cii->codec->close) {
+                       tmp = cii->codec->close(cii, pi->substream);
+                       if (tmp)
+                               err = tmp;
+               }
+       }
+
+       pi->substream = NULL;
+       pi->active = 0;
+       mutex_unlock(&i2sdev->lock);
+       return err;
+}
+
+static void i2sbus_wait_for_stop(struct i2sbus_dev *i2sdev,
+                                struct pcm_info *pi)
+{
+       unsigned long flags;
+       struct completion done;
+       long timeout;
+
+       spin_lock_irqsave(&i2sdev->low_lock, flags);
+       if (pi->dbdma_ring.stopping) {
+               init_completion(&done);
+               pi->stop_completion = &done;
+               spin_unlock_irqrestore(&i2sdev->low_lock, flags);
+               timeout = wait_for_completion_timeout(&done, HZ);
+               spin_lock_irqsave(&i2sdev->low_lock, flags);
+               pi->stop_completion = NULL;
+               if (timeout == 0) {
+                       /* timeout expired, stop dbdma forcefully */
+                       printk(KERN_ERR "i2sbus_wait_for_stop: timed out\n");
+                       /* make sure RUN, PAUSE and S0 bits are cleared */
+                       out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
+                       pi->dbdma_ring.stopping = 0;
+                       timeout = 10;
+                       while (in_le32(&pi->dbdma->status) & ACTIVE) {
+                               if (--timeout <= 0)
+                                       break;
+                               udelay(1);
+                       }
+               }
+       }
+       spin_unlock_irqrestore(&i2sdev->low_lock, flags);
+}
+
+#ifdef CONFIG_PM
+void i2sbus_wait_for_stop_both(struct i2sbus_dev *i2sdev)
+{
+       struct pcm_info *pi;
+
+       get_pcm_info(i2sdev, 0, &pi, NULL);
+       i2sbus_wait_for_stop(i2sdev, pi);
+       get_pcm_info(i2sdev, 1, &pi, NULL);
+       i2sbus_wait_for_stop(i2sdev, pi);
+}
+#endif
+
+static int i2sbus_hw_params(struct snd_pcm_substream *substream,
+                           struct snd_pcm_hw_params *params)
+{
+       return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
+}
+
+static inline int i2sbus_hw_free(struct snd_pcm_substream *substream, int in)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+       struct pcm_info *pi;
+
+       get_pcm_info(i2sdev, in, &pi, NULL);
+       if (pi->dbdma_ring.stopping)
+               i2sbus_wait_for_stop(i2sdev, pi);
+       snd_pcm_lib_free_pages(substream);
+       return 0;
+}
+
+static int i2sbus_playback_hw_free(struct snd_pcm_substream *substream)
+{
+       return i2sbus_hw_free(substream, 0);
+}
+
+static int i2sbus_record_hw_free(struct snd_pcm_substream *substream)
+{
+       return i2sbus_hw_free(substream, 1);
+}
+
+static int i2sbus_pcm_prepare(struct i2sbus_dev *i2sdev, int in)
+{
+       /* whee. Hard work now. The user has selected a bitrate
+        * and bit format, so now we have to program our
+        * I2S controller appropriately. */
+       struct snd_pcm_runtime *runtime;
+       struct dbdma_cmd *command;
+       int i, periodsize, nperiods;
+       dma_addr_t offset;
+       struct bus_info bi;
+       struct codec_info_item *cii;
+       int sfr = 0;            /* serial format register */
+       int dws = 0;            /* data word sizes reg */
+       int input_16bit;
+       struct pcm_info *pi, *other;
+       int cnt;
+       int result = 0;
+       unsigned int cmd, stopaddr;
+
+       mutex_lock(&i2sdev->lock);
+
+       get_pcm_info(i2sdev, in, &pi, &other);
+
+       if (pi->dbdma_ring.running) {
+               result = -EBUSY;
+               goto out_unlock;
+       }
+       if (pi->dbdma_ring.stopping)
+               i2sbus_wait_for_stop(i2sdev, pi);
+
+       if (!pi->substream || !pi->substream->runtime) {
+               result = -EINVAL;
+               goto out_unlock;
+       }
+
+       runtime = pi->substream->runtime;
+       pi->active = 1;
+       if (other->active &&
+           ((i2sdev->format != runtime->format)
+            || (i2sdev->rate != runtime->rate))) {
+               result = -EINVAL;
+               goto out_unlock;
+       }
+
+       i2sdev->format = runtime->format;
+       i2sdev->rate = runtime->rate;
+
+       periodsize = snd_pcm_lib_period_bytes(pi->substream);
+       nperiods = pi->substream->runtime->periods;
+       pi->current_period = 0;
+
+       /* generate dbdma command ring first */
+       command = pi->dbdma_ring.cmds;
+       memset(command, 0, (nperiods + 2) * sizeof(struct dbdma_cmd));
+
+       /* commands to DMA to/from the ring */
+       /*
+        * For input, we need to do a graceful stop; if we abort
+        * the DMA, we end up with leftover bytes that corrupt
+        * the next recording.  To do this we set the S0 status
+        * bit and wait for the DMA controller to stop.  Each
+        * command has a branch condition to
+        * make it branch to a stop command if S0 is set.
+        * On input we also need to wait for the S7 bit to be
+        * set before turning off the DMA controller.
+        * In fact we do the graceful stop for output as well.
+        */
+       offset = runtime->dma_addr;
+       cmd = (in? INPUT_MORE: OUTPUT_MORE) | BR_IFSET | INTR_ALWAYS;
+       stopaddr = pi->dbdma_ring.bus_cmd_start +
+               (nperiods + 1) * sizeof(struct dbdma_cmd);
+       for (i = 0; i < nperiods; i++, command++, offset += periodsize) {
+               command->command = cpu_to_le16(cmd);
+               command->cmd_dep = cpu_to_le32(stopaddr);
+               command->phy_addr = cpu_to_le32(offset);
+               command->req_count = cpu_to_le16(periodsize);
+       }
+
+       /* branch back to beginning of ring */
+       command->command = cpu_to_le16(DBDMA_NOP | BR_ALWAYS);
+       command->cmd_dep = cpu_to_le32(pi->dbdma_ring.bus_cmd_start);
+       command++;
+
+       /* set stop command */
+       command->command = cpu_to_le16(DBDMA_STOP);
+
+       /* ok, let's set the serial format and stuff */
+       switch (runtime->format) {
+       /* 16 bit formats */
+       case SNDRV_PCM_FORMAT_S16_BE:
+       case SNDRV_PCM_FORMAT_U16_BE:
+               /* FIXME: if we add different bus factors we need to
+                * do more here!! */
+               bi.bus_factor = 0;
+               list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+                       bi.bus_factor = cii->codec->bus_factor;
+                       break;
+               }
+               if (!bi.bus_factor) {
+                       result = -ENODEV;
+                       goto out_unlock;
+               }
+               input_16bit = 1;
+               break;
+       case SNDRV_PCM_FORMAT_S32_BE:
+       case SNDRV_PCM_FORMAT_U32_BE:
+               /* force 64x bus speed, otherwise the data cannot be
+                * transferred quickly enough! */
+               bi.bus_factor = 64;
+               input_16bit = 0;
+               break;
+       default:
+               result = -EINVAL;
+               goto out_unlock;
+       }
+       /* we assume all sysclocks are the same! */
+       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+               bi.sysclock_factor = cii->codec->sysclock_factor;
+               break;
+       }
+
+       if (clock_and_divisors(bi.sysclock_factor,
+                              bi.bus_factor,
+                              runtime->rate,
+                              &sfr) < 0) {
+               result = -EINVAL;
+               goto out_unlock;
+       }
+       switch (bi.bus_factor) {
+       case 32:
+               sfr |= I2S_SF_SERIAL_FORMAT_I2S_32X;
+               break;
+       case 64:
+               sfr |= I2S_SF_SERIAL_FORMAT_I2S_64X;
+               break;
+       }
+       /* FIXME: THIS ASSUMES MASTER ALL THE TIME */
+       sfr |= I2S_SF_SCLK_MASTER;
+
+       list_for_each_entry(cii, &i2sdev->sound.codec_list, list) {
+               int err = 0;
+               if (cii->codec->prepare)
+                       err = cii->codec->prepare(cii, &bi, pi->substream);
+               if (err) {
+                       result = err;
+                       goto out_unlock;
+               }
+       }
+       /* codecs are fine with it, so set our clocks */
+       if (input_16bit)
+               dws =   (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) |
+                       (2 << I2S_DWS_NUM_CHANNELS_OUT_SHIFT) |
+                       I2S_DWS_DATA_IN_16BIT | I2S_DWS_DATA_OUT_16BIT;
+       else
+               dws =   (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) |
+                       (2 << I2S_DWS_NUM_CHANNELS_OUT_SHIFT) |
+                       I2S_DWS_DATA_IN_24BIT | I2S_DWS_DATA_OUT_24BIT;
+
+       /* early exit if already programmed correctly */
+       /* not locking these is fine since we touch them only in this function */
+       if (in_le32(&i2sdev->intfregs->serial_format) == sfr
+        && in_le32(&i2sdev->intfregs->data_word_sizes) == dws)
+               goto out_unlock;
+
+       /* let's notify the codecs about clocks going away.
+        * For now we only do mastering on the i2s cell... */
+       list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
+               if (cii->codec->switch_clock)
+                       cii->codec->switch_clock(cii, CLOCK_SWITCH_PREPARE_SLAVE);
+
+       i2sbus_control_enable(i2sdev->control, i2sdev);
+       i2sbus_control_cell(i2sdev->control, i2sdev, 1);
+
+       out_le32(&i2sdev->intfregs->intr_ctl, I2S_PENDING_CLOCKS_STOPPED);
+
+       i2sbus_control_clock(i2sdev->control, i2sdev, 0);
+
+       msleep(1);
+
+       /* wait for clock stopped. This can apparently take a while... */
+       cnt = 100;
+       while (cnt-- &&
+           !(in_le32(&i2sdev->intfregs->intr_ctl) & I2S_PENDING_CLOCKS_STOPPED)) {
+               msleep(5);
+       }
+       out_le32(&i2sdev->intfregs->intr_ctl, I2S_PENDING_CLOCKS_STOPPED);
+
+       /* not locking these is fine since we touch them only in this function */
+       out_le32(&i2sdev->intfregs->serial_format, sfr);
+       out_le32(&i2sdev->intfregs->data_word_sizes, dws);
+
+        i2sbus_control_enable(i2sdev->control, i2sdev);
+        i2sbus_control_cell(i2sdev->control, i2sdev, 1);
+        i2sbus_control_clock(i2sdev->control, i2sdev, 1);
+       msleep(1);
+
+       list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
+               if (cii->codec->switch_clock)
+                       cii->codec->switch_clock(cii, CLOCK_SWITCH_SLAVE);
+
+ out_unlock:
+       mutex_unlock(&i2sdev->lock);
+       return result;
+}
+
+#ifdef CONFIG_PM
+void i2sbus_pcm_prepare_both(struct i2sbus_dev *i2sdev)
+{
+       i2sbus_pcm_prepare(i2sdev, 0);
+       i2sbus_pcm_prepare(i2sdev, 1);
+}
+#endif
+
+static int i2sbus_pcm_trigger(struct i2sbus_dev *i2sdev, int in, int cmd)
+{
+       struct codec_info_item *cii;
+       struct pcm_info *pi;
+       int result = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&i2sdev->low_lock, flags);
+
+       get_pcm_info(i2sdev, in, &pi, NULL);
+
+       switch (cmd) {
+       case SNDRV_PCM_TRIGGER_START:
+       case SNDRV_PCM_TRIGGER_RESUME:
+               if (pi->dbdma_ring.running) {
+                       result = -EALREADY;
+                       goto out_unlock;
+               }
+               list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
+                       if (cii->codec->start)
+                               cii->codec->start(cii, pi->substream);
+               pi->dbdma_ring.running = 1;
+
+               if (pi->dbdma_ring.stopping) {
+                       /* Clear the S0 bit, then see if we stopped yet */
+                       out_le32(&pi->dbdma->control, 1 << 16);
+                       if (in_le32(&pi->dbdma->status) & ACTIVE) {
+                               /* possible race here? */
+                               udelay(10);
+                               if (in_le32(&pi->dbdma->status) & ACTIVE) {
+                                       pi->dbdma_ring.stopping = 0;
+                                       goto out_unlock; /* keep running */
+                               }
+                       }
+               }
+
+               /* make sure RUN, PAUSE and S0 bits are cleared */
+               out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
+
+               /* set branch condition select register */
+               out_le32(&pi->dbdma->br_sel, (1 << 16) | 1);
+
+               /* write dma command buffer address to the dbdma chip */
+               out_le32(&pi->dbdma->cmdptr, pi->dbdma_ring.bus_cmd_start);
+
+               /* initialize the frame count and current period */
+               pi->current_period = 0;
+               pi->frame_count = in_le32(&i2sdev->intfregs->frame_count);
+
+               /* set the DMA controller running */
+               out_le32(&pi->dbdma->control, (RUN << 16) | RUN);
+
+               /* off you go! */
+               break;
+
+       case SNDRV_PCM_TRIGGER_STOP:
+       case SNDRV_PCM_TRIGGER_SUSPEND:
+               if (!pi->dbdma_ring.running) {
+                       result = -EALREADY;
+                       goto out_unlock;
+               }
+               pi->dbdma_ring.running = 0;
+
+               /* Set the S0 bit to make the DMA branch to the stop cmd */
+               out_le32(&pi->dbdma->control, (1 << 16) | 1);
+               pi->dbdma_ring.stopping = 1;
+
+               list_for_each_entry(cii, &i2sdev->sound.codec_list, list)
+                       if (cii->codec->stop)
+                               cii->codec->stop(cii, pi->substream);
+               break;
+       default:
+               result = -EINVAL;
+               goto out_unlock;
+       }
+
+ out_unlock:
+       spin_unlock_irqrestore(&i2sdev->low_lock, flags);
+       return result;
+}
+
+static snd_pcm_uframes_t i2sbus_pcm_pointer(struct i2sbus_dev *i2sdev, int in)
+{
+       struct pcm_info *pi;
+       u32 fc;
+
+       get_pcm_info(i2sdev, in, &pi, NULL);
+
+       fc = in_le32(&i2sdev->intfregs->frame_count);
+       fc = fc - pi->frame_count;
+
+       if (fc >= pi->substream->runtime->buffer_size)
+               fc %= pi->substream->runtime->buffer_size;
+       return fc;
+}
+
+static inline void handle_interrupt(struct i2sbus_dev *i2sdev, int in)
+{
+       struct pcm_info *pi;
+       u32 fc, nframes;
+       u32 status;
+       int timeout, i;
+       int dma_stopped = 0;
+       struct snd_pcm_runtime *runtime;
+
+       spin_lock(&i2sdev->low_lock);
+       get_pcm_info(i2sdev, in, &pi, NULL);
+       if (!pi->dbdma_ring.running && !pi->dbdma_ring.stopping)
+               goto out_unlock;
+
+       i = pi->current_period;
+       runtime = pi->substream->runtime;
+       while (pi->dbdma_ring.cmds[i].xfer_status) {
+               if (le16_to_cpu(pi->dbdma_ring.cmds[i].xfer_status) & BT)
+                       /*
+                        * BT is the branch taken bit.  If it took a branch
+                        * it is because we set the S0 bit to make it
+                        * branch to the stop command.
+                        */
+                       dma_stopped = 1;
+               pi->dbdma_ring.cmds[i].xfer_status = 0;
+
+               if (++i >= runtime->periods) {
+                       i = 0;
+                       pi->frame_count += runtime->buffer_size;
+               }
+               pi->current_period = i;
+
+               /*
+                * Check the frame count.  The DMA tends to get a bit
+                * ahead of the frame counter, which confuses the core.
+                */
+               fc = in_le32(&i2sdev->intfregs->frame_count);
+               nframes = i * runtime->period_size;
+               if (fc < pi->frame_count + nframes)
+                       pi->frame_count = fc - nframes;
+       }
+
+       if (dma_stopped) {
+               timeout = 1000;
+               for (;;) {
+                       status = in_le32(&pi->dbdma->status);
+                       if (!(status & ACTIVE) && (!in || (status & 0x80)))
+                               break;
+                       if (--timeout <= 0) {
+                               printk(KERN_ERR "i2sbus: timed out "
+                                      "waiting for DMA to stop!\n");
+                               break;
+                       }
+                       udelay(1);
+               }
+
+               /* Turn off DMA controller, clear S0 bit */
+               out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
+
+               pi->dbdma_ring.stopping = 0;
+               if (pi->stop_completion)
+                       complete(pi->stop_completion);
+       }
+
+       if (!pi->dbdma_ring.running)
+               goto out_unlock;
+       spin_unlock(&i2sdev->low_lock);
+       /* may call _trigger again, hence needs to be unlocked */
+       snd_pcm_period_elapsed(pi->substream);
+       return;
+
+ out_unlock:
+       spin_unlock(&i2sdev->low_lock);
+}
+
+irqreturn_t i2sbus_tx_intr(int irq, void *devid)
+{
+       handle_interrupt((struct i2sbus_dev *)devid, 0);
+       return IRQ_HANDLED;
+}
+
+irqreturn_t i2sbus_rx_intr(int irq, void *devid)
+{
+       handle_interrupt((struct i2sbus_dev *)devid, 1);
+       return IRQ_HANDLED;
+}
+
+static int i2sbus_playback_open(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       i2sdev->out.substream = substream;
+       return i2sbus_pcm_open(i2sdev, 0);
+}
+
+static int i2sbus_playback_close(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+       int err;
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->out.substream != substream)
+               return -EINVAL;
+       err = i2sbus_pcm_close(i2sdev, 0);
+       if (!err)
+               i2sdev->out.substream = NULL;
+       return err;
+}
+
+static int i2sbus_playback_prepare(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->out.substream != substream)
+               return -EINVAL;
+       return i2sbus_pcm_prepare(i2sdev, 0);
+}
+
+static int i2sbus_playback_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->out.substream != substream)
+               return -EINVAL;
+       return i2sbus_pcm_trigger(i2sdev, 0, cmd);
+}
+
+static snd_pcm_uframes_t i2sbus_playback_pointer(struct snd_pcm_substream
+                                                *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->out.substream != substream)
+               return 0;
+       return i2sbus_pcm_pointer(i2sdev, 0);
+}
+
+static struct snd_pcm_ops i2sbus_playback_ops = {
+       .open =         i2sbus_playback_open,
+       .close =        i2sbus_playback_close,
+       .ioctl =        snd_pcm_lib_ioctl,
+       .hw_params =    i2sbus_hw_params,
+       .hw_free =      i2sbus_playback_hw_free,
+       .prepare =      i2sbus_playback_prepare,
+       .trigger =      i2sbus_playback_trigger,
+       .pointer =      i2sbus_playback_pointer,
+};
+
+static int i2sbus_record_open(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       i2sdev->in.substream = substream;
+       return i2sbus_pcm_open(i2sdev, 1);
+}
+
+static int i2sbus_record_close(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+       int err;
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->in.substream != substream)
+               return -EINVAL;
+       err = i2sbus_pcm_close(i2sdev, 1);
+       if (!err)
+               i2sdev->in.substream = NULL;
+       return err;
+}
+
+static int i2sbus_record_prepare(struct snd_pcm_substream *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->in.substream != substream)
+               return -EINVAL;
+       return i2sbus_pcm_prepare(i2sdev, 1);
+}
+
+static int i2sbus_record_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->in.substream != substream)
+               return -EINVAL;
+       return i2sbus_pcm_trigger(i2sdev, 1, cmd);
+}
+
+static snd_pcm_uframes_t i2sbus_record_pointer(struct snd_pcm_substream
+                                              *substream)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_substream_chip(substream);
+
+       if (!i2sdev)
+               return -EINVAL;
+       if (i2sdev->in.substream != substream)
+               return 0;
+       return i2sbus_pcm_pointer(i2sdev, 1);
+}
+
+static struct snd_pcm_ops i2sbus_record_ops = {
+       .open =         i2sbus_record_open,
+       .close =        i2sbus_record_close,
+       .ioctl =        snd_pcm_lib_ioctl,
+       .hw_params =    i2sbus_hw_params,
+       .hw_free =      i2sbus_record_hw_free,
+       .prepare =      i2sbus_record_prepare,
+       .trigger =      i2sbus_record_trigger,
+       .pointer =      i2sbus_record_pointer,
+};
+
+static void i2sbus_private_free(struct snd_pcm *pcm)
+{
+       struct i2sbus_dev *i2sdev = snd_pcm_chip(pcm);
+       struct codec_info_item *p, *tmp;
+
+       i2sdev->sound.pcm = NULL;
+       i2sdev->out.created = 0;
+       i2sdev->in.created = 0;
+       list_for_each_entry_safe(p, tmp, &i2sdev->sound.codec_list, list) {
+               printk(KERN_ERR "i2sbus: a codec didn't unregister!\n");
+               list_del(&p->list);
+               module_put(p->codec->owner);
+               kfree(p);
+       }
+       soundbus_dev_put(&i2sdev->sound);
+       module_put(THIS_MODULE);
+}
+
+int
+i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,
+                   struct codec_info *ci, void *data)
+{
+       int err, in = 0, out = 0;
+       struct transfer_info *tmp;
+       struct i2sbus_dev *i2sdev = soundbus_dev_to_i2sbus_dev(dev);
+       struct codec_info_item *cii;
+
+       if (!dev->pcmname || dev->pcmid == -1) {
+               printk(KERN_ERR "i2sbus: pcm name and id must be set!\n");
+               return -EINVAL;
+       }
+
+       list_for_each_entry(cii, &dev->codec_list, list) {
+               if (cii->codec_data == data)
+                       return -EALREADY;
+       }
+
+       if (!ci->transfers || !ci->transfers->formats
+           || !ci->transfers->rates || !ci->usable)
+               return -EINVAL;
+
+       /* we currently code the i2s transfer on the clock, and support only
+        * 32 and 64 */
+       if (ci->bus_factor != 32 && ci->bus_factor != 64)
+               return -EINVAL;
+
+       /* If you want to fix this, you need to keep track of what transport infos
+        * are to be used, which codecs they belong to, and then fix all the
+        * sysclock/busclock stuff above to depend on which is usable */
+       list_for_each_entry(cii, &dev->codec_list, list) {
+               if (cii->codec->sysclock_factor != ci->sysclock_factor) {
+                       printk(KERN_DEBUG
+                              "cannot yet handle multiple different sysclocks!\n");
+                       return -EINVAL;
+               }
+               if (cii->codec->bus_factor != ci->bus_factor) {
+                       printk(KERN_DEBUG
+                              "cannot yet handle multiple different bus clocks!\n");
+                       return -EINVAL;
+               }
+       }
+
+       tmp = ci->transfers;
+       while (tmp->formats && tmp->rates) {
+               if (tmp->transfer_in)
+                       in = 1;
+               else
+                       out = 1;
+               tmp++;
+       }
+
+       cii = kzalloc(sizeof(struct codec_info_item), GFP_KERNEL);
+       if (!cii) {
+               printk(KERN_DEBUG "i2sbus: failed to allocate cii\n");
+               return -ENOMEM;
+       }
+
+       /* use the private data to point to the codec info */
+       cii->sdev = soundbus_dev_get(dev);
+       cii->codec = ci;
+       cii->codec_data = data;
+
+       if (!cii->sdev) {
+               printk(KERN_DEBUG
+                      "i2sbus: failed to get soundbus dev reference\n");
+               err = -ENODEV;
+               goto out_free_cii;
+       }
+
+       if (!try_module_get(THIS_MODULE)) {
+               printk(KERN_DEBUG "i2sbus: failed to get module reference!\n");
+               err = -EBUSY;
+               goto out_put_sdev;
+       }
+
+       if (!try_module_get(ci->owner)) {
+               printk(KERN_DEBUG
+                      "i2sbus: failed to get module reference to codec owner!\n");
+               err = -EBUSY;
+               goto out_put_this_module;
+       }
+
+       if (!dev->pcm) {
+               err = snd_pcm_new(card, dev->pcmname, dev->pcmid, 0, 0,
+                                 &dev->pcm);
+               if (err) {
+                       printk(KERN_DEBUG "i2sbus: failed to create pcm\n");
+                       goto out_put_ci_module;
+               }
+               dev->pcm->dev = &dev->ofdev.dev;
+       }
+
+       /* ALSA yet again sucks.
+        * If it is ever fixed, remove this line. See below. */
+       out = in = 1;
+
+       if (!i2sdev->out.created && out) {
+               if (dev->pcm->card != card) {
+                       /* eh? */
+                       printk(KERN_ERR
+                              "Can't attach same bus to different cards!\n");
+                       err = -EINVAL;
+                       goto out_put_ci_module;
+               }
+               err = snd_pcm_new_stream(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK, 1);
+               if (err)
+                       goto out_put_ci_module;
+               snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_PLAYBACK,
+                               &i2sbus_playback_ops);
+               i2sdev->out.created = 1;
+       }
+
+       if (!i2sdev->in.created && in) {
+               if (dev->pcm->card != card) {
+                       printk(KERN_ERR
+                              "Can't attach same bus to different cards!\n");
+                       err = -EINVAL;
+                       goto out_put_ci_module;
+               }
+               err = snd_pcm_new_stream(dev->pcm, SNDRV_PCM_STREAM_CAPTURE, 1);
+               if (err)
+                       goto out_put_ci_module;
+               snd_pcm_set_ops(dev->pcm, SNDRV_PCM_STREAM_CAPTURE,
+                               &i2sbus_record_ops);
+               i2sdev->in.created = 1;
+       }
+
+       /* so we have to register the pcm after adding any substream
+        * to it because alsa doesn't create the devices for the
+        * substreams when we add them later.
+        * Therefore, force in and out on both busses (above) and
+        * register the pcm now instead of just after creating it.
+        */
+       err = snd_device_register(card, dev->pcm);
+       if (err) {
+               printk(KERN_ERR "i2sbus: error registering new pcm\n");
+               goto out_put_ci_module;
+       }
+       /* no errors any more, so let's add this to our list */
+       list_add(&cii->list, &dev->codec_list);
+
+       dev->pcm->private_data = i2sdev;
+       dev->pcm->private_free = i2sbus_private_free;
+
+       /* well, we really should support scatter/gather DMA */
+       snd_pcm_lib_preallocate_pages_for_all(
+               dev->pcm, SNDRV_DMA_TYPE_DEV,
+               snd_dma_pci_data(macio_get_pci_dev(i2sdev->macio)),
+               64 * 1024, 64 * 1024);
+
+       return 0;
+ out_put_ci_module:
+       module_put(ci->owner);
+ out_put_this_module:
+       module_put(THIS_MODULE);
+ out_put_sdev:
+       soundbus_dev_put(dev);
+ out_free_cii:
+       kfree(cii);
+       return err;
+}
+
+void i2sbus_detach_codec(struct soundbus_dev *dev, void *data)
+{
+       struct codec_info_item *cii = NULL, *i;
+
+       list_for_each_entry(i, &dev->codec_list, list) {
+               if (i->codec_data == data) {
+                       cii = i;
+                       break;
+               }
+       }
+       if (cii) {
+               list_del(&cii->list);
+               module_put(cii->codec->owner);
+               kfree(cii);
+       }
+       /* no more codecs, but still a pcm? */
+       if (list_empty(&dev->codec_list) && dev->pcm) {
+               /* the actual cleanup is done by the callback above! */
+               snd_device_free(dev->pcm->card, dev->pcm);
+       }
+}
index c58d8227254c8ff77d1a8ab210c1bbbedb769787..a67dfac08c035aa1c41938d150c7ce333336faf0 100644 (file)
@@ -98,7 +98,7 @@ int snd_device_free(struct snd_card *card, void *device_data)
                kfree(dev);
                return 0;
        }
-       snd_printd("device free %p (from %p), not found\n", device_data,
+       snd_printd("device free %p (from %pF), not found\n", device_data,
                   __builtin_return_address(0));
        return -ENXIO;
 }
@@ -135,7 +135,7 @@ int snd_device_disconnect(struct snd_card *card, void *device_data)
                }
                return 0;
        }
-       snd_printd("device disconnect %p (from %p), not found\n", device_data,
+       snd_printd("device disconnect %p (from %pF), not found\n", device_data,
                   __builtin_return_address(0));
        return -ENXIO;
 }
index 39672f68ce5d2a2c86b4b944377ea115a9c37032..002777ba336aea636cd0a5c54d54934c87867bd8 100644 (file)
@@ -151,7 +151,7 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs
        if (!substream->opened)
                return;
        if (up) {
-               tasklet_hi_schedule(&substream->runtime->tasklet);
+               tasklet_schedule(&substream->runtime->tasklet);
        } else {
                tasklet_kill(&substream->runtime->tasklet);
                substream->ops->trigger(substream, 0);
@@ -908,7 +908,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
        }
        if (result > 0) {
                if (runtime->event)
-                       tasklet_hi_schedule(&runtime->tasklet);
+                       tasklet_schedule(&runtime->tasklet);
                else if (snd_rawmidi_ready(substream))
                        wake_up(&runtime->sleep);
        }
index 51e64e30dd3b6eea52b9d79908e3e50e333e7979..0851cd13e30394811e54fb29ed9a02112c9849ac 100644 (file)
@@ -118,7 +118,7 @@ static void rtctimer_tasklet(unsigned long data)
  */
 static void rtctimer_interrupt(void *private_data)
 {
-       tasklet_hi_schedule(private_data);
+       tasklet_schedule(private_data);
 }
 
 
index c584408c9f17d32dcace6b8684bfe02647a0f228..796532081e8153125a6067bdee899ecf2869c909 100644 (file)
@@ -743,7 +743,7 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
        spin_unlock_irqrestore(&timer->lock, flags);
 
        if (use_tasklet)
-               tasklet_hi_schedule(&timer->task_queue);
+               tasklet_schedule(&timer->task_queue);
 }
 
 /*
index 255fd18b9aecc357730f16c1670706d5c5d95c1d..0bcf14640fdedf35886a6eaf5e7a5c1ab8a6469b 100644 (file)
@@ -163,7 +163,7 @@ config SND_ML403_AC97CR
 
 config SND_AC97_POWER_SAVE
        bool "AC97 Power-Saving Mode"
-       depends on SND_AC97_CODEC && EXPERIMENTAL
+       depends on SND_AC97_CODEC
        default n
        help
          Say Y here to enable the aggressive power-saving support of
index 1899cf0685bc64c2732602e23dd2081ebcd97890..2a02f704f366b31c58947e3d409cf5fd5212d06c 100644 (file)
@@ -96,7 +96,7 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
                return -EINVAL;
 
        hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       pcsp_chip.timer.cb_mode = HRTIMER_CB_SOFTIRQ;
+       pcsp_chip.timer.cb_mode = HRTIMER_CB_IRQSAFE_UNLOCKED;
        pcsp_chip.timer.function = pcsp_do_timer;
 
        card = snd_card_new(index, id, THIS_MODULE, 0);
@@ -188,10 +188,8 @@ static int __devexit pcsp_remove(struct platform_device *dev)
 
 static void pcsp_stop_beep(struct snd_pcsp *chip)
 {
-       spin_lock_irq(&chip->substream_lock);
-       if (!chip->playback_substream)
-               pcspkr_stop_sound();
-       spin_unlock_irq(&chip->substream_lock);
+       pcsp_sync_stop(chip);
+       pcspkr_stop_sound();
 }
 
 #ifdef CONFIG_PM
index 1d661f795e8c15f13342ffeb221901d922e8b10d..cdef2664218ff7c27582d49d0a987bcc2f65d030 100644 (file)
@@ -62,6 +62,8 @@ struct snd_pcsp {
        unsigned short port, irq, dma;
        spinlock_t substream_lock;
        struct snd_pcm_substream *playback_substream;
+       unsigned int fmt_size;
+       unsigned int is_signed;
        size_t playback_ptr;
        size_t period_ptr;
        atomic_t timer_active;
@@ -77,6 +79,7 @@ struct snd_pcsp {
 extern struct snd_pcsp pcsp_chip;
 
 extern enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle);
+extern void pcsp_sync_stop(struct snd_pcsp *chip);
 
 extern int snd_pcsp_new_pcm(struct snd_pcsp *chip);
 extern int snd_pcsp_new_mixer(struct snd_pcsp *chip);
index 1f42e406311835a5c98aae272d9969ec6d5aa61b..84cc2658c05b327e20a908d8fddb0f05f353fd12 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
+#include <linux/interrupt.h>
 #include <sound/pcm.h>
 #include <asm/io.h>
 #include "pcsp.h"
@@ -19,61 +20,57 @@ MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "
 
 #define DMIX_WANTS_S16 1
 
-enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
+/*
+ * Call snd_pcm_period_elapsed in a tasklet
+ * This avoids spinlock messes and long-running irq contexts
+ */
+static void pcsp_call_pcm_elapsed(unsigned long priv)
+{
+       if (atomic_read(&pcsp_chip.timer_active)) {
+               struct snd_pcm_substream *substream;
+               substream = pcsp_chip.playback_substream;
+               if (substream)
+                       snd_pcm_period_elapsed(substream);
+       }
+}
+
+static DECLARE_TASKLET(pcsp_pcm_tasklet, pcsp_call_pcm_elapsed, 0);
+
+/* write the port and returns the next expire time in ns;
+ * called at the trigger-start and in hrtimer callback
+ */
+static unsigned long pcsp_timer_update(struct hrtimer *handle)
 {
        unsigned char timer_cnt, val;
-       int fmt_size, periods_elapsed;
        u64 ns;
-       size_t period_bytes, buffer_bytes;
        struct snd_pcm_substream *substream;
        struct snd_pcm_runtime *runtime;
        struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
+       unsigned long flags;
 
        if (chip->thalf) {
                outb(chip->val61, 0x61);
                chip->thalf = 0;
                if (!atomic_read(&chip->timer_active))
-                       return HRTIMER_NORESTART;
-               hrtimer_forward(&chip->timer, hrtimer_get_expires(&chip->timer),
-                               ktime_set(0, chip->ns_rem));
-               return HRTIMER_RESTART;
+                       return 0;
+               return chip->ns_rem;
        }
 
-       spin_lock_irq(&chip->substream_lock);
-       /* Takashi Iwai says regarding this extra lock:
-
-       If the irq handler handles some data on the DMA buffer, it should
-       do snd_pcm_stream_lock().
-       That protects basically against all races among PCM callbacks, yes.
-       However, there are two remaining issues:
-       1. The substream pointer you try to lock isn't protected _before_
-         this lock yet.
-       2. snd_pcm_period_elapsed() itself acquires the lock.
-       The requirement of another lock is because of 1.  When you get
-       chip->playback_substream, it's not protected.
-       Keeping this lock while snd_pcm_period_elapsed() assures the substream
-       is still protected (at least, not released).  And the other status is
-       handled properly inside snd_pcm_stream_lock() in
-       snd_pcm_period_elapsed().
-
-       */
-       if (!chip->playback_substream)
-               goto exit_nr_unlock1;
-       substream = chip->playback_substream;
-       snd_pcm_stream_lock(substream);
        if (!atomic_read(&chip->timer_active))
-               goto exit_nr_unlock2;
+               return 0;
+       substream = chip->playback_substream;
+       if (!substream)
+               return 0;
 
        runtime = substream->runtime;
-       fmt_size = snd_pcm_format_physical_width(runtime->format) >> 3;
        /* assume it is mono! */
-       val = runtime->dma_area[chip->playback_ptr + fmt_size - 1];
-       if (snd_pcm_format_signed(runtime->format))
+       val = runtime->dma_area[chip->playback_ptr + chip->fmt_size - 1];
+       if (chip->is_signed)
                val ^= 0x80;
        timer_cnt = val * CUR_DIV() / 256;
 
        if (timer_cnt && chip->enable) {
-               spin_lock(&i8253_lock);
+               spin_lock_irqsave(&i8253_lock, flags);
                if (!nforce_wa) {
                        outb_p(chip->val61, 0x61);
                        outb_p(timer_cnt, 0x42);
@@ -82,12 +79,39 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
                        outb(chip->val61 ^ 2, 0x61);
                        chip->thalf = 1;
                }
-               spin_unlock(&i8253_lock);
+               spin_unlock_irqrestore(&i8253_lock, flags);
        }
 
+       chip->ns_rem = PCSP_PERIOD_NS();
+       ns = (chip->thalf ? PCSP_CALC_NS(timer_cnt) : chip->ns_rem);
+       chip->ns_rem -= ns;
+       return ns;
+}
+
+enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
+{
+       struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
+       struct snd_pcm_substream *substream;
+       int periods_elapsed, pointer_update;
+       size_t period_bytes, buffer_bytes;
+       unsigned long ns;
+       unsigned long flags;
+
+       pointer_update = !chip->thalf;
+       ns = pcsp_timer_update(handle);
+       if (!ns)
+               return HRTIMER_NORESTART;
+
+       /* update the playback position */
+       substream = chip->playback_substream;
+       if (!substream)
+               return HRTIMER_NORESTART;
+
        period_bytes = snd_pcm_lib_period_bytes(substream);
        buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
-       chip->playback_ptr += PCSP_INDEX_INC() * fmt_size;
+
+       spin_lock_irqsave(&chip->substream_lock, flags);
+       chip->playback_ptr += PCSP_INDEX_INC() * chip->fmt_size;
        periods_elapsed = chip->playback_ptr - chip->period_ptr;
        if (periods_elapsed < 0) {
 #if PCSP_DEBUG
@@ -102,41 +126,30 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
         * or ALSA will BUG on us. */
        chip->playback_ptr %= buffer_bytes;
 
-       snd_pcm_stream_unlock(substream);
-
        if (periods_elapsed) {
-               snd_pcm_period_elapsed(substream);
                chip->period_ptr += periods_elapsed * period_bytes;
                chip->period_ptr %= buffer_bytes;
        }
+       spin_unlock_irqrestore(&chip->substream_lock, flags);
 
-       spin_unlock_irq(&chip->substream_lock);
+       if (periods_elapsed)
+               tasklet_schedule(&pcsp_pcm_tasklet);
 
-       if (!atomic_read(&chip->timer_active))
-               return HRTIMER_NORESTART;
+       hrtimer_forward(handle, hrtimer_get_expires(handle), ns_to_ktime(ns));
 
-       chip->ns_rem = PCSP_PERIOD_NS();
-       ns = (chip->thalf ? PCSP_CALC_NS(timer_cnt) : chip->ns_rem);
-       chip->ns_rem -= ns;
-       hrtimer_forward(&chip->timer, hrtimer_get_expires(&chip->timer),
-                                                       ktime_set(0, ns));
        return HRTIMER_RESTART;
-
-exit_nr_unlock2:
-       snd_pcm_stream_unlock(substream);
-exit_nr_unlock1:
-       spin_unlock_irq(&chip->substream_lock);
-       return HRTIMER_NORESTART;
 }
 
-static void pcsp_start_playing(struct snd_pcsp *chip)
+static int pcsp_start_playing(struct snd_pcsp *chip)
 {
+       unsigned long ns;
+
 #if PCSP_DEBUG
        printk(KERN_INFO "PCSP: start_playing called\n");
 #endif
        if (atomic_read(&chip->timer_active)) {
                printk(KERN_ERR "PCSP: Timer already active\n");
-               return;
+               return -EIO;
        }
 
        spin_lock(&i8253_lock);
@@ -146,7 +159,12 @@ static void pcsp_start_playing(struct snd_pcsp *chip)
        atomic_set(&chip->timer_active, 1);
        chip->thalf = 0;
 
-       hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
+       ns = pcsp_timer_update(&pcsp_chip.timer);
+       if (!ns)
+               return -EIO;
+
+       hrtimer_start(&pcsp_chip.timer, ktime_set(0, ns), HRTIMER_MODE_REL);
+       return 0;
 }
 
 static void pcsp_stop_playing(struct snd_pcsp *chip)
@@ -165,26 +183,35 @@ static void pcsp_stop_playing(struct snd_pcsp *chip)
        spin_unlock(&i8253_lock);
 }
 
+/*
+ * Force to stop and sync the stream
+ */
+void pcsp_sync_stop(struct snd_pcsp *chip)
+{
+       local_irq_disable();
+       pcsp_stop_playing(chip);
+       local_irq_enable();
+       hrtimer_cancel(&chip->timer);
+       tasklet_kill(&pcsp_pcm_tasklet);
+}
+
 static int snd_pcsp_playback_close(struct snd_pcm_substream *substream)
 {
        struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
 #if PCSP_DEBUG
        printk(KERN_INFO "PCSP: close called\n");
 #endif
-       if (atomic_read(&chip->timer_active)) {
-               printk(KERN_ERR "PCSP: timer still active\n");
-               pcsp_stop_playing(chip);
-       }
-       spin_lock_irq(&chip->substream_lock);
+       pcsp_sync_stop(chip);
        chip->playback_substream = NULL;
-       spin_unlock_irq(&chip->substream_lock);
        return 0;
 }
 
 static int snd_pcsp_playback_hw_params(struct snd_pcm_substream *substream,
                                       struct snd_pcm_hw_params *hw_params)
 {
+       struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
        int err;
+       pcsp_sync_stop(chip);
        err = snd_pcm_lib_malloc_pages(substream,
                                      params_buffer_bytes(hw_params));
        if (err < 0)
@@ -194,9 +221,11 @@ static int snd_pcsp_playback_hw_params(struct snd_pcm_substream *substream,
 
 static int snd_pcsp_playback_hw_free(struct snd_pcm_substream *substream)
 {
+       struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
 #if PCSP_DEBUG
        printk(KERN_INFO "PCSP: hw_free called\n");
 #endif
+       pcsp_sync_stop(chip);
        return snd_pcm_lib_free_pages(substream);
 }
 
@@ -212,8 +241,12 @@ static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream)
                        snd_pcm_lib_period_bytes(substream),
                        substream->runtime->periods);
 #endif
+       pcsp_sync_stop(chip);
        chip->playback_ptr = 0;
        chip->period_ptr = 0;
+       chip->fmt_size =
+               snd_pcm_format_physical_width(substream->runtime->format) >> 3;
+       chip->is_signed = snd_pcm_format_signed(substream->runtime->format);
        return 0;
 }
 
@@ -226,8 +259,7 @@ static int snd_pcsp_trigger(struct snd_pcm_substream *substream, int cmd)
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
        case SNDRV_PCM_TRIGGER_RESUME:
-               pcsp_start_playing(chip);
-               break;
+               return pcsp_start_playing(chip);
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
                pcsp_stop_playing(chip);
@@ -242,7 +274,11 @@ static snd_pcm_uframes_t snd_pcsp_playback_pointer(struct snd_pcm_substream
                                                   *substream)
 {
        struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
-       return bytes_to_frames(substream->runtime, chip->playback_ptr);
+       unsigned int pos;
+       spin_lock(&chip->substream_lock);
+       pos = chip->playback_ptr;
+       spin_unlock(&chip->substream_lock);
+       return bytes_to_frames(substream->runtime, pos);
 }
 
 static struct snd_pcm_hardware snd_pcsp_playback = {
@@ -279,9 +315,7 @@ static int snd_pcsp_playback_open(struct snd_pcm_substream *substream)
                return -EBUSY;
        }
        runtime->hw = snd_pcsp_playback;
-       spin_lock_irq(&chip->substream_lock);
        chip->playback_substream = substream;
-       spin_unlock_irq(&chip->substream_lock);
        return 0;
 }
 
index 473b07f6ae85f09d9760f708468aa7352362c1d1..14e3354be43a4470b1cd241c5649f5fa3c6637f5 100644 (file)
@@ -548,7 +548,7 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev)
            (chip->chip_status & VX_STAT_IS_STALE))
                return IRQ_NONE;
        if (! vx_test_and_ack(chip))
-               tasklet_hi_schedule(&chip->tq);
+               tasklet_schedule(&chip->tq);
        return IRQ_HANDLED;
 }
 
index 27de574c08f76c5ff5763e1051e6dba353402648..6644d0034fbaa357b88f7207b676343881ff4207 100644 (file)
@@ -823,7 +823,7 @@ static int vx_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
                 * we trigger the pipe using tasklet, so that the interrupts are
                 * issued surely after the trigger is completed.
                 */ 
-               tasklet_hi_schedule(&pipe->start_tq);
+               tasklet_schedule(&pipe->start_tq);
                chip->pcm_running++;
                pipe->running = 1;
                break;
index 667eccc676a40a8898f887ef21288cefa717624f..ea06877be4b135fb8256de12ebe416dc9df46901 100644 (file)
@@ -140,8 +140,10 @@ static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev)
                                break;
                        }
                }
-               if (i >= ARRAY_SIZE(possible_ports))
+               if (i >= ARRAY_SIZE(possible_ports)) {
+                       err = -EINVAL;
                        goto _err;
+               }
        }
        acard->chip = chip;
                        
index bd510eceff1ff413422c0c5d004440e7a2fd44af..e2b843b4f9d0963c681c6fe877bddd48bdd2ee7c 100644 (file)
@@ -175,7 +175,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
 { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q",   patch_wolfson04, NULL},
 { 0x574d4C05, 0xffffffff, "WM9705,WM9710",     patch_wolfson05, NULL},
 { 0x574d4C09, 0xffffffff, "WM9709",            NULL,           NULL},
-{ 0x574d4C12, 0xffffffff, "WM9711,WM9712",     patch_wolfson11, NULL},
+{ 0x574d4C12, 0xffffffff, "WM9711,WM9712,WM9715",      patch_wolfson11, NULL},
 { 0x574d4c13, 0xffffffff, "WM9713,WM9714",     patch_wolfson13, NULL, AC97_DEFAULT_POWER_OFF},
 { 0x594d4800, 0xffffffff, "YMF743",            patch_yamaha_ymf743,    NULL },
 { 0x594d4802, 0xffffffff, "YMF752",            NULL,           NULL },
index 7ad25f439b50649d715ee866692dec20e23bac8e..81bc93e5f1e30f5b6abb06f6b0140d0c752e4672 100644 (file)
@@ -2833,6 +2833,8 @@ static int patch_alc655(struct snd_ac97 * ac97)
                        val &= ~(1 << 1); /* Pin 47 is EAPD (for internal speaker) */
                else
                        val |= (1 << 1); /* Pin 47 is spdif input pin */
+               /* this seems missing on some hardwares */
+               ac97->ext_id |= AC97_EI_SPDIF;
        }
        val &= ~(1 << 12); /* vref enable */
        snd_ac97_write_cache(ac97, 0x7a, val);
index 74175fc80c7f447dbc0441c325c04abf29350e91..14b8d9a91aae27655439e487aed6aed853b9e426 100644 (file)
@@ -664,10 +664,14 @@ struct snd_ca0106_pcm {
 struct snd_ca0106_details {
         u32 serial;
         char * name;
-        int ac97;
-       int gpio_type;
-       int i2c_adc;
-       int spi_dac;
+       int ac97;       /* ac97 = 0 -> Select MIC, Line in, TAD in, AUX in.
+                          ac97 = 1 -> Default to AC97 in. */
+       int gpio_type;  /* gpio_type = 1 -> shared mic-in/line-in
+                          gpio_type = 2 -> shared side-out/line-in. */
+       int i2c_adc;    /* with i2c_adc=1, the driver adds some capture volume
+                          controls, phone, mic, line-in and aux. */
+       int spi_dac;    /* spi_dac=1 adds the mute switch for each analog
+                          output, front, rear, etc. */
 };
 
 // definition of the chip-specific record
@@ -686,11 +690,12 @@ struct snd_ca0106 {
        spinlock_t emu_lock;
 
        struct snd_ac97 *ac97;
-       struct snd_pcm *pcm;
+       struct snd_pcm *pcm[4];
 
        struct snd_ca0106_channel playback_channels[4];
        struct snd_ca0106_channel capture_channels[4];
-       u32 spdif_bits[4];             /* s/pdif out setup */
+       u32 spdif_bits[4];             /* s/pdif out default setup */
+       u32 spdif_str_bits[4];         /* s/pdif out per-stream setup */
        int spdif_enable;
        int capture_source;
        int i2c_capture_source;
@@ -703,6 +708,11 @@ struct snd_ca0106 {
        struct snd_ca_midi midi2;
 
        u16 spi_dac_reg[16];
+
+#ifdef CONFIG_PM
+#define NUM_SAVED_VOLUMES      9
+       unsigned int saved_vol[NUM_SAVED_VOLUMES];
+#endif
 };
 
 int snd_ca0106_mixer(struct snd_ca0106 *emu);
@@ -721,3 +731,11 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value);
 
 int snd_ca0106_spi_write(struct snd_ca0106 * emu,
                                   unsigned int data);
+
+#ifdef CONFIG_PM
+void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip);
+void snd_ca0106_mixer_resume(struct snd_ca0106 *chip);
+#else
+#define snd_ca0106_mixer_suspend(chip) do { } while (0)
+#define snd_ca0106_mixer_resume(chip)  do { } while (0)
+#endif
index 88fbf285d2b74ea6cf1ccc701398d0e730784840..0e62205d4081d3da96606c9b48f7b568d221f7ca 100644 (file)
@@ -254,7 +254,7 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
           .name   = "MSI K8N Diamond MB",
           .gpio_type = 2,
           .i2c_adc = 1,
-          .spi_dac = 2 } ,
+          .spi_dac = 1 } ,
         /* Shuttle XPC SD31P which has an onboard Creative Labs
          * Sound Blaster Live! 24-bit EAX
          * high-definition 7.1 audio processor".
@@ -305,9 +305,15 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
                                 SNDRV_PCM_INFO_MMAP_VALID),
        .formats =              SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
+#if 0 /* FIXME: looks like 44.1kHz capture causes noisy output on 48kHz */
        .rates =                (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
                                 SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000),
        .rate_min =             44100,
+#else
+       .rates =                (SNDRV_PCM_RATE_48000 |
+                                SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000),
+       .rate_min =             48000,
+#endif /* FIXME */
        .rate_max =             192000,
        .channels_min =         2,
        .channels_max =         2,
@@ -479,6 +485,15 @@ static const int spi_dacd_bit[] = {
        [PCM_UNKNOWN_CHANNEL]   = SPI_DACD1_BIT,
 };
 
+static void restore_spdif_bits(struct snd_ca0106 *chip, int idx)
+{
+       if (chip->spdif_str_bits[idx] != chip->spdif_bits[idx]) {
+               chip->spdif_str_bits[idx] = chip->spdif_bits[idx];
+               snd_ca0106_ptr_write(chip, SPCS0 + idx, 0,
+                                    chip->spdif_str_bits[idx]);
+       }
+}
+
 /* open_playback callback */
 static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substream,
                                                int channel_id)
@@ -524,6 +539,9 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
                if (err < 0)
                        return err;
        }
+
+       restore_spdif_bits(chip, channel_id);
+
        return 0;
 }
 
@@ -535,6 +553,8 @@ static int snd_ca0106_pcm_close_playback(struct snd_pcm_substream *substream)
         struct snd_ca0106_pcm *epcm = runtime->private_data;
        chip->playback_channels[epcm->channel_id].use = 0;
 
+       restore_spdif_bits(chip, epcm->channel_id);
+
        if (chip->details->spi_dac && epcm->channel_id != PCM_FRONT_CHANNEL) {
                const int reg = spi_dacd_reg[epcm->channel_id];
 
@@ -847,15 +867,18 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
         struct snd_pcm_substream *s;
        u32 basic = 0;
        u32 extended = 0;
-       int running=0;
+       u32 bits;
+       int running = 0;
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
-               running=1;
+       case SNDRV_PCM_TRIGGER_RESUME:
+               running = 1;
                break;
        case SNDRV_PCM_TRIGGER_STOP:
+       case SNDRV_PCM_TRIGGER_SUSPEND:
        default:
-               running=0;
+               running = 0;
                break;
        }
         snd_pcm_group_for_each_entry(s, substream) {
@@ -865,22 +888,32 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
                runtime = s->runtime;
                epcm = runtime->private_data;
                channel = epcm->channel_id;
-               //snd_printk("channel=%d\n",channel);
+               /* snd_printk("channel=%d\n",channel); */
                epcm->running = running;
-               basic |= (0x1<<channel);
-               extended |= (0x10<<channel);
+               basic |= (0x1 << channel);
+               extended |= (0x10 << channel);
                 snd_pcm_trigger_done(s, substream);
         }
-       //snd_printk("basic=0x%x, extended=0x%x\n",basic, extended);
+       /* snd_printk("basic=0x%x, extended=0x%x\n",basic, extended); */
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
-               snd_ca0106_ptr_write(emu, EXTENDED_INT_MASK, 0, snd_ca0106_ptr_read(emu, EXTENDED_INT_MASK, 0) | (extended));
-               snd_ca0106_ptr_write(emu, BASIC_INTERRUPT, 0, snd_ca0106_ptr_read(emu, BASIC_INTERRUPT, 0)|(basic));
+       case SNDRV_PCM_TRIGGER_RESUME:
+               bits = snd_ca0106_ptr_read(emu, EXTENDED_INT_MASK, 0);
+               bits |= extended;
+               snd_ca0106_ptr_write(emu, EXTENDED_INT_MASK, 0, bits);
+               bits = snd_ca0106_ptr_read(emu, BASIC_INTERRUPT, 0);
+               bits |= basic;
+               snd_ca0106_ptr_write(emu, BASIC_INTERRUPT, 0, bits);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
-               snd_ca0106_ptr_write(emu, BASIC_INTERRUPT, 0, snd_ca0106_ptr_read(emu, BASIC_INTERRUPT, 0) & ~(basic));
-               snd_ca0106_ptr_write(emu, EXTENDED_INT_MASK, 0, snd_ca0106_ptr_read(emu, EXTENDED_INT_MASK, 0) & ~(extended));
+       case SNDRV_PCM_TRIGGER_SUSPEND:
+               bits = snd_ca0106_ptr_read(emu, BASIC_INTERRUPT, 0);
+               bits &= ~basic;
+               snd_ca0106_ptr_write(emu, BASIC_INTERRUPT, 0, bits);
+               bits = snd_ca0106_ptr_read(emu, EXTENDED_INT_MASK, 0);
+               bits &= ~extended;
+               snd_ca0106_ptr_write(emu, EXTENDED_INT_MASK, 0, bits);
                break;
        default:
                result = -EINVAL;
@@ -1103,21 +1136,13 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
        return snd_ac97_mixer(pbus, &ac97, &chip->ac97);
 }
 
+static void ca0106_stop_chip(struct snd_ca0106 *chip);
+
 static int snd_ca0106_free(struct snd_ca0106 *chip)
 {
-       if (chip->res_port != NULL) {    /* avoid access to already used hardware */
-               // disable interrupts
-               snd_ca0106_ptr_write(chip, BASIC_INTERRUPT, 0, 0);
-               outl(0, chip->port + INTE);
-               snd_ca0106_ptr_write(chip, EXTENDED_INT_MASK, 0, 0);
-               udelay(1000);
-               // disable audio
-               //outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
-               outl(0, chip->port + HCFG);
-               /* FIXME: We need to stop and DMA transfers here.
-                *        But as I am not sure how yet, we cannot from the dma pages.
-                * So we can fix: snd-malloc: Memory leak?  pages not freed = 8
-                */
+       if (chip->res_port != NULL) {
+               /* avoid access to already used hardware */
+               ca0106_stop_chip(chip);
        }
        if (chip->irq >= 0)
                free_irq(chip->irq, chip);
@@ -1203,15 +1228,14 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct snd_pcm **rpcm)
+static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device)
 {
        struct snd_pcm *pcm;
        struct snd_pcm_substream *substream;
        int err;
   
-       if (rpcm)
-               *rpcm = NULL;
-       if ((err = snd_pcm_new(emu->card, "ca0106", device, 1, 1, &pcm)) < 0)
+       err = snd_pcm_new(emu->card, "ca0106", device, 1, 1, &pcm);
+       if (err < 0)
                return err;
   
        pcm->private_data = emu;
@@ -1238,7 +1262,6 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
        pcm->info_flags = 0;
        pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
        strcpy(pcm->name, "CA0106");
-       emu->pcm = pcm;
 
        for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; 
            substream; 
@@ -1260,8 +1283,7 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
                        return err;
        }
   
-       if (rpcm)
-               *rpcm = pcm;
+       emu->pcm[device] = pcm;
   
        return 0;
 }
@@ -1301,89 +1323,10 @@ static unsigned int i2c_adc_init[][2] = {
        { 0x15, ADC_MUX_LINEIN },  /* ADC Mixer control */
 };
 
-static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
-                                        struct pci_dev *pci,
-                                        struct snd_ca0106 **rchip)
+static void ca0106_init_chip(struct snd_ca0106 *chip, int resume)
 {
-       struct snd_ca0106 *chip;
-       struct snd_ca0106_details *c;
-       int err;
        int ch;
-       static struct snd_device_ops ops = {
-               .dev_free = snd_ca0106_dev_free,
-       };
-  
-       *rchip = NULL;
-  
-       if ((err = pci_enable_device(pci)) < 0)
-               return err;
-       if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
-           pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) {
-               printk(KERN_ERR "error to set 32bit mask DMA\n");
-               pci_disable_device(pci);
-               return -ENXIO;
-       }
-  
-       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-       if (chip == NULL) {
-               pci_disable_device(pci);
-               return -ENOMEM;
-       }
-  
-       chip->card = card;
-       chip->pci = pci;
-       chip->irq = -1;
-
-       spin_lock_init(&chip->emu_lock);
-  
-       chip->port = pci_resource_start(pci, 0);
-       if ((chip->res_port = request_region(chip->port, 0x20,
-                                            "snd_ca0106")) == NULL) { 
-               snd_ca0106_free(chip);
-               printk(KERN_ERR "cannot allocate the port\n");
-               return -EBUSY;
-       }
-
-       if (request_irq(pci->irq, snd_ca0106_interrupt,
-                       IRQF_SHARED, "snd_ca0106", chip)) {
-               snd_ca0106_free(chip);
-               printk(KERN_ERR "cannot grab irq\n");
-               return -EBUSY;
-       }
-       chip->irq = pci->irq;
-  
-       /* This stores the periods table. */ 
-       if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &chip->buffer) < 0) {
-               snd_ca0106_free(chip);
-               return -ENOMEM;
-       }
-
-       pci_set_master(pci);
-       /* read serial */
-       pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
-       pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
-#if 1
-       printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model,
-              pci->revision, chip->serial);
-#endif
-       strcpy(card->driver, "CA0106");
-       strcpy(card->shortname, "CA0106");
-
-       for (c = ca0106_chip_details; c->serial; c++) {
-               if (subsystem[dev]) {
-                       if (c->serial == subsystem[dev])
-                               break;
-               } else if (c->serial == chip->serial)
-                       break;
-       }
-       chip->details = c;
-       if (subsystem[dev]) {
-               printk(KERN_INFO "snd-ca0106: Sound card name=%s, subsystem=0x%x. Forced to subsystem=0x%x\n",
-                        c->name, chip->serial, subsystem[dev]);
-       }
-
-       sprintf(card->longname, "%s at 0x%lx irq %i",
-               c->name, chip->port, chip->irq);
+       unsigned int def_bits;
 
        outl(0, chip->port + INTE);
 
@@ -1401,31 +1344,22 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
         *  AN                = 0     (Audio data)
         *  P                 = 0     (Consumer)
         */
-       snd_ca0106_ptr_write(chip, SPCS0, 0,
-                               chip->spdif_bits[0] =
-                               SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
-                               SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
-                               SPCS_GENERATIONSTATUS | 0x00001200 |
-                               0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
+       def_bits =
+               SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
+               SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
+               SPCS_GENERATIONSTATUS | 0x00001200 |
+               0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
+       if (!resume) {
+               chip->spdif_str_bits[0] = chip->spdif_bits[0] = def_bits;
+               chip->spdif_str_bits[1] = chip->spdif_bits[1] = def_bits;
+               chip->spdif_str_bits[2] = chip->spdif_bits[2] = def_bits;
+               chip->spdif_str_bits[3] = chip->spdif_bits[3] = def_bits;
+       }
        /* Only SPCS1 has been tested */
-       snd_ca0106_ptr_write(chip, SPCS1, 0,
-                               chip->spdif_bits[1] =
-                               SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
-                               SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
-                               SPCS_GENERATIONSTATUS | 0x00001200 |
-                               0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
-       snd_ca0106_ptr_write(chip, SPCS2, 0,
-                               chip->spdif_bits[2] =
-                               SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
-                               SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
-                               SPCS_GENERATIONSTATUS | 0x00001200 |
-                               0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
-       snd_ca0106_ptr_write(chip, SPCS3, 0,
-                               chip->spdif_bits[3] =
-                               SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
-                               SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
-                               SPCS_GENERATIONSTATUS | 0x00001200 |
-                               0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
+       snd_ca0106_ptr_write(chip, SPCS1, 0, chip->spdif_str_bits[1]);
+       snd_ca0106_ptr_write(chip, SPCS0, 0, chip->spdif_str_bits[0]);
+       snd_ca0106_ptr_write(chip, SPCS2, 0, chip->spdif_str_bits[2]);
+       snd_ca0106_ptr_write(chip, SPCS3, 0, chip->spdif_str_bits[3]);
 
         snd_ca0106_ptr_write(chip, PLAYBACK_MUTE, 0, 0x00fc0000);
         snd_ca0106_ptr_write(chip, CAPTURE_MUTE, 0, 0x00fc0000);
@@ -1433,92 +1367,124 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
         /* Write 0x8000 to AC97_REC_GAIN to mute it. */
         outb(AC97_REC_GAIN, chip->port + AC97ADDRESS);
         outw(0x8000, chip->port + AC97DATA);
-#if 0
+#if 0 /* FIXME: what are these? */
        snd_ca0106_ptr_write(chip, SPCS0, 0, 0x2108006);
        snd_ca0106_ptr_write(chip, 0x42, 0, 0x2108006);
        snd_ca0106_ptr_write(chip, 0x43, 0, 0x2108006);
        snd_ca0106_ptr_write(chip, 0x44, 0, 0x2108006);
 #endif
 
-       //snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); /* OSS drivers set this. */
+       /* OSS drivers set this. */
+       /* snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); */
+
        /* Analog or Digital output */
        snd_ca0106_ptr_write(chip, SPDIF_SELECT1, 0, 0xf);
-       snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0x000f0000); /* 0x0b000000 for digital, 0x000b0000 for analog, from win2000 drivers. Use 0x000f0000 for surround71 */
+       /* 0x0b000000 for digital, 0x000b0000 for analog, from win2000 drivers.
+        * Use 0x000f0000 for surround71
+        */
+       snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0x000f0000);
+
        chip->spdif_enable = 0; /* Set digital SPDIF output off */
-       //snd_ca0106_ptr_write(chip, 0x45, 0, 0); /* Analogue out */
-       //snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00); /* Digital out */
+       /*snd_ca0106_ptr_write(chip, 0x45, 0, 0);*/ /* Analogue out */
+       /*snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00);*/ /* Digital out */
+
+       /* goes to 0x40c80000 when doing SPDIF IN/OUT */
+       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 0, 0x40c81000);
+       /* (Mute) CAPTURE feedback into PLAYBACK volume.
+        * Only lower 16 bits matter.
+        */
+       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 1, 0xffffffff);
+       /* SPDIF IN Volume */
+       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 2, 0x30300000);
+       /* SPDIF IN Volume, 0x70 = (vol & 0x3f) | 0x40 */
+       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 3, 0x00700000);
 
-       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 0, 0x40c81000); /* goes to 0x40c80000 when doing SPDIF IN/OUT */
-       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 1, 0xffffffff); /* (Mute) CAPTURE feedback into PLAYBACK volume. Only lower 16 bits matter. */
-       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 2, 0x30300000); /* SPDIF IN Volume */
-       snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 3, 0x00700000); /* SPDIF IN Volume, 0x70 = (vol & 0x3f) | 0x40 */
        snd_ca0106_ptr_write(chip, PLAYBACK_ROUTING1, 0, 0x32765410);
        snd_ca0106_ptr_write(chip, PLAYBACK_ROUTING2, 0, 0x76767676);
        snd_ca0106_ptr_write(chip, CAPTURE_ROUTING1, 0, 0x32765410);
        snd_ca0106_ptr_write(chip, CAPTURE_ROUTING2, 0, 0x76767676);
-       for(ch = 0; ch < 4; ch++) {
-               snd_ca0106_ptr_write(chip, CAPTURE_VOLUME1, ch, 0x30303030); /* Only high 16 bits matter */
+
+       for (ch = 0; ch < 4; ch++) {
+               /* Only high 16 bits matter */
+               snd_ca0106_ptr_write(chip, CAPTURE_VOLUME1, ch, 0x30303030);
                snd_ca0106_ptr_write(chip, CAPTURE_VOLUME2, ch, 0x30303030);
-               //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040); /* Mute */
-               //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040); /* Mute */
-               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0xffffffff); /* Mute */
-               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0xffffffff); /* Mute */
+#if 0 /* Mute */
+               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040);
+               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040);
+               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0xffffffff);
+               snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0xffffffff);
+#endif
        }
        if (chip->details->i2c_adc == 1) {
                /* Select MIC, Line in, TAD in, AUX in */
                snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
                /* Default to CAPTURE_SOURCE to i2s in */
-               chip->capture_source = 3;
+               if (!resume)
+                       chip->capture_source = 3;
        } else if (chip->details->ac97 == 1) {
                /* Default to AC97 in */
                snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x444400e4);
                /* Default to CAPTURE_SOURCE to AC97 in */
-               chip->capture_source = 4;
+               if (!resume)
+                       chip->capture_source = 4;
        } else {
                /* Select MIC, Line in, TAD in, AUX in */
                snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4);
                /* Default to Set CAPTURE_SOURCE to i2s in */
-               chip->capture_source = 3;
+               if (!resume)
+                       chip->capture_source = 3;
        }
 
-        if (chip->details->gpio_type == 2) { /* The SB0438 use GPIO differently. */
-               /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
+       if (chip->details->gpio_type == 2) {
+               /* The SB0438 use GPIO differently. */
+               /* FIXME: Still need to find out what the other GPIO bits do.
+                * E.g. For digital spdif out.
+                */
                outl(0x0, chip->port+GPIO);
-               //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+               /* outl(0x00f0e000, chip->port+GPIO); */ /* Analog */
                outl(0x005f5301, chip->port+GPIO); /* Analog */
-       } else if (chip->details->gpio_type == 1) { /* The SB0410 and SB0413 use GPIO differently. */
-               /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
+       } else if (chip->details->gpio_type == 1) {
+               /* The SB0410 and SB0413 use GPIO differently. */
+               /* FIXME: Still need to find out what the other GPIO bits do.
+                * E.g. For digital spdif out.
+                */
                outl(0x0, chip->port+GPIO);
-               //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+               /* outl(0x00f0e000, chip->port+GPIO); */ /* Analog */
                outl(0x005f5301, chip->port+GPIO); /* Analog */
        } else {
                outl(0x0, chip->port+GPIO);
                outl(0x005f03a3, chip->port+GPIO); /* Analog */
-               //outl(0x005f02a2, chip->port+GPIO);   /* SPDIF */
+               /* outl(0x005f02a2, chip->port+GPIO); */ /* SPDIF */
        }
        snd_ca0106_intr_enable(chip, 0x105); /* Win2000 uses 0x1e0 */
 
-       //outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
-       //outl(0x00001409, chip->port+HCFG); /* 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
-       //outl(0x00000009, chip->port+HCFG);
-       outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG); /* AC97 2.0, Enable outputs. */
+       /* outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG); */
+       /* 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
+       /* outl(0x00001409, chip->port+HCFG); */
+       /* outl(0x00000009, chip->port+HCFG); */
+       /* AC97 2.0, Enable outputs. */
+       outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG);
 
-        if (chip->details->i2c_adc == 1) { /* The SB0410 and SB0413 use I2C to control ADC. */
+       if (chip->details->i2c_adc == 1) {
+               /* The SB0410 and SB0413 use I2C to control ADC. */
                int size, n;
 
                size = ARRAY_SIZE(i2c_adc_init);
-                //snd_printk("I2C:array size=0x%x\n", size);
-               for (n=0; n < size; n++) {
-                       snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], i2c_adc_init[n][1]);
-               }
-               for (n=0; n < 4; n++) {
-                       chip->i2c_capture_volume[n][0]= 0xcf;
-                       chip->i2c_capture_volume[n][1]= 0xcf;
+               /* snd_printk("I2C:array size=0x%x\n", size); */
+               for (n = 0; n < size; n++)
+                       snd_ca0106_i2c_write(chip, i2c_adc_init[n][0],
+                                            i2c_adc_init[n][1]);
+               for (n = 0; n < 4; n++) {
+                       chip->i2c_capture_volume[n][0] = 0xcf;
+                       chip->i2c_capture_volume[n][1] = 0xcf;
                }
-               chip->i2c_capture_source=2; /* Line in */
-               //snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); /* Enable Line-in capture. MIC in currently untested. */
+               chip->i2c_capture_source = 2; /* Line in */
+               /* Enable Line-in capture. MIC in currently untested. */
+               /* snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); */
        }
-        if (chip->details->spi_dac == 1) { /* The SB0570 use SPI to control DAC. */
+
+       if (chip->details->spi_dac == 1) {
+               /* The SB0570 use SPI to control DAC. */
                int size, n;
 
                size = ARRAY_SIZE(spi_dac_init);
@@ -1530,9 +1496,112 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
                                chip->spi_dac_reg[reg] = spi_dac_init[n];
                }
        }
+}
 
-       if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
-                                 chip, &ops)) < 0) {
+static void ca0106_stop_chip(struct snd_ca0106 *chip)
+{
+       /* disable interrupts */
+       snd_ca0106_ptr_write(chip, BASIC_INTERRUPT, 0, 0);
+       outl(0, chip->port + INTE);
+       snd_ca0106_ptr_write(chip, EXTENDED_INT_MASK, 0, 0);
+       udelay(1000);
+       /* disable audio */
+       /* outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG); */
+       outl(0, chip->port + HCFG);
+       /* FIXME: We need to stop and DMA transfers here.
+        *        But as I am not sure how yet, we cannot from the dma pages.
+        * So we can fix: snd-malloc: Memory leak?  pages not freed = 8
+        */
+}
+
+static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
+                                        struct pci_dev *pci,
+                                        struct snd_ca0106 **rchip)
+{
+       struct snd_ca0106 *chip;
+       struct snd_ca0106_details *c;
+       int err;
+       static struct snd_device_ops ops = {
+               .dev_free = snd_ca0106_dev_free,
+       };
+
+       *rchip = NULL;
+
+       err = pci_enable_device(pci);
+       if (err < 0)
+               return err;
+       if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) {
+               printk(KERN_ERR "error to set 32bit mask DMA\n");
+               pci_disable_device(pci);
+               return -ENXIO;
+       }
+
+       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+       if (chip == NULL) {
+               pci_disable_device(pci);
+               return -ENOMEM;
+       }
+
+       chip->card = card;
+       chip->pci = pci;
+       chip->irq = -1;
+
+       spin_lock_init(&chip->emu_lock);
+
+       chip->port = pci_resource_start(pci, 0);
+       chip->res_port = request_region(chip->port, 0x20, "snd_ca0106");
+       if (!chip->res_port) {
+               snd_ca0106_free(chip);
+               printk(KERN_ERR "cannot allocate the port\n");
+               return -EBUSY;
+       }
+
+       if (request_irq(pci->irq, snd_ca0106_interrupt,
+                       IRQF_SHARED, "snd_ca0106", chip)) {
+               snd_ca0106_free(chip);
+               printk(KERN_ERR "cannot grab irq\n");
+               return -EBUSY;
+       }
+       chip->irq = pci->irq;
+
+       /* This stores the periods table. */
+       if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
+                               1024, &chip->buffer) < 0) {
+               snd_ca0106_free(chip);
+               return -ENOMEM;
+       }
+
+       pci_set_master(pci);
+       /* read serial */
+       pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
+       pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
+       printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n",
+              chip->model, pci->revision, chip->serial);
+       strcpy(card->driver, "CA0106");
+       strcpy(card->shortname, "CA0106");
+
+       for (c = ca0106_chip_details; c->serial; c++) {
+               if (subsystem[dev]) {
+                       if (c->serial == subsystem[dev])
+                               break;
+               } else if (c->serial == chip->serial)
+                       break;
+       }
+       chip->details = c;
+       if (subsystem[dev]) {
+               printk(KERN_INFO "snd-ca0106: Sound card name=%s, "
+                      "subsystem=0x%x. Forced to subsystem=0x%x\n",
+                      c->name, chip->serial, subsystem[dev]);
+       }
+
+       sprintf(card->longname, "%s at 0x%lx irq %i",
+               c->name, chip->port, chip->irq);
+
+       ca0106_init_chip(chip, 0);
+
+       err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
+       if (err < 0) {
                snd_ca0106_free(chip);
                return err;
        }
@@ -1629,7 +1698,7 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
        static int dev;
        struct snd_card *card;
        struct snd_ca0106 *chip;
-       int err;
+       int i, err;
 
        if (dev >= SNDRV_CARDS)
                return -ENODEV;
@@ -1642,44 +1711,31 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
        if (card == NULL)
                return -ENOMEM;
 
-       if ((err = snd_ca0106_create(dev, card, pci, &chip)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       err = snd_ca0106_create(dev, card, pci, &chip);
+       if (err < 0)
+               goto error;
+       card->private_data = chip;
 
-       if ((err = snd_ca0106_pcm(chip, 0, NULL)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
-       if ((err = snd_ca0106_pcm(chip, 1, NULL)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
-       if ((err = snd_ca0106_pcm(chip, 2, NULL)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
-       if ((err = snd_ca0106_pcm(chip, 3, NULL)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
-        if (chip->details->ac97 == 1) { /* The SB0410 and SB0413 do not have an AC97 chip. */
-               if ((err = snd_ca0106_ac97(chip)) < 0) {
-                       snd_card_free(card);
-                       return err;
-               }
+       for (i = 0; i < 4; i++) {
+               err = snd_ca0106_pcm(chip, i);
+               if (err < 0)
+                       goto error;
        }
-       if ((err = snd_ca0106_mixer(chip)) < 0) {
-               snd_card_free(card);
-               return err;
+
+       if (chip->details->ac97 == 1) {
+               /* The SB0410 and SB0413 do not have an AC97 chip. */
+               err = snd_ca0106_ac97(chip);
+               if (err < 0)
+                       goto error;
        }
+       err = snd_ca0106_mixer(chip);
+       if (err < 0)
+               goto error;
 
        snd_printdd("ca0106: probe for MIDI channel A ...");
-       if ((err = snd_ca0106_midi(chip,CA0106_MIDI_CHAN_A)) < 0) {
-               snd_card_free(card);
-               snd_printdd(" failed, err=0x%x\n",err);
-               return err;
-       }
+       err = snd_ca0106_midi(chip, CA0106_MIDI_CHAN_A);
+       if (err < 0)
+               goto error;
        snd_printdd(" done.\n");
 
 #ifdef CONFIG_PROC_FS
@@ -1688,14 +1744,17 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
 
        snd_card_set_dev(card, &pci->dev);
 
-       if ((err = snd_card_register(card)) < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       err = snd_card_register(card);
+       if (err < 0)
+               goto error;
 
        pci_set_drvdata(pci, card);
        dev++;
        return 0;
+
+ error:
+       snd_card_free(card);
+       return err;
 }
 
 static void __devexit snd_ca0106_remove(struct pci_dev *pci)
@@ -1704,6 +1763,59 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
        pci_set_drvdata(pci, NULL);
 }
 
+#ifdef CONFIG_PM
+static int snd_ca0106_suspend(struct pci_dev *pci, pm_message_t state)
+{
+       struct snd_card *card = pci_get_drvdata(pci);
+       struct snd_ca0106 *chip = card->private_data;
+       int i;
+
+       snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+       for (i = 0; i < 4; i++)
+               snd_pcm_suspend_all(chip->pcm[i]);
+       if (chip->details->ac97)
+               snd_ac97_suspend(chip->ac97);
+       snd_ca0106_mixer_suspend(chip);
+
+       ca0106_stop_chip(chip);
+
+       pci_disable_device(pci);
+       pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
+       return 0;
+}
+
+static int snd_ca0106_resume(struct pci_dev *pci)
+{
+       struct snd_card *card = pci_get_drvdata(pci);
+       struct snd_ca0106 *chip = card->private_data;
+       int i;
+
+       pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+
+       if (pci_enable_device(pci) < 0) {
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+
+       pci_set_master(pci);
+
+       ca0106_init_chip(chip, 1);
+
+       if (chip->details->ac97)
+               snd_ac97_resume(chip->ac97);
+       snd_ca0106_mixer_resume(chip);
+       if (chip->details->spi_dac) {
+               for (i = 0; i < ARRAY_SIZE(chip->spi_dac_reg); i++)
+                       snd_ca0106_spi_write(chip, chip->spi_dac_reg[i]);
+       }
+
+       snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+       return 0;
+}
+#endif
+
 // PCI IDs
 static struct pci_device_id snd_ca0106_ids[] = {
        { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* Audigy LS or Live 24bit */
@@ -1717,6 +1829,10 @@ static struct pci_driver driver = {
        .id_table = snd_ca0106_ids,
        .probe = snd_ca0106_probe,
        .remove = __devexit_p(snd_ca0106_remove),
+#ifdef CONFIG_PM
+       .suspend = snd_ca0106_suspend,
+       .resume = snd_ca0106_resume,
+#endif
 };
 
 // initialization of the module
index 3025ed1b6e1efd1444ccf5d3403d4ca7ab36627c..ad2888705d2a60d63661d8d1ba1412a109ce2bad 100644 (file)
 
 #include "ca0106.h"
 
+static void ca0106_spdif_enable(struct snd_ca0106 *emu)
+{
+       unsigned int val;
+
+       if (emu->spdif_enable) {
+               /* Digital */
+               snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
+               snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000);
+               val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000;
+               snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val);
+               val = inl(emu->port + GPIO) & ~0x101;
+               outl(val, emu->port + GPIO);
+
+       } else {
+               /* Analog */
+               snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
+               snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000);
+               val = snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000;
+               snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0, val);
+               val = inl(emu->port + GPIO) | 0x101;
+               outl(val, emu->port + GPIO);
+       }
+}
+
+static void ca0106_set_capture_source(struct snd_ca0106 *emu)
+{
+       unsigned int val = emu->capture_source;
+       unsigned int source, mask;
+       source = (val << 28) | (val << 24) | (val << 20) | (val << 16);
+       mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff;
+       snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask);
+}
+
+static void ca0106_set_i2c_capture_source(struct snd_ca0106 *emu,
+                                         unsigned int val, int force)
+{
+       unsigned int ngain, ogain;
+       u32 source;
+
+       snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
+       ngain = emu->i2c_capture_volume[val][0]; /* Left */
+       ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */
+       if (force || ngain != ogain)
+               snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ngain & 0xff);
+       ngain = emu->i2c_capture_volume[val][1]; /* Right */
+       ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Right */
+       if (force || ngain != ogain)
+               snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ngain & 0xff);
+       source = 1 << val;
+       snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */
+       emu->i2c_capture_source = val;
+}
+
+static void ca0106_set_capture_mic_line_in(struct snd_ca0106 *emu)
+{
+       u32 tmp;
+
+       if (emu->capture_mic_line_in) {
+               /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */
+               tmp = inl(emu->port+GPIO) & ~0x400;
+               tmp = tmp | 0x400;
+               outl(tmp, emu->port+GPIO);
+               /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */
+       } else {
+               /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); */ /* Mute input */
+               tmp = inl(emu->port+GPIO) & ~0x400;
+               outl(tmp, emu->port+GPIO);
+               /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); */
+       }
+}
+
+static void ca0106_set_spdif_bits(struct snd_ca0106 *emu, int idx)
+{
+       snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, emu->spdif_str_bits[idx]);
+}
+
+/*
+ */
 static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale1, -5175, 25, 1);
 static const DECLARE_TLV_DB_SCALE(snd_ca0106_db_scale2, -10350, 50, 1);
 
@@ -95,30 +173,12 @@ static int snd_ca0106_shared_spdif_put(struct snd_kcontrol *kcontrol,
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int val;
        int change = 0;
-       u32 mask;
 
        val = !!ucontrol->value.integer.value[0];
        change = (emu->spdif_enable != val);
        if (change) {
                emu->spdif_enable = val;
-               if (val) {
-                       /* Digital */
-                       snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
-                       snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x0b000000);
-                       snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0,
-                               snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) & ~0x1000);
-                       mask = inl(emu->port + GPIO) & ~0x101;
-                       outl(mask, emu->port + GPIO);
-
-               } else {
-                       /* Analog */
-                       snd_ca0106_ptr_write(emu, SPDIF_SELECT1, 0, 0xf);
-                       snd_ca0106_ptr_write(emu, SPDIF_SELECT2, 0, 0x000f0000);
-                       snd_ca0106_ptr_write(emu, CAPTURE_CONTROL, 0,
-                               snd_ca0106_ptr_read(emu, CAPTURE_CONTROL, 0) | 0x1000);
-                       mask = inl(emu->port + GPIO) | 0x101;
-                       outl(mask, emu->port + GPIO);
-               }
+               ca0106_spdif_enable(emu);
        }
         return change;
 }
@@ -154,8 +214,6 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int val;
        int change = 0;
-       u32 mask;
-       u32 source;
 
        val = ucontrol->value.enumerated.item[0] ;
        if (val >= 6)
@@ -163,9 +221,7 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
        change = (emu->capture_source != val);
        if (change) {
                emu->capture_source = val;
-               source = (val << 28) | (val << 24) | (val << 20) | (val << 16);
-               mask = snd_ca0106_ptr_read(emu, CAPTURE_SOURCE, 0) & 0xffff;
-               snd_ca0106_ptr_write(emu, CAPTURE_SOURCE, 0, source | mask);
+               ca0106_set_capture_source(emu);
        }
         return change;
 }
@@ -200,9 +256,7 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
 {
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int source_id;
-       unsigned int ngain, ogain;
        int change = 0;
-       u32 source;
        /* If the capture source has changed,
         * update the capture volume from the cached value
         * for the particular source.
@@ -212,18 +266,7 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
                return -EINVAL;
        change = (emu->i2c_capture_source != source_id);
        if (change) {
-               snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
-               ngain = emu->i2c_capture_volume[source_id][0]; /* Left */
-               ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */
-               if (ngain != ogain)
-                       snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
-               ngain = emu->i2c_capture_volume[source_id][1]; /* Left */
-               ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Left */
-               if (ngain != ogain)
-                       snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
-               source = 1 << source_id;
-               snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */
-               emu->i2c_capture_source = source_id;
+               ca0106_set_i2c_capture_source(emu, source_id, 0);
        }
         return change;
 }
@@ -271,7 +314,6 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int val;
        int change = 0;
-       u32 tmp;
 
        val = ucontrol->value.enumerated.item[0] ;
        if (val > 1)
@@ -279,18 +321,7 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
        change = (emu->capture_mic_line_in != val);
        if (change) {
                emu->capture_mic_line_in = val;
-               if (val) {
-                       //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
-                       tmp = inl(emu->port+GPIO) & ~0x400;
-                       tmp = tmp | 0x400;
-                       outl(tmp, emu->port+GPIO);
-                       //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC);
-               } else {
-                       //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
-                       tmp = inl(emu->port+GPIO) & ~0x400;
-                       outl(tmp, emu->port+GPIO);
-                       //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN);
-               }
+               ca0106_set_capture_mic_line_in(emu);
        }
         return change;
 }
@@ -322,16 +353,33 @@ static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static int snd_ca0106_spdif_get(struct snd_kcontrol *kcontrol,
+static void decode_spdif_bits(unsigned char *status, unsigned int bits)
+{
+       status[0] = (bits >> 0) & 0xff;
+       status[1] = (bits >> 8) & 0xff;
+       status[2] = (bits >> 16) & 0xff;
+       status[3] = (bits >> 24) & 0xff;
+}
+
+static int snd_ca0106_spdif_get_default(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
 
-       ucontrol->value.iec958.status[0] = (emu->spdif_bits[idx] >> 0) & 0xff;
-       ucontrol->value.iec958.status[1] = (emu->spdif_bits[idx] >> 8) & 0xff;
-       ucontrol->value.iec958.status[2] = (emu->spdif_bits[idx] >> 16) & 0xff;
-       ucontrol->value.iec958.status[3] = (emu->spdif_bits[idx] >> 24) & 0xff;
+       decode_spdif_bits(ucontrol->value.iec958.status,
+                         emu->spdif_bits[idx]);
+        return 0;
+}
+
+static int snd_ca0106_spdif_get_stream(struct snd_kcontrol *kcontrol,
+                                 struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
+       unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+       decode_spdif_bits(ucontrol->value.iec958.status,
+                         emu->spdif_str_bits[idx]);
         return 0;
 }
 
@@ -345,24 +393,48 @@ static int snd_ca0106_spdif_get_mask(struct snd_kcontrol *kcontrol,
         return 0;
 }
 
-static int snd_ca0106_spdif_put(struct snd_kcontrol *kcontrol,
+static unsigned int encode_spdif_bits(unsigned char *status)
+{
+       return ((unsigned int)status[0] << 0) |
+               ((unsigned int)status[1] << 8) |
+               ((unsigned int)status[2] << 16) |
+               ((unsigned int)status[3] << 24);
+}
+
+static int snd_ca0106_spdif_put_default(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
        unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
-       int change;
        unsigned int val;
 
-       val = (ucontrol->value.iec958.status[0] << 0) |
-             (ucontrol->value.iec958.status[1] << 8) |
-             (ucontrol->value.iec958.status[2] << 16) |
-             (ucontrol->value.iec958.status[3] << 24);
-       change = val != emu->spdif_bits[idx];
-       if (change) {
-               snd_ca0106_ptr_write(emu, SPCS0 + idx, 0, val);
+       val = encode_spdif_bits(ucontrol->value.iec958.status);
+       if (val != emu->spdif_bits[idx]) {
                emu->spdif_bits[idx] = val;
+               /* FIXME: this isn't safe, but needed to keep the compatibility
+                * with older alsa-lib config
+                */
+               emu->spdif_str_bits[idx] = val;
+               ca0106_set_spdif_bits(emu, idx);
+               return 1;
        }
-        return change;
+       return 0;
+}
+
+static int snd_ca0106_spdif_put_stream(struct snd_kcontrol *kcontrol,
+                                 struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
+       unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+       unsigned int val;
+
+       val = encode_spdif_bits(ucontrol->value.iec958.status);
+       if (val != emu->spdif_str_bits[idx]) {
+               emu->spdif_str_bits[idx] = val;
+               ca0106_set_spdif_bits(emu, idx);
+               return 1;
+       }
+        return 0;
 }
 
 static int snd_ca0106_volume_info(struct snd_kcontrol *kcontrol,
@@ -573,8 +645,16 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = {
                .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
                .count =        4,
                .info =         snd_ca0106_spdif_info,
-               .get =          snd_ca0106_spdif_get,
-               .put =          snd_ca0106_spdif_put
+               .get =          snd_ca0106_spdif_get_default,
+               .put =          snd_ca0106_spdif_put_default
+       },
+       {
+               .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
+               .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
+               .count =        4,
+               .info =         snd_ca0106_spdif_info,
+               .get =          snd_ca0106_spdif_get_stream,
+               .put =          snd_ca0106_spdif_put_stream
        },
 };
 
@@ -773,3 +853,50 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
         return 0;
 }
 
+#ifdef CONFIG_PM
+struct ca0106_vol_tbl {
+       unsigned int channel_id;
+       unsigned int reg;
+};
+
+static struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = {
+       { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 },
+       { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 },
+       { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 },
+       { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2 },
+       { CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME1 },
+       { CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME1 },
+       { CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME1 },
+       { CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME1 },
+       { 1, CAPTURE_CONTROL },
+};
+
+void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip)
+{
+       int i;
+
+       /* save volumes */
+       for (i = 0; i < NUM_SAVED_VOLUMES; i++)
+               chip->saved_vol[i] =
+                       snd_ca0106_ptr_read(chip, saved_volumes[i].reg,
+                                           saved_volumes[i].channel_id);
+}
+
+void snd_ca0106_mixer_resume(struct snd_ca0106  *chip)
+{
+       int i;
+
+       for (i = 0; i < NUM_SAVED_VOLUMES; i++)
+               snd_ca0106_ptr_write(chip, saved_volumes[i].reg,
+                                    saved_volumes[i].channel_id,
+                                    chip->saved_vol[i]);
+
+       ca0106_spdif_enable(chip);
+       ca0106_set_capture_source(chip);
+       ca0106_set_i2c_capture_source(chip, chip->i2c_capture_source, 1);
+       for (i = 0; i < 4; i++)
+               ca0106_set_spdif_bits(chip, i);
+       if (chip->details->i2c_adc)
+               ca0106_set_capture_mic_line_in(chip);
+}
+#endif /* CONFIG_PM */
index fb6dc398025753c08fd861ed134677dd675d1117..8ab07aa63652b010c9337c7a83c66a8e2a1c5218 100644 (file)
@@ -3640,7 +3640,10 @@ int snd_cs46xx_resume(struct pci_dev *pci)
 {
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_cs46xx *chip = card->private_data;
-       int i, amp_saved;
+       int amp_saved;
+#ifdef CONFIG_SND_CS46XX_NEW_DSP
+       int i;
+#endif
 
        pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
index de5ee8f097f6d46a17d1961e20e200cade3af5a0..7958006a1d66cf9559a62bbda6fbfd48b0994047 100644 (file)
@@ -69,7 +69,7 @@ MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME);
  * EMU10K1 init / done
  *************************************************************************/
 
-void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int ch)
+void snd_emu10k1_voice_init(struct snd_emu10k1 *emu, int ch)
 {
        snd_emu10k1_ptr_write(emu, DCYSUSV, ch, 0);
        snd_emu10k1_ptr_write(emu, IP, ch, 0);
@@ -151,9 +151,9 @@ static unsigned int i2c_adc_init[][2] = {
        { 0x12, 0x32 },  /* ALC Control 3 */
        { 0x13, 0x00 },  /* Noise gate control */
        { 0x14, 0xa6 },  /* Limiter control */
-       { 0x15, ADC_MUX_2 },  /* ADC Mixer control. Mic for Audigy 2 ZS Notebook */
+       { 0x15, ADC_MUX_2 },  /* ADC Mixer control. Mic for A2ZS Notebook */
 };
-       
+
 static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
 {
        unsigned int silent_page;
@@ -161,8 +161,8 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
        u32 tmp;
 
        /* disable audio and lock cache */
-       outl(HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE,
-            emu->port + HCFG);
+       outl(HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK |
+               HCFG_MUTEBUTTONENABLE, emu->port + HCFG);
 
        /* reset recording buffers */
        snd_emu10k1_ptr_write(emu, MICBS, 0, ADCBS_BUFSIZE_NONE);
@@ -179,7 +179,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
        snd_emu10k1_ptr_write(emu, SOLEL, 0, 0);
        snd_emu10k1_ptr_write(emu, SOLEH, 0, 0);
 
-       if (emu->audigy){
+       if (emu->audigy) {
                /* set SPDIF bypass mode */
                snd_emu10k1_ptr_write(emu, SPBYPASS, 0, SPBYPASS_FORMAT);
                /* enable rear left + rear right AC97 slots */
@@ -197,12 +197,12 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
 
        if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
                /* Hacks for Alice3 to work independent of haP16V driver */
-               //Setup SRCMulti_I2S SamplingRate
+               /* Setup SRCMulti_I2S SamplingRate */
                tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
                tmp &= 0xfffff1ff;
                tmp |= (0x2<<9);
                snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp);
-               
+
                /* Setup SRCSel (Enable Spdif,I2S SRCMulti) */
                snd_emu10k1_ptr20_write(emu, SRCSel, 0, 0x14);
                /* Setup SRCMulti Input Audio Enable */
@@ -217,7 +217,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
        if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
                /* Hacks for Alice3 to work independent of haP16V driver */
                snd_printk(KERN_INFO "Audigy2 value: Special config.\n");
-               //Setup SRCMulti_I2S SamplingRate
+               /* Setup SRCMulti_I2S SamplingRate */
                tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
                tmp &= 0xfffff1ff;
                tmp |= (0x2<<9);
@@ -270,13 +270,13 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
                size = ARRAY_SIZE(i2c_adc_init);
                for (n = 0; n < size; n++)
                        snd_emu10k1_i2c_write(emu, i2c_adc_init[n][0], i2c_adc_init[n][1]);
-               for (n=0; n < 4; n++) {
-                       emu->i2c_capture_volume[n][0]= 0xcf;
-                       emu->i2c_capture_volume[n][1]= 0xcf;
+               for (n = 0; n < 4; n++) {
+                       emu->i2c_capture_volume[n][0] = 0xcf;
+                       emu->i2c_capture_volume[n][1] = 0xcf;
                }
        }
 
-       
+
        snd_emu10k1_ptr_write(emu, PTB, 0, emu->ptb_pages.addr);
        snd_emu10k1_ptr_write(emu, TCB, 0, 0);  /* taken from original driver */
        snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */
@@ -313,7 +313,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
            (emu->model == 0x21 && emu->revision < 6))
                outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE, emu->port + HCFG);
        else
-               // With on-chip joystick
+               /* With on-chip joystick */
                outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
 
        if (enable_ir) {        /* enable IR for SB Live */
@@ -335,9 +335,9 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
                        outl(reg | HCFG_GPOUT1 | HCFG_GPOUT2, emu->port + HCFG);
                        udelay(100);
                        outl(reg, emu->port + HCFG);
-               }
+               }
        }
-       
+
        if (emu->card_capabilities->emu_model) {
                ;  /* Disable all access to A_IOCFG for the emu1010 */
        } else if (emu->card_capabilities->i2c_adc) {
@@ -364,7 +364,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
                ;  /* Disable A_IOCFG for Audigy 2 ZS Notebook */
        } else if (emu->audigy) {
                outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG);
+
                if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
                        /* Unmute Analog now.  Set GPO6 to 1 for Apollo.
                         * This has to be done after init ALice3 I2SOut beyond 48KHz.
@@ -378,12 +378,12 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
                        outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
                }
        }
-       
+
 #if 0
        {
        unsigned int tmp;
        /* FIXME: the following routine disables LiveDrive-II !! */
-       // TOSLink detection
+       /* TOSLink detection */
        emu->tos_link = 0;
        tmp = inl(emu->port + HCFG);
        if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {
@@ -400,7 +400,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
        snd_emu10k1_intr_enable(emu, INTE_PCIERRORENABLE);
 }
 
-int snd_emu10k1_done(struct snd_emu10k1 * emu)
+int snd_emu10k1_done(struct snd_emu10k1 *emu)
 {
        int ch;
 
@@ -495,7 +495,7 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
 
 #define EC_LAST_PROMFILE_ADDR  0x2f
 
-#define EC_SERIALNUM_ADDR      0x30    /* First word of serial number.  The 
+#define EC_SERIALNUM_ADDR      0x30    /* First word of serial number.  The
                                         * can be up to 30 characters in length
                                         * and is stored as a NULL-terminated
                                         * ASCII string.  Any unused bytes must be
@@ -503,8 +503,8 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
 #define EC_CHECKSUM_ADDR       0x3f    /* Location at which checksum is stored */
 
 
-/* Most of this stuff is pretty self-evident.  According to the hardware 
- * dudes, we need to leave the ADCCAL bit low in order to avoid a DC 
+/* Most of this stuff is pretty self-evident.  According to the hardware
+ * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
  * offset problem.  Weird.
  */
 #define EC_RAW_RUN_MODE                (EC_DACMUTEN | EC_ADCRSTN | EC_TRIM_MUTEN | \
@@ -523,7 +523,7 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
  *  register.
  */
 
-static void snd_emu10k1_ecard_write(struct snd_emu10k1 * emu, unsigned int value)
+static void snd_emu10k1_ecard_write(struct snd_emu10k1 *emu, unsigned int value)
 {
        unsigned short count;
        unsigned int data;
@@ -561,7 +561,7 @@ static void snd_emu10k1_ecard_write(struct snd_emu10k1 * emu, unsigned int value
  * channel.
  */
 
-static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
+static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 *emu,
                                         unsigned short gain)
 {
        unsigned int bit;
@@ -574,7 +574,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
 
        for (bit = (1 << 15); bit; bit >>= 1) {
                unsigned int value;
-               
+
                value = emu->ecard_ctrl & ~(EC_TRIM_CSN | EC_TRIM_SDATA);
 
                if (gain & bit)
@@ -589,7 +589,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
        snd_emu10k1_ecard_write(emu, emu->ecard_ctrl);
 }
 
-static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_ecard_init(struct snd_emu10k1 *emu)
 {
        unsigned int hc_value;
 
@@ -598,7 +598,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
                          EC_SPDIF0_SELECT(EC_DEFAULT_SPDIF0_SEL) |
                          EC_SPDIF1_SELECT(EC_DEFAULT_SPDIF1_SEL);
 
-       /* Step 0: Set the codec type in the hardware control register 
+       /* Step 0: Set the codec type in the hardware control register
         * and enable audio output */
        hc_value = inl(emu->port + HCFG);
        outl(hc_value | HCFG_AUDIOENABLE | HCFG_CODECFORMAT_I2S, emu->port + HCFG);
@@ -629,7 +629,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
        return 0;
 }
 
-static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_cardbus_init(struct snd_emu10k1 *emu)
 {
        unsigned long special_port;
        unsigned int value;
@@ -656,7 +656,7 @@ static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
        return 0;
 }
 
-static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * filename)
+static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu, const char *filename)
 {
        int err;
        int n, i;
@@ -666,11 +666,12 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
        unsigned long flags;
        const struct firmware *fw_entry;
 
-       if ((err = request_firmware(&fw_entry, filename, &emu->pci->dev)) != 0) {
-               snd_printk(KERN_ERR "firmware: %s not found. Err=%d\n",filename, err);
+       err = request_firmware(&fw_entry, filename, &emu->pci->dev);
+       if (err != 0) {
+               snd_printk(KERN_ERR "firmware: %s not found. Err = %d\n", filename, err);
                return err;
        }
-       snd_printk(KERN_INFO "firmware size=0x%zx\n", fw_entry->size);
+       snd_printk(KERN_INFO "firmware size = 0x%zx\n", fw_entry->size);
 
        /* The FPGA is a Xilinx Spartan IIE XC2S50E */
        /* GPIO7 -> FPGA PGMN
@@ -685,13 +686,13 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
        outl(0x80, emu->port + A_IOCFG); /* Leave bit 7 set during netlist setup. */
        write_post = inl(emu->port + A_IOCFG);
        udelay(100); /* Allow FPGA memory to clean */
-       for(n = 0; n < fw_entry->size; n++) {
-               value=fw_entry->data[n];        
-               for(i = 0; i < 8; i++) {
+       for (n = 0; n < fw_entry->size; n++) {
+               value = fw_entry->data[n];
+               for (i = 0; i < 8; i++) {
                        reg = 0x80;
                        if (value & 0x1)
                                reg = reg | 0x20;
-                       value = value >> 1;   
+                       value = value >> 1;
                        outl(reg, emu->port + A_IOCFG);
                        write_post = inl(emu->port + A_IOCFG);
                        outl(reg | 0x40, emu->port + A_IOCFG);
@@ -703,14 +704,14 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
        write_post = inl(emu->port + A_IOCFG);
        spin_unlock_irqrestore(&emu->emu_lock, flags);
 
-        release_firmware(fw_entry);
+       release_firmware(fw_entry);
        return 0;
 }
 
 static int emu1010_firmware_thread(void *data)
 {
-       struct snd_emu10k1 * emu = data;
-       int tmp,tmp2;
+       struct snd_emu10k1 *emu = data;
+       int tmp, tmp2;
        int reg;
        int err;
 
@@ -719,50 +720,50 @@ static int emu1010_firmware_thread(void *data)
                msleep_interruptible(1000);
                if (kthread_should_stop())
                        break;
-               snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp ); /* IRQ Status */
-               snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg ); /* OPTIONS: Which cards are attached to the EMU */
+               snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp); /* IRQ Status */
+               snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg); /* OPTIONS: Which cards are attached to the EMU */
                if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {
                        /* Audio Dock attached */
                        /* Return to Audio Dock programming mode */
                        snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n");
-                       snd_emu1010_fpga_write(emu,  EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK );
+                       snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK);
                        if (emu->card_capabilities->emu_model ==
                            EMU_MODEL_EMU1010) {
-                               if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) {
+                               err = snd_emu1010_load_firmware(emu, DOCK_FILENAME);
+                               if (err != 0)
                                        continue;
-                               }
                        } else if (emu->card_capabilities->emu_model ==
                                   EMU_MODEL_EMU1010B) {
-                               if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) {
+                               err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME);
+                               if (err != 0)
                                        continue;
-                               }
                        } else if (emu->card_capabilities->emu_model ==
                                   EMU_MODEL_EMU1616) {
-                               if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) {
+                               err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME);
+                               if (err != 0)
                                        continue;
-                               }
                        }
 
-                       snd_emu1010_fpga_write(emu,  EMU_HANA_FPGA_CONFIG, 0 );
-                       snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg );
-                       snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg);
+                       snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
+                       snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg);
+                       snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS = 0x%x\n", reg);
                        /* ID, should read & 0x7f = 0x55 when FPGA programmed. */
-                       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg );
-                       snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg);
+                       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
+                       snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID = 0x%x\n", reg);
                        if ((reg & 0x1f) != 0x15) {
                                /* FPGA failed to be programmed */
-                               snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg);
+                               snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg = 0x%x\n", reg);
                                continue;
                        }
                        snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
-                       snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp );
-                       snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2 );
-                       snd_printk("Audio Dock ver:%d.%d\n",tmp ,tmp2);
+                       snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
+                       snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2);
+                       snd_printk("Audio Dock ver:%d.%d\n", tmp, tmp2);
                        /* Sync clocking between 1010 and Dock */
                        /* Allow DLL to settle */
                        msleep(10);
                        /* Unmute all. Default is muted after a firmware load */
-                       snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+                       snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
                }
        }
        snd_printk(KERN_INFO "emu1010: firmware thread stopping\n");
@@ -800,10 +801,10 @@ static int emu1010_firmware_thread(void *data)
  *             16 x 16-bit playback - snd_emu10k1_fx8010_playback_ops
  *             16 x 32-bit capture - snd_emu10k1_capture_efx_ops
  */
-static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
 {
        unsigned int i;
-       int tmp,tmp2;
+       int tmp, tmp2;
        int reg;
        int err;
        const char *filename = NULL;
@@ -818,7 +819,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
         * Lock Tank Memory Cache,
         * Mute all codecs.
         */
-       outl(0x0005a004, emu->port + HCFG); 
+       outl(0x0005a004, emu->port + HCFG);
        /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
         * Mute all codecs.
         */
@@ -829,25 +830,25 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
        outl(0x0005a000, emu->port + HCFG);
 
        /* Disable 48Volt power to Audio Dock */
-       snd_emu1010_fpga_write(emu,  EMU_HANA_DOCK_PWR,  0 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
 
        /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
-       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg );
-       snd_printdd("reg1=0x%x\n",reg);
+       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
+       snd_printdd("reg1 = 0x%x\n", reg);
        if ((reg & 0x3f) == 0x15) {
                /* FPGA netlist already present so clear it */
                /* Return to programming mode */
 
-               snd_emu1010_fpga_write(emu,  EMU_HANA_FPGA_CONFIG, 0x02 );
+               snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02);
        }
-       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg );
-       snd_printdd("reg2=0x%x\n",reg);
+       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
+       snd_printdd("reg2 = 0x%x\n", reg);
        if ((reg & 0x3f) == 0x15) {
                /* FPGA failed to return to programming mode */
                snd_printk(KERN_INFO "emu1010: FPGA failed to return to programming mode\n");
                return -ENODEV;
        }
-       snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg);
+       snd_printk(KERN_INFO "emu1010: EMU_HANA_ID = 0x%x\n", reg);
        switch (emu->card_capabilities->emu_model) {
        case EMU_MODEL_EMU1010:
                filename = HANA_FILENAME;
@@ -876,25 +877,25 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
        }
 
        /* ID, should read & 0x7f = 0x55 when FPGA programmed. */
-       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg );
+       snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
        if ((reg & 0x3f) != 0x15) {
                /* FPGA failed to be programmed */
-               snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg);
+               snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg = 0x%x\n", reg);
                return -ENODEV;
        }
 
        snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n");
-       snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp );
-       snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2 );
-       snd_printk("Hana ver:%d.%d\n",tmp ,tmp2);
+       snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
+       snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2);
+       snd_printk("emu1010: Hana version: %d.%d\n", tmp, tmp2);
        /* Enable 48Volt power to Audio Dock */
-       snd_emu1010_fpga_write(emu,  EMU_HANA_DOCK_PWR,  EMU_HANA_DOCK_PWR_ON );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
 
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg );
-       snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg );
-       snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp ); 
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
+       snd_printk(KERN_INFO "emu1010: Card options = 0x%x\n", reg);
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
+       snd_printk(KERN_INFO "emu1010: Card options = 0x%x\n", reg);
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp);
        /* Optical -> ADAT I/O  */
        /* 0 : SPDIF
         * 1 : ADAT
@@ -904,41 +905,42 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
        tmp = 0;
        tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : 0) |
                (emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : 0);
-       snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp );
-       snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp );
+       snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
+       snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp);
        /* Set no attenuation on Audio Dock pads. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00);
        emu->emu1010.adc_pads = 0x00;
-       snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
+       snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
        /* Unmute Audio dock DACs, Headphone source DAC-4. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
-       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
-       snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
+       snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp);
        /* DAC PADs. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f);
        emu->emu1010.dac_pads = 0x0f;
-       snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
-       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
-       snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
+       snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+       snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
        /* SPDIF Format. Set Consumer mode, 24bit, copy enable */
-       snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10);
        /* MIDI routing */
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19);
        /* Unknown. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c );
-       /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c);
+       /* IRQ Enable: Alll on */
+       /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); */
        /* IRQ Enable: All off */
-       snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00);
 
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg );
-       snd_printk(KERN_INFO "emu1010: Card options3=0x%x\n",reg);
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &reg);
+       snd_printk(KERN_INFO "emu1010: Card options3 = 0x%x\n", reg);
        /* Default WCLK set to 48kHz. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00);
        /* Word Clock source, Internal 48kHz x1 */
-       snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
-       //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+       snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+       /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
        /* Audio Dock LEDs. */
-       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
 
 #if 0
        /* For 96kHz */
@@ -992,7 +994,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
         * Defaults only, users will set their own values anyways, let's
         * just copy/paste.
         */
-       
+
        snd_emu1010_fpga_link_dst_src_write(emu,
                EMU_DST_ALICE2_EMU32_8, EMU_SRC_DOCK_MIC_A1);
        snd_emu1010_fpga_link_dst_src_write(emu,
@@ -1037,19 +1039,19 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
        snd_emu1010_fpga_link_dst_src_write(emu,
                EMU_DST_ALICE2_EMU32_F, EMU_SRC_HAMOA_ADC_LEFT2);
 #endif
-       for (i = 0;i < 0x20; i++ ) {
-               /* AudioDock Elink <-  Silence */
-               snd_emu1010_fpga_link_dst_src_write(emu, 0x0100+i, EMU_SRC_SILENCE);
+       for (i = 0; i < 0x20; i++) {
+               /* AudioDock Elink <- Silence */
+               snd_emu1010_fpga_link_dst_src_write(emu, 0x0100 + i, EMU_SRC_SILENCE);
        }
-       for (i = 0;i < 4; i++) {
+       for (i = 0; i < 4; i++) {
                /* Hana SPDIF Out <- Silence */
-               snd_emu1010_fpga_link_dst_src_write(emu, 0x0200+i, EMU_SRC_SILENCE);
+               snd_emu1010_fpga_link_dst_src_write(emu, 0x0200 + i, EMU_SRC_SILENCE);
        }
-       for (i = 0;i < 7; i++) {
+       for (i = 0; i < 7; i++) {
                /* Hamoa DAC <- Silence */
-               snd_emu1010_fpga_link_dst_src_write(emu, 0x0300+i, EMU_SRC_SILENCE);
+               snd_emu1010_fpga_link_dst_src_write(emu, 0x0300 + i, EMU_SRC_SILENCE);
        }
-       for (i = 0;i < 7; i++) {
+       for (i = 0; i < 7; i++) {
                /* Hana ADAT Out <- Silence */
                snd_emu1010_fpga_link_dst_src_write(emu, EMU_DST_HANA_ADAT + i, EMU_SRC_SILENCE);
        }
@@ -1065,30 +1067,30 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
                EMU_DST_ALICE_I2S2_LEFT, EMU_SRC_DOCK_ADC3_LEFT1);
        snd_emu1010_fpga_link_dst_src_write(emu,
                EMU_DST_ALICE_I2S2_RIGHT, EMU_SRC_DOCK_ADC3_RIGHT1);
-       snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01 ); // Unmute all
+       snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01); /* Unmute all */
+
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
 
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
-       
        /* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
         * Lock Sound Memory Cache, Lock Tank Memory Cache,
         * Mute all codecs.
         */
-       outl(0x0000a000, emu->port + HCFG); 
+       outl(0x0000a000, emu->port + HCFG);
        /* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
         * Lock Sound Memory Cache, Lock Tank Memory Cache,
         * Un-Mute all codecs.
         */
        outl(0x0000a001, emu->port + HCFG);
+
        /* Initial boot complete. Now patches */
 
-       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
-       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
-       snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp ); 
-       snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif  (or 0x11 for aes/ebu) */
+       snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+       snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+       snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
+       snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10); /* SPDIF Format spdif  (or 0x11 for aes/ebu) */
 
        /* Start Micro/Audio Dock firmware loader thread */
        if (!emu->emu1010.firmware_thread) {
@@ -1218,20 +1220,20 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
                emu->emu1010.output_source[23] = 28;
        }
        /* TEMP: Select SPDIF in/out */
-       //snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); /* Output spdif */
+       /* snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); */ /* Output spdif */
 
        /* TEMP: Select 48kHz SPDIF out */
        snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x0); /* Mute all */
        snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x0); /* Default fallback clock 48kHz */
        /* Word Clock source, Internal 48kHz x1 */
-       snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
-       //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+       snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+       /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
        emu->emu1010.internal_clock = 1; /* 48000 */
-       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);/* Set LEDs on Audio Dock */
+       snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12); /* Set LEDs on Audio Dock */
        snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x1); /* Unmute all */
-       //snd_emu1010_fpga_write(emu, 0x7, 0x0); /* Mute all */
-       //snd_emu1010_fpga_write(emu, 0x7, 0x1); /* Unmute all */
-       //snd_emu1010_fpga_write(emu, 0xe, 0x12); /* Set LEDs on Audio Dock */
+       /* snd_emu1010_fpga_write(emu, 0x7, 0x0); */ /* Mute all */
+       /* snd_emu1010_fpga_write(emu, 0x7, 0x1); */ /* Unmute all */
+       /* snd_emu1010_fpga_write(emu, 0xe, 0x12); */ /* Set LEDs on Audio Dock */
 
        return 0;
 }
@@ -1247,13 +1249,13 @@ static void free_pm_buffer(struct snd_emu10k1 *emu);
 static int snd_emu10k1_free(struct snd_emu10k1 *emu)
 {
        if (emu->port) {        /* avoid access to already used hardware */
-               snd_emu10k1_fx8010_tram_setup(emu, 0);
+               snd_emu10k1_fx8010_tram_setup(emu, 0);
                snd_emu10k1_done(emu);
                snd_emu10k1_free_efx(emu);
-               }
+       }
        if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) {
                /* Disable 48Volt power to Audio Dock */
-               snd_emu1010_fpga_write(emu,  EMU_HANA_DOCK_PWR,  0 );
+               snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
        }
        if (emu->emu1010.firmware_thread)
                kthread_stop(emu->emu1010.firmware_thread);
@@ -1278,7 +1280,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
 #endif
        if (emu->port)
                pci_release_regions(emu->pci);
-       if (emu->card_capabilities->ca0151_chip) /* P16V */     
+       if (emu->card_capabilities->ca0151_chip) /* P16V */
                snd_p16v_free(emu);
        pci_disable_device(emu->pci);
        kfree(emu);
@@ -1292,21 +1294,6 @@ static int snd_emu10k1_dev_free(struct snd_device *device)
 }
 
 static struct snd_emu_chip_details emu_chip_details[] = {
-       /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
-       /* Tested by James@superbug.co.uk 3rd July 2005 */
-       /* DSP: CA0108-IAT
-        * DAC: CS4382-KQ
-        * ADC: Philips 1361T
-        * AC97: STAC9750
-        * CA0151: None
-        */
-       {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
-        .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]", 
-        .id = "Audigy2",
-        .emu10k2_chip = 1,
-        .ca0108_chip = 1,
-        .spk71 = 1,
-        .ac97_chip = 1} ,
        /* Audigy4 (Not PRO) SB0610 */
        /* Tested by James@superbug.co.uk 4th April 2006 */
        /* A_IOCFG bits
@@ -1346,20 +1333,37 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         * CA0151: None
         */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
-        .driver = "Audigy2", .name = "Audigy 4 [SB0610]", 
+        .driver = "Audigy2", .name = "SB Audigy 4 [SB0610]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
         .spk71 = 1,
         .adc_1361t = 1,  /* 24 bit capture instead of 16bit */
         .ac97_chip = 1} ,
+       /* Audigy 2 Value AC3 out does not work yet.
+        * Need to find out how to turn off interpolators.
+        */
+       /* Tested by James@superbug.co.uk 3rd July 2005 */
+       /* DSP: CA0108-IAT
+        * DAC: CS4382-KQ
+        * ADC: Philips 1361T
+        * AC97: STAC9750
+        * CA0151: None
+        */
+       {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
+        .driver = "Audigy2", .name = "SB Audigy 2 Value [SB0400]",
+        .id = "Audigy2",
+        .emu10k2_chip = 1,
+        .ca0108_chip = 1,
+        .spk71 = 1,
+        .ac97_chip = 1} ,
        /* Audigy 2 ZS Notebook Cardbus card.*/
        /* Tested by James@superbug.co.uk 6th November 2006 */
        /* Audio output 7.1/Headphones working.
         * Digital output working. (AC3 not checked, only PCM)
         * Audio Mic/Line inputs working.
         * Digital input not tested.
-        */ 
+        */
        /* DSP: Tina2
         * DAC: Wolfson WM8768/WM8568
         * ADC: Wolfson WM8775
@@ -1386,7 +1390,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         *
         */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102,
-        .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 ZS Notebook [SB0530]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
@@ -1396,7 +1400,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .spk71 = 1} ,
        /* Tested by James@superbug.co.uk 4th Nov 2007. */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102,
-        .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]", 
+        .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]",
         .id = "EMU1010",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
@@ -1404,47 +1408,49 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .spk71 = 1 ,
         .emu_model = EMU_MODEL_EMU1616},
        /* Tested by James@superbug.co.uk 4th Nov 2007. */
+       /* This is MAEM8960, 0202 is MAEM 8980 */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102,
-        .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", 
+        .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM8960]",
         .id = "EMU1010",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
         .spk71 = 1,
-        .emu_model = EMU_MODEL_EMU1010B},
+        .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */
        /* Tested by James@superbug.co.uk 8th July 2005. */
+       /* This is MAEM8810, 0202 is MAEM8820 */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
-        .driver = "Audigy2", .name = "E-mu 1010 [4001]",
+        .driver = "Audigy2", .name = "E-mu 1010 [MAEM8810]",
         .id = "EMU1010",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .spk71 = 1,
-        .emu_model = EMU_MODEL_EMU1010}, /* Emu 1010 */
+        .emu_model = EMU_MODEL_EMU1010}, /* EMU 1010 old revision */
        /* EMU0404b */
        {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40021102,
-        .driver = "Audigy2", .name = "E-mu 0404b [4002]",
+        .driver = "Audigy2", .name = "E-mu 0404b PCI [MAEM8852]",
         .id = "EMU0404",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
         .spk71 = 1,
-        .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */
+        .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 new revision */
        /* Tested by James@superbug.co.uk 20-3-2007. */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40021102,
-        .driver = "Audigy2", .name = "E-mu 0404 [4002]",
+        .driver = "Audigy2", .name = "E-mu 0404 [MAEM8850]",
         .id = "EMU0404",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .spk71 = 1,
         .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */
-       /* Audigy4 (Not PRO) SB0610 */
-       {.vendor = 0x1102, .device = 0x0008, 
-        .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", 
+       /* Note that all E-mu cards require kernel 2.6 or newer. */
+       {.vendor = 0x1102, .device = 0x0008,
+        .driver = "Audigy2", .name = "SB Audigy 2 Value [Unknown]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0108_chip = 1,
         .ac97_chip = 1} ,
        /* Tested by James@superbug.co.uk 3rd July 2005 */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102,
-        .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]", 
+        .driver = "Audigy2", .name = "SB Audigy 4 PRO [SB0380]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1457,7 +1463,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         * Just like 0x20021102
         */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20061102,
-        .driver = "Audigy2", .name = "Audigy 2 [SB0350b]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 [SB0350b]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1467,7 +1473,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .invert_shared_spdif = 1,      /* digital/analog switch swapped */
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
-        .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0350]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1477,7 +1483,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .invert_shared_spdif = 1,      /* digital/analog switch swapped */
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
-        .driver = "Audigy2", .name = "Audigy 2 ZS [2001]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0360]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1495,7 +1501,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         * CA0151: Yes
         */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10071102,
-        .driver = "Audigy2", .name = "Audigy 2 [SB0240]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 [SB0240]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1505,7 +1511,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .adc_1361t = 1,  /* 24 bit capture instead of 16bit */
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102,
-        .driver = "Audigy2", .name = "Audigy 2 EX [1005]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 Platinum EX [SB0280]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1515,7 +1521,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
        /* Dell OEM/Creative Labs Audigy 2 ZS */
        /* See ALSA bug#1365 */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10031102,
-        .driver = "Audigy2", .name = "Audigy 2 ZS [SB0353]",
+        .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0353]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1524,7 +1530,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .spdif_bug = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
-        .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]", 
+        .driver = "Audigy2", .name = "SB Audigy 2 Platinum [SB0240P]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1535,7 +1541,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .adc_1361t = 1,  /* 24 bit capture instead of 16bit. Fixes ALSA bug#324 */
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .revision = 0x04,
-        .driver = "Audigy2", .name = "Audigy 2 [Unknown]",
+        .driver = "Audigy2", .name = "SB Audigy 2 [Unknown]",
         .id = "Audigy2",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
@@ -1543,78 +1549,79 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .spdif_bug = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00531102,
-        .driver = "Audigy", .name = "Audigy 1 [SB0090]", 
+        .driver = "Audigy", .name = "SB Audigy 1 [SB0092]",
         .id = "Audigy",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00521102,
-        .driver = "Audigy", .name = "Audigy 1 ES [SB0160]", 
+        .driver = "Audigy", .name = "SB Audigy 1 ES [SB0160]",
         .id = "Audigy",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .spdif_bug = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00511102,
-        .driver = "Audigy", .name = "Audigy 1 [SB0090]", 
+        .driver = "Audigy", .name = "SB Audigy 1 [SB0090]",
         .id = "Audigy",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0004,
-        .driver = "Audigy", .name = "Audigy 1 [Unknown]", 
+        .driver = "Audigy", .name = "Audigy 1 [Unknown]",
         .id = "Audigy",
         .emu10k2_chip = 1,
         .ca0102_chip = 1,
         .ac97_chip = 1} ,
-       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806B1102,
-        .driver = "EMU10K1", .name = "SBLive! [SB0105]", 
+       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x100a1102,
+        .driver = "EMU10K1", .name = "SB Live! 5.1 [SB0220]",
+        .id = "Live",
+        .emu10k1_chip = 1,
+        .ac97_chip = 1,
+        .sblive51 = 1} ,
+       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806b1102,
+        .driver = "EMU10K1", .name = "SB Live! [SB0105]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
-       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806A1102,
-        .driver = "EMU10K1", .name = "SBLive! Value [SB0103]", 
+       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806a1102,
+        .driver = "EMU10K1", .name = "SB Live! Value [SB0103]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80691102,
-        .driver = "EMU10K1", .name = "SBLive! Value [SB0101]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [SB0101]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        /* Tested by ALSA bug#1680 26th December 2005 */
-       /* note: It really has SB0220 written on the card. */
+       /* note: It really has SB0220 written on the card, */
+       /* but it's SB0228 according to kx.inf */
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80661102,
-        .driver = "EMU10K1", .name = "SB Live 5.1 Dell OEM [SB0220]", 
+        .driver = "EMU10K1", .name = "SB Live! 5.1 Dell OEM [SB0228]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        /* Tested by Thomas Zehetbauer 27th Aug 2005 */
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80651102,
-        .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]", 
-        .id = "Live",
-        .emu10k1_chip = 1,
-        .ac97_chip = 1,
-        .sblive51 = 1} ,
-       {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x100a1102,
-        .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]", 
+        .driver = "EMU10K1", .name = "SB Live! 5.1 [SB0220]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102,
-        .driver = "EMU10K1", .name = "SB Live 5.1", 
+        .driver = "EMU10K1", .name = "SB Live! 5.1",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        /* Tested by alsa bugtrack user "hus" bug #1297 12th Aug 2005 */
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80611102,
-        .driver = "EMU10K1", .name = "SBLive 5.1 [SB0060]",
+        .driver = "EMU10K1", .name = "SB Live! 5.1 [SB0060]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 2, /* ac97 is optional; both SBLive 5.1 and platinum
@@ -1622,78 +1629,78 @@ static struct snd_emu_chip_details emu_chip_details[] = {
                          */
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4850]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4850]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102,
-        .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]", 
+        .driver = "EMU10K1", .name = "SB Live! Platinum [CT4760P]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80321102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4871]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4871]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80311102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4831]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4831]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80281102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4870]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4870]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        /* Tested by James@superbug.co.uk 3rd July 2005 */
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4832]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4832]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80261102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4830]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4830]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80231102,
-        .driver = "EMU10K1", .name = "SB PCI512 [CT4790]", 
+        .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80221102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4780]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4780]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x40011102,
-        .driver = "EMU10K1", .name = "E-mu APS [4001]", 
+        .driver = "EMU10K1", .name = "E-mu APS [PC545]",
         .id = "APS",
         .emu10k1_chip = 1,
         .ecard = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00211102,
-        .driver = "EMU10K1", .name = "SBLive! [CT4620]", 
+        .driver = "EMU10K1", .name = "SB Live! [CT4620]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00201102,
-        .driver = "EMU10K1", .name = "SBLive! Value [CT4670]", 
+        .driver = "EMU10K1", .name = "SB Live! Value [CT4670]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
         .sblive51 = 1} ,
        {.vendor = 0x1102, .device = 0x0002,
-        .driver = "EMU10K1", .name = "SB Live [Unknown]", 
+        .driver = "EMU10K1", .name = "SB Live! [Unknown]",
         .id = "Live",
         .emu10k1_chip = 1,
         .ac97_chip = 1,
@@ -1702,13 +1709,13 @@ static struct snd_emu_chip_details emu_chip_details[] = {
 };
 
 int __devinit snd_emu10k1_create(struct snd_card *card,
-                      struct pci_dev * pci,
+                      struct pci_dev *pci,
                       unsigned short extin_mask,
                       unsigned short extout_mask,
                       long max_cache_bytes,
                       int enable_ir,
                       uint subsystem,
-                      struct snd_emu10k1 ** remu)
+                      struct snd_emu10k1 **remu)
 {
        struct snd_emu10k1 *emu;
        int idx, err;
@@ -1718,11 +1725,12 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        static struct snd_device_ops ops = {
                .dev_free =     snd_emu10k1_dev_free,
        };
-       
+
        *remu = NULL;
 
        /* enable PCI device */
-       if ((err = pci_enable_device(pci)) < 0)
+       err = pci_enable_device(pci);
+       if (err < 0)
                return err;
 
        emu = kzalloc(sizeof(*emu), GFP_KERNEL);
@@ -1749,16 +1757,17 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        emu->revision = pci->revision;
        pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial);
        pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model);
-       snd_printdd("vendor=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x\n",pci->vendor, pci->device, emu->serial, emu->model);
+       snd_printdd("vendor = 0x%x, device = 0x%x, subsystem_vendor_id = 0x%x, subsystem_id = 0x%x\n", pci->vendor, pci->device, emu->serial, emu->model);
 
        for (c = emu_chip_details; c->vendor; c++) {
                if (c->vendor == pci->vendor && c->device == pci->device) {
                        if (subsystem) {
-                               if (c->subsystem && (c->subsystem == subsystem) ) {
+                               if (c->subsystem && (c->subsystem == subsystem))
                                        break;
-                               } else continue;
+                               else
+                                       continue;
                        } else {
-                               if (c->subsystem && (c->subsystem != emu->serial) )
+                               if (c->subsystem && (c->subsystem != emu->serial))
                                        continue;
                                if (c->revision && c->revision != emu->revision)
                                        continue;
@@ -1774,14 +1783,18 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        }
        emu->card_capabilities = c;
        if (c->subsystem && !subsystem)
-               snd_printdd("Sound card name=%s\n", c->name);
-       else if (subsystem) 
-               snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x. Forced to subsytem=0x%x\n",
-                       c->name, pci->vendor, pci->device, emu->serial, c->subsystem);
-       else 
-               snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x.\n",
-                       c->name, pci->vendor, pci->device, emu->serial);
-       
+               snd_printdd("Sound card name = %s\n", c->name);
+       else if (subsystem)
+               snd_printdd("Sound card name = %s, "
+                       "vendor = 0x%x, device = 0x%x, subsystem = 0x%x. "
+                       "Forced to subsytem = 0x%x\n",  c->name,
+                       pci->vendor, pci->device, emu->serial, c->subsystem);
+       else
+               snd_printdd("Sound card name = %s, "
+                       "vendor = 0x%x, device = 0x%x, subsystem = 0x%x.\n",
+                       c->name, pci->vendor, pci->device,
+                       emu->serial);
+
        if (!*card->id && c->id) {
                int i, n = 0;
                strlcpy(card->id, c->id, sizeof(card->id));
@@ -1815,7 +1828,8 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        else
                emu->gpr_base = FXGPREGBASE;
 
-       if ((err = pci_request_regions(pci, "EMU10K1")) < 0) {
+       err = pci_request_regions(pci, "EMU10K1");
+       if (err < 0) {
                kfree(emu);
                pci_disable_device(pci);
                return err;
@@ -1862,21 +1876,25 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        emu->enable_ir = enable_ir;
 
        if (emu->card_capabilities->ca_cardbus_chip) {
-               if ((err = snd_emu10k1_cardbus_init(emu)) < 0)
+               err = snd_emu10k1_cardbus_init(emu);
+               if (err < 0)
                        goto error;
        }
        if (emu->card_capabilities->ecard) {
-               if ((err = snd_emu10k1_ecard_init(emu)) < 0)
+               err = snd_emu10k1_ecard_init(emu);
+               if (err < 0)
                        goto error;
        } else if (emu->card_capabilities->emu_model) {
-               if ((err = snd_emu10k1_emu1010_init(emu)) < 0) {
-                       snd_emu10k1_free(emu);
-                       return err;
-               }
+               err = snd_emu10k1_emu1010_init(emu);
+               if (err < 0) {
+                       snd_emu10k1_free(emu);
+                       return err;
+               }
        } else {
                /* 5.1: Enable the additional AC97 Slots. If the emu10k1 version
                        does not support this, it shouldn't do any harm */
-               snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE);
+               snd_emu10k1_ptr_write(emu, AC97SLOT, 0,
+                                       AC97SLOT_CNTR|AC97SLOT_LFE);
        }
 
        /* initialize TRAM setup */
@@ -1916,7 +1934,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
                snd_emu10k1_synth_alloc(emu, 4096);
        if (emu->reserved_page)
                emu->reserved_page->map_locked = 1;
-       
+
        /* Clear silent pages and set up pointers */
        memset(emu->silent_page.area, 0, PAGE_SIZE);
        silent_page = emu->silent_page.addr << 1;
@@ -1929,19 +1947,23 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
                emu->voices[idx].number = idx;
        }
 
-       if ((err = snd_emu10k1_init(emu, enable_ir, 0)) < 0)
+       err = snd_emu10k1_init(emu, enable_ir, 0);
+       if (err < 0)
                goto error;
 #ifdef CONFIG_PM
-       if ((err = alloc_pm_buffer(emu)) < 0)
+       err = alloc_pm_buffer(emu);
+       if (err < 0)
                goto error;
 #endif
 
        /*  Initialize the effect engine */
-       if ((err = snd_emu10k1_init_efx(emu)) < 0)
+       err = snd_emu10k1_init_efx(emu);
+       if (err < 0)
                goto error;
        snd_emu10k1_audio_enable(emu);
 
-       if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, emu, &ops)) < 0)
+       err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, emu, &ops);
+       if (err < 0)
                goto error;
 
 #ifdef CONFIG_PROC_FS
@@ -1981,7 +2003,7 @@ static int __devinit alloc_pm_buffer(struct snd_emu10k1 *emu)
        if (emu->audigy)
                size += ARRAY_SIZE(saved_regs_audigy);
        emu->saved_ptr = vmalloc(4 * NUM_G * size);
-       if (! emu->saved_ptr)
+       if (!emu->saved_ptr)
                return -ENOMEM;
        if (snd_emu10k1_efx_alloc_pm_buffer(emu) < 0)
                return -ENOMEM;
@@ -2026,7 +2048,7 @@ void snd_emu10k1_resume_init(struct snd_emu10k1 *emu)
        if (emu->card_capabilities->ecard)
                snd_emu10k1_ecard_init(emu);
        else if (emu->card_capabilities->emu_model)
-               snd_emu10k1_emu1010_init(emu);
+               snd_emu10k1_emu1010_init(emu);
        else
                snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE);
        snd_emu10k1_init(emu, emu->enable_ir, 1);
index f34bbfb705f5f7c870d50012aa17e7c7b57b93ee..b0fb6c917c388df22d716a7f10900e94d6b1ff1f 100644 (file)
@@ -1639,6 +1639,45 @@ static struct snd_kcontrol_new snd_audigy_shared_spdif __devinitdata =
        .put =          snd_emu10k1_shared_spdif_put
 };
 
+/* workaround for too low volume on Audigy due to 16bit/24bit conversion */
+
+#define snd_audigy_capture_boost_info  snd_ctl_boolean_mono_info
+
+static int snd_audigy_capture_boost_get(struct snd_kcontrol *kcontrol,
+                                       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
+       unsigned int val;
+
+       /* FIXME: better to use a cached version */
+       val = snd_ac97_read(emu->ac97, AC97_REC_GAIN);
+       ucontrol->value.integer.value[0] = !!val;
+       return 0;
+}
+
+static int snd_audigy_capture_boost_put(struct snd_kcontrol *kcontrol,
+                                       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
+       unsigned int val;
+
+       if (ucontrol->value.integer.value[0])
+               val = 0x0f0f;
+       else
+               val = 0;
+       return snd_ac97_update(emu->ac97, AC97_REC_GAIN, val);
+}
+
+static struct snd_kcontrol_new snd_audigy_capture_boost __devinitdata =
+{
+       .iface =        SNDRV_CTL_ELEM_IFACE_MIXER,
+       .name =         "Analog Capture Boost",
+       .info =         snd_audigy_capture_boost_info,
+       .get =          snd_audigy_capture_boost_get,
+       .put =          snd_audigy_capture_boost_put
+};
+
+
 /*
  */
 static void snd_emu10k1_mixer_free_ac97(struct snd_ac97 *ac97)
@@ -2087,5 +2126,12 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                }
        }
                
+       if (emu->card_capabilities->ac97_chip && emu->audigy) {
+               err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_capture_boost,
+                                                    emu));
+               if (err < 0)
+                       return err;
+       }
+
        return 0;
 }
index 20ee7599600bee87340f264e99842a4efa195465..e9c3794bbcb8a409751cc26ab466764d37fd1698 100644 (file)
@@ -1953,7 +1953,7 @@ static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id)
        outw(inw(chip->io_port + 4) & 1, chip->io_port + 4);
 
        if (event & ESM_HWVOL_IRQ)
-               tasklet_hi_schedule(&chip->hwvol_tq); /* we'll do this later */
+               tasklet_schedule(&chip->hwvol_tq); /* we'll do this later */
 
        /* else ack 'em all, i imagine */
        outb(0xFF, chip->io_port + 0x1A);
index 5dd3e89f620a2753511097d1fe86b4e6673afefa..b77f330d2650b7c13d23d1d0f84d9344d973940a 100644 (file)
@@ -69,6 +69,7 @@ enum {
 };
 
 enum {
+       STAC_92HD73XX_NO_JD, /* no jack-detection */
        STAC_92HD73XX_REF,
        STAC_DELL_M6_AMIC,
        STAC_DELL_M6_DMIC,
@@ -127,6 +128,7 @@ enum {
 };
 
 enum {
+       STAC_D965_REF_NO_JD, /* no jack-detection */
        STAC_D965_REF,
        STAC_D965_3ST,
        STAC_D965_5ST,
@@ -857,6 +859,7 @@ static struct hda_verb stac92hd83xxx_core_init[] = {
 
        /* power state controls amps */
        { 0x01, AC_VERB_SET_EAPD, 1 << 2},
+       {}
 };
 
 static struct hda_verb stac92hd71bxx_core_init[] = {
@@ -868,6 +871,7 @@ static struct hda_verb stac92hd71bxx_core_init[] = {
        { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        { 0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       {}
 };
 
 #define HD_DISABLE_PORTF 2
@@ -1611,6 +1615,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
 };
 
 static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
+       [STAC_92HD73XX_NO_JD] = "no-jd",
        [STAC_92HD73XX_REF] = "ref",
        [STAC_DELL_M6_AMIC] = "dell-m6-amic",
        [STAC_DELL_M6_DMIC] = "dell-m6-dmic",
@@ -1640,6 +1645,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
                                "unknown Dell", STAC_DELL_M6_DMIC),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
                                "Dell Studio 1537", STAC_DELL_M6_DMIC),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
+                               "Dell Studio 17", STAC_DELL_M6_DMIC),
        {} /* terminator */
 };
 
@@ -1662,6 +1669,7 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
        /* SigmaTel reference board */
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
                      "DFI LanParty", STAC_92HD71BXX_REF),
+       {} /* terminator */
 };
 
 static unsigned int ref92hd71bxx_pin_configs[11] = {
@@ -2027,6 +2035,7 @@ static unsigned int dell_3st_pin_configs[14] = {
 };
 
 static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
+       [STAC_D965_REF_NO_JD] = ref927x_pin_configs,
        [STAC_D965_REF]  = ref927x_pin_configs,
        [STAC_D965_3ST]  = d965_3st_pin_configs,
        [STAC_D965_5ST]  = d965_5st_pin_configs,
@@ -2035,6 +2044,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
 };
 
 static const char *stac927x_models[STAC_927X_MODELS] = {
+       [STAC_D965_REF_NO_JD]   = "ref-no-jd",
        [STAC_D965_REF]         = "ref",
        [STAC_D965_3ST]         = "3stack",
        [STAC_D965_5ST]         = "5stack",
@@ -2896,7 +2906,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
        }
 
        if ((spec->multiout.num_dacs - cfg->line_outs) > 0 &&
-                       cfg->hp_outs && !spec->multiout.hp_nid)
+           cfg->hp_outs == 1 && !spec->multiout.hp_nid)
                spec->multiout.hp_nid = nid;
 
        if (cfg->hp_outs > 1 && cfg->line_out_type == AUTO_PIN_LINE_OUT) {
@@ -4254,14 +4264,17 @@ again:
 
        switch (spec->multiout.num_dacs) {
        case 0x3: /* 6 Channel */
+               spec->multiout.hp_nid = 0x17;
                spec->mixer = stac92hd73xx_6ch_mixer;
                spec->init = stac92hd73xx_6ch_core_init;
                break;
        case 0x4: /* 8 Channel */
+               spec->multiout.hp_nid = 0x18;
                spec->mixer = stac92hd73xx_8ch_mixer;
                spec->init = stac92hd73xx_8ch_core_init;
                break;
        case 0x5: /* 10 Channel */
+               spec->multiout.hp_nid = 0x19;
                spec->mixer = stac92hd73xx_10ch_mixer;
                spec->init = stac92hd73xx_10ch_core_init;
        };
@@ -4297,6 +4310,7 @@ again:
                spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
                spec->eapd_switch = 0;
                spec->num_amps = 1;
+               spec->multiout.hp_nid = 0; /* dual HPs */
 
                if (!spec->init)
                        spec->init = dell_m6_core_init;
@@ -4351,6 +4365,9 @@ again:
                return err;
        }
 
+       if (spec->board_config == STAC_92HD73XX_NO_JD)
+               spec->hp_detect = 0;
+
        codec->patch_ops = stac92xx_patch_ops;
 
        return 0;
@@ -4899,6 +4916,10 @@ static int patch_stac927x(struct hda_codec *codec)
         */
        codec->bus->needs_damn_long_delay = 1;
 
+       /* no jack detecion for ref-no-jd model */
+       if (spec->board_config == STAC_D965_REF_NO_JD)
+               spec->hp_detect = 0;
+
        return 0;
 }
 
index 1b3f11702713624b3cc5f344e598fcce7f5af70c..0dfa0540ce2cb917991d058d8c6aa9d88e6329ba 100644 (file)
@@ -382,23 +382,25 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id)
        unsigned char status_mask =
                VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX | VT1724_IRQ_MTPCM;
        int handled = 0;
-#ifdef CONFIG_SND_DEBUG
        int timeout = 0;
-#endif
 
        while (1) {
                status = inb(ICEREG1724(ice, IRQSTAT));
                status &= status_mask;
                if (status == 0)
                        break;
-#ifdef CONFIG_SND_DEBUG
                if (++timeout > 10) {
-                       printk(KERN_ERR
-                              "ice1724: Too long irq loop, status = 0x%x\n",
-                              status);
+                       status = inb(ICEREG1724(ice, IRQSTAT));
+                       printk(KERN_ERR "ice1724: Too long irq loop, "
+                              "status = 0x%x\n", status);
+                       if (status & VT1724_IRQ_MPU_TX) {
+                               printk(KERN_ERR "ice1724: Disabling MPU_TX\n");
+                               outb(inb(ICEREG1724(ice, IRQMASK)) |
+                                    VT1724_IRQ_MPU_TX,
+                                    ICEREG1724(ice, IRQMASK));
+                       }
                        break;
                }
-#endif
                handled = 1;
                if (status & VT1724_IRQ_MPU_TX) {
                        spin_lock(&ice->reg_lock);
@@ -2351,7 +2353,6 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
 {
        struct snd_ice1712 *ice;
        int err;
-       unsigned char mask;
        static struct snd_device_ops ops = {
                .dev_free =     snd_vt1724_dev_free,
        };
@@ -2412,9 +2413,9 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
                return -EIO;
        }
 
-       /* unmask used interrupts */
-       mask = VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX;
-       outb(mask, ICEREG1724(ice, IRQMASK));
+       /* MPU_RX and TX irq masks are cleared later dynamically */
+       outb(VT1724_IRQ_MPU_RX | VT1724_IRQ_MPU_TX , ICEREG1724(ice, IRQMASK));
+
        /* don't handle FIFO overrun/underruns (just yet),
         * since they cause machine lockups
         */
index 9ff3f9e34404c4fa4c9c0b9b46a3b503d3c2fb03..59bbaf8f3e5b9bbe026fe13162e5258408598958 100644 (file)
@@ -1670,7 +1670,7 @@ static irqreturn_t snd_m3_interrupt(int irq, void *dev_id)
                return IRQ_NONE;
 
        if (status & HV_INT_PENDING)
-               tasklet_hi_schedule(&chip->hwvol_tq);
+               tasklet_schedule(&chip->hwvol_tq);
 
        /*
         * ack an assp int if its running
index ae7601f353a706d0f69ca0a31195104b3040beb8..f23a73577c2219cb7da2b03317bf1106b7e1f981 100644 (file)
@@ -1010,7 +1010,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
                .dev_free = snd_mixart_chip_dev_free,
        };
 
-       mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
        if (! chip) {
                snd_printk(KERN_ERR "cannot allocate chip\n");
                return -ENOMEM;
@@ -1025,6 +1025,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
                return err;
        }
 
+       mgr->chip[idx] = chip;
        snd_card_set_dev(card, &mgr->pci->dev);
 
        return 0;
@@ -1377,6 +1378,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
                sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
 
                if ((err = snd_mixart_create(mgr, card, i)) < 0) {
+                       snd_card_free(card);
                        snd_mixart_free(mgr);
                        return err;
                }
index b9a06c2793970d4d13a29e6c2ca3f9a4cae7faa4..d3350f383966b7ec1460282a287c8426f0215480 100644 (file)
@@ -550,7 +550,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
                                mgr->msg_fifo[mgr->msg_fifo_writeptr] = msg;
                                mgr->msg_fifo_writeptr++;
                                mgr->msg_fifo_writeptr %= MSG_FIFO_SIZE;
-                               tasklet_hi_schedule(&mgr->msg_taskq);
+                               tasklet_schedule(&mgr->msg_taskq);
                        }
                        spin_unlock(&mgr->msg_lock);
                        break;
index 73de6e989b3d4ab78069d8b24240637890fd3131..471ee27e6c8ad9d6f9ca7fbf401d6b64edca3429 100644 (file)
@@ -653,7 +653,7 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
                                        PCXHR_STREAM_STATUS_SCHEDULE_RUN;
                                snd_pcm_trigger_done(s, subs);
                        }
-                       tasklet_hi_schedule(&chip->mgr->trigger_taskq);
+                       tasklet_schedule(&chip->mgr->trigger_taskq);
                } else {
                        stream = subs->runtime->private_data;
                        snd_printdd("Only one Substream %c %d\n",
@@ -1024,7 +1024,7 @@ static int __devinit pcxhr_create(struct pcxhr_mgr *mgr, struct snd_card *card,
                .dev_free = pcxhr_chip_dev_free,
        };
 
-       mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
        if (! chip) {
                snd_printk(KERN_ERR "cannot allocate chip\n");
                return -ENOMEM;
@@ -1050,6 +1050,7 @@ static int __devinit pcxhr_create(struct pcxhr_mgr *mgr, struct snd_card *card,
                return err;
        }
 
+       mgr->chip[idx] = chip;
        snd_card_set_dev(card, &mgr->pci->dev);
 
        return 0;
@@ -1310,6 +1311,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
                sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i);
 
                if ((err = pcxhr_create(mgr, card, i)) < 0) {
+                       snd_card_free(card);
                        pcxhr_free(mgr);
                        return err;
                }
index 7143259cfe3432f339c363d47a0589956f41b8d9..4a5481f9781fec6e742786e3e45c4df7f1607f0e 100644 (file)
@@ -1213,7 +1213,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
                mgr->dsp_time_last = PCXHR_DSP_TIME_INVALID;
                
                mgr->src_it_dsp = reg;
-               tasklet_hi_schedule(&mgr->msg_taskq);
+               tasklet_schedule(&mgr->msg_taskq);
        }
 #ifdef CONFIG_SND_DEBUG_VERBOSE
        if (reg & PCXHR_FATAL_DSP_ERR)
index e9f0706ed3e45d2368ebe7170682b74290b15159..3caacfb9d8e005c3382b76ef8a742b798837a77d 100644 (file)
@@ -172,7 +172,7 @@ MODULE_PARM_DESC(opl3_port, "OPL3 port # for Riptide driver.");
 
 #define MAX_WRITE_RETRY  10    /* cmd interface limits */
 #define MAX_ERROR_COUNT  10
-#define CMDIF_TIMEOUT    500000
+#define CMDIF_TIMEOUT    50000
 #define RESET_TRIES      5
 
 #define READ_PORT_ULONG(p)     inl((unsigned long)&(p))
@@ -1754,7 +1754,7 @@ snd_riptide_interrupt(int irq, void *dev_id)
                if (IS_EOBIRQ(cif->hwport) || IS_EOSIRQ(cif->hwport) ||
                    IS_EOCIRQ(cif->hwport)) {
                        chip->handled_irqs++;
-                       tasklet_hi_schedule(&chip->riptide_tq);
+                       tasklet_schedule(&chip->riptide_tq);
                }
                if (chip->rmidi && IS_MPUIRQ(cif->hwport)) {
                        chip->handled_irqs++;
index 736246f98accb3e7e3d724da1d74c2ef17b34c4f..f87ff0497116ee02d8770e987dd6a32c5f272537 100644 (file)
@@ -3750,7 +3750,7 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
                }
        }
        if (hdsp->use_midi_tasklet && schedule)
-               tasklet_hi_schedule(&hdsp->midi_tasklet);
+               tasklet_schedule(&hdsp->midi_tasklet);
        return IRQ_HANDLED;
 }
 
index 98762f909d6407b75495e4cbc98ad3640d9ea9cb..d7dd53675ccd599d8ff77585a0e64813fcfd9b51 100644 (file)
@@ -3476,7 +3476,7 @@ static irqreturn_t snd_hdspm_interrupt(int irq, void *dev_id)
                schedule = 1;
        }
        if (schedule)
-               tasklet_hi_schedule(&hdspm->midi_tasklet);
+               tasklet_schedule(&hdspm->midi_tasklet);
        return IRQ_HANDLED;
 }
 
index fa4b11398b1fbdeb8f7b6c2ccc08f9a6fb71a460..ea903c8e90ddb9a27c3b445a0432df2443f4e552 100644 (file)
@@ -41,7 +41,7 @@ irqreturn_t pdacf_interrupt(int irq, void *dev)
                if (stat & PDAUDIOCF_IRQOVR)    /* should never happen */
                        snd_printk(KERN_ERR "PDAUDIOCF SRAM buffer overrun detected!\n");
                if (chip->pcm_substream)
-                       tasklet_hi_schedule(&chip->tq);
+                       tasklet_schedule(&chip->tq);
                if (!(stat & PDAUDIOCF_IRQAKM))
                        stat |= PDAUDIOCF_IRQAKM;       /* check rate */
        }
index a38c0c790d2bb3ab6e4175477dbcf4a77e345a3d..af76ee862d2787f89b34313dbba2bd5ff98b715c 100644 (file)
@@ -1033,7 +1033,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        }
        if (of_device_is_compatible(sound, "tumbler")) {
                chip->model = PMAC_TUMBLER;
-               chip->can_capture = 0;  /* no capture */
+               chip->can_capture = machine_is_compatible("PowerMac4,2");
                chip->can_duplex = 0;
                // chip->can_byte_swap = 0; /* FIXME: check this */
                chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
index f746e15b8481b8ee8d3bbe10a9a1c13be436ad4a..3eb2233854166e06a7c532f9ec2d555020c7d567 100644 (file)
@@ -875,7 +875,8 @@ static struct snd_kcontrol_new snapper_mixers[] __initdata = {
          .put = tumbler_put_master_switch
        },
        DEFINE_SNAPPER_MIX("PCM Playback Volume", 0, VOL_IDX_PCM),
-       DEFINE_SNAPPER_MIX("PCM Playback Volume", 1, VOL_IDX_PCM2),
+       /* Alternative PCM is assigned to Mic analog loopback on iBook G4 */
+       DEFINE_SNAPPER_MIX("Mic Playback Volume", 0, VOL_IDX_PCM2),
        DEFINE_SNAPPER_MIX("Monitor Mix Volume", 0, VOL_IDX_ADC),
        DEFINE_SNAPPER_MONO("Tone Control - Bass", bass),
        DEFINE_SNAPPER_MONO("Tone Control - Treble", treble),
index 4dfda6674bec98507ee354a5c7a84f9606a9ab37..ef025c66cc669c49c7b4537893ba76860fbd2397 100644 (file)
@@ -22,17 +22,16 @@ if SND_SOC
 config SND_SOC_AC97_BUS
        bool
 
-# All the supported Soc's
-source "sound/soc/at32/Kconfig"
-source "sound/soc/at91/Kconfig"
+# All the supported SoCs
+source "sound/soc/atmel/Kconfig"
 source "sound/soc/au1x/Kconfig"
+source "sound/soc/blackfin/Kconfig"
+source "sound/soc/davinci/Kconfig"
+source "sound/soc/fsl/Kconfig"
+source "sound/soc/omap/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
 source "sound/soc/sh/Kconfig"
-source "sound/soc/fsl/Kconfig"
-source "sound/soc/davinci/Kconfig"
-source "sound/soc/omap/Kconfig"
-source "sound/soc/blackfin/Kconfig"
 
 # Supported codecs
 source "sound/soc/codecs/Kconfig"
index d849349f2c6607ddb5a0da9a1097eae024b22848..86a9b1f5b0f3cbf83c315505613fd751c8356306 100644 (file)
@@ -1,5 +1,13 @@
 snd-soc-core-objs := soc-core.o soc-dapm.o
 
 obj-$(CONFIG_SND_SOC)  += snd-soc-core.o
-obj-$(CONFIG_SND_SOC)  += codecs/ at32/ at91/ pxa/ s3c24xx/ sh/ fsl/ davinci/
-obj-$(CONFIG_SND_SOC)  += omap/ au1x/ blackfin/
+obj-$(CONFIG_SND_SOC)  += codecs/
+obj-$(CONFIG_SND_SOC)  += atmel/
+obj-$(CONFIG_SND_SOC)  += au1x/
+obj-$(CONFIG_SND_SOC)  += blackfin/
+obj-$(CONFIG_SND_SOC)  += davinci/
+obj-$(CONFIG_SND_SOC)  += fsl/
+obj-$(CONFIG_SND_SOC)  += omap/
+obj-$(CONFIG_SND_SOC)  += pxa/
+obj-$(CONFIG_SND_SOC)  += s3c24xx/
+obj-$(CONFIG_SND_SOC)  += sh/
diff --git a/sound/soc/at32/Kconfig b/sound/soc/at32/Kconfig
deleted file mode 100644 (file)
index b0765e8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-config SND_AT32_SOC
-        tristate "SoC Audio for the Atmel AT32 System-on-a-Chip"
-        depends on AVR32 && SND_SOC
-        help
-          Say Y or M if you want to add support for codecs attached to 
-          the AT32 SSC interface.  You will also need to
-          to select the audio interfaces to support below.
-
-
-config SND_AT32_SOC_SSC
-        tristate
-
-
-
-config SND_AT32_SOC_PLAYPAQ
-        tristate "SoC Audio support for PlayPaq with WM8510"
-        depends on SND_AT32_SOC && BOARD_PLAYPAQ
-        select SND_AT32_SOC_SSC
-        select SND_SOC_WM8510
-        help
-          Say Y or M here if you want to add support for SoC audio
-          on the LRS PlayPaq.
-
-
-
-config SND_AT32_SOC_PLAYPAQ_SLAVE
-        bool "Run CODEC on PlayPaq in slave mode"
-        depends on SND_AT32_SOC_PLAYPAQ
-        default n
-        help
-          Say Y if you want to run with the AT32 SSC generating the BCLK
-          and FRAME signals on the PlayPaq.  Unless you want to play
-          with the AT32 as the SSC master, you probably want to say N here,
-          as this will give you better sound quality.
diff --git a/sound/soc/at32/Makefile b/sound/soc/at32/Makefile
deleted file mode 100644 (file)
index c03e55e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# AT32 Platform Support
-snd-soc-at32-objs := at32-pcm.o
-snd-soc-at32-ssc-objs := at32-ssc.o
-
-obj-$(CONFIG_SND_AT32_SOC) += snd-soc-at32.o
-obj-$(CONFIG_SND_AT32_SOC_SSC) += snd-soc-at32-ssc.o
-
-# AT32 Machine Support
-snd-soc-playpaq-objs := playpaq_wm8510.o
-
-obj-$(CONFIG_SND_AT32_SOC_PLAYPAQ) += snd-soc-playpaq.o
diff --git a/sound/soc/at32/at32-pcm.c b/sound/soc/at32/at32-pcm.c
deleted file mode 100644 (file)
index c83584f..0000000
+++ /dev/null
@@ -1,492 +0,0 @@
-/* sound/soc/at32/at32-pcm.c
- * ASoC PCM interface for Atmel AT32 SoC
- *
- * Copyright (C) 2008 Long Range Systems
- *    Geoffrey Wossum <gwossum@acm.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Note that this is basically a port of the sound/soc/at91-pcm.c to
- * the AVR32 kernel.  Thanks to Frank Mandarino for that code.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/dma-mapping.h>
-#include <linux/atmel_pdc.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include "at32-pcm.h"
-
-
-
-/*--------------------------------------------------------------------------*\
- * Hardware definition
-\*--------------------------------------------------------------------------*/
-/* TODO: These values were taken from the AT91 platform driver, check
- *      them against real values for AT32
- */
-static const struct snd_pcm_hardware at32_pcm_hardware = {
-       .info = (SNDRV_PCM_INFO_MMAP |
-                SNDRV_PCM_INFO_MMAP_VALID |
-                SNDRV_PCM_INFO_INTERLEAVED |
-                SNDRV_PCM_INFO_BLOCK_TRANSFER |
-                SNDRV_PCM_INFO_PAUSE),
-
-       .formats = SNDRV_PCM_FMTBIT_S16,
-       .period_bytes_min = 32,
-       .period_bytes_max = 8192,       /* 512 frames * 16 bytes / frame */
-       .periods_min = 2,
-       .periods_max = 1024,
-       .buffer_bytes_max = 32 * 1024,
-};
-
-
-
-/*--------------------------------------------------------------------------*\
- * Data types
-\*--------------------------------------------------------------------------*/
-struct at32_runtime_data {
-       struct at32_pcm_dma_params *params;
-       dma_addr_t dma_buffer;  /* physical address of DMA buffer */
-       dma_addr_t dma_buffer_end; /* first address beyond DMA buffer */
-       size_t period_size;
-
-       dma_addr_t period_ptr;  /* physical address of next period */
-       int periods;            /* period index of period_ptr */
-
-       /* Save PDC registers (for power management) */
-       u32 pdc_xpr_save;
-       u32 pdc_xcr_save;
-       u32 pdc_xnpr_save;
-       u32 pdc_xncr_save;
-};
-
-
-
-/*--------------------------------------------------------------------------*\
- * Helper functions
-\*--------------------------------------------------------------------------*/
-static int at32_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
-{
-       struct snd_pcm_substream *substream = pcm->streams[stream].substream;
-       struct snd_dma_buffer *dmabuf = &substream->dma_buffer;
-       size_t size = at32_pcm_hardware.buffer_bytes_max;
-
-       dmabuf->dev.type = SNDRV_DMA_TYPE_DEV;
-       dmabuf->dev.dev = pcm->card->dev;
-       dmabuf->private_data = NULL;
-       dmabuf->area = dma_alloc_coherent(pcm->card->dev, size,
-                                         &dmabuf->addr, GFP_KERNEL);
-       pr_debug("at32_pcm: preallocate_dma_buffer: "
-                "area=%p, addr=%p, size=%ld\n",
-                (void *)dmabuf->area, (void *)dmabuf->addr, size);
-
-       if (!dmabuf->area)
-               return -ENOMEM;
-
-       dmabuf->bytes = size;
-       return 0;
-}
-
-
-
-/*--------------------------------------------------------------------------*\
- * ISR
-\*--------------------------------------------------------------------------*/
-static void at32_pcm_dma_irq(u32 ssc_sr, struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *rtd = substream->runtime;
-       struct at32_runtime_data *prtd = rtd->private_data;
-       struct at32_pcm_dma_params *params = prtd->params;
-       static int count;
-
-       count++;
-       if (ssc_sr & params->mask->ssc_endbuf) {
-               pr_warning("at32-pcm: buffer %s on %s (SSC_SR=%#x, count=%d)\n",
-                          substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
-                          "underrun" : "overrun", params->name, ssc_sr, count);
-
-               /* re-start the PDC */
-               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                          params->mask->pdc_disable);
-               prtd->period_ptr += prtd->period_size;
-               if (prtd->period_ptr >= prtd->dma_buffer_end)
-                       prtd->period_ptr = prtd->dma_buffer;
-
-
-               ssc_writex(params->ssc->regs, params->pdc->xpr,
-                          prtd->period_ptr);
-               ssc_writex(params->ssc->regs, params->pdc->xcr,
-                          prtd->period_size / params->pdc_xfer_size);
-               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                          params->mask->pdc_enable);
-       }
-
-
-       if (ssc_sr & params->mask->ssc_endx) {
-               /* Load the PDC next pointer and counter registers */
-               prtd->period_ptr += prtd->period_size;
-               if (prtd->period_ptr >= prtd->dma_buffer_end)
-                       prtd->period_ptr = prtd->dma_buffer;
-               ssc_writex(params->ssc->regs, params->pdc->xnpr,
-                          prtd->period_ptr);
-               ssc_writex(params->ssc->regs, params->pdc->xncr,
-                          prtd->period_size / params->pdc_xfer_size);
-       }
-
-
-       snd_pcm_period_elapsed(substream);
-}
-
-
-
-/*--------------------------------------------------------------------------*\
- * PCM operations
-\*--------------------------------------------------------------------------*/
-static int at32_pcm_hw_params(struct snd_pcm_substream *substream,
-                             struct snd_pcm_hw_params *params)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at32_runtime_data *prtd = runtime->private_data;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-
-       /* this may get called several times by oss emulation
-        * with different params
-        */
-       snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
-       runtime->dma_bytes = params_buffer_bytes(params);
-
-       prtd->params = rtd->dai->cpu_dai->dma_data;
-       prtd->params->dma_intr_handler = at32_pcm_dma_irq;
-
-       prtd->dma_buffer = runtime->dma_addr;
-       prtd->dma_buffer_end = runtime->dma_addr + runtime->dma_bytes;
-       prtd->period_size = params_period_bytes(params);
-
-       pr_debug("hw_params: DMA for %s initialized "
-                "(dma_bytes=%ld, period_size=%ld)\n",
-                prtd->params->name, runtime->dma_bytes, prtd->period_size);
-
-       return 0;
-}
-
-
-
-static int at32_pcm_hw_free(struct snd_pcm_substream *substream)
-{
-       struct at32_runtime_data *prtd = substream->runtime->private_data;
-       struct at32_pcm_dma_params *params = prtd->params;
-
-       if (params != NULL) {
-               ssc_writex(params->ssc->regs, SSC_PDC_PTCR,
-                          params->mask->pdc_disable);
-               prtd->params->dma_intr_handler = NULL;
-       }
-
-       return 0;
-}
-
-
-
-static int at32_pcm_prepare(struct snd_pcm_substream *substream)
-{
-       struct at32_runtime_data *prtd = substream->runtime->private_data;
-       struct at32_pcm_dma_params *params = prtd->params;
-
-       ssc_writex(params->ssc->regs, SSC_IDR,
-                  params->mask->ssc_endx | params->mask->ssc_endbuf);
-       ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                  params->mask->pdc_disable);
-
-       return 0;
-}
-
-
-static int at32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-       struct snd_pcm_runtime *rtd = substream->runtime;
-       struct at32_runtime_data *prtd = rtd->private_data;
-       struct at32_pcm_dma_params *params = prtd->params;
-       int ret = 0;
-
-       pr_debug("at32_pcm_trigger: buffer_size = %ld, "
-                "dma_area = %p, dma_bytes = %ld\n",
-                rtd->buffer_size, rtd->dma_area, rtd->dma_bytes);
-
-       switch (cmd) {
-       case SNDRV_PCM_TRIGGER_START:
-               prtd->period_ptr = prtd->dma_buffer;
-
-               ssc_writex(params->ssc->regs, params->pdc->xpr,
-                          prtd->period_ptr);
-               ssc_writex(params->ssc->regs, params->pdc->xcr,
-                          prtd->period_size / params->pdc_xfer_size);
-
-               prtd->period_ptr += prtd->period_size;
-               ssc_writex(params->ssc->regs, params->pdc->xnpr,
-                          prtd->period_ptr);
-               ssc_writex(params->ssc->regs, params->pdc->xncr,
-                          prtd->period_size / params->pdc_xfer_size);
-
-               pr_debug("trigger: period_ptr=%lx, xpr=%x, "
-                        "xcr=%d, xnpr=%x, xncr=%d\n",
-                        (unsigned long)prtd->period_ptr,
-                        ssc_readx(params->ssc->regs, params->pdc->xpr),
-                        ssc_readx(params->ssc->regs, params->pdc->xcr),
-                        ssc_readx(params->ssc->regs, params->pdc->xnpr),
-                        ssc_readx(params->ssc->regs, params->pdc->xncr));
-
-               ssc_writex(params->ssc->regs, SSC_IER,
-                          params->mask->ssc_endx | params->mask->ssc_endbuf);
-               ssc_writex(params->ssc->regs, SSC_PDC_PTCR,
-                          params->mask->pdc_enable);
-
-               pr_debug("sr=%x, imr=%x\n",
-                        ssc_readx(params->ssc->regs, SSC_SR),
-                        ssc_readx(params->ssc->regs, SSC_IER));
-               break;          /* SNDRV_PCM_TRIGGER_START */
-
-
-
-       case SNDRV_PCM_TRIGGER_STOP:
-       case SNDRV_PCM_TRIGGER_SUSPEND:
-       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                          params->mask->pdc_disable);
-               break;
-
-
-       case SNDRV_PCM_TRIGGER_RESUME:
-       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                          params->mask->pdc_enable);
-               break;
-
-       default:
-               ret = -EINVAL;
-       }
-
-       return ret;
-}
-
-
-
-static snd_pcm_uframes_t at32_pcm_pointer(struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at32_runtime_data *prtd = runtime->private_data;
-       struct at32_pcm_dma_params *params = prtd->params;
-       dma_addr_t ptr;
-       snd_pcm_uframes_t x;
-
-       ptr = (dma_addr_t) ssc_readx(params->ssc->regs, params->pdc->xpr);
-       x = bytes_to_frames(runtime, ptr - prtd->dma_buffer);
-
-       if (x == runtime->buffer_size)
-               x = 0;
-
-       return x;
-}
-
-
-
-static int at32_pcm_open(struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at32_runtime_data *prtd;
-       int ret = 0;
-
-       snd_soc_set_runtime_hwparams(substream, &at32_pcm_hardware);
-
-       /* ensure that buffer size is a multiple of period size */
-       ret = snd_pcm_hw_constraint_integer(runtime,
-                                           SNDRV_PCM_HW_PARAM_PERIODS);
-       if (ret < 0)
-               goto out;
-
-       prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
-       if (prtd == NULL) {
-               ret = -ENOMEM;
-               goto out;
-       }
-       runtime->private_data = prtd;
-
-
-out:
-       return ret;
-}
-
-
-
-static int at32_pcm_close(struct snd_pcm_substream *substream)
-{
-       struct at32_runtime_data *prtd = substream->runtime->private_data;
-
-       kfree(prtd);
-       return 0;
-}
-
-
-static int at32_pcm_mmap(struct snd_pcm_substream *substream,
-                        struct vm_area_struct *vma)
-{
-       return remap_pfn_range(vma, vma->vm_start,
-                              substream->dma_buffer.addr >> PAGE_SHIFT,
-                              vma->vm_end - vma->vm_start, vma->vm_page_prot);
-}
-
-
-
-static struct snd_pcm_ops at32_pcm_ops = {
-       .open = at32_pcm_open,
-       .close = at32_pcm_close,
-       .ioctl = snd_pcm_lib_ioctl,
-       .hw_params = at32_pcm_hw_params,
-       .hw_free = at32_pcm_hw_free,
-       .prepare = at32_pcm_prepare,
-       .trigger = at32_pcm_trigger,
-       .pointer = at32_pcm_pointer,
-       .mmap = at32_pcm_mmap,
-};
-
-
-
-/*--------------------------------------------------------------------------*\
- * ASoC platform driver
-\*--------------------------------------------------------------------------*/
-static u64 at32_pcm_dmamask = 0xffffffff;
-
-static int at32_pcm_new(struct snd_card *card,
-                       struct snd_soc_dai *dai,
-                       struct snd_pcm *pcm)
-{
-       int ret = 0;
-
-       if (!card->dev->dma_mask)
-               card->dev->dma_mask = &at32_pcm_dmamask;
-       if (!card->dev->coherent_dma_mask)
-               card->dev->coherent_dma_mask = 0xffffffff;
-
-       if (dai->playback.channels_min) {
-               ret = at32_pcm_preallocate_dma_buffer(
-                         pcm, SNDRV_PCM_STREAM_PLAYBACK);
-               if (ret)
-                       goto out;
-       }
-
-       if (dai->capture.channels_min) {
-               pr_debug("at32-pcm: Allocating PCM capture DMA buffer\n");
-               ret = at32_pcm_preallocate_dma_buffer(
-                         pcm, SNDRV_PCM_STREAM_CAPTURE);
-               if (ret)
-                       goto out;
-       }
-
-
-out:
-       return ret;
-}
-
-
-
-static void at32_pcm_free_dma_buffers(struct snd_pcm *pcm)
-{
-       struct snd_pcm_substream *substream;
-       struct snd_dma_buffer *buf;
-       int stream;
-
-       for (stream = 0; stream < 2; stream++) {
-               substream = pcm->streams[stream].substream;
-               if (substream == NULL)
-                       continue;
-
-               buf = &substream->dma_buffer;
-               if (!buf->area)
-                       continue;
-               dma_free_coherent(pcm->card->dev, buf->bytes,
-                                 buf->area, buf->addr);
-               buf->area = NULL;
-       }
-}
-
-
-
-#ifdef CONFIG_PM
-static int at32_pcm_suspend(struct platform_device *pdev,
-                           struct snd_soc_dai *dai)
-{
-       struct snd_pcm_runtime *runtime = dai->runtime;
-       struct at32_runtime_data *prtd;
-       struct at32_pcm_dma_params *params;
-
-       if (runtime == NULL)
-               return 0;
-       prtd = runtime->private_data;
-       params = prtd->params;
-
-       /* Disable the PDC and save the PDC registers */
-       ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
-                  params->mask->pdc_disable);
-
-       prtd->pdc_xpr_save = ssc_readx(params->ssc->regs, params->pdc->xpr);
-       prtd->pdc_xcr_save = ssc_readx(params->ssc->regs, params->pdc->xcr);
-       prtd->pdc_xnpr_save = ssc_readx(params->ssc->regs, params->pdc->xnpr);
-       prtd->pdc_xncr_save = ssc_readx(params->ssc->regs, params->pdc->xncr);
-
-       return 0;
-}
-
-
-
-static int at32_pcm_resume(struct platform_device *pdev,
-                          struct snd_soc_dai *dai)
-{
-       struct snd_pcm_runtime *runtime = dai->runtime;
-       struct at32_runtime_data *prtd;
-       struct at32_pcm_dma_params *params;
-
-       if (runtime == NULL)
-               return 0;
-       prtd = runtime->private_data;
-       params = prtd->params;
-
-       /* Restore the PDC registers and enable the PDC */
-       ssc_writex(params->ssc->regs, params->pdc->xpr, prtd->pdc_xpr_save);
-       ssc_writex(params->ssc->regs, params->pdc->xcr, prtd->pdc_xcr_save);
-       ssc_writex(params->ssc->regs, params->pdc->xnpr, prtd->pdc_xnpr_save);
-       ssc_writex(params->ssc->regs, params->pdc->xncr, prtd->pdc_xncr_save);
-
-       ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR, params->mask->pdc_enable);
-       return 0;
-}
-#else /* CONFIG_PM */
-#  define at32_pcm_suspend     NULL
-#  define at32_pcm_resume      NULL
-#endif /* CONFIG_PM */
-
-
-
-struct snd_soc_platform at32_soc_platform = {
-       .name = "at32-audio",
-       .pcm_ops = &at32_pcm_ops,
-       .pcm_new = at32_pcm_new,
-       .pcm_free = at32_pcm_free_dma_buffers,
-       .suspend = at32_pcm_suspend,
-       .resume = at32_pcm_resume,
-};
-EXPORT_SYMBOL_GPL(at32_soc_platform);
-
-
-
-MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>");
-MODULE_DESCRIPTION("Atmel AT32 PCM module");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/at32/at32-pcm.h b/sound/soc/at32/at32-pcm.h
deleted file mode 100644 (file)
index 2a52430..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* sound/soc/at32/at32-pcm.h
- * ASoC PCM interface for Atmel AT32 SoC
- *
- * Copyright (C) 2008 Long Range Systems
- *    Geoffrey Wossum <gwossum@acm.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __SOUND_SOC_AT32_AT32_PCM_H
-#define __SOUND_SOC_AT32_AT32_PCM_H __FILE__
-
-#include <linux/atmel-ssc.h>
-
-
-/*
- * Registers and status bits that are required by the PCM driver
- * TODO: Is ptcr really used?
- */
-struct at32_pdc_regs {
-       u32 xpr;                /* PDC RX/TX pointer */
-       u32 xcr;                /* PDC RX/TX counter */
-       u32 xnpr;               /* PDC next RX/TX pointer */
-       u32 xncr;               /* PDC next RX/TX counter */
-       u32 ptcr;               /* PDC transfer control */
-};
-
-
-
-/*
- * SSC mask info
- */
-struct at32_ssc_mask {
-       u32 ssc_enable;         /* SSC RX/TX enable */
-       u32 ssc_disable;        /* SSC RX/TX disable */
-       u32 ssc_endx;           /* SSC ENDTX or ENDRX */
-       u32 ssc_endbuf;         /* SSC TXBUFF or RXBUFF */
-       u32 pdc_enable;         /* PDC RX/TX enable */
-       u32 pdc_disable;        /* PDC RX/TX disable */
-};
-
-
-
-/*
- * This structure, shared between the PCM driver and the interface,
- * contains all information required by the PCM driver to perform the
- * PDC DMA operation.  All fields except dma_intr_handler() are initialized
- * by the interface.  The dms_intr_handler() pointer is set by the PCM
- * driver and called by the interface SSC interrupt handler if it is
- * non-NULL.
- */
-struct at32_pcm_dma_params {
-       char *name;             /* stream identifier */
-       int pdc_xfer_size;      /* PDC counter increment in bytes */
-       struct ssc_device *ssc; /* SSC device for stream */
-       struct at32_pdc_regs *pdc;      /* PDC register info */
-       struct at32_ssc_mask *mask;     /* SSC mask info */
-       struct snd_pcm_substream *substream;
-       void (*dma_intr_handler) (u32, struct snd_pcm_substream *);
-};
-
-
-
-/*
- * The AT32 ASoC platform driver
- */
-extern struct snd_soc_platform at32_soc_platform;
-
-
-
-/*
- * SSC register access (since ssc_writel() / ssc_readl() require literal name)
- */
-#define ssc_readx(base, reg)            (__raw_readl((base) + (reg)))
-#define ssc_writex(base, reg, value)    __raw_writel((value), (base) + (reg))
-
-#endif /* __SOUND_SOC_AT32_AT32_PCM_H */
diff --git a/sound/soc/at32/at32-ssc.c b/sound/soc/at32/at32-ssc.c
deleted file mode 100644 (file)
index 4ef6492..0000000
+++ /dev/null
@@ -1,849 +0,0 @@
-/* sound/soc/at32/at32-ssc.c
- * ASoC platform driver for AT32 using SSC as DAI
- *
- * Copyright (C) 2008 Long Range Systems
- *    Geoffrey Wossum <gwossum@acm.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Note that this is basically a port of the sound/soc/at91-ssc.c to
- * the AVR32 kernel.  Thanks to Frank Mandarino for that code.
- */
-
-/* #define DEBUG */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/atmel_pdc.h>
-#include <linux/atmel-ssc.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-
-#include "at32-pcm.h"
-#include "at32-ssc.h"
-
-
-
-/*-------------------------------------------------------------------------*\
- * Constants
-\*-------------------------------------------------------------------------*/
-#define NUM_SSC_DEVICES                3
-
-/*
- * SSC direction masks
- */
-#define SSC_DIR_MASK_UNUSED    0
-#define SSC_DIR_MASK_PLAYBACK  1
-#define SSC_DIR_MASK_CAPTURE   2
-
-/*
- * SSC register values that Atmel left out of <linux/atmel-ssc.h>.  These
- * are expected to be used with SSC_BF
- */
-/* START bit field values */
-#define SSC_START_CONTINUOUS   0
-#define SSC_START_TX_RX                1
-#define SSC_START_LOW_RF       2
-#define SSC_START_HIGH_RF      3
-#define SSC_START_FALLING_RF   4
-#define SSC_START_RISING_RF    5
-#define SSC_START_LEVEL_RF     6
-#define SSC_START_EDGE_RF      7
-#define SSS_START_COMPARE_0    8
-
-/* CKI bit field values */
-#define SSC_CKI_FALLING                0
-#define SSC_CKI_RISING         1
-
-/* CKO bit field values */
-#define SSC_CKO_NONE           0
-#define SSC_CKO_CONTINUOUS     1
-#define SSC_CKO_TRANSFER       2
-
-/* CKS bit field values */
-#define SSC_CKS_DIV            0
-#define SSC_CKS_CLOCK          1
-#define SSC_CKS_PIN            2
-
-/* FSEDGE bit field values */
-#define SSC_FSEDGE_POSITIVE    0
-#define SSC_FSEDGE_NEGATIVE    1
-
-/* FSOS bit field values */
-#define SSC_FSOS_NONE          0
-#define SSC_FSOS_NEGATIVE      1
-#define SSC_FSOS_POSITIVE      2
-#define SSC_FSOS_LOW           3
-#define SSC_FSOS_HIGH          4
-#define SSC_FSOS_TOGGLE                5
-
-#define START_DELAY            1
-
-
-
-/*-------------------------------------------------------------------------*\
- * Module data
-\*-------------------------------------------------------------------------*/
-/*
- * SSC PDC registered required by the PCM DMA engine
- */
-static struct at32_pdc_regs pdc_tx_reg = {
-       .xpr = SSC_PDC_TPR,
-       .xcr = SSC_PDC_TCR,
-       .xnpr = SSC_PDC_TNPR,
-       .xncr = SSC_PDC_TNCR,
-};
-
-
-
-static struct at32_pdc_regs pdc_rx_reg = {
-       .xpr = SSC_PDC_RPR,
-       .xcr = SSC_PDC_RCR,
-       .xnpr = SSC_PDC_RNPR,
-       .xncr = SSC_PDC_RNCR,
-};
-
-
-
-/*
- * SSC and PDC status bits for transmit and receive
- */
-static struct at32_ssc_mask ssc_tx_mask = {
-       .ssc_enable = SSC_BIT(CR_TXEN),
-       .ssc_disable = SSC_BIT(CR_TXDIS),
-       .ssc_endx = SSC_BIT(SR_ENDTX),
-       .ssc_endbuf = SSC_BIT(SR_TXBUFE),
-       .pdc_enable = SSC_BIT(PDC_PTCR_TXTEN),
-       .pdc_disable = SSC_BIT(PDC_PTCR_TXTDIS),
-};
-
-
-
-static struct at32_ssc_mask ssc_rx_mask = {
-       .ssc_enable = SSC_BIT(CR_RXEN),
-       .ssc_disable = SSC_BIT(CR_RXDIS),
-       .ssc_endx = SSC_BIT(SR_ENDRX),
-       .ssc_endbuf = SSC_BIT(SR_RXBUFF),
-       .pdc_enable = SSC_BIT(PDC_PTCR_RXTEN),
-       .pdc_disable = SSC_BIT(PDC_PTCR_RXTDIS),
-};
-
-
-
-/*
- * DMA parameters for each SSC
- */
-static struct at32_pcm_dma_params ssc_dma_params[NUM_SSC_DEVICES][2] = {
-       {
-        {
-         .name = "SSC0 PCM out",
-         .pdc = &pdc_tx_reg,
-         .mask = &ssc_tx_mask,
-         },
-        {
-         .name = "SSC0 PCM in",
-         .pdc = &pdc_rx_reg,
-         .mask = &ssc_rx_mask,
-         },
-        },
-       {
-        {
-         .name = "SSC1 PCM out",
-         .pdc = &pdc_tx_reg,
-         .mask = &ssc_tx_mask,
-         },
-        {
-         .name = "SSC1 PCM in",
-         .pdc = &pdc_rx_reg,
-         .mask = &ssc_rx_mask,
-         },
-        },
-       {
-        {
-         .name = "SSC2 PCM out",
-         .pdc = &pdc_tx_reg,
-         .mask = &ssc_tx_mask,
-         },
-        {
-         .name = "SSC2 PCM in",
-         .pdc = &pdc_rx_reg,
-         .mask = &ssc_rx_mask,
-         },
-        },
-};
-
-
-
-static struct at32_ssc_info ssc_info[NUM_SSC_DEVICES] = {
-       {
-        .name = "ssc0",
-        .lock = __SPIN_LOCK_UNLOCKED(ssc_info[0].lock),
-        .dir_mask = SSC_DIR_MASK_UNUSED,
-        .initialized = 0,
-        },
-       {
-        .name = "ssc1",
-        .lock = __SPIN_LOCK_UNLOCKED(ssc_info[1].lock),
-        .dir_mask = SSC_DIR_MASK_UNUSED,
-        .initialized = 0,
-        },
-       {
-        .name = "ssc2",
-        .lock = __SPIN_LOCK_UNLOCKED(ssc_info[2].lock),
-        .dir_mask = SSC_DIR_MASK_UNUSED,
-        .initialized = 0,
-        },
-};
-
-
-
-
-/*-------------------------------------------------------------------------*\
- * ISR
-\*-------------------------------------------------------------------------*/
-/*
- * SSC interrupt handler.  Passes PDC interrupts to the DMA interrupt
- * handler in the PCM driver.
- */
-static irqreturn_t at32_ssc_interrupt(int irq, void *dev_id)
-{
-       struct at32_ssc_info *ssc_p = dev_id;
-       struct at32_pcm_dma_params *dma_params;
-       u32 ssc_sr;
-       u32 ssc_substream_mask;
-       int i;
-
-       ssc_sr = (ssc_readl(ssc_p->ssc->regs, SR) &
-                 ssc_readl(ssc_p->ssc->regs, IMR));
-
-       /*
-        * Loop through substreams attached to this SSC.  If a DMA-related
-        * interrupt occured on that substream, call the DMA interrupt
-        * handler function, if one has been registered in the dma_param
-        * structure by the PCM driver.
-        */
-       for (i = 0; i < ARRAY_SIZE(ssc_p->dma_params); i++) {
-               dma_params = ssc_p->dma_params[i];
-
-               if ((dma_params != NULL) &&
-                   (dma_params->dma_intr_handler != NULL)) {
-                       ssc_substream_mask = (dma_params->mask->ssc_endx |
-                                             dma_params->mask->ssc_endbuf);
-                       if (ssc_sr & ssc_substream_mask) {
-                               dma_params->dma_intr_handler(ssc_sr,
-                                                            dma_params->
-                                                            substream);
-                       }
-               }
-       }
-
-
-       return IRQ_HANDLED;
-}
-
-/*-------------------------------------------------------------------------*\
- * DAI functions
-\*-------------------------------------------------------------------------*/
-/*
- * Startup.  Only that one substream allowed in each direction.
- */
-static int at32_ssc_startup(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at32_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       int dir_mask;
-
-       dir_mask = ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
-                   SSC_DIR_MASK_PLAYBACK : SSC_DIR_MASK_CAPTURE);
-
-       spin_lock_irq(&ssc_p->lock);
-       if (ssc_p->dir_mask & dir_mask) {
-               spin_unlock_irq(&ssc_p->lock);
-               return -EBUSY;
-       }
-       ssc_p->dir_mask |= dir_mask;
-       spin_unlock_irq(&ssc_p->lock);
-
-       return 0;
-}
-
-
-
-/*
- * Shutdown.  Clear DMA parameters and shutdown the SSC if there
- * are no other substreams open.
- */
-static void at32_ssc_shutdown(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at32_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       struct at32_pcm_dma_params *dma_params;
-       int dir_mask;
-
-       dma_params = ssc_p->dma_params[substream->stream];
-
-       if (dma_params != NULL) {
-               ssc_writel(dma_params->ssc->regs, CR,
-                          dma_params->mask->ssc_disable);
-               pr_debug("%s disabled SSC_SR=0x%08x\n",
-                        (substream->stream ? "receiver" : "transmit"),
-                        ssc_readl(ssc_p->ssc->regs, SR));
-
-               dma_params->ssc = NULL;
-               dma_params->substream = NULL;
-               ssc_p->dma_params[substream->stream] = NULL;
-       }
-
-
-       dir_mask = 1 << substream->stream;
-       spin_lock_irq(&ssc_p->lock);
-       ssc_p->dir_mask &= ~dir_mask;
-       if (!ssc_p->dir_mask) {
-               /* Shutdown the SSC clock */
-               pr_debug("at32-ssc: Stopping user %d clock\n",
-                        ssc_p->ssc->user);
-               clk_disable(ssc_p->ssc->clk);
-
-               if (ssc_p->initialized) {
-                       free_irq(ssc_p->ssc->irq, ssc_p);
-                       ssc_p->initialized = 0;
-               }
-
-               /* Reset the SSC */
-               ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST));
-
-               /* clear the SSC dividers */
-               ssc_p->cmr_div = 0;
-               ssc_p->tcmr_period = 0;
-               ssc_p->rcmr_period = 0;
-       }
-       spin_unlock_irq(&ssc_p->lock);
-}
-
-
-
-/*
- * Set the SSC system clock rate
- */
-static int at32_ssc_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
-                                  int clk_id, unsigned int freq, int dir)
-{
-       /* TODO: What the heck do I do here? */
-       return 0;
-}
-
-
-
-/*
- * Record DAI format for use by hw_params()
- */
-static int at32_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
-                               unsigned int fmt)
-{
-       struct at32_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
-
-       ssc_p->daifmt = fmt;
-       return 0;
-}
-
-
-
-/*
- * Record SSC clock dividers for use in hw_params()
- */
-static int at32_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
-                                  int div_id, int div)
-{
-       struct at32_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
-
-       switch (div_id) {
-       case AT32_SSC_CMR_DIV:
-               /*
-                * The same master clock divider is used for both
-                * transmit and receive, so if a value has already
-                * been set, it must match this value
-                */
-               if (ssc_p->cmr_div == 0)
-                       ssc_p->cmr_div = div;
-               else if (div != ssc_p->cmr_div)
-                       return -EBUSY;
-               break;
-
-       case AT32_SSC_TCMR_PERIOD:
-               ssc_p->tcmr_period = div;
-               break;
-
-       case AT32_SSC_RCMR_PERIOD:
-               ssc_p->rcmr_period = div;
-               break;
-
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-
-
-/*
- * Configure the SSC
- */
-static int at32_ssc_hw_params(struct snd_pcm_substream *substream,
-                             struct snd_pcm_hw_params *params)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       int id = rtd->dai->cpu_dai->id;
-       struct at32_ssc_info *ssc_p = &ssc_info[id];
-       struct at32_pcm_dma_params *dma_params;
-       int channels, bits;
-       u32 tfmr, rfmr, tcmr, rcmr;
-       int start_event;
-       int ret;
-
-
-       /*
-        * Currently, there is only one set of dma_params for each direction.
-        * If more are added, this code will have to be changed to select
-        * the proper set
-        */
-       dma_params = &ssc_dma_params[id][substream->stream];
-       dma_params->ssc = ssc_p->ssc;
-       dma_params->substream = substream;
-
-       ssc_p->dma_params[substream->stream] = dma_params;
-
-
-       /*
-        * The cpu_dai->dma_data field is only used to communicate the
-        * appropriate DMA parameters to the PCM driver's hw_params()
-        * function.  It should not be used for other purposes as it
-        * is common to all substreams.
-        */
-       rtd->dai->cpu_dai->dma_data = dma_params;
-
-       channels = params_channels(params);
-
-
-       /*
-        * Determine sample size in bits and the PDC increment
-        */
-       switch (params_format(params)) {
-       case SNDRV_PCM_FORMAT_S8:
-               bits = 8;
-               dma_params->pdc_xfer_size = 1;
-               break;
-
-       case SNDRV_PCM_FORMAT_S16:
-               bits = 16;
-               dma_params->pdc_xfer_size = 2;
-               break;
-
-       case SNDRV_PCM_FORMAT_S24:
-               bits = 24;
-               dma_params->pdc_xfer_size = 4;
-               break;
-
-       case SNDRV_PCM_FORMAT_S32:
-               bits = 32;
-               dma_params->pdc_xfer_size = 4;
-               break;
-
-       default:
-               pr_warning("at32-ssc: Unsupported PCM format %d",
-                          params_format(params));
-               return -EINVAL;
-       }
-       pr_debug("at32-ssc: bits = %d, pdc_xfer_size = %d, channels = %d\n",
-                bits, dma_params->pdc_xfer_size, channels);
-
-
-       /*
-        * The SSC only supports up to 16-bit samples in I2S format, due
-        * to the size of the Frame Mode Register FSLEN field.
-        */
-       if ((ssc_p->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S)
-               if (bits > 16) {
-                       pr_warning("at32-ssc: "
-                                  "sample size %d is too large for I2S\n",
-                                  bits);
-                       return -EINVAL;
-               }
-
-
-       /*
-        * Compute the SSC register settings
-        */
-       switch (ssc_p->daifmt & (SND_SOC_DAIFMT_FORMAT_MASK |
-                                SND_SOC_DAIFMT_MASTER_MASK)) {
-       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS:
-               /*
-                * I2S format, SSC provides BCLK and LRS clocks.
-                *
-                * The SSC transmit and receive clocks are generated from the
-                * MCK divider, and the BCLK signal is output on the SSC TK line
-                */
-               pr_debug("at32-ssc: SSC mode is I2S BCLK / FRAME master\n");
-               rcmr = (SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) |
-                       SSC_BF(RCMR_STTDLY, START_DELAY) |
-                       SSC_BF(RCMR_START, SSC_START_FALLING_RF) |
-                       SSC_BF(RCMR_CKI, SSC_CKI_RISING) |
-                       SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
-                       SSC_BF(RCMR_CKS, SSC_CKS_DIV));
-
-               rfmr = (SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(RFMR_FSOS, SSC_FSOS_NEGATIVE) |
-                       SSC_BF(RFMR_FSLEN, bits - 1) |
-                       SSC_BF(RFMR_DATNB, channels - 1) |
-                       SSC_BIT(RFMR_MSBF) | SSC_BF(RFMR_DATLEN, bits - 1));
-
-               tcmr = (SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) |
-                       SSC_BF(TCMR_STTDLY, START_DELAY) |
-                       SSC_BF(TCMR_START, SSC_START_FALLING_RF) |
-                       SSC_BF(TCMR_CKI, SSC_CKI_FALLING) |
-                       SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) |
-                       SSC_BF(TCMR_CKS, SSC_CKS_DIV));
-
-               tfmr = (SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(TFMR_FSOS, SSC_FSOS_NEGATIVE) |
-                       SSC_BF(TFMR_FSLEN, bits - 1) |
-                       SSC_BF(TFMR_DATNB, channels - 1) | SSC_BIT(TFMR_MSBF) |
-                       SSC_BF(TFMR_DATLEN, bits - 1));
-               break;
-
-
-       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
-               /*
-                * I2S format, CODEC supplies BCLK and LRC clock.
-                *
-                * The SSC transmit clock is obtained from the BCLK signal
-                * on the TK line, and the SSC receive clock is generated from
-                * the transmit clock.
-                *
-                * For single channel data, one sample is transferred on the
-                * falling edge of the LRC clock.  For two channel data, one
-                * sample is transferred on both edges of the LRC clock.
-                */
-               pr_debug("at32-ssc: SSC mode is I2S BCLK / FRAME slave\n");
-               start_event = ((channels == 1) ?
-                              SSC_START_FALLING_RF : SSC_START_EDGE_RF);
-
-               rcmr = (SSC_BF(RCMR_STTDLY, START_DELAY) |
-                       SSC_BF(RCMR_START, start_event) |
-                       SSC_BF(RCMR_CKI, SSC_CKI_RISING) |
-                       SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
-                       SSC_BF(RCMR_CKS, SSC_CKS_CLOCK));
-
-               rfmr = (SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) |
-                       SSC_BIT(RFMR_MSBF) | SSC_BF(RFMR_DATLEN, bits - 1));
-
-               tcmr = (SSC_BF(TCMR_STTDLY, START_DELAY) |
-                       SSC_BF(TCMR_START, start_event) |
-                       SSC_BF(TCMR_CKI, SSC_CKI_FALLING) |
-                       SSC_BF(TCMR_CKO, SSC_CKO_NONE) |
-                       SSC_BF(TCMR_CKS, SSC_CKS_PIN));
-
-               tfmr = (SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) |
-                       SSC_BIT(TFMR_MSBF) | SSC_BF(TFMR_DATLEN, bits - 1));
-               break;
-
-
-       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS:
-               /*
-                * DSP/PCM Mode A format, SSC provides BCLK and LRC clocks.
-                *
-                * The SSC transmit and receive clocks are generated from the
-                * MCK divider, and the BCLK signal is output on the SSC TK line
-                */
-               pr_debug("at32-ssc: SSC mode is DSP A BCLK / FRAME master\n");
-               rcmr = (SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) |
-                       SSC_BF(RCMR_STTDLY, 1) |
-                       SSC_BF(RCMR_START, SSC_START_RISING_RF) |
-                       SSC_BF(RCMR_CKI, SSC_CKI_RISING) |
-                       SSC_BF(RCMR_CKO, SSC_CKO_NONE) |
-                       SSC_BF(RCMR_CKS, SSC_CKS_DIV));
-
-               rfmr = (SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(RFMR_FSOS, SSC_FSOS_POSITIVE) |
-                       SSC_BF(RFMR_DATNB, channels - 1) |
-                       SSC_BIT(RFMR_MSBF) | SSC_BF(RFMR_DATLEN, bits - 1));
-
-               tcmr = (SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) |
-                       SSC_BF(TCMR_STTDLY, 1) |
-                       SSC_BF(TCMR_START, SSC_START_RISING_RF) |
-                       SSC_BF(TCMR_CKI, SSC_CKI_RISING) |
-                       SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) |
-                       SSC_BF(TCMR_CKS, SSC_CKS_DIV));
-
-               tfmr = (SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE) |
-                       SSC_BF(TFMR_FSOS, SSC_FSOS_POSITIVE) |
-                       SSC_BF(TFMR_DATNB, channels - 1) |
-                       SSC_BIT(TFMR_MSBF) | SSC_BF(TFMR_DATLEN, bits - 1));
-               break;
-
-
-       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM:
-       default:
-               pr_warning("at32-ssc: unsupported DAI format 0x%x\n",
-                          ssc_p->daifmt);
-               return -EINVAL;
-               break;
-       }
-       pr_debug("at32-ssc: RCMR=%08x RFMR=%08x TCMR=%08x TFMR=%08x\n",
-                rcmr, rfmr, tcmr, tfmr);
-
-
-       if (!ssc_p->initialized) {
-               /* enable peripheral clock */
-               pr_debug("at32-ssc: Starting clock\n");
-               clk_enable(ssc_p->ssc->clk);
-
-               /* Reset the SSC and its PDC registers */
-               ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST));
-
-               ssc_writel(ssc_p->ssc->regs, PDC_RPR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_RCR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_RNPR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_RNCR, 0);
-
-               ssc_writel(ssc_p->ssc->regs, PDC_TPR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_TCR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_TNPR, 0);
-               ssc_writel(ssc_p->ssc->regs, PDC_TNCR, 0);
-
-               ret = request_irq(ssc_p->ssc->irq, at32_ssc_interrupt, 0,
-                                 ssc_p->name, ssc_p);
-               if (ret < 0) {
-                       pr_warning("at32-ssc: request irq failed (%d)\n", ret);
-                       pr_debug("at32-ssc: Stopping clock\n");
-                       clk_disable(ssc_p->ssc->clk);
-                       return ret;
-               }
-
-               ssc_p->initialized = 1;
-       }
-
-       /* Set SSC clock mode register */
-       ssc_writel(ssc_p->ssc->regs, CMR, ssc_p->cmr_div);
-
-       /* set receive clock mode and format */
-       ssc_writel(ssc_p->ssc->regs, RCMR, rcmr);
-       ssc_writel(ssc_p->ssc->regs, RFMR, rfmr);
-
-       /* set transmit clock mode and format */
-       ssc_writel(ssc_p->ssc->regs, TCMR, tcmr);
-       ssc_writel(ssc_p->ssc->regs, TFMR, tfmr);
-
-       pr_debug("at32-ssc: SSC initialized\n");
-       return 0;
-}
-
-
-
-static int at32_ssc_prepare(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at32_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       struct at32_pcm_dma_params *dma_params;
-
-       dma_params = ssc_p->dma_params[substream->stream];
-
-       ssc_writel(dma_params->ssc->regs, CR, dma_params->mask->ssc_enable);
-
-       return 0;
-}
-
-
-
-#ifdef CONFIG_PM
-static int at32_ssc_suspend(struct platform_device *pdev,
-                           struct snd_soc_dai *cpu_dai)
-{
-       struct at32_ssc_info *ssc_p;
-
-       if (!cpu_dai->active)
-               return 0;
-
-       ssc_p = &ssc_info[cpu_dai->id];
-
-       /* Save the status register before disabling transmit and receive */
-       ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
-       ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_TXDIS) | SSC_BIT(CR_RXDIS));
-
-       /* Save the current interrupt mask, then disable unmasked interrupts */
-       ssc_p->ssc_state.ssc_imr = ssc_readl(ssc_p->ssc->regs, IMR);
-       ssc_writel(ssc_p->ssc->regs, IDR, ssc_p->ssc_state.ssc_imr);
-
-       ssc_p->ssc_state.ssc_cmr = ssc_readl(ssc_p->ssc->regs, CMR);
-       ssc_p->ssc_state.ssc_rcmr = ssc_readl(ssc_p->ssc->regs, RCMR);
-       ssc_p->ssc_state.ssc_rfmr = ssc_readl(ssc_p->ssc->regs, RFMR);
-       ssc_p->ssc_state.ssc_tcmr = ssc_readl(ssc_p->ssc->regs, TCMR);
-       ssc_p->ssc_state.ssc_tfmr = ssc_readl(ssc_p->ssc->regs, TFMR);
-
-       return 0;
-}
-
-
-
-static int at32_ssc_resume(struct platform_device *pdev,
-                          struct snd_soc_dai *cpu_dai)
-{
-       struct at32_ssc_info *ssc_p;
-       u32 cr;
-
-       if (!cpu_dai->active)
-               return 0;
-
-       ssc_p = &ssc_info[cpu_dai->id];
-
-       /* restore SSC register settings */
-       ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
-       ssc_writel(ssc_p->ssc->regs, TCMR, ssc_p->ssc_state.ssc_tcmr);
-       ssc_writel(ssc_p->ssc->regs, RFMR, ssc_p->ssc_state.ssc_rfmr);
-       ssc_writel(ssc_p->ssc->regs, RCMR, ssc_p->ssc_state.ssc_rcmr);
-       ssc_writel(ssc_p->ssc->regs, CMR, ssc_p->ssc_state.ssc_cmr);
-
-       /* re-enable interrupts */
-       ssc_writel(ssc_p->ssc->regs, IER, ssc_p->ssc_state.ssc_imr);
-
-       /* Re-enable recieve and transmit as appropriate */
-       cr = 0;
-       cr |=
-           (ssc_p->ssc_state.ssc_sr & SSC_BIT(SR_RXEN)) ? SSC_BIT(CR_RXEN) : 0;
-       cr |=
-           (ssc_p->ssc_state.ssc_sr & SSC_BIT(SR_TXEN)) ? SSC_BIT(CR_TXEN) : 0;
-       ssc_writel(ssc_p->ssc->regs, CR, cr);
-
-       return 0;
-}
-#else /* CONFIG_PM */
-#  define at32_ssc_suspend     NULL
-#  define at32_ssc_resume      NULL
-#endif /* CONFIG_PM */
-
-
-#define AT32_SSC_RATES \
-    (SNDRV_PCM_RATE_8000  | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
-     SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
-     SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
-
-
-#define AT32_SSC_FORMATS \
-    (SNDRV_PCM_FMTBIT_S8  | SNDRV_PCM_FMTBIT_S16 | \
-     SNDRV_PCM_FMTBIT_S24 | SNDRV_PCM_FMTBIT_S32)
-
-
-struct snd_soc_dai at32_ssc_dai[NUM_SSC_DEVICES] = {
-       {
-        .name = "at32-ssc0",
-        .id = 0,
-        .type = SND_SOC_DAI_PCM,
-        .suspend = at32_ssc_suspend,
-        .resume = at32_ssc_resume,
-        .playback = {
-                     .channels_min = 1,
-                     .channels_max = 2,
-                     .rates = AT32_SSC_RATES,
-                     .formats = AT32_SSC_FORMATS,
-                     },
-        .capture = {
-                    .channels_min = 1,
-                    .channels_max = 2,
-                    .rates = AT32_SSC_RATES,
-                    .formats = AT32_SSC_FORMATS,
-                    },
-        .ops = {
-                .startup = at32_ssc_startup,
-                .shutdown = at32_ssc_shutdown,
-                .prepare = at32_ssc_prepare,
-                .hw_params = at32_ssc_hw_params,
-                },
-        .dai_ops = {
-                    .set_sysclk = at32_ssc_set_dai_sysclk,
-                    .set_fmt = at32_ssc_set_dai_fmt,
-                    .set_clkdiv = at32_ssc_set_dai_clkdiv,
-                    },
-        .private_data = &ssc_info[0],
-        },
-       {
-        .name = "at32-ssc1",
-        .id = 1,
-        .type = SND_SOC_DAI_PCM,
-        .suspend = at32_ssc_suspend,
-        .resume = at32_ssc_resume,
-        .playback = {
-                     .channels_min = 1,
-                     .channels_max = 2,
-                     .rates = AT32_SSC_RATES,
-                     .formats = AT32_SSC_FORMATS,
-                     },
-        .capture = {
-                    .channels_min = 1,
-                    .channels_max = 2,
-                    .rates = AT32_SSC_RATES,
-                    .formats = AT32_SSC_FORMATS,
-                    },
-        .ops = {
-                .startup = at32_ssc_startup,
-                .shutdown = at32_ssc_shutdown,
-                .prepare = at32_ssc_prepare,
-                .hw_params = at32_ssc_hw_params,
-                },
-        .dai_ops = {
-                    .set_sysclk = at32_ssc_set_dai_sysclk,
-                    .set_fmt = at32_ssc_set_dai_fmt,
-                    .set_clkdiv = at32_ssc_set_dai_clkdiv,
-                    },
-        .private_data = &ssc_info[1],
-        },
-       {
-        .name = "at32-ssc2",
-        .id = 2,
-        .type = SND_SOC_DAI_PCM,
-        .suspend = at32_ssc_suspend,
-        .resume = at32_ssc_resume,
-        .playback = {
-                     .channels_min = 1,
-                     .channels_max = 2,
-                     .rates = AT32_SSC_RATES,
-                     .formats = AT32_SSC_FORMATS,
-                     },
-        .capture = {
-                    .channels_min = 1,
-                    .channels_max = 2,
-                    .rates = AT32_SSC_RATES,
-                    .formats = AT32_SSC_FORMATS,
-                    },
-        .ops = {
-                .startup = at32_ssc_startup,
-                .shutdown = at32_ssc_shutdown,
-                .prepare = at32_ssc_prepare,
-                .hw_params = at32_ssc_hw_params,
-                },
-        .dai_ops = {
-                    .set_sysclk = at32_ssc_set_dai_sysclk,
-                    .set_fmt = at32_ssc_set_dai_fmt,
-                    .set_clkdiv = at32_ssc_set_dai_clkdiv,
-                    },
-        .private_data = &ssc_info[2],
-        },
-};
-EXPORT_SYMBOL_GPL(at32_ssc_dai);
-
-
-MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>");
-MODULE_DESCRIPTION("AT32 SSC ASoC Interface");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/at32/at32-ssc.h b/sound/soc/at32/at32-ssc.h
deleted file mode 100644 (file)
index 3c052db..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* sound/soc/at32/at32-ssc.h
- * ASoC SSC interface for Atmel AT32 SoC
- *
- * Copyright (C) 2008 Long Range Systems
- *    Geoffrey Wossum <gwossum@acm.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __SOUND_SOC_AT32_AT32_SSC_H
-#define __SOUND_SOC_AT32_AT32_SSC_H __FILE__
-
-#include <linux/types.h>
-#include <linux/atmel-ssc.h>
-
-#include "at32-pcm.h"
-
-
-
-struct at32_ssc_state {
-       u32 ssc_cmr;
-       u32 ssc_rcmr;
-       u32 ssc_rfmr;
-       u32 ssc_tcmr;
-       u32 ssc_tfmr;
-       u32 ssc_sr;
-       u32 ssc_imr;
-};
-
-
-
-struct at32_ssc_info {
-       char *name;
-       struct ssc_device *ssc;
-       spinlock_t lock;        /* lock for dir_mask */
-       unsigned short dir_mask;        /* 0=unused, 1=playback, 2=capture */
-       unsigned short initialized;     /* true if SSC has been initialized */
-       unsigned short daifmt;
-       unsigned short cmr_div;
-       unsigned short tcmr_period;
-       unsigned short rcmr_period;
-       struct at32_pcm_dma_params *dma_params[2];
-       struct at32_ssc_state ssc_state;
-};
-
-
-/* SSC divider ids */
-#define AT32_SSC_CMR_DIV        0      /* MCK divider for BCLK */
-#define AT32_SSC_TCMR_PERIOD    1      /* BCLK divider for transmit FS */
-#define AT32_SSC_RCMR_PERIOD    2      /* BCLK divider for receive FS */
-
-
-extern struct snd_soc_dai at32_ssc_dai[];
-
-
-
-#endif /* __SOUND_SOC_AT32_AT32_SSC_H */
diff --git a/sound/soc/at32/playpaq_wm8510.c b/sound/soc/at32/playpaq_wm8510.c
deleted file mode 100644 (file)
index b1966e4..0000000
+++ /dev/null
@@ -1,513 +0,0 @@
-/* sound/soc/at32/playpaq_wm8510.c
- * ASoC machine driver for PlayPaq using WM8510 codec
- *
- * Copyright (C) 2008 Long Range Systems
- *    Geoffrey Wossum <gwossum@acm.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This code is largely inspired by sound/soc/at91/eti_b1_wm8731.c
- *
- * NOTE: If you don't have the AT32 enhanced portmux configured (which
- * isn't currently in the mainline or Atmel patched kernel), you will
- * need to set the MCLK pin (PA30) to peripheral A in your board initialization
- * code.  Something like:
- *     at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0);
- *
- */
-
-/* #define DEBUG */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/version.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/clk.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-#include <sound/soc-dapm.h>
-
-#include <mach/at32ap700x.h>
-#include <mach/portmux.h>
-
-#include "../codecs/wm8510.h"
-#include "at32-pcm.h"
-#include "at32-ssc.h"
-
-
-/*-------------------------------------------------------------------------*\
- * constants
-\*-------------------------------------------------------------------------*/
-#define MCLK_PIN               GPIO_PIN_PA(30)
-#define MCLK_PERIPH            GPIO_PERIPH_A
-
-
-/*-------------------------------------------------------------------------*\
- * data types
-\*-------------------------------------------------------------------------*/
-/* SSC clocking data */
-struct ssc_clock_data {
-       /* CMR div */
-       unsigned int cmr_div;
-
-       /* Frame period (as needed by xCMR.PERIOD) */
-       unsigned int period;
-
-       /* The SSC clock rate these settings where calculated for */
-       unsigned long ssc_rate;
-};
-
-
-/*-------------------------------------------------------------------------*\
- * module data
-\*-------------------------------------------------------------------------*/
-static struct clk *_gclk0;
-static struct clk *_pll0;
-
-#define CODEC_CLK (_gclk0)
-
-
-/*-------------------------------------------------------------------------*\
- * Sound SOC operations
-\*-------------------------------------------------------------------------*/
-#if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
-static struct ssc_clock_data playpaq_wm8510_calc_ssc_clock(
-       struct snd_pcm_hw_params *params,
-       struct snd_soc_dai *cpu_dai)
-{
-       struct at32_ssc_info *ssc_p = cpu_dai->private_data;
-       struct ssc_device *ssc = ssc_p->ssc;
-       struct ssc_clock_data cd;
-       unsigned int rate, width_bits, channels;
-       unsigned int bitrate, ssc_div;
-       unsigned actual_rate;
-
-
-       /*
-        * Figure out required bitrate
-        */
-       rate = params_rate(params);
-       channels = params_channels(params);
-       width_bits = snd_pcm_format_physical_width(params_format(params));
-       bitrate = rate * width_bits * channels;
-
-
-       /*
-        * Figure out required SSC divider and period for required bitrate
-        */
-       cd.ssc_rate = clk_get_rate(ssc->clk);
-       ssc_div = cd.ssc_rate / bitrate;
-       cd.cmr_div = ssc_div / 2;
-       if (ssc_div & 1) {
-               /* round cmr_div up */
-               cd.cmr_div++;
-       }
-       cd.period = width_bits - 1;
-
-
-       /*
-        * Find actual rate, compare to requested rate
-        */
-       actual_rate = (cd.ssc_rate / (cd.cmr_div * 2)) / (2 * (cd.period + 1));
-       pr_debug("playpaq_wm8510: Request rate = %d, actual rate = %d\n",
-                rate, actual_rate);
-
-
-       return cd;
-}
-#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
-
-
-
-static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
-                                   struct snd_pcm_hw_params *params)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
-       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
-       struct at32_ssc_info *ssc_p = cpu_dai->private_data;
-       struct ssc_device *ssc = ssc_p->ssc;
-       unsigned int pll_out = 0, bclk = 0, mclk_div = 0;
-       int ret;
-
-
-       /* Due to difficulties with getting the correct clocks from the AT32's
-        * PLL0, we're going to let the CODEC be in charge of all the clocks
-        */
-#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
-       const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
-                                 SND_SOC_DAIFMT_NB_NF |
-                                 SND_SOC_DAIFMT_CBM_CFM);
-#else
-       struct ssc_clock_data cd;
-       const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
-                                 SND_SOC_DAIFMT_NB_NF |
-                                 SND_SOC_DAIFMT_CBS_CFS);
-#endif
-
-       if (ssc == NULL) {
-               pr_warning("playpaq_wm8510_hw_params: ssc is NULL!\n");
-               return -EINVAL;
-       }
-
-
-       /*
-        * Figure out PLL and BCLK dividers for WM8510
-        */
-       switch (params_rate(params)) {
-       case 48000:
-               pll_out = 12288000;
-               mclk_div = WM8510_MCLKDIV_1;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       case 44100:
-               pll_out = 11289600;
-               mclk_div = WM8510_MCLKDIV_1;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       case 22050:
-               pll_out = 11289600;
-               mclk_div = WM8510_MCLKDIV_2;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       case 16000:
-               pll_out = 12288000;
-               mclk_div = WM8510_MCLKDIV_3;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       case 11025:
-               pll_out = 11289600;
-               mclk_div = WM8510_MCLKDIV_4;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       case 8000:
-               pll_out = 12288000;
-               mclk_div = WM8510_MCLKDIV_6;
-               bclk = WM8510_BCLKDIV_8;
-               break;
-
-       default:
-               pr_warning("playpaq_wm8510: Unsupported sample rate %d\n",
-                          params_rate(params));
-               return -EINVAL;
-       }
-
-
-       /*
-        * set CPU and CODEC DAI configuration
-        */
-       ret = snd_soc_dai_set_fmt(codec_dai, fmt);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: "
-                          "Failed to set CODEC DAI format (%d)\n",
-                          ret);
-               return ret;
-       }
-       ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: "
-                          "Failed to set CPU DAI format (%d)\n",
-                          ret);
-               return ret;
-       }
-
-
-       /*
-        * Set CPU clock configuration
-        */
-#if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
-       cd = playpaq_wm8510_calc_ssc_clock(params, cpu_dai);
-       pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n",
-                cd.cmr_div, cd.period);
-       ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_CMR_DIV, cd.cmr_div);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n",
-                          ret);
-               return ret;
-       }
-       ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_TCMR_PERIOD,
-                                         cd.period);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: "
-                          "Failed to set CPU transmit period (%d)\n",
-                          ret);
-               return ret;
-       }
-#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
-
-
-       /*
-        * Set CODEC clock configuration
-        */
-       pr_debug("playpaq_wm8510: "
-                "pll_in = %ld, pll_out = %u, bclk = %x, mclk = %x\n",
-                clk_get_rate(CODEC_CLK), pll_out, bclk, mclk_div);
-
-
-#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
-       ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_BCLKDIV, bclk);
-       if (ret < 0) {
-               pr_warning
-                   ("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n",
-                    ret);
-               return ret;
-       }
-#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
-
-
-       ret = snd_soc_dai_set_pll(codec_dai, 0,
-                                        clk_get_rate(CODEC_CLK), pll_out);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n",
-                          ret);
-               return ret;
-       }
-
-
-       ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_MCLKDIV, mclk_div);
-       if (ret < 0) {
-               pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n",
-                          ret);
-               return ret;
-       }
-
-
-       return 0;
-}
-
-
-
-static struct snd_soc_ops playpaq_wm8510_ops = {
-       .hw_params = playpaq_wm8510_hw_params,
-};
-
-
-
-static const struct snd_soc_dapm_widget playpaq_dapm_widgets[] = {
-       SND_SOC_DAPM_MIC("Int Mic", NULL),
-       SND_SOC_DAPM_SPK("Ext Spk", NULL),
-};
-
-
-
-static const struct snd_soc_dapm_route intercon[] = {
-       /* speaker connected to SPKOUT */
-       {"Ext Spk", NULL, "SPKOUTP"},
-       {"Ext Spk", NULL, "SPKOUTN"},
-
-       {"Mic Bias", NULL, "Int Mic"},
-       {"MICN", NULL, "Mic Bias"},
-       {"MICP", NULL, "Mic Bias"},
-};
-
-
-
-static int playpaq_wm8510_init(struct snd_soc_codec *codec)
-{
-       int i;
-
-       /*
-        * Add DAPM widgets
-        */
-       for (i = 0; i < ARRAY_SIZE(playpaq_dapm_widgets); i++)
-               snd_soc_dapm_new_control(codec, &playpaq_dapm_widgets[i]);
-
-
-
-       /*
-        * Setup audio path interconnects
-        */
-       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
-
-
-
-       /* always connected pins */
-       snd_soc_dapm_enable_pin(codec, "Int Mic");
-       snd_soc_dapm_enable_pin(codec, "Ext Spk");
-       snd_soc_dapm_sync(codec);
-
-
-
-       /* Make CSB show PLL rate */
-       snd_soc_dai_set_clkdiv(codec->dai, WM8510_OPCLKDIV,
-                                      WM8510_OPCLKDIV_1 | 4);
-
-       return 0;
-}
-
-
-
-static struct snd_soc_dai_link playpaq_wm8510_dai = {
-       .name = "WM8510",
-       .stream_name = "WM8510 PCM",
-       .cpu_dai = &at32_ssc_dai[0],
-       .codec_dai = &wm8510_dai,
-       .init = playpaq_wm8510_init,
-       .ops = &playpaq_wm8510_ops,
-};
-
-
-
-static struct snd_soc_machine snd_soc_machine_playpaq = {
-       .name = "LRS_PlayPaq_WM8510",
-       .dai_link = &playpaq_wm8510_dai,
-       .num_links = 1,
-};
-
-
-
-static struct wm8510_setup_data playpaq_wm8510_setup = {
-       .i2c_bus = 0,
-       .i2c_address = 0x1a,
-};
-
-
-
-static struct snd_soc_device playpaq_wm8510_snd_devdata = {
-       .machine = &snd_soc_machine_playpaq,
-       .platform = &at32_soc_platform,
-       .codec_dev = &soc_codec_dev_wm8510,
-       .codec_data = &playpaq_wm8510_setup,
-};
-
-static struct platform_device *playpaq_snd_device;
-
-
-static int __init playpaq_asoc_init(void)
-{
-       int ret = 0;
-       struct at32_ssc_info *ssc_p = playpaq_wm8510_dai.cpu_dai->private_data;
-       struct ssc_device *ssc = NULL;
-
-
-       /*
-        * Request SSC device
-        */
-       ssc = ssc_request(0);
-       if (IS_ERR(ssc)) {
-               ret = PTR_ERR(ssc);
-               goto err_ssc;
-       }
-       ssc_p->ssc = ssc;
-
-
-       /*
-        * Configure MCLK for WM8510
-        */
-       _gclk0 = clk_get(NULL, "gclk0");
-       if (IS_ERR(_gclk0)) {
-               _gclk0 = NULL;
-               goto err_gclk0;
-       }
-       _pll0 = clk_get(NULL, "pll0");
-       if (IS_ERR(_pll0)) {
-               _pll0 = NULL;
-               goto err_pll0;
-       }
-       if (clk_set_parent(_gclk0, _pll0)) {
-               pr_warning("snd-soc-playpaq: "
-                          "Failed to set PLL0 as parent for DAC clock\n");
-               goto err_set_clk;
-       }
-       clk_set_rate(CODEC_CLK, 12000000);
-       clk_enable(CODEC_CLK);
-
-#if defined CONFIG_AT32_ENHANCED_PORTMUX
-       at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0);
-#endif
-
-
-       /*
-        * Create and register platform device
-        */
-       playpaq_snd_device = platform_device_alloc("soc-audio", 0);
-       if (playpaq_snd_device == NULL) {
-               ret = -ENOMEM;
-               goto err_device_alloc;
-       }
-
-       platform_set_drvdata(playpaq_snd_device, &playpaq_wm8510_snd_devdata);
-       playpaq_wm8510_snd_devdata.dev = &playpaq_snd_device->dev;
-
-       ret = platform_device_add(playpaq_snd_device);
-       if (ret) {
-               pr_warning("playpaq_wm8510: platform_device_add failed (%d)\n",
-                          ret);
-               goto err_device_add;
-       }
-
-       return 0;
-
-
-err_device_add:
-       if (playpaq_snd_device != NULL) {
-               platform_device_put(playpaq_snd_device);
-               playpaq_snd_device = NULL;
-       }
-err_device_alloc:
-err_set_clk:
-       if (_pll0 != NULL) {
-               clk_put(_pll0);
-               _pll0 = NULL;
-       }
-err_pll0:
-       if (_gclk0 != NULL) {
-               clk_put(_gclk0);
-               _gclk0 = NULL;
-       }
-err_gclk0:
-       ssc_free(ssc);
-err_ssc:
-       return ret;
-}
-
-
-static void __exit playpaq_asoc_exit(void)
-{
-       struct at32_ssc_info *ssc_p = playpaq_wm8510_dai.cpu_dai->private_data;
-       struct ssc_device *ssc;
-
-       if (ssc_p != NULL) {
-               ssc = ssc_p->ssc;
-               if (ssc != NULL)
-                       ssc_free(ssc);
-               ssc_p->ssc = NULL;
-       }
-
-       if (_gclk0 != NULL) {
-               clk_put(_gclk0);
-               _gclk0 = NULL;
-       }
-       if (_pll0 != NULL) {
-               clk_put(_pll0);
-               _pll0 = NULL;
-       }
-
-#if defined CONFIG_AT32_ENHANCED_PORTMUX
-       at32_free_pin(MCLK_PIN);
-#endif
-
-       platform_device_unregister(playpaq_snd_device);
-       playpaq_snd_device = NULL;
-}
-
-module_init(playpaq_asoc_init);
-module_exit(playpaq_asoc_exit);
-
-MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>");
-MODULE_DESCRIPTION("ASoC machine driver for LRS PlayPaq");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/at91/Kconfig b/sound/soc/at91/Kconfig
deleted file mode 100644 (file)
index 85a8832..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-config SND_AT91_SOC
-       tristate "SoC Audio for the Atmel AT91 System-on-Chip"
-       depends on ARCH_AT91
-       help
-         Say Y or M if you want to add support for codecs attached to
-         the AT91 SSC interface. You will also need
-         to select the audio interfaces to support below.
-
-config SND_AT91_SOC_SSC
-       tristate
diff --git a/sound/soc/at91/Makefile b/sound/soc/at91/Makefile
deleted file mode 100644 (file)
index b817f11..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# AT91 Platform Support
-snd-soc-at91-objs := at91-pcm.o
-snd-soc-at91-ssc-objs := at91-ssc.o
-
-obj-$(CONFIG_SND_AT91_SOC) += snd-soc-at91.o
-obj-$(CONFIG_SND_AT91_SOC_SSC) += snd-soc-at91-ssc.o
diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c
deleted file mode 100644 (file)
index 7ab48bd..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * at91-pcm.c -- ALSA PCM interface for the Atmel AT91 SoC
- *
- * Author:     Frank Mandarino <fmandarino@endrelia.com>
- *             Endrelia Technologies Inc.
- * Created:    Mar 3, 2006
- *
- * Based on pxa2xx-pcm.c by:
- *
- * Author:     Nicolas Pitre
- * Created:    Nov 30, 2004
- * Copyright:  (C) 2004 MontaVista Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/dma-mapping.h>
-#include <linux/atmel_pdc.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include <mach/hardware.h>
-#include <mach/at91_ssc.h>
-
-#include "at91-pcm.h"
-
-#if 0
-#define        DBG(x...)       printk(KERN_INFO "at91-pcm: " x)
-#else
-#define        DBG(x...)
-#endif
-
-static const struct snd_pcm_hardware at91_pcm_hardware = {
-       .info                   = SNDRV_PCM_INFO_MMAP |
-                                 SNDRV_PCM_INFO_MMAP_VALID |
-                                 SNDRV_PCM_INFO_INTERLEAVED |
-                                 SNDRV_PCM_INFO_PAUSE,
-       .formats                = SNDRV_PCM_FMTBIT_S16_LE,
-       .period_bytes_min       = 32,
-       .period_bytes_max       = 8192,
-       .periods_min            = 2,
-       .periods_max            = 1024,
-       .buffer_bytes_max       = 32 * 1024,
-};
-
-struct at91_runtime_data {
-       struct at91_pcm_dma_params *params;
-       dma_addr_t dma_buffer;                  /* physical address of dma buffer */
-       dma_addr_t dma_buffer_end;              /* first address beyond DMA buffer */
-       size_t period_size;
-       dma_addr_t period_ptr;                  /* physical address of next period */
-       u32 pdc_xpr_save;                       /* PDC register save */
-       u32 pdc_xcr_save;
-       u32 pdc_xnpr_save;
-       u32 pdc_xncr_save;
-};
-
-static void at91_pcm_dma_irq(u32 ssc_sr,
-       struct snd_pcm_substream *substream)
-{
-       struct at91_runtime_data *prtd = substream->runtime->private_data;
-       struct at91_pcm_dma_params *params = prtd->params;
-       static int count = 0;
-
-       count++;
-
-       if (ssc_sr & params->mask->ssc_endbuf) {
-
-               printk(KERN_WARNING
-                       "at91-pcm: buffer %s on %s (SSC_SR=%#x, count=%d)\n",
-                       substream->stream == SNDRV_PCM_STREAM_PLAYBACK
-                               ? "underrun" : "overrun",
-                       params->name, ssc_sr, count);
-
-               /* re-start the PDC */
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
-
-               prtd->period_ptr += prtd->period_size;
-               if (prtd->period_ptr >= prtd->dma_buffer_end) {
-                       prtd->period_ptr = prtd->dma_buffer;
-               }
-
-               at91_ssc_write(params->ssc_base + params->pdc->xpr, prtd->period_ptr);
-               at91_ssc_write(params->ssc_base + params->pdc->xcr,
-                               prtd->period_size / params->pdc_xfer_size);
-
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
-       }
-
-       if (ssc_sr & params->mask->ssc_endx) {
-
-               /* Load the PDC next pointer and counter registers */
-               prtd->period_ptr += prtd->period_size;
-               if (prtd->period_ptr >= prtd->dma_buffer_end) {
-                       prtd->period_ptr = prtd->dma_buffer;
-               }
-               at91_ssc_write(params->ssc_base + params->pdc->xnpr,
-                              prtd->period_ptr);
-               at91_ssc_write(params->ssc_base + params->pdc->xncr,
-                               prtd->period_size / params->pdc_xfer_size);
-       }
-
-       snd_pcm_period_elapsed(substream);
-}
-
-static int at91_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at91_runtime_data *prtd = runtime->private_data;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-
-       /* this may get called several times by oss emulation
-        * with different params */
-
-       snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
-       runtime->dma_bytes = params_buffer_bytes(params);
-
-       prtd->params = rtd->dai->cpu_dai->dma_data;
-       prtd->params->dma_intr_handler = at91_pcm_dma_irq;
-
-       prtd->dma_buffer = runtime->dma_addr;
-       prtd->dma_buffer_end = runtime->dma_addr + runtime->dma_bytes;
-       prtd->period_size = params_period_bytes(params);
-
-       DBG("hw_params: DMA for %s initialized (dma_bytes=%d, period_size=%d)\n",
-               prtd->params->name, runtime->dma_bytes, prtd->period_size);
-       return 0;
-}
-
-static int at91_pcm_hw_free(struct snd_pcm_substream *substream)
-{
-       struct at91_runtime_data *prtd = substream->runtime->private_data;
-       struct at91_pcm_dma_params *params = prtd->params;
-
-       if (params != NULL) {
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
-               prtd->params->dma_intr_handler = NULL;
-       }
-
-       return 0;
-}
-
-static int at91_pcm_prepare(struct snd_pcm_substream *substream)
-{
-       struct at91_runtime_data *prtd = substream->runtime->private_data;
-       struct at91_pcm_dma_params *params = prtd->params;
-
-       at91_ssc_write(params->ssc_base + AT91_SSC_IDR,
-                       params->mask->ssc_endx | params->mask->ssc_endbuf);
-
-       at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
-       return 0;
-}
-
-static int at91_pcm_trigger(struct snd_pcm_substream *substream,
-       int cmd)
-{
-       struct at91_runtime_data *prtd = substream->runtime->private_data;
-       struct at91_pcm_dma_params *params = prtd->params;
-       int ret = 0;
-
-       switch (cmd) {
-       case SNDRV_PCM_TRIGGER_START:
-               prtd->period_ptr = prtd->dma_buffer;
-
-               at91_ssc_write(params->ssc_base + params->pdc->xpr, prtd->period_ptr);
-               at91_ssc_write(params->ssc_base + params->pdc->xcr,
-                               prtd->period_size / params->pdc_xfer_size);
-
-               prtd->period_ptr += prtd->period_size;
-               at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->period_ptr);
-               at91_ssc_write(params->ssc_base + params->pdc->xncr,
-                               prtd->period_size / params->pdc_xfer_size);
-
-               DBG("trigger: period_ptr=%lx, xpr=%lx, xcr=%ld, xnpr=%lx, xncr=%ld\n",
-                       (unsigned long) prtd->period_ptr,
-                       at91_ssc_read(params->ssc_base + params->pdc->xpr),
-                       at91_ssc_read(params->ssc_base + params->pdc->xcr),
-                       at91_ssc_read(params->ssc_base + params->pdc->xnpr),
-                       at91_ssc_read(params->ssc_base + params->pdc->xncr));
-
-               at91_ssc_write(params->ssc_base + AT91_SSC_IER,
-                       params->mask->ssc_endx | params->mask->ssc_endbuf);
-
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR,
-                       params->mask->pdc_enable);
-
-               DBG("sr=%lx imr=%lx\n",
-                   at91_ssc_read(params->ssc_base + AT91_SSC_SR),
-                   at91_ssc_read(params->ssc_base + AT91_SSC_IMR));
-               break;
-
-       case SNDRV_PCM_TRIGGER_STOP:
-       case SNDRV_PCM_TRIGGER_SUSPEND:
-       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
-               break;
-
-       case SNDRV_PCM_TRIGGER_RESUME:
-       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-               at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
-               break;
-
-       default:
-               ret = -EINVAL;
-       }
-
-       return ret;
-}
-
-static snd_pcm_uframes_t at91_pcm_pointer(
-       struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at91_runtime_data *prtd = runtime->private_data;
-       struct at91_pcm_dma_params *params = prtd->params;
-       dma_addr_t ptr;
-       snd_pcm_uframes_t x;
-
-       ptr = (dma_addr_t) at91_ssc_read(params->ssc_base + params->pdc->xpr);
-       x = bytes_to_frames(runtime, ptr - prtd->dma_buffer);
-
-       if (x == runtime->buffer_size)
-               x = 0;
-       return x;
-}
-
-static int at91_pcm_open(struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct at91_runtime_data *prtd;
-       int ret = 0;
-
-       snd_soc_set_runtime_hwparams(substream, &at91_pcm_hardware);
-
-       /* ensure that buffer size is a multiple of period size */
-       ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
-       if (ret < 0)
-               goto out;
-
-       prtd = kzalloc(sizeof(struct at91_runtime_data), GFP_KERNEL);
-       if (prtd == NULL) {
-               ret = -ENOMEM;
-               goto out;
-       }
-       runtime->private_data = prtd;
-
- out:
-       return ret;
-}
-
-static int at91_pcm_close(struct snd_pcm_substream *substream)
-{
-       struct at91_runtime_data *prtd = substream->runtime->private_data;
-
-       kfree(prtd);
-       return 0;
-}
-
-static int at91_pcm_mmap(struct snd_pcm_substream *substream,
-       struct vm_area_struct *vma)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-
-       return dma_mmap_writecombine(substream->pcm->card->dev, vma,
-                                    runtime->dma_area,
-                                    runtime->dma_addr,
-                                    runtime->dma_bytes);
-}
-
-struct snd_pcm_ops at91_pcm_ops = {
-       .open           = at91_pcm_open,
-       .close          = at91_pcm_close,
-       .ioctl          = snd_pcm_lib_ioctl,
-       .hw_params      = at91_pcm_hw_params,
-       .hw_free        = at91_pcm_hw_free,
-       .prepare        = at91_pcm_prepare,
-       .trigger        = at91_pcm_trigger,
-       .pointer        = at91_pcm_pointer,
-       .mmap           = at91_pcm_mmap,
-};
-
-static int at91_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
-       int stream)
-{
-       struct snd_pcm_substream *substream = pcm->streams[stream].substream;
-       struct snd_dma_buffer *buf = &substream->dma_buffer;
-       size_t size = at91_pcm_hardware.buffer_bytes_max;
-
-       buf->dev.type = SNDRV_DMA_TYPE_DEV;
-       buf->dev.dev = pcm->card->dev;
-       buf->private_data = NULL;
-       buf->area = dma_alloc_writecombine(pcm->card->dev, size,
-                                          &buf->addr, GFP_KERNEL);
-
-       DBG("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
-               (void *) buf->area,
-               (void *) buf->addr,
-               size);
-
-       if (!buf->area)
-               return -ENOMEM;
-
-       buf->bytes = size;
-       return 0;
-}
-
-static u64 at91_pcm_dmamask = 0xffffffff;
-
-static int at91_pcm_new(struct snd_card *card,
-       struct snd_soc_dai *dai, struct snd_pcm *pcm)
-{
-       int ret = 0;
-
-       if (!card->dev->dma_mask)
-               card->dev->dma_mask = &at91_pcm_dmamask;
-       if (!card->dev->coherent_dma_mask)
-               card->dev->coherent_dma_mask = 0xffffffff;
-
-       if (dai->playback.channels_min) {
-               ret = at91_pcm_preallocate_dma_buffer(pcm,
-                       SNDRV_PCM_STREAM_PLAYBACK);
-               if (ret)
-                       goto out;
-       }
-
-       if (dai->capture.channels_min) {
-               ret = at91_pcm_preallocate_dma_buffer(pcm,
-                       SNDRV_PCM_STREAM_CAPTURE);
-               if (ret)
-                       goto out;
-       }
- out:
-       return ret;
-}
-
-static void at91_pcm_free_dma_buffers(struct snd_pcm *pcm)
-{
-       struct snd_pcm_substream *substream;
-       struct snd_dma_buffer *buf;
-       int stream;
-
-       for (stream = 0; stream < 2; stream++) {
-               substream = pcm->streams[stream].substream;
-               if (!substream)
-                       continue;
-
-               buf = &substream->dma_buffer;
-               if (!buf->area)
-                       continue;
-
-               dma_free_writecombine(pcm->card->dev, buf->bytes,
-                                     buf->area, buf->addr);
-               buf->area = NULL;
-       }
-}
-
-#ifdef CONFIG_PM
-static int at91_pcm_suspend(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
-{
-       struct snd_pcm_runtime *runtime = dai->runtime;
-       struct at91_runtime_data *prtd;
-       struct at91_pcm_dma_params *params;
-
-       if (!runtime)
-               return 0;
-
-       prtd = runtime->private_data;
-       params = prtd->params;
-
-       /* disable the PDC and save the PDC registers */
-
-       at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_disable);
-
-       prtd->pdc_xpr_save  = at91_ssc_read(params->ssc_base + params->pdc->xpr);
-       prtd->pdc_xcr_save  = at91_ssc_read(params->ssc_base + params->pdc->xcr);
-       prtd->pdc_xnpr_save = at91_ssc_read(params->ssc_base + params->pdc->xnpr);
-       prtd->pdc_xncr_save = at91_ssc_read(params->ssc_base + params->pdc->xncr);
-
-       return 0;
-}
-
-static int at91_pcm_resume(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
-{
-       struct snd_pcm_runtime *runtime = dai->runtime;
-       struct at91_runtime_data *prtd;
-       struct at91_pcm_dma_params *params;
-
-       if (!runtime)
-               return 0;
-
-       prtd = runtime->private_data;
-       params = prtd->params;
-
-       /* restore the PDC registers and enable the PDC */
-       at91_ssc_write(params->ssc_base + params->pdc->xpr,  prtd->pdc_xpr_save);
-       at91_ssc_write(params->ssc_base + params->pdc->xcr,  prtd->pdc_xcr_save);
-       at91_ssc_write(params->ssc_base + params->pdc->xnpr, prtd->pdc_xnpr_save);
-       at91_ssc_write(params->ssc_base + params->pdc->xncr, prtd->pdc_xncr_save);
-
-       at91_ssc_write(params->ssc_base + ATMEL_PDC_PTCR, params->mask->pdc_enable);
-       return 0;
-}
-#else
-#define at91_pcm_suspend       NULL
-#define at91_pcm_resume                NULL
-#endif
-
-struct snd_soc_platform at91_soc_platform = {
-       .name           = "at91-audio",
-       .pcm_ops        = &at91_pcm_ops,
-       .pcm_new        = at91_pcm_new,
-       .pcm_free       = at91_pcm_free_dma_buffers,
-       .suspend        = at91_pcm_suspend,
-       .resume         = at91_pcm_resume,
-};
-
-EXPORT_SYMBOL_GPL(at91_soc_platform);
-
-MODULE_AUTHOR("Frank Mandarino <fmandarino@endrelia.com>");
-MODULE_DESCRIPTION("Atmel AT91 PCM module");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/at91/at91-pcm.h b/sound/soc/at91/at91-pcm.h
deleted file mode 100644 (file)
index e5aada2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC
- *
- * Author:     Frank Mandarino <fmandarino@endrelia.com>
- *             Endrelia Technologies Inc.
- * Created:    Mar 3, 2006
- *
- * Based on pxa2xx-pcm.h by:
- *
- * Author:     Nicolas Pitre
- * Created:    Nov 30, 2004
- * Copyright:  MontaVista Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _AT91_PCM_H
-#define _AT91_PCM_H
-
-#include <mach/hardware.h>
-
-struct at91_ssc_periph {
-       void __iomem    *base;
-       u32             pid;
-};
-
-/*
- * Registers and status bits that are required by the PCM driver.
- */
-struct at91_pdc_regs {
-       unsigned int    xpr;            /* PDC recv/trans pointer */
-       unsigned int    xcr;            /* PDC recv/trans counter */
-       unsigned int    xnpr;           /* PDC next recv/trans pointer */
-       unsigned int    xncr;           /* PDC next recv/trans counter */
-       unsigned int    ptcr;           /* PDC transfer control */
-};
-
-struct at91_ssc_mask {
-       u32     ssc_enable;             /* SSC recv/trans enable */
-       u32     ssc_disable;            /* SSC recv/trans disable */
-       u32     ssc_endx;               /* SSC ENDTX or ENDRX */
-       u32     ssc_endbuf;             /* SSC TXBUFE or RXBUFF */
-       u32     pdc_enable;             /* PDC recv/trans enable */
-       u32     pdc_disable;            /* PDC recv/trans disable */
-};
-
-/*
- * This structure, shared between the PCM driver and the interface,
- * contains all information required by the PCM driver to perform the
- * PDC DMA operation.  All fields except dma_intr_handler() are initialized
- * by the interface.  The dms_intr_handler() pointer is set by the PCM
- * driver and called by the interface SSC interrupt handler if it is
- * non-NULL.
- */
-struct at91_pcm_dma_params {
-       char *name;                     /* stream identifier */
-       int pdc_xfer_size;              /* PDC counter increment in bytes */
-       void __iomem *ssc_base;         /* SSC base address */
-       struct at91_pdc_regs *pdc; /* PDC receive or transmit registers */
-       struct at91_ssc_mask *mask;/* SSC & PDC status bits */
-       struct snd_pcm_substream *substream;
-       void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
-};
-
-extern struct snd_soc_platform at91_soc_platform;
-
-#define at91_ssc_read(a)       ((unsigned long) __raw_readl(a))
-#define at91_ssc_write(a,v)    __raw_writel((v),(a))
-
-#endif /* _AT91_PCM_H */
diff --git a/sound/soc/at91/at91-ssc.c b/sound/soc/at91/at91-ssc.c
deleted file mode 100644 (file)
index 1b61cc4..0000000
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * at91-ssc.c  --  ALSA SoC AT91 SSC Audio Layer Platform driver
- *
- * Author: Frank Mandarino <fmandarino@endrelia.com>
- *         Endrelia Technologies Inc.
- *
- * Based on pxa2xx Platform drivers by
- * Liam Girdwood <lrg@slimlogic.co.uk>
- *
- *  This program is free software; you can redistribute  it and/or modify it
- *  under  the terms of  the GNU General  Public License as published by the
- *  Free Software Foundation;  either version 2 of the  License, or (at your
- *  option) any later version.
- *
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/atmel_pdc.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-
-#include <mach/hardware.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91_ssc.h>
-
-#include "at91-pcm.h"
-#include "at91-ssc.h"
-
-#if 0
-#define        DBG(x...)       printk(KERN_DEBUG "at91-ssc:" x)
-#else
-#define        DBG(x...)
-#endif
-
-#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
-#define NUM_SSC_DEVICES                1
-#else
-#define NUM_SSC_DEVICES                3
-#endif
-
-
-/*
- * SSC PDC registers required by the PCM DMA engine.
- */
-static struct at91_pdc_regs pdc_tx_reg = {
-       .xpr            = ATMEL_PDC_TPR,
-       .xcr            = ATMEL_PDC_TCR,
-       .xnpr           = ATMEL_PDC_TNPR,
-       .xncr           = ATMEL_PDC_TNCR,
-};
-
-static struct at91_pdc_regs pdc_rx_reg = {
-       .xpr            = ATMEL_PDC_RPR,
-       .xcr            = ATMEL_PDC_RCR,
-       .xnpr           = ATMEL_PDC_RNPR,
-       .xncr           = ATMEL_PDC_RNCR,
-};
-
-/*
- * SSC & PDC status bits for transmit and receive.
- */
-static struct at91_ssc_mask ssc_tx_mask = {
-       .ssc_enable     = AT91_SSC_TXEN,
-       .ssc_disable    = AT91_SSC_TXDIS,
-       .ssc_endx       = AT91_SSC_ENDTX,
-       .ssc_endbuf     = AT91_SSC_TXBUFE,
-       .pdc_enable     = ATMEL_PDC_TXTEN,
-       .pdc_disable    = ATMEL_PDC_TXTDIS,
-};
-
-static struct at91_ssc_mask ssc_rx_mask = {
-       .ssc_enable     = AT91_SSC_RXEN,
-       .ssc_disable    = AT91_SSC_RXDIS,
-       .ssc_endx       = AT91_SSC_ENDRX,
-       .ssc_endbuf     = AT91_SSC_RXBUFF,
-       .pdc_enable     = ATMEL_PDC_RXTEN,
-       .pdc_disable    = ATMEL_PDC_RXTDIS,
-};
-
-
-/*
- * DMA parameters.
- */
-static struct at91_pcm_dma_params ssc_dma_params[NUM_SSC_DEVICES][2] = {
-       {{
-       .name           = "SSC0 PCM out",
-       .pdc            = &pdc_tx_reg,
-       .mask           = &ssc_tx_mask,
-       },
-       {
-       .name           = "SSC0 PCM in",
-       .pdc            = &pdc_rx_reg,
-       .mask           = &ssc_rx_mask,
-       }},
-#if NUM_SSC_DEVICES == 3
-       {{
-       .name           = "SSC1 PCM out",
-       .pdc            = &pdc_tx_reg,
-       .mask           = &ssc_tx_mask,
-       },
-       {
-       .name           = "SSC1 PCM in",
-       .pdc            = &pdc_rx_reg,
-       .mask           = &ssc_rx_mask,
-       }},
-       {{
-       .name           = "SSC2 PCM out",
-       .pdc            = &pdc_tx_reg,
-       .mask           = &ssc_tx_mask,
-       },
-       {
-       .name           = "SSC2 PCM in",
-       .pdc            = &pdc_rx_reg,
-       .mask           = &ssc_rx_mask,
-       }},
-#endif
-};
-
-struct at91_ssc_state {
-       u32     ssc_cmr;
-       u32     ssc_rcmr;
-       u32     ssc_rfmr;
-       u32     ssc_tcmr;
-       u32     ssc_tfmr;
-       u32     ssc_sr;
-       u32     ssc_imr;
-};
-
-static struct at91_ssc_info {
-       char            *name;
-       struct at91_ssc_periph ssc;
-       spinlock_t      lock;           /* lock for dir_mask */
-       unsigned short  dir_mask;       /* 0=unused, 1=playback, 2=capture */
-       unsigned short  initialized;    /* 1=SSC has been initialized */
-       unsigned short  daifmt;
-       unsigned short  cmr_div;
-       unsigned short  tcmr_period;
-       unsigned short  rcmr_period;
-       struct at91_pcm_dma_params *dma_params[2];
-       struct at91_ssc_state ssc_state;
-
-} ssc_info[NUM_SSC_DEVICES] = {
-       {
-       .name           = "ssc0",
-       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[0].lock),
-       .dir_mask       = 0,
-       .initialized    = 0,
-       },
-#if NUM_SSC_DEVICES == 3
-       {
-       .name           = "ssc1",
-       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[1].lock),
-       .dir_mask       = 0,
-       .initialized    = 0,
-       },
-       {
-       .name           = "ssc2",
-       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[2].lock),
-       .dir_mask       = 0,
-       .initialized    = 0,
-       },
-#endif
-};
-
-static unsigned int at91_ssc_sysclk;
-
-/*
- * SSC interrupt handler.  Passes PDC interrupts to the DMA
- * interrupt handler in the PCM driver.
- */
-static irqreturn_t at91_ssc_interrupt(int irq, void *dev_id)
-{
-       struct at91_ssc_info *ssc_p = dev_id;
-       struct at91_pcm_dma_params *dma_params;
-       u32 ssc_sr;
-       int i;
-
-       ssc_sr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR)
-                       & at91_ssc_read(ssc_p->ssc.base + AT91_SSC_IMR);
-
-       /*
-        * Loop through the substreams attached to this SSC.  If
-        * a DMA-related interrupt occurred on that substream, call
-        * the DMA interrupt handler function, if one has been
-        * registered in the dma_params structure by the PCM driver.
-        */
-       for (i = 0; i < ARRAY_SIZE(ssc_p->dma_params); i++) {
-               dma_params = ssc_p->dma_params[i];
-
-               if (dma_params != NULL && dma_params->dma_intr_handler != NULL &&
-                       (ssc_sr &
-                       (dma_params->mask->ssc_endx | dma_params->mask->ssc_endbuf)))
-
-                       dma_params->dma_intr_handler(ssc_sr, dma_params->substream);
-       }
-
-       return IRQ_HANDLED;
-}
-
-/*
- * Startup.  Only that one substream allowed in each direction.
- */
-static int at91_ssc_startup(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       int dir_mask;
-
-       DBG("ssc_startup: SSC_SR=0x%08lx\n",
-                       at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR));
-       dir_mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0x1 : 0x2;
-
-       spin_lock_irq(&ssc_p->lock);
-       if (ssc_p->dir_mask & dir_mask) {
-               spin_unlock_irq(&ssc_p->lock);
-               return -EBUSY;
-       }
-       ssc_p->dir_mask |= dir_mask;
-       spin_unlock_irq(&ssc_p->lock);
-
-       return 0;
-}
-
-/*
- * Shutdown.  Clear DMA parameters and shutdown the SSC if there
- * are no other substreams open.
- */
-static void at91_ssc_shutdown(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       struct at91_pcm_dma_params *dma_params;
-       int dir, dir_mask;
-
-       dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
-       dma_params = ssc_p->dma_params[dir];
-
-       if (dma_params != NULL) {
-               at91_ssc_write(dma_params->ssc_base + AT91_SSC_CR,
-                               dma_params->mask->ssc_disable);
-               DBG("%s disabled SSC_SR=0x%08lx\n", (dir ? "receive" : "transmit"),
-                       at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR));
-
-               dma_params->ssc_base = NULL;
-               dma_params->substream = NULL;
-               ssc_p->dma_params[dir] = NULL;
-       }
-
-       dir_mask = 1 << dir;
-
-       spin_lock_irq(&ssc_p->lock);
-       ssc_p->dir_mask &= ~dir_mask;
-       if (!ssc_p->dir_mask) {
-               /* Shutdown the SSC clock. */
-               DBG("Stopping pid %d clock\n", ssc_p->ssc.pid);
-               at91_sys_write(AT91_PMC_PCDR, 1<<ssc_p->ssc.pid);
-
-               if (ssc_p->initialized) {
-                       free_irq(ssc_p->ssc.pid, ssc_p);
-                       ssc_p->initialized = 0;
-               }
-
-               /* Reset the SSC */
-               at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST);
-
-               /* Clear the SSC dividers */
-               ssc_p->cmr_div = ssc_p->tcmr_period = ssc_p->rcmr_period = 0;
-       }
-       spin_unlock_irq(&ssc_p->lock);
-}
-
-/*
- * Record the SSC system clock rate.
- */
-static int at91_ssc_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
-               int clk_id, unsigned int freq, int dir)
-{
-       /*
-        * The only clock supplied to the SSC is the AT91 master clock,
-        * which is only used if the SSC is generating BCLK and/or
-        * LRC clocks.
-        */
-       switch (clk_id) {
-       case AT91_SYSCLK_MCK:
-               at91_ssc_sysclk = freq;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-/*
- * Record the DAI format for use in hw_params().
- */
-static int at91_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
-               unsigned int fmt)
-{
-       struct at91_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
-
-       ssc_p->daifmt = fmt;
-       return 0;
-}
-
-/*
- * Record SSC clock dividers for use in hw_params().
- */
-static int at91_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
-       int div_id, int div)
-{
-       struct at91_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
-
-       switch (div_id) {
-       case AT91SSC_CMR_DIV:
-               /*
-                * The same master clock divider is used for both
-                * transmit and receive, so if a value has already
-                * been set, it must match this value.
-                */
-               if (ssc_p->cmr_div == 0)
-                       ssc_p->cmr_div = div;
-               else
-                       if (div != ssc_p->cmr_div)
-                               return -EBUSY;
-               break;
-
-       case AT91SSC_TCMR_PERIOD:
-               ssc_p->tcmr_period = div;
-               break;
-
-       case AT91SSC_RCMR_PERIOD:
-               ssc_p->rcmr_period = div;
-               break;
-
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-/*
- * Configure the SSC.
- */
-static int at91_ssc_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       int id = rtd->dai->cpu_dai->id;
-       struct at91_ssc_info *ssc_p = &ssc_info[id];
-       struct at91_pcm_dma_params *dma_params;
-       int dir, channels, bits;
-       u32 tfmr, rfmr, tcmr, rcmr;
-       int start_event;
-       int ret;
-
-       /*
-        * Currently, there is only one set of dma params for
-        * each direction.  If more are added, this code will
-        * have to be changed to select the proper set.
-        */
-       dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
-
-       dma_params = &ssc_dma_params[id][dir];
-       dma_params->ssc_base = ssc_p->ssc.base;
-       dma_params->substream = substream;
-
-       ssc_p->dma_params[dir] = dma_params;
-
-       /*
-        * The cpu_dai->dma_data field is only used to communicate the
-        * appropriate DMA parameters to the pcm driver hw_params()
-        * function.  It should not be used for other purposes
-        * as it is common to all substreams.
-        */
-       rtd->dai->cpu_dai->dma_data = dma_params;
-
-       channels = params_channels(params);
-
-       /*
-        * Determine sample size in bits and the PDC increment.
-        */
-       switch(params_format(params)) {
-       case SNDRV_PCM_FORMAT_S8:
-               bits = 8;
-               dma_params->pdc_xfer_size = 1;
-               break;
-       case SNDRV_PCM_FORMAT_S16_LE:
-               bits = 16;
-               dma_params->pdc_xfer_size = 2;
-               break;
-       case SNDRV_PCM_FORMAT_S24_LE:
-               bits = 24;
-               dma_params->pdc_xfer_size = 4;
-               break;
-       case SNDRV_PCM_FORMAT_S32_LE:
-               bits = 32;
-               dma_params->pdc_xfer_size = 4;
-               break;
-       default:
-               printk(KERN_WARNING "at91-ssc: unsupported PCM format\n");
-               return -EINVAL;
-       }
-
-       /*
-        * The SSC only supports up to 16-bit samples in I2S format, due
-        * to the size of the Frame Mode Register FSLEN field.
-        */
-       if ((ssc_p->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S
-               && bits > 16) {
-               printk(KERN_WARNING
-                       "at91-ssc: sample size %d is too large for I2S\n", bits);
-               return -EINVAL;
-       }
-
-       /*
-        * Compute SSC register settings.
-        */
-       switch (ssc_p->daifmt
-               & (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_MASTER_MASK)) {
-
-       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS:
-               /*
-                * I2S format, SSC provides BCLK and LRC clocks.
-                *
-                * The SSC transmit and receive clocks are generated from the
-                * MCK divider, and the BCLK signal is output on the SSC TK line.
-                */
-               rcmr =    (( ssc_p->rcmr_period         << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( AT91_SSC_START_FALLING_RF       ) & AT91_SSC_START)
-                       | (( AT91_SSC_CK_RISING              ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_NONE               ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_DIV                ) & AT91_SSC_CKS);
-
-               rfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( AT91_SSC_FSOS_NEGATIVE          ) & AT91_SSC_FSOS)
-                       | (((bits - 1)                  << 16) & AT91_SSC_FSLEN)
-                       | (((channels - 1)              <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_LOOP)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-
-               tcmr =    (( ssc_p->tcmr_period         << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( AT91_SSC_START_FALLING_RF       ) & AT91_SSC_START)
-                       | (( AT91_SSC_CKI_FALLING            ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_CONTINUOUS         ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_DIV                ) & AT91_SSC_CKS);
-
-               tfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( 0                          << 23) & AT91_SSC_FSDEN)
-                       | (( AT91_SSC_FSOS_NEGATIVE          ) & AT91_SSC_FSOS)
-                       | (((bits - 1)                  << 16) & AT91_SSC_FSLEN)
-                       | (((channels - 1)              <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_DATDEF)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-               break;
-
-       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
-               /*
-                * I2S format, CODEC supplies BCLK and LRC clocks.
-                *
-                * The SSC transmit clock is obtained from the BCLK signal on
-                * on the TK line, and the SSC receive clock is generated from the
-                * transmit clock.
-                *
-                * For single channel data, one sample is transferred on the falling
-                * edge of the LRC clock.  For two channel data, one sample is
-                * transferred on both edges of the LRC clock.
-                */
-               start_event = channels == 1
-                               ? AT91_SSC_START_FALLING_RF
-                               : AT91_SSC_START_EDGE_RF;
-
-               rcmr =    (( 0                          << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( start_event                     ) & AT91_SSC_START)
-                       | (( AT91_SSC_CK_RISING              ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_NONE               ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_CLOCK              ) & AT91_SSC_CKS);
-
-               rfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( AT91_SSC_FSOS_NONE              ) & AT91_SSC_FSOS)
-                       | (( 0                          << 16) & AT91_SSC_FSLEN)
-                       | (( 0                          <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_LOOP)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-
-               tcmr =    (( 0                          << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( start_event                     ) & AT91_SSC_START)
-                       | (( AT91_SSC_CKI_FALLING            ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_NONE               ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_PIN                ) & AT91_SSC_CKS);
-
-               tfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( 0                          << 23) & AT91_SSC_FSDEN)
-                       | (( AT91_SSC_FSOS_NONE              ) & AT91_SSC_FSOS)
-                       | (( 0                          << 16) & AT91_SSC_FSLEN)
-                       | (( 0                          <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_DATDEF)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-               break;
-
-       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS:
-               /*
-                * DSP/PCM Mode A format, SSC provides BCLK and LRC clocks.
-                *
-                * The SSC transmit and receive clocks are generated from the
-                * MCK divider, and the BCLK signal is output on the SSC TK line.
-                */
-               rcmr =    (( ssc_p->rcmr_period         << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( AT91_SSC_START_RISING_RF        ) & AT91_SSC_START)
-                       | (( AT91_SSC_CK_RISING              ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_NONE               ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_DIV                ) & AT91_SSC_CKS);
-
-               rfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( AT91_SSC_FSOS_POSITIVE          ) & AT91_SSC_FSOS)
-                       | (( 0                          << 16) & AT91_SSC_FSLEN)
-                       | (((channels - 1)              <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_LOOP)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-
-               tcmr =    (( ssc_p->tcmr_period         << 24) & AT91_SSC_PERIOD)
-                       | (( 1                          << 16) & AT91_SSC_STTDLY)
-                       | (( AT91_SSC_START_RISING_RF        ) & AT91_SSC_START)
-                       | (( AT91_SSC_CK_RISING              ) & AT91_SSC_CKI)
-                       | (( AT91_SSC_CKO_CONTINUOUS         ) & AT91_SSC_CKO)
-                       | (( AT91_SSC_CKS_DIV                ) & AT91_SSC_CKS);
-
-               tfmr =    (( AT91_SSC_FSEDGE_POSITIVE        ) & AT91_SSC_FSEDGE)
-                       | (( 0                          << 23) & AT91_SSC_FSDEN)
-                       | (( AT91_SSC_FSOS_POSITIVE          ) & AT91_SSC_FSOS)
-                       | (( 0                          << 16) & AT91_SSC_FSLEN)
-                       | (((channels - 1)              <<  8) & AT91_SSC_DATNB)
-                       | (( 1                          <<  7) & AT91_SSC_MSBF)
-                       | (( 0                          <<  5) & AT91_SSC_DATDEF)
-                       | (((bits - 1)                  <<  0) & AT91_SSC_DATALEN);
-
-
-
-                       break;
-
-       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM:
-       default:
-               printk(KERN_WARNING "at91-ssc: unsupported DAI format 0x%x.\n",
-                       ssc_p->daifmt);
-               return -EINVAL;
-               break;
-       }
-       DBG("RCMR=%08x RFMR=%08x TCMR=%08x TFMR=%08x\n", rcmr, rfmr, tcmr, tfmr);
-
-       if (!ssc_p->initialized) {
-
-               /* Enable PMC peripheral clock for this SSC */
-               DBG("Starting pid %d clock\n", ssc_p->ssc.pid);
-               at91_sys_write(AT91_PMC_PCER, 1<<ssc_p->ssc.pid);
-
-               /* Reset the SSC and its PDC registers */
-               at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR, AT91_SSC_SWRST);
-
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RPR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RCR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNPR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_RNCR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TPR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TCR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNPR, 0);
-               at91_ssc_write(ssc_p->ssc.base + ATMEL_PDC_TNCR, 0);
-
-               if ((ret = request_irq(ssc_p->ssc.pid, at91_ssc_interrupt,
-                                       0, ssc_p->name, ssc_p)) < 0) {
-                       printk(KERN_WARNING "at91-ssc: request_irq failure\n");
-
-                       DBG("Stopping pid %d clock\n", ssc_p->ssc.pid);
-                       at91_sys_write(AT91_PMC_PCDR, 1<<ssc_p->ssc.pid);
-                       return ret;
-               }
-
-               ssc_p->initialized = 1;
-       }
-
-       /* set SSC clock mode register */
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CMR, ssc_p->cmr_div);
-
-       /* set receive clock mode and format */
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RCMR, rcmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RFMR, rfmr);
-
-       /* set transmit clock mode and format */
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TCMR, tcmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TFMR, tfmr);
-
-       DBG("hw_params: SSC initialized\n");
-       return 0;
-}
-
-
-static int at91_ssc_prepare(struct snd_pcm_substream *substream)
-{
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct at91_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
-       struct at91_pcm_dma_params *dma_params;
-       int dir;
-
-       dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1;
-       dma_params = ssc_p->dma_params[dir];
-
-       at91_ssc_write(dma_params->ssc_base + AT91_SSC_CR,
-                       dma_params->mask->ssc_enable);
-
-       DBG("%s enabled SSC_SR=0x%08lx\n", dir ? "receive" : "transmit",
-               at91_ssc_read(dma_params->ssc_base + AT91_SSC_SR));
-       return 0;
-}
-
-
-#ifdef CONFIG_PM
-static int at91_ssc_suspend(struct platform_device *pdev,
-       struct snd_soc_dai *cpu_dai)
-{
-       struct at91_ssc_info *ssc_p;
-
-       if(!cpu_dai->active)
-               return 0;
-
-       ssc_p = &ssc_info[cpu_dai->id];
-
-       /* Save the status register before disabling transmit and receive. */
-       ssc_p->ssc_state.ssc_sr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_SR);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR,
-                       AT91_SSC_TXDIS | AT91_SSC_RXDIS);
-
-       /* Save the current interrupt mask, then disable unmasked interrupts. */
-       ssc_p->ssc_state.ssc_imr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_IMR);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_IDR, ssc_p->ssc_state.ssc_imr);
-
-       ssc_p->ssc_state.ssc_cmr  = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_CMR);
-       ssc_p->ssc_state.ssc_rcmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_RCMR);
-       ssc_p->ssc_state.ssc_rfmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_RFMR);
-       ssc_p->ssc_state.ssc_tcmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_TCMR);
-       ssc_p->ssc_state.ssc_tfmr = at91_ssc_read(ssc_p->ssc.base + AT91_SSC_TFMR);
-
-       return 0;
-}
-
-static int at91_ssc_resume(struct platform_device *pdev,
-       struct snd_soc_dai *cpu_dai)
-{
-       struct at91_ssc_info *ssc_p;
-
-       if(!cpu_dai->active)
-               return 0;
-
-       ssc_p = &ssc_info[cpu_dai->id];
-
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TFMR, ssc_p->ssc_state.ssc_tfmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_TCMR, ssc_p->ssc_state.ssc_tcmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RFMR, ssc_p->ssc_state.ssc_rfmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_RCMR, ssc_p->ssc_state.ssc_rcmr);
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CMR,  ssc_p->ssc_state.ssc_cmr);
-
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_IER,  ssc_p->ssc_state.ssc_imr);
-
-       at91_ssc_write(ssc_p->ssc.base + AT91_SSC_CR,
-               ((ssc_p->ssc_state.ssc_sr & AT91_SSC_RXENA) ? AT91_SSC_RXEN : 0) |
-               ((ssc_p->ssc_state.ssc_sr & AT91_SSC_TXENA) ? AT91_SSC_TXEN : 0));
-
-       return 0;
-}
-
-#else
-#define at91_ssc_suspend       NULL
-#define at91_ssc_resume                NULL
-#endif
-
-#define AT91_SSC_RATES (SNDRV_PCM_RATE_8000  | SNDRV_PCM_RATE_11025 |\
-                       SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
-                       SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
-                       SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
-                       SNDRV_PCM_RATE_96000)
-
-#define AT91_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8     | SNDRV_PCM_FMTBIT_S16_LE |\
-                         SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
-
-struct snd_soc_dai at91_ssc_dai[NUM_SSC_DEVICES] = {
-       {       .name = "at91-ssc0",
-               .id = 0,
-               .type = SND_SOC_DAI_PCM,
-               .suspend = at91_ssc_suspend,
-               .resume = at91_ssc_resume,
-               .playback = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .capture = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .ops = {
-                       .startup = at91_ssc_startup,
-                       .shutdown = at91_ssc_shutdown,
-                       .prepare = at91_ssc_prepare,
-                       .hw_params = at91_ssc_hw_params,},
-               .dai_ops = {
-                       .set_sysclk = at91_ssc_set_dai_sysclk,
-                       .set_fmt = at91_ssc_set_dai_fmt,
-                       .set_clkdiv = at91_ssc_set_dai_clkdiv,},
-               .private_data = &ssc_info[0].ssc,
-       },
-#if NUM_SSC_DEVICES == 3
-       {       .name = "at91-ssc1",
-               .id = 1,
-               .type = SND_SOC_DAI_PCM,
-               .suspend = at91_ssc_suspend,
-               .resume = at91_ssc_resume,
-               .playback = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .capture = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .ops = {
-                       .startup = at91_ssc_startup,
-                       .shutdown = at91_ssc_shutdown,
-                       .prepare = at91_ssc_prepare,
-                       .hw_params = at91_ssc_hw_params,},
-               .dai_ops = {
-                       .set_sysclk = at91_ssc_set_dai_sysclk,
-                       .set_fmt = at91_ssc_set_dai_fmt,
-                       .set_clkdiv = at91_ssc_set_dai_clkdiv,},
-               .private_data = &ssc_info[1].ssc,
-       },
-       {       .name = "at91-ssc2",
-               .id = 2,
-               .type = SND_SOC_DAI_PCM,
-               .suspend = at91_ssc_suspend,
-               .resume = at91_ssc_resume,
-               .playback = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .capture = {
-                       .channels_min = 1,
-                       .channels_max = 2,
-                       .rates = AT91_SSC_RATES,
-                       .formats = AT91_SSC_FORMATS,},
-               .ops = {
-                       .startup = at91_ssc_startup,
-                       .shutdown = at91_ssc_shutdown,
-                       .prepare = at91_ssc_prepare,
-                       .hw_params = at91_ssc_hw_params,},
-               .dai_ops = {
-                       .set_sysclk = at91_ssc_set_dai_sysclk,
-                       .set_fmt = at91_ssc_set_dai_fmt,
-                       .set_clkdiv = at91_ssc_set_dai_clkdiv,},
-               .private_data = &ssc_info[2].ssc,
-       },
-#endif
-};
-
-EXPORT_SYMBOL_GPL(at91_ssc_dai);
-
-/* Module information */
-MODULE_AUTHOR("Frank Mandarino, fmandarino@endrelia.com, www.endrelia.com");
-MODULE_DESCRIPTION("AT91 SSC ASoC Interface");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/at91/at91-ssc.h b/sound/soc/at91/at91-ssc.h
deleted file mode 100644 (file)
index 6b7bf38..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * at91-ssc.h - ALSA SSC interface for the Atmel AT91 SoC
- *
- * Author:     Frank Mandarino <fmandarino@endrelia.com>
- *             Endrelia Technologies Inc.
- * Created:    Jan 9, 2007
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _AT91_SSC_H
-#define _AT91_SSC_H
-
-/* SSC system clock ids */
-#define AT91_SYSCLK_MCK                0 /* SSC uses AT91 MCK as system clock */
-
-/* SSC divider ids */
-#define AT91SSC_CMR_DIV                0 /* MCK divider for BCLK */
-#define AT91SSC_TCMR_PERIOD    1 /* BCLK divider for transmit FS */
-#define AT91SSC_RCMR_PERIOD    2 /* BCLK divider for receive FS */
-
-extern struct snd_soc_dai at91_ssc_dai[];
-
-#endif /* _AT91_SSC_H */
-
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig
new file mode 100644 (file)
index 0000000..a608d70
--- /dev/null
@@ -0,0 +1,43 @@
+config SND_ATMEL_SOC
+       tristate "SoC Audio for the Atmel System-on-Chip"
+       depends on ARCH_AT91 || AVR32
+       help
+         Say Y or M if you want to add support for codecs attached to
+         the ATMEL SSC interface. You will also need
+         to select the audio interfaces to support below.
+
+config SND_ATMEL_SOC_SSC
+       tristate
+       depends on SND_ATMEL_SOC
+       help
+         Say Y or M if you want to add support for codecs the
+         ATMEL SSC interface. You will also needs to select the individual
+         machine drivers to support below.
+
+config SND_AT91_SOC_SAM9G20_WM8731
+       tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board"
+       depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC
+       select SND_ATMEL_SOC_SSC
+       select SND_SOC_WM8731
+       help
+         Say Y if you want to add support for SoC audio on WM8731-based
+         AT91sam9g20 evaluation board.
+
+config SND_AT32_SOC_PLAYPAQ
+        tristate "SoC Audio support for PlayPaq with WM8510"
+        depends on SND_ATMEL_SOC && BOARD_PLAYPAQ
+        select SND_ATMEL_SOC_SSC
+        select SND_SOC_WM8510
+        help
+          Say Y or M here if you want to add support for SoC audio
+          on the LRS PlayPaq.
+
+config SND_AT32_SOC_PLAYPAQ_SLAVE
+        bool "Run CODEC on PlayPaq in slave mode"
+        depends on SND_AT32_SOC_PLAYPAQ
+        default n
+        help
+          Say Y if you want to run with the AT32 SSC generating the BCLK
+          and FRAME signals on the PlayPaq.  Unless you want to play
+          with the AT32 as the SSC master, you probably want to say N here,
+          as this will give you better sound quality.
diff --git a/sound/soc/atmel/Makefile b/sound/soc/atmel/Makefile
new file mode 100644 (file)
index 0000000..f54a7cc
--- /dev/null
@@ -0,0 +1,15 @@
+# AT91 Platform Support
+snd-soc-atmel-pcm-objs := atmel-pcm.o
+snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o
+
+obj-$(CONFIG_SND_ATMEL_SOC) += snd-soc-atmel-pcm.o
+obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o
+
+# AT91 Machine Support
+snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o
+
+# AT32 Machine Support
+snd-soc-playpaq-objs := playpaq_wm8510.o
+
+obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o
+obj-$(CONFIG_SND_AT32_SOC_PLAYPAQ) += snd-soc-playpaq.o
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
new file mode 100644 (file)
index 0000000..1fac5ef
--- /dev/null
@@ -0,0 +1,494 @@
+/*
+ * atmel-pcm.c  --  ALSA PCM interface for the Atmel atmel SoC.
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2008 Atmel
+ *
+ * Authors: Sedji Gaouaou <sedji.gaouaou@atmel.com>
+ *
+ * Based on at91-pcm. by:
+ * Frank Mandarino <fmandarino@endrelia.com>
+ * Copyright 2006 Endrelia Technologies Inc.
+ *
+ * Based on pxa2xx-pcm.c by:
+ *
+ * Author:     Nicolas Pitre
+ * Created:    Nov 30, 2004
+ * Copyright:  (C) 2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/dma-mapping.h>
+#include <linux/atmel_pdc.h>
+#include <linux/atmel-ssc.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+
+#include <mach/hardware.h>
+
+#include "atmel-pcm.h"
+
+
+/*--------------------------------------------------------------------------*\
+ * Hardware definition
+\*--------------------------------------------------------------------------*/
+/* TODO: These values were taken from the AT91 platform driver, check
+ *      them against real values for AT32
+ */
+static const struct snd_pcm_hardware atmel_pcm_hardware = {
+       .info                   = SNDRV_PCM_INFO_MMAP |
+                                 SNDRV_PCM_INFO_MMAP_VALID |
+                                 SNDRV_PCM_INFO_INTERLEAVED |
+                                 SNDRV_PCM_INFO_PAUSE,
+       .formats                = SNDRV_PCM_FMTBIT_S16_LE,
+       .period_bytes_min       = 32,
+       .period_bytes_max       = 8192,
+       .periods_min            = 2,
+       .periods_max            = 1024,
+       .buffer_bytes_max       = 32 * 1024,
+};
+
+
+/*--------------------------------------------------------------------------*\
+ * Data types
+\*--------------------------------------------------------------------------*/
+struct atmel_runtime_data {
+       struct atmel_pcm_dma_params *params;
+       dma_addr_t dma_buffer;          /* physical address of dma buffer */
+       dma_addr_t dma_buffer_end;      /* first address beyond DMA buffer */
+       size_t period_size;
+
+       dma_addr_t period_ptr;          /* physical address of next period */
+       int periods;                    /* period index of period_ptr */
+
+       /* PDC register save */
+       u32 pdc_xpr_save;
+       u32 pdc_xcr_save;
+       u32 pdc_xnpr_save;
+       u32 pdc_xncr_save;
+};
+
+
+/*--------------------------------------------------------------------------*\
+ * Helper functions
+\*--------------------------------------------------------------------------*/
+static int atmel_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
+       int stream)
+{
+       struct snd_pcm_substream *substream = pcm->streams[stream].substream;
+       struct snd_dma_buffer *buf = &substream->dma_buffer;
+       size_t size = atmel_pcm_hardware.buffer_bytes_max;
+
+       buf->dev.type = SNDRV_DMA_TYPE_DEV;
+       buf->dev.dev = pcm->card->dev;
+       buf->private_data = NULL;
+       buf->area = dma_alloc_coherent(pcm->card->dev, size,
+                                         &buf->addr, GFP_KERNEL);
+       pr_debug("atmel-pcm:"
+               "preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
+               (void *) buf->area,
+               (void *) buf->addr,
+               size);
+
+       if (!buf->area)
+               return -ENOMEM;
+
+       buf->bytes = size;
+       return 0;
+}
+/*--------------------------------------------------------------------------*\
+ * ISR
+\*--------------------------------------------------------------------------*/
+static void atmel_pcm_dma_irq(u32 ssc_sr,
+       struct snd_pcm_substream *substream)
+{
+       struct atmel_runtime_data *prtd = substream->runtime->private_data;
+       struct atmel_pcm_dma_params *params = prtd->params;
+       static int count;
+
+       count++;
+
+       if (ssc_sr & params->mask->ssc_endbuf) {
+               pr_warning("atmel-pcm: buffer %s on %s"
+                               " (SSC_SR=%#x, count=%d)\n",
+                               substream->stream == SNDRV_PCM_STREAM_PLAYBACK
+                               ? "underrun" : "overrun",
+                               params->name, ssc_sr, count);
+
+               /* re-start the PDC */
+               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
+                          params->mask->pdc_disable);
+               prtd->period_ptr += prtd->period_size;
+               if (prtd->period_ptr >= prtd->dma_buffer_end)
+                       prtd->period_ptr = prtd->dma_buffer;
+
+               ssc_writex(params->ssc->regs, params->pdc->xpr,
+                          prtd->period_ptr);
+               ssc_writex(params->ssc->regs, params->pdc->xcr,
+                          prtd->period_size / params->pdc_xfer_size);
+               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
+                          params->mask->pdc_enable);
+       }
+
+       if (ssc_sr & params->mask->ssc_endx) {
+               /* Load the PDC next pointer and counter registers */
+               prtd->period_ptr += prtd->period_size;
+               if (prtd->period_ptr >= prtd->dma_buffer_end)
+                       prtd->period_ptr = prtd->dma_buffer;
+
+               ssc_writex(params->ssc->regs, params->pdc->xnpr,
+                          prtd->period_ptr);
+               ssc_writex(params->ssc->regs, params->pdc->xncr,
+                          prtd->period_size / params->pdc_xfer_size);
+       }
+
+       snd_pcm_period_elapsed(substream);
+}
+
+
+/*--------------------------------------------------------------------------*\
+ * PCM operations
+\*--------------------------------------------------------------------------*/
+static int atmel_pcm_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       struct atmel_runtime_data *prtd = runtime->private_data;
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+
+       /* this may get called several times by oss emulation
+        * with different params */
+
+       snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
+       runtime->dma_bytes = params_buffer_bytes(params);
+
+       prtd->params = rtd->dai->cpu_dai->dma_data;
+       prtd->params->dma_intr_handler = atmel_pcm_dma_irq;
+
+       prtd->dma_buffer = runtime->dma_addr;
+       prtd->dma_buffer_end = runtime->dma_addr + runtime->dma_bytes;
+       prtd->period_size = params_period_bytes(params);
+
+       pr_debug("atmel-pcm: "
+               "hw_params: DMA for %s initialized "
+               "(dma_bytes=%u, period_size=%u)\n",
+               prtd->params->name,
+               runtime->dma_bytes,
+               prtd->period_size);
+       return 0;
+}
+
+static int atmel_pcm_hw_free(struct snd_pcm_substream *substream)
+{
+       struct atmel_runtime_data *prtd = substream->runtime->private_data;
+       struct atmel_pcm_dma_params *params = prtd->params;
+
+       if (params != NULL) {
+               ssc_writex(params->ssc->regs, SSC_PDC_PTCR,
+                          params->mask->pdc_disable);
+               prtd->params->dma_intr_handler = NULL;
+       }
+
+       return 0;
+}
+
+static int atmel_pcm_prepare(struct snd_pcm_substream *substream)
+{
+       struct atmel_runtime_data *prtd = substream->runtime->private_data;
+       struct atmel_pcm_dma_params *params = prtd->params;
+
+       ssc_writex(params->ssc->regs, SSC_IDR,
+                  params->mask->ssc_endx | params->mask->ssc_endbuf);
+       ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
+                  params->mask->pdc_disable);
+       return 0;
+}
+
+static int atmel_pcm_trigger(struct snd_pcm_substream *substream,
+       int cmd)
+{
+       struct snd_pcm_runtime *rtd = substream->runtime;
+       struct atmel_runtime_data *prtd = rtd->private_data;
+       struct atmel_pcm_dma_params *params = prtd->params;
+       int ret = 0;
+
+       pr_debug("atmel-pcm:buffer_size = %ld,"
+               "dma_area = %p, dma_bytes = %u\n",
+               rtd->buffer_size, rtd->dma_area, rtd->dma_bytes);
+
+       switch (cmd) {
+       case SNDRV_PCM_TRIGGER_START:
+               prtd->period_ptr = prtd->dma_buffer;
+
+               ssc_writex(params->ssc->regs, params->pdc->xpr,
+                          prtd->period_ptr);
+               ssc_writex(params->ssc->regs, params->pdc->xcr,
+                          prtd->period_size / params->pdc_xfer_size);
+
+               prtd->period_ptr += prtd->period_size;
+               ssc_writex(params->ssc->regs, params->pdc->xnpr,
+                          prtd->period_ptr);
+               ssc_writex(params->ssc->regs, params->pdc->xncr,
+                          prtd->period_size / params->pdc_xfer_size);
+
+               pr_debug("atmel-pcm: trigger: "
+                       "period_ptr=%lx, xpr=%u, "
+                       "xcr=%u, xnpr=%u, xncr=%u\n",
+                       (unsigned long)prtd->period_ptr,
+                       ssc_readx(params->ssc->regs, params->pdc->xpr),
+                       ssc_readx(params->ssc->regs, params->pdc->xcr),
+                       ssc_readx(params->ssc->regs, params->pdc->xnpr),
+                       ssc_readx(params->ssc->regs, params->pdc->xncr));
+
+               ssc_writex(params->ssc->regs, SSC_IER,
+                          params->mask->ssc_endx | params->mask->ssc_endbuf);
+               ssc_writex(params->ssc->regs, SSC_PDC_PTCR,
+                          params->mask->pdc_enable);
+
+               pr_debug("sr=%u imr=%u\n",
+                       ssc_readx(params->ssc->regs, SSC_SR),
+                       ssc_readx(params->ssc->regs, SSC_IER));
+               break;          /* SNDRV_PCM_TRIGGER_START */
+
+       case SNDRV_PCM_TRIGGER_STOP:
+       case SNDRV_PCM_TRIGGER_SUSPEND:
+       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
+                          params->mask->pdc_disable);
+               break;
+
+       case SNDRV_PCM_TRIGGER_RESUME:
+       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+               ssc_writex(params->ssc->regs, ATMEL_PDC_PTCR,
+                          params->mask->pdc_enable);
+               break;
+
+       default:
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
+static snd_pcm_uframes_t atmel_pcm_pointer(
+       struct snd_pcm_substream *substream)
+{
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       struct atmel_runtime_data *prtd = runtime->private_data;
+       struct atmel_pcm_dma_params *params = prtd->params;
+       dma_addr_t ptr;
+       snd_pcm_uframes_t x;
+
+       ptr = (dma_addr_t) ssc_readx(params->ssc->regs, params->pdc->xpr);
+       x = bytes_to_frames(runtime, ptr - prtd->dma_buffer);
+
+       if (x == runtime->buffer_size)
+               x = 0;
+
+       return x;
+}
+
+static int atmel_pcm_open(struct snd_pcm_substream *substream)
+{
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       struct atmel_runtime_data *prtd;
+       int ret = 0;
+
+       snd_soc_set_runtime_hwparams(substream, &atmel_pcm_hardware);
+
+       /* ensure that buffer size is a multiple of period size */
+       ret = snd_pcm_hw_constraint_integer(runtime,
+                                               SNDRV_PCM_HW_PARAM_PERIODS);
+       if (ret < 0)
+               goto out;
+
+       prtd = kzalloc(sizeof(struct atmel_runtime_data), GFP_KERNEL);
+       if (prtd == NULL) {
+               ret = -ENOMEM;
+               goto out;
+       }
+       runtime->private_data = prtd;
+
+ out:
+       return ret;
+}
+
+static int atmel_pcm_close(struct snd_pcm_substream *substream)
+{
+       struct atmel_runtime_data *prtd = substream->runtime->private_data;
+
+       kfree(prtd);
+       return 0;
+}
+
+static int atmel_pcm_mmap(struct snd_pcm_substream *substream,
+       struct vm_area_struct *vma)
+{
+       return remap_pfn_range(vma, vma->vm_start,
+                      substream->dma_buffer.addr >> PAGE_SHIFT,
+                      vma->vm_end - vma->vm_start, vma->vm_page_prot);
+}
+
+struct snd_pcm_ops atmel_pcm_ops = {
+       .open           = atmel_pcm_open,
+       .close          = atmel_pcm_close,
+       .ioctl          = snd_pcm_lib_ioctl,
+       .hw_params      = atmel_pcm_hw_params,
+       .hw_free        = atmel_pcm_hw_free,
+       .prepare        = atmel_pcm_prepare,
+       .trigger        = atmel_pcm_trigger,
+       .pointer        = atmel_pcm_pointer,
+       .mmap           = atmel_pcm_mmap,
+};
+
+
+/*--------------------------------------------------------------------------*\
+ * ASoC platform driver
+\*--------------------------------------------------------------------------*/
+static u64 atmel_pcm_dmamask = 0xffffffff;
+
+static int atmel_pcm_new(struct snd_card *card,
+       struct snd_soc_dai *dai, struct snd_pcm *pcm)
+{
+       int ret = 0;
+
+       if (!card->dev->dma_mask)
+               card->dev->dma_mask = &atmel_pcm_dmamask;
+       if (!card->dev->coherent_dma_mask)
+               card->dev->coherent_dma_mask = 0xffffffff;
+
+       if (dai->playback.channels_min) {
+               ret = atmel_pcm_preallocate_dma_buffer(pcm,
+                       SNDRV_PCM_STREAM_PLAYBACK);
+               if (ret)
+                       goto out;
+       }
+
+       if (dai->capture.channels_min) {
+               pr_debug("at32-pcm:"
+                               "Allocating PCM capture DMA buffer\n");
+               ret = atmel_pcm_preallocate_dma_buffer(pcm,
+                       SNDRV_PCM_STREAM_CAPTURE);
+               if (ret)
+                       goto out;
+       }
+ out:
+       return ret;
+}
+
+static void atmel_pcm_free_dma_buffers(struct snd_pcm *pcm)
+{
+       struct snd_pcm_substream *substream;
+       struct snd_dma_buffer *buf;
+       int stream;
+
+       for (stream = 0; stream < 2; stream++) {
+               substream = pcm->streams[stream].substream;
+               if (!substream)
+                       continue;
+
+               buf = &substream->dma_buffer;
+               if (!buf->area)
+                       continue;
+               dma_free_coherent(pcm->card->dev, buf->bytes,
+                                 buf->area, buf->addr);
+               buf->area = NULL;
+       }
+}
+
+#ifdef CONFIG_PM
+static int atmel_pcm_suspend(struct snd_soc_dai *dai)
+{
+       struct snd_pcm_runtime *runtime = dai->runtime;
+       struct atmel_runtime_data *prtd;
+       struct atmel_pcm_dma_params *params;
+
+       if (!runtime)
+               return 0;
+
+       prtd = runtime->private_data;
+       params = prtd->params;
+
+       /* disable the PDC and save the PDC registers */
+
+       ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_disable);
+
+       prtd->pdc_xpr_save = ssc_readx(params->ssc->regs, params->pdc->xpr);
+       prtd->pdc_xcr_save = ssc_readx(params->ssc->regs, params->pdc->xcr);
+       prtd->pdc_xnpr_save = ssc_readx(params->ssc->regs, params->pdc->xnpr);
+       prtd->pdc_xncr_save = ssc_readx(params->ssc->regs, params->pdc->xncr);
+
+       return 0;
+}
+
+static int atmel_pcm_resume(struct snd_soc_dai *dai)
+{
+       struct snd_pcm_runtime *runtime = dai->runtime;
+       struct atmel_runtime_data *prtd;
+       struct atmel_pcm_dma_params *params;
+
+       if (!runtime)
+               return 0;
+
+       prtd = runtime->private_data;
+       params = prtd->params;
+
+       /* restore the PDC registers and enable the PDC */
+       ssc_writex(params->ssc->regs, params->pdc->xpr, prtd->pdc_xpr_save);
+       ssc_writex(params->ssc->regs, params->pdc->xcr, prtd->pdc_xcr_save);
+       ssc_writex(params->ssc->regs, params->pdc->xnpr, prtd->pdc_xnpr_save);
+       ssc_writex(params->ssc->regs, params->pdc->xncr, prtd->pdc_xncr_save);
+
+       ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_enable);
+       return 0;
+}
+#else
+#define atmel_pcm_suspend      NULL
+#define atmel_pcm_resume       NULL
+#endif
+
+struct snd_soc_platform atmel_soc_platform = {
+       .name           = "atmel-audio",
+       .pcm_ops        = &atmel_pcm_ops,
+       .pcm_new        = atmel_pcm_new,
+       .pcm_free       = atmel_pcm_free_dma_buffers,
+       .suspend        = atmel_pcm_suspend,
+       .resume         = atmel_pcm_resume,
+};
+EXPORT_SYMBOL_GPL(atmel_soc_platform);
+
+static int __init atmel_pcm_modinit(void)
+{
+       return snd_soc_register_platform(&atmel_soc_platform);
+}
+module_init(atmel_pcm_modinit);
+
+static void __exit atmel_pcm_modexit(void)
+{
+       snd_soc_unregister_platform(&atmel_soc_platform);
+}
+module_exit(atmel_pcm_modexit);
+
+MODULE_AUTHOR("Sedji Gaouaou <sedji.gaouaou@atmel.com>");
+MODULE_DESCRIPTION("Atmel PCM module");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h
new file mode 100644 (file)
index 0000000..ec9b282
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * at91-pcm.h - ALSA PCM interface for the Atmel AT91 SoC.
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2008 Atmel
+ *
+ * Authors: Sedji Gaouaou <sedji.gaouaou@atmel.com>
+ *
+ * Based on at91-pcm. by:
+ * Frank Mandarino <fmandarino@endrelia.com>
+ * Copyright 2006 Endrelia Technologies Inc.
+ *
+ * Based on pxa2xx-pcm.c by:
+ *
+ * Author:     Nicolas Pitre
+ * Created:    Nov 30, 2004
+ * Copyright:  (C) 2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _ATMEL_PCM_H
+#define _ATMEL_PCM_H
+
+#include <linux/atmel-ssc.h>
+
+/*
+ * Registers and status bits that are required by the PCM driver.
+ */
+struct atmel_pdc_regs {
+       unsigned int    xpr;            /* PDC recv/trans pointer */
+       unsigned int    xcr;            /* PDC recv/trans counter */
+       unsigned int    xnpr;           /* PDC next recv/trans pointer */
+       unsigned int    xncr;           /* PDC next recv/trans counter */
+       unsigned int    ptcr;           /* PDC transfer control */
+};
+
+struct atmel_ssc_mask {
+       u32     ssc_enable;             /* SSC recv/trans enable */
+       u32     ssc_disable;            /* SSC recv/trans disable */
+       u32     ssc_endx;               /* SSC ENDTX or ENDRX */
+       u32     ssc_endbuf;             /* SSC TXBUFE or RXBUFF */
+       u32     pdc_enable;             /* PDC recv/trans enable */
+       u32     pdc_disable;            /* PDC recv/trans disable */
+};
+
+/*
+ * This structure, shared between the PCM driver and the interface,
+ * contains all information required by the PCM driver to perform the
+ * PDC DMA operation.  All fields except dma_intr_handler() are initialized
+ * by the interface.  The dms_intr_handler() pointer is set by the PCM
+ * driver and called by the interface SSC interrupt handler if it is
+ * non-NULL.
+ */
+struct atmel_pcm_dma_params {
+       char *name;                     /* stream identifier */
+       int pdc_xfer_size;              /* PDC counter increment in bytes */
+       struct ssc_device *ssc;         /* SSC device for stream */
+       struct atmel_pdc_regs *pdc;     /* PDC receive or transmit registers */
+       struct atmel_ssc_mask *mask;    /* SSC & PDC status bits */
+       struct snd_pcm_substream *substream;
+       void (*dma_intr_handler)(u32, struct snd_pcm_substream *);
+};
+
+extern struct snd_soc_platform atmel_soc_platform;
+
+
+/*
+ * SSC register access (since ssc_writel() / ssc_readl() require literal name)
+ */
+#define ssc_readx(base, reg)            (__raw_readl((base) + (reg)))
+#define ssc_writex(base, reg, value)    __raw_writel((value), (base) + (reg))
+
+#endif /* _ATMEL_PCM_H */
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
new file mode 100644 (file)
index 0000000..c5d6790
--- /dev/null
@@ -0,0 +1,790 @@
+/*
+ * atmel_ssc_dai.c  --  ALSA SoC ATMEL SSC Audio Layer Platform driver
+ *
+ * Copyright (C) 2005 SAN People
+ * Copyright (C) 2008 Atmel
+ *
+ * Author: Sedji Gaouaou <sedji.gaouaou@atmel.com>
+ *         ATMEL CORP.
+ *
+ * Based on at91-ssc.c by
+ * Frank Mandarino <fmandarino@endrelia.com>
+ * Based on pxa2xx Platform drivers by
+ * Liam Girdwood <liam.girdwood@wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/atmel_pdc.h>
+
+#include <linux/atmel-ssc.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/initval.h>
+#include <sound/soc.h>
+
+#include <mach/hardware.h>
+
+#include "atmel-pcm.h"
+#include "atmel_ssc_dai.h"
+
+
+#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
+#define NUM_SSC_DEVICES                1
+#else
+#define NUM_SSC_DEVICES                3
+#endif
+
+/*
+ * SSC PDC registers required by the PCM DMA engine.
+ */
+static struct atmel_pdc_regs pdc_tx_reg = {
+       .xpr            = ATMEL_PDC_TPR,
+       .xcr            = ATMEL_PDC_TCR,
+       .xnpr           = ATMEL_PDC_TNPR,
+       .xncr           = ATMEL_PDC_TNCR,
+};
+
+static struct atmel_pdc_regs pdc_rx_reg = {
+       .xpr            = ATMEL_PDC_RPR,
+       .xcr            = ATMEL_PDC_RCR,
+       .xnpr           = ATMEL_PDC_RNPR,
+       .xncr           = ATMEL_PDC_RNCR,
+};
+
+/*
+ * SSC & PDC status bits for transmit and receive.
+ */
+static struct atmel_ssc_mask ssc_tx_mask = {
+       .ssc_enable     = SSC_BIT(CR_TXEN),
+       .ssc_disable    = SSC_BIT(CR_TXDIS),
+       .ssc_endx       = SSC_BIT(SR_ENDTX),
+       .ssc_endbuf     = SSC_BIT(SR_TXBUFE),
+       .pdc_enable     = ATMEL_PDC_TXTEN,
+       .pdc_disable    = ATMEL_PDC_TXTDIS,
+};
+
+static struct atmel_ssc_mask ssc_rx_mask = {
+       .ssc_enable     = SSC_BIT(CR_RXEN),
+       .ssc_disable    = SSC_BIT(CR_RXDIS),
+       .ssc_endx       = SSC_BIT(SR_ENDRX),
+       .ssc_endbuf     = SSC_BIT(SR_RXBUFF),
+       .pdc_enable     = ATMEL_PDC_RXTEN,
+       .pdc_disable    = ATMEL_PDC_RXTDIS,
+};
+
+
+/*
+ * DMA parameters.
+ */
+static struct atmel_pcm_dma_params ssc_dma_params[NUM_SSC_DEVICES][2] = {
+       {{
+       .name           = "SSC0 PCM out",
+       .pdc            = &pdc_tx_reg,
+       .mask           = &ssc_tx_mask,
+       },
+       {
+       .name           = "SSC0 PCM in",
+       .pdc            = &pdc_rx_reg,
+       .mask           = &ssc_rx_mask,
+       } },
+#if NUM_SSC_DEVICES == 3
+       {{
+       .name           = "SSC1 PCM out",
+       .pdc            = &pdc_tx_reg,
+       .mask           = &ssc_tx_mask,
+       },
+       {
+       .name           = "SSC1 PCM in",
+       .pdc            = &pdc_rx_reg,
+       .mask           = &ssc_rx_mask,
+       } },
+       {{
+       .name           = "SSC2 PCM out",
+       .pdc            = &pdc_tx_reg,
+       .mask           = &ssc_tx_mask,
+       },
+       {
+       .name           = "SSC2 PCM in",
+       .pdc            = &pdc_rx_reg,
+       .mask           = &ssc_rx_mask,
+       } },
+#endif
+};
+
+
+static struct atmel_ssc_info ssc_info[NUM_SSC_DEVICES] = {
+       {
+       .name           = "ssc0",
+       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[0].lock),
+       .dir_mask       = SSC_DIR_MASK_UNUSED,
+       .initialized    = 0,
+       },
+#if NUM_SSC_DEVICES == 3
+       {
+       .name           = "ssc1",
+       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[1].lock),
+       .dir_mask       = SSC_DIR_MASK_UNUSED,
+       .initialized    = 0,
+       },
+       {
+       .name           = "ssc2",
+       .lock           = __SPIN_LOCK_UNLOCKED(ssc_info[2].lock),
+       .dir_mask       = SSC_DIR_MASK_UNUSED,
+       .initialized    = 0,
+       },
+#endif
+};
+
+
+/*
+ * SSC interrupt handler.  Passes PDC interrupts to the DMA
+ * interrupt handler in the PCM driver.
+ */
+static irqreturn_t atmel_ssc_interrupt(int irq, void *dev_id)
+{
+       struct atmel_ssc_info *ssc_p = dev_id;
+       struct atmel_pcm_dma_params *dma_params;
+       u32 ssc_sr;
+       u32 ssc_substream_mask;
+       int i;
+
+       ssc_sr = (unsigned long)ssc_readl(ssc_p->ssc->regs, SR)
+                       & (unsigned long)ssc_readl(ssc_p->ssc->regs, IMR);
+
+       /*
+        * Loop through the substreams attached to this SSC.  If
+        * a DMA-related interrupt occurred on that substream, call
+        * the DMA interrupt handler function, if one has been
+        * registered in the dma_params structure by the PCM driver.
+        */
+       for (i = 0; i < ARRAY_SIZE(ssc_p->dma_params); i++) {
+               dma_params = ssc_p->dma_params[i];
+
+               if ((dma_params != NULL) &&
+                       (dma_params->dma_intr_handler != NULL)) {
+                       ssc_substream_mask = (dma_params->mask->ssc_endx |
+                                       dma_params->mask->ssc_endbuf);
+                       if (ssc_sr & ssc_substream_mask) {
+                               dma_params->dma_intr_handler(ssc_sr,
+                                               dma_params->
+                                               substream);
+                       }
+               }
+       }
+
+       return IRQ_HANDLED;
+}
+
+
+/*-------------------------------------------------------------------------*\
+ * DAI functions
+\*-------------------------------------------------------------------------*/
+/*
+ * Startup.  Only that one substream allowed in each direction.
+ */
+static int atmel_ssc_startup(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+       struct atmel_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
+       int dir_mask;
+
+       pr_debug("atmel_ssc_startup: SSC_SR=0x%u\n",
+               ssc_readl(ssc_p->ssc->regs, SR));
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               dir_mask = SSC_DIR_MASK_PLAYBACK;
+       else
+               dir_mask = SSC_DIR_MASK_CAPTURE;
+
+       spin_lock_irq(&ssc_p->lock);
+       if (ssc_p->dir_mask & dir_mask) {
+               spin_unlock_irq(&ssc_p->lock);
+               return -EBUSY;
+       }
+       ssc_p->dir_mask |= dir_mask;
+       spin_unlock_irq(&ssc_p->lock);
+
+       return 0;
+}
+
+/*
+ * Shutdown.  Clear DMA parameters and shutdown the SSC if there
+ * are no other substreams open.
+ */
+static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+       struct atmel_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
+       struct atmel_pcm_dma_params *dma_params;
+       int dir, dir_mask;
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               dir = 0;
+       else
+               dir = 1;
+
+       dma_params = ssc_p->dma_params[dir];
+
+       if (dma_params != NULL) {
+               ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_disable);
+               pr_debug("atmel_ssc_shutdown: %s disabled SSC_SR=0x%08x\n",
+                       (dir ? "receive" : "transmit"),
+                       ssc_readl(ssc_p->ssc->regs, SR));
+
+               dma_params->ssc = NULL;
+               dma_params->substream = NULL;
+               ssc_p->dma_params[dir] = NULL;
+       }
+
+       dir_mask = 1 << dir;
+
+       spin_lock_irq(&ssc_p->lock);
+       ssc_p->dir_mask &= ~dir_mask;
+       if (!ssc_p->dir_mask) {
+               if (ssc_p->initialized) {
+                       /* Shutdown the SSC clock. */
+                       pr_debug("atmel_ssc_dau: Stopping clock\n");
+                       clk_disable(ssc_p->ssc->clk);
+
+                       free_irq(ssc_p->ssc->irq, ssc_p);
+                       ssc_p->initialized = 0;
+               }
+
+               /* Reset the SSC */
+               ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST));
+               /* Clear the SSC dividers */
+               ssc_p->cmr_div = ssc_p->tcmr_period = ssc_p->rcmr_period = 0;
+       }
+       spin_unlock_irq(&ssc_p->lock);
+}
+
+
+/*
+ * Record the DAI format for use in hw_params().
+ */
+static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
+               unsigned int fmt)
+{
+       struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+
+       ssc_p->daifmt = fmt;
+       return 0;
+}
+
+/*
+ * Record SSC clock dividers for use in hw_params().
+ */
+static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
+       int div_id, int div)
+{
+       struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+
+       switch (div_id) {
+       case ATMEL_SSC_CMR_DIV:
+               /*
+                * The same master clock divider is used for both
+                * transmit and receive, so if a value has already
+                * been set, it must match this value.
+                */
+               if (ssc_p->cmr_div == 0)
+                       ssc_p->cmr_div = div;
+               else
+                       if (div != ssc_p->cmr_div)
+                               return -EBUSY;
+               break;
+
+       case ATMEL_SSC_TCMR_PERIOD:
+               ssc_p->tcmr_period = div;
+               break;
+
+       case ATMEL_SSC_RCMR_PERIOD:
+               ssc_p->rcmr_period = div;
+               break;
+
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+/*
+ * Configure the SSC.
+ */
+static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+       int id = rtd->dai->cpu_dai->id;
+       struct atmel_ssc_info *ssc_p = &ssc_info[id];
+       struct atmel_pcm_dma_params *dma_params;
+       int dir, channels, bits;
+       u32 tfmr, rfmr, tcmr, rcmr;
+       int start_event;
+       int ret;
+
+       /*
+        * Currently, there is only one set of dma params for
+        * each direction.  If more are added, this code will
+        * have to be changed to select the proper set.
+        */
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               dir = 0;
+       else
+               dir = 1;
+
+       dma_params = &ssc_dma_params[id][dir];
+       dma_params->ssc = ssc_p->ssc;
+       dma_params->substream = substream;
+
+       ssc_p->dma_params[dir] = dma_params;
+
+       /*
+        * The cpu_dai->dma_data field is only used to communicate the
+        * appropriate DMA parameters to the pcm driver hw_params()
+        * function.  It should not be used for other purposes
+        * as it is common to all substreams.
+        */
+       rtd->dai->cpu_dai->dma_data = dma_params;
+
+       channels = params_channels(params);
+
+       /*
+        * Determine sample size in bits and the PDC increment.
+        */
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S8:
+               bits = 8;
+               dma_params->pdc_xfer_size = 1;
+               break;
+       case SNDRV_PCM_FORMAT_S16_LE:
+               bits = 16;
+               dma_params->pdc_xfer_size = 2;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+               bits = 24;
+               dma_params->pdc_xfer_size = 4;
+               break;
+       case SNDRV_PCM_FORMAT_S32_LE:
+               bits = 32;
+               dma_params->pdc_xfer_size = 4;
+               break;
+       default:
+               printk(KERN_WARNING "atmel_ssc_dai: unsupported PCM format");
+               return -EINVAL;
+       }
+
+       /*
+        * The SSC only supports up to 16-bit samples in I2S format, due
+        * to the size of the Frame Mode Register FSLEN field.
+        */
+       if ((ssc_p->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S
+               && bits > 16) {
+               printk(KERN_WARNING
+                               "atmel_ssc_dai: sample size %d"
+                               "is too large for I2S\n", bits);
+               return -EINVAL;
+       }
+
+       /*
+        * Compute SSC register settings.
+        */
+       switch (ssc_p->daifmt
+               & (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_MASTER_MASK)) {
+
+       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS:
+               /*
+                * I2S format, SSC provides BCLK and LRC clocks.
+                *
+                * The SSC transmit and receive clocks are generated
+                * from the MCK divider, and the BCLK signal
+                * is output on the SSC TK line.
+                */
+               rcmr =    SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
+                       | SSC_BF(RCMR_STTDLY, START_DELAY)
+                       | SSC_BF(RCMR_START, SSC_START_FALLING_RF)
+                       | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
+                       | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
+                       | SSC_BF(RCMR_CKS, SSC_CKS_DIV);
+
+               rfmr =    SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(RFMR_FSOS, SSC_FSOS_NEGATIVE)
+                       | SSC_BF(RFMR_FSLEN, (bits - 1))
+                       | SSC_BF(RFMR_DATNB, (channels - 1))
+                       | SSC_BIT(RFMR_MSBF)
+                       | SSC_BF(RFMR_LOOP, 0)
+                       | SSC_BF(RFMR_DATLEN, (bits - 1));
+
+               tcmr =    SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
+                       | SSC_BF(TCMR_STTDLY, START_DELAY)
+                       | SSC_BF(TCMR_START, SSC_START_FALLING_RF)
+                       | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
+                       | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS)
+                       | SSC_BF(TCMR_CKS, SSC_CKS_DIV);
+
+               tfmr =    SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(TFMR_FSDEN, 0)
+                       | SSC_BF(TFMR_FSOS, SSC_FSOS_NEGATIVE)
+                       | SSC_BF(TFMR_FSLEN, (bits - 1))
+                       | SSC_BF(TFMR_DATNB, (channels - 1))
+                       | SSC_BIT(TFMR_MSBF)
+                       | SSC_BF(TFMR_DATDEF, 0)
+                       | SSC_BF(TFMR_DATLEN, (bits - 1));
+               break;
+
+       case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
+               /*
+                * I2S format, CODEC supplies BCLK and LRC clocks.
+                *
+                * The SSC transmit clock is obtained from the BCLK signal on
+                * on the TK line, and the SSC receive clock is
+                * generated from the transmit clock.
+                *
+                *  For single channel data, one sample is transferred
+                * on the falling edge of the LRC clock.
+                * For two channel data, one sample is
+                * transferred on both edges of the LRC clock.
+                */
+               start_event = ((channels == 1)
+                               ? SSC_START_FALLING_RF
+                               : SSC_START_EDGE_RF);
+
+               rcmr =    SSC_BF(RCMR_PERIOD, 0)
+                       | SSC_BF(RCMR_STTDLY, START_DELAY)
+                       | SSC_BF(RCMR_START, start_event)
+                       | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
+                       | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
+                       | SSC_BF(RCMR_CKS, SSC_CKS_CLOCK);
+
+               rfmr =    SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
+                       | SSC_BF(RFMR_FSLEN, 0)
+                       | SSC_BF(RFMR_DATNB, 0)
+                       | SSC_BIT(RFMR_MSBF)
+                       | SSC_BF(RFMR_LOOP, 0)
+                       | SSC_BF(RFMR_DATLEN, (bits - 1));
+
+               tcmr =    SSC_BF(TCMR_PERIOD, 0)
+                       | SSC_BF(TCMR_STTDLY, START_DELAY)
+                       | SSC_BF(TCMR_START, start_event)
+                       | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
+                       | SSC_BF(TCMR_CKO, SSC_CKO_NONE)
+                       | SSC_BF(TCMR_CKS, SSC_CKS_PIN);
+
+               tfmr =    SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(TFMR_FSDEN, 0)
+                       | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
+                       | SSC_BF(TFMR_FSLEN, 0)
+                       | SSC_BF(TFMR_DATNB, 0)
+                       | SSC_BIT(TFMR_MSBF)
+                       | SSC_BF(TFMR_DATDEF, 0)
+                       | SSC_BF(TFMR_DATLEN, (bits - 1));
+               break;
+
+       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS:
+               /*
+                * DSP/PCM Mode A format, SSC provides BCLK and LRC clocks.
+                *
+                * The SSC transmit and receive clocks are generated from the
+                * MCK divider, and the BCLK signal is output
+                * on the SSC TK line.
+                */
+               rcmr =    SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
+                       | SSC_BF(RCMR_STTDLY, 1)
+                       | SSC_BF(RCMR_START, SSC_START_RISING_RF)
+                       | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
+                       | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
+                       | SSC_BF(RCMR_CKS, SSC_CKS_DIV);
+
+               rfmr =    SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(RFMR_FSOS, SSC_FSOS_POSITIVE)
+                       | SSC_BF(RFMR_FSLEN, 0)
+                       | SSC_BF(RFMR_DATNB, (channels - 1))
+                       | SSC_BIT(RFMR_MSBF)
+                       | SSC_BF(RFMR_LOOP, 0)
+                       | SSC_BF(RFMR_DATLEN, (bits - 1));
+
+               tcmr =    SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
+                       | SSC_BF(TCMR_STTDLY, 1)
+                       | SSC_BF(TCMR_START, SSC_START_RISING_RF)
+                       | SSC_BF(TCMR_CKI, SSC_CKI_RISING)
+                       | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS)
+                       | SSC_BF(TCMR_CKS, SSC_CKS_DIV);
+
+               tfmr =    SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+                       | SSC_BF(TFMR_FSDEN, 0)
+                       | SSC_BF(TFMR_FSOS, SSC_FSOS_POSITIVE)
+                       | SSC_BF(TFMR_FSLEN, 0)
+                       | SSC_BF(TFMR_DATNB, (channels - 1))
+                       | SSC_BIT(TFMR_MSBF)
+                       | SSC_BF(TFMR_DATDEF, 0)
+                       | SSC_BF(TFMR_DATLEN, (bits - 1));
+               break;
+
+       case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM:
+       default:
+               printk(KERN_WARNING "atmel_ssc_dai: unsupported DAI format 0x%x\n",
+                       ssc_p->daifmt);
+               return -EINVAL;
+               break;
+       }
+       pr_debug("atmel_ssc_hw_params: "
+                       "RCMR=%08x RFMR=%08x TCMR=%08x TFMR=%08x\n",
+                       rcmr, rfmr, tcmr, tfmr);
+
+       if (!ssc_p->initialized) {
+
+               /* Enable PMC peripheral clock for this SSC */
+               pr_debug("atmel_ssc_dai: Starting clock\n");
+               clk_enable(ssc_p->ssc->clk);
+
+               /* Reset the SSC and its PDC registers */
+               ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST));
+
+               ssc_writel(ssc_p->ssc->regs, PDC_RPR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_RCR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_RNPR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_RNCR, 0);
+
+               ssc_writel(ssc_p->ssc->regs, PDC_TPR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_TCR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_TNPR, 0);
+               ssc_writel(ssc_p->ssc->regs, PDC_TNCR, 0);
+
+               ret = request_irq(ssc_p->ssc->irq, atmel_ssc_interrupt, 0,
+                               ssc_p->name, ssc_p);
+               if (ret < 0) {
+                       printk(KERN_WARNING
+                                       "atmel_ssc_dai: request_irq failure\n");
+                       pr_debug("Atmel_ssc_dai: Stoping clock\n");
+                       clk_disable(ssc_p->ssc->clk);
+                       return ret;
+               }
+
+               ssc_p->initialized = 1;
+       }
+
+       /* set SSC clock mode register */
+       ssc_writel(ssc_p->ssc->regs, CMR, ssc_p->cmr_div);
+
+       /* set receive clock mode and format */
+       ssc_writel(ssc_p->ssc->regs, RCMR, rcmr);
+       ssc_writel(ssc_p->ssc->regs, RFMR, rfmr);
+
+       /* set transmit clock mode and format */
+       ssc_writel(ssc_p->ssc->regs, TCMR, tcmr);
+       ssc_writel(ssc_p->ssc->regs, TFMR, tfmr);
+
+       pr_debug("atmel_ssc_dai,hw_params: SSC initialized\n");
+       return 0;
+}
+
+
+static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+       struct atmel_ssc_info *ssc_p = &ssc_info[rtd->dai->cpu_dai->id];
+       struct atmel_pcm_dma_params *dma_params;
+       int dir;
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               dir = 0;
+       else
+               dir = 1;
+
+       dma_params = ssc_p->dma_params[dir];
+
+       ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable);
+
+       pr_debug("%s enabled SSC_SR=0x%08x\n",
+                       dir ? "receive" : "transmit",
+                       ssc_readl(ssc_p->ssc->regs, SR));
+       return 0;
+}
+
+
+#ifdef CONFIG_PM
+static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
+{
+       struct atmel_ssc_info *ssc_p;
+
+       if (!cpu_dai->active)
+               return 0;
+
+       ssc_p = &ssc_info[cpu_dai->id];
+
+       /* Save the status register before disabling transmit and receive */
+       ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
+       ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_TXDIS) | SSC_BIT(CR_RXDIS));
+
+       /* Save the current interrupt mask, then disable unmasked interrupts */
+       ssc_p->ssc_state.ssc_imr = ssc_readl(ssc_p->ssc->regs, IMR);
+       ssc_writel(ssc_p->ssc->regs, IDR, ssc_p->ssc_state.ssc_imr);
+
+       ssc_p->ssc_state.ssc_cmr = ssc_readl(ssc_p->ssc->regs, CMR);
+       ssc_p->ssc_state.ssc_rcmr = ssc_readl(ssc_p->ssc->regs, RCMR);
+       ssc_p->ssc_state.ssc_rfmr = ssc_readl(ssc_p->ssc->regs, RFMR);
+       ssc_p->ssc_state.ssc_tcmr = ssc_readl(ssc_p->ssc->regs, TCMR);
+       ssc_p->ssc_state.ssc_tfmr = ssc_readl(ssc_p->ssc->regs, TFMR);
+
+       return 0;
+}
+
+
+
+static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
+{
+       struct atmel_ssc_info *ssc_p;
+       u32 cr;
+
+       if (!cpu_dai->active)
+               return 0;
+
+       ssc_p = &ssc_info[cpu_dai->id];
+
+       /* restore SSC register settings */
+       ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
+       ssc_writel(ssc_p->ssc->regs, TCMR, ssc_p->ssc_state.ssc_tcmr);
+       ssc_writel(ssc_p->ssc->regs, RFMR, ssc_p->ssc_state.ssc_rfmr);
+       ssc_writel(ssc_p->ssc->regs, RCMR, ssc_p->ssc_state.ssc_rcmr);
+       ssc_writel(ssc_p->ssc->regs, CMR, ssc_p->ssc_state.ssc_cmr);
+
+       /* re-enable interrupts */
+       ssc_writel(ssc_p->ssc->regs, IER, ssc_p->ssc_state.ssc_imr);
+
+       /* Re-enable recieve and transmit as appropriate */
+       cr = 0;
+       cr |=
+           (ssc_p->ssc_state.ssc_sr & SSC_BIT(SR_RXEN)) ? SSC_BIT(CR_RXEN) : 0;
+       cr |=
+           (ssc_p->ssc_state.ssc_sr & SSC_BIT(SR_TXEN)) ? SSC_BIT(CR_TXEN) : 0;
+       ssc_writel(ssc_p->ssc->regs, CR, cr);
+
+       return 0;
+}
+#else /* CONFIG_PM */
+#  define atmel_ssc_suspend    NULL
+#  define atmel_ssc_resume     NULL
+#endif /* CONFIG_PM */
+
+
+#define ATMEL_SSC_RATES (SNDRV_PCM_RATE_8000_96000)
+
+#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8     | SNDRV_PCM_FMTBIT_S16_LE |\
+                         SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
+
+struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
+       {       .name = "atmel-ssc0",
+               .id = 0,
+               .suspend = atmel_ssc_suspend,
+               .resume = atmel_ssc_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .ops = {
+                       .startup = atmel_ssc_startup,
+                       .shutdown = atmel_ssc_shutdown,
+                       .prepare = atmel_ssc_prepare,
+                       .hw_params = atmel_ssc_hw_params,
+                       .set_fmt = atmel_ssc_set_dai_fmt,
+                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .private_data = &ssc_info[0],
+       },
+#if NUM_SSC_DEVICES == 3
+       {       .name = "atmel-ssc1",
+               .id = 1,
+               .suspend = atmel_ssc_suspend,
+               .resume = atmel_ssc_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .ops = {
+                       .startup = atmel_ssc_startup,
+                       .shutdown = atmel_ssc_shutdown,
+                       .prepare = atmel_ssc_prepare,
+                       .hw_params = atmel_ssc_hw_params,
+                       .set_fmt = atmel_ssc_set_dai_fmt,
+                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .private_data = &ssc_info[1],
+       },
+       {       .name = "atmel-ssc2",
+               .id = 2,
+               .suspend = atmel_ssc_suspend,
+               .resume = atmel_ssc_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = ATMEL_SSC_RATES,
+                       .formats = ATMEL_SSC_FORMATS,},
+               .ops = {
+                       .startup = atmel_ssc_startup,
+                       .shutdown = atmel_ssc_shutdown,
+                       .prepare = atmel_ssc_prepare,
+                       .hw_params = atmel_ssc_hw_params,
+                       .set_fmt = atmel_ssc_set_dai_fmt,
+                       .set_clkdiv = atmel_ssc_set_dai_clkdiv,},
+               .private_data = &ssc_info[2],
+       },
+#endif
+};
+EXPORT_SYMBOL_GPL(atmel_ssc_dai);
+
+static int __init atmel_ssc_modinit(void)
+{
+       return snd_soc_register_dais(atmel_ssc_dai, ARRAY_SIZE(atmel_ssc_dai));
+}
+module_init(atmel_ssc_modinit);
+
+static void __exit atmel_ssc_modexit(void)
+{
+       snd_soc_unregister_dais(atmel_ssc_dai, ARRAY_SIZE(atmel_ssc_dai));
+}
+module_exit(atmel_ssc_modexit);
+
+/* Module information */
+MODULE_AUTHOR("Sedji Gaouaou, sedji.gaouaou@atmel.com, www.atmel.com");
+MODULE_DESCRIPTION("ATMEL SSC ASoC Interface");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/atmel/atmel_ssc_dai.h b/sound/soc/atmel/atmel_ssc_dai.h
new file mode 100644 (file)
index 0000000..a828746
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * atmel_ssc_dai.h - ALSA SSC interface for the Atmel  SoC
+ *
+ * Copyright (C) 2005 SAN People
+ * Copyright (C) 2008 Atmel
+ *
+ * Author: Sedji Gaouaou <sedji.gaouaou@atmel.com>
+ *         ATMEL CORP.
+ *
+ * Based on at91-ssc.c by
+ * Frank Mandarino <fmandarino@endrelia.com>
+ * Based on pxa2xx Platform drivers by
+ * Liam Girdwood <liam.girdwood@wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _ATMEL_SSC_DAI_H
+#define _ATMEL_SSC_DAI_H
+
+#include <linux/types.h>
+#include <linux/atmel-ssc.h>
+
+#include "atmel-pcm.h"
+
+/* SSC system clock ids */
+#define ATMEL_SYSCLK_MCK       0 /* SSC uses AT91 MCK as system clock */
+
+/* SSC divider ids */
+#define ATMEL_SSC_CMR_DIV      0 /* MCK divider for BCLK */
+#define ATMEL_SSC_TCMR_PERIOD  1 /* BCLK divider for transmit FS */
+#define ATMEL_SSC_RCMR_PERIOD  2 /* BCLK divider for receive FS */
+/*
+ * SSC direction masks
+ */
+#define SSC_DIR_MASK_UNUSED    0
+#define SSC_DIR_MASK_PLAYBACK  1
+#define SSC_DIR_MASK_CAPTURE   2
+
+/*
+ * SSC register values that Atmel left out of <linux/atmel-ssc.h>.  These
+ * are expected to be used with SSC_BF
+ */
+/* START bit field values */
+#define SSC_START_CONTINUOUS   0
+#define SSC_START_TX_RX                1
+#define SSC_START_LOW_RF       2
+#define SSC_START_HIGH_RF      3
+#define SSC_START_FALLING_RF   4
+#define SSC_START_RISING_RF    5
+#define SSC_START_LEVEL_RF     6
+#define SSC_START_EDGE_RF      7
+#define SSS_START_COMPARE_0    8
+
+/* CKI bit field values */
+#define SSC_CKI_FALLING                0
+#define SSC_CKI_RISING         1
+
+/* CKO bit field values */
+#define SSC_CKO_NONE           0
+#define SSC_CKO_CONTINUOUS     1
+#define SSC_CKO_TRANSFER       2
+
+/* CKS bit field values */
+#define SSC_CKS_DIV            0
+#define SSC_CKS_CLOCK          1
+#define SSC_CKS_PIN            2
+
+/* FSEDGE bit field values */
+#define SSC_FSEDGE_POSITIVE    0
+#define SSC_FSEDGE_NEGATIVE    1
+
+/* FSOS bit field values */
+#define SSC_FSOS_NONE          0
+#define SSC_FSOS_NEGATIVE      1
+#define SSC_FSOS_POSITIVE      2
+#define SSC_FSOS_LOW           3
+#define SSC_FSOS_HIGH          4
+#define SSC_FSOS_TOGGLE                5
+
+#define START_DELAY            1
+
+struct atmel_ssc_state {
+       u32 ssc_cmr;
+       u32 ssc_rcmr;
+       u32 ssc_rfmr;
+       u32 ssc_tcmr;
+       u32 ssc_tfmr;
+       u32 ssc_sr;
+       u32 ssc_imr;
+};
+
+
+struct atmel_ssc_info {
+       char *name;
+       struct ssc_device *ssc;
+       spinlock_t lock;        /* lock for dir_mask */
+       unsigned short dir_mask;        /* 0=unused, 1=playback, 2=capture */
+       unsigned short initialized;     /* true if SSC has been initialized */
+       unsigned short daifmt;
+       unsigned short cmr_div;
+       unsigned short tcmr_period;
+       unsigned short rcmr_period;
+       struct atmel_pcm_dma_params *dma_params[2];
+       struct atmel_ssc_state ssc_state;
+};
+extern struct snd_soc_dai atmel_ssc_dai[];
+
+#endif /* _AT91_SSC_DAI_H */
diff --git a/sound/soc/atmel/playpaq_wm8510.c b/sound/soc/atmel/playpaq_wm8510.c
new file mode 100644 (file)
index 0000000..43dd8ce
--- /dev/null
@@ -0,0 +1,512 @@
+/* sound/soc/at32/playpaq_wm8510.c
+ * ASoC machine driver for PlayPaq using WM8510 codec
+ *
+ * Copyright (C) 2008 Long Range Systems
+ *    Geoffrey Wossum <gwossum@acm.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This code is largely inspired by sound/soc/at91/eti_b1_wm8731.c
+ *
+ * NOTE: If you don't have the AT32 enhanced portmux configured (which
+ * isn't currently in the mainline or Atmel patched kernel), you will
+ * need to set the MCLK pin (PA30) to peripheral A in your board initialization
+ * code.  Something like:
+ *     at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0);
+ *
+ */
+
+/* #define DEBUG */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/clk.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <mach/at32ap700x.h>
+#include <mach/portmux.h>
+
+#include "../codecs/wm8510.h"
+#include "atmel-pcm.h"
+#include "atmel_ssc_dai.h"
+
+
+/*-------------------------------------------------------------------------*\
+ * constants
+\*-------------------------------------------------------------------------*/
+#define MCLK_PIN               GPIO_PIN_PA(30)
+#define MCLK_PERIPH            GPIO_PERIPH_A
+
+
+/*-------------------------------------------------------------------------*\
+ * data types
+\*-------------------------------------------------------------------------*/
+/* SSC clocking data */
+struct ssc_clock_data {
+       /* CMR div */
+       unsigned int cmr_div;
+
+       /* Frame period (as needed by xCMR.PERIOD) */
+       unsigned int period;
+
+       /* The SSC clock rate these settings where calculated for */
+       unsigned long ssc_rate;
+};
+
+
+/*-------------------------------------------------------------------------*\
+ * module data
+\*-------------------------------------------------------------------------*/
+static struct clk *_gclk0;
+static struct clk *_pll0;
+
+#define CODEC_CLK (_gclk0)
+
+
+/*-------------------------------------------------------------------------*\
+ * Sound SOC operations
+\*-------------------------------------------------------------------------*/
+#if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
+static struct ssc_clock_data playpaq_wm8510_calc_ssc_clock(
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *cpu_dai)
+{
+       struct at32_ssc_info *ssc_p = cpu_dai->private_data;
+       struct ssc_device *ssc = ssc_p->ssc;
+       struct ssc_clock_data cd;
+       unsigned int rate, width_bits, channels;
+       unsigned int bitrate, ssc_div;
+       unsigned actual_rate;
+
+
+       /*
+        * Figure out required bitrate
+        */
+       rate = params_rate(params);
+       channels = params_channels(params);
+       width_bits = snd_pcm_format_physical_width(params_format(params));
+       bitrate = rate * width_bits * channels;
+
+
+       /*
+        * Figure out required SSC divider and period for required bitrate
+        */
+       cd.ssc_rate = clk_get_rate(ssc->clk);
+       ssc_div = cd.ssc_rate / bitrate;
+       cd.cmr_div = ssc_div / 2;
+       if (ssc_div & 1) {
+               /* round cmr_div up */
+               cd.cmr_div++;
+       }
+       cd.period = width_bits - 1;
+
+
+       /*
+        * Find actual rate, compare to requested rate
+        */
+       actual_rate = (cd.ssc_rate / (cd.cmr_div * 2)) / (2 * (cd.period + 1));
+       pr_debug("playpaq_wm8510: Request rate = %d, actual rate = %d\n",
+                rate, actual_rate);
+
+
+       return cd;
+}
+#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
+
+
+
+static int playpaq_wm8510_hw_params(struct snd_pcm_substream *substream,
+                                   struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct at32_ssc_info *ssc_p = cpu_dai->private_data;
+       struct ssc_device *ssc = ssc_p->ssc;
+       unsigned int pll_out = 0, bclk = 0, mclk_div = 0;
+       int ret;
+
+
+       /* Due to difficulties with getting the correct clocks from the AT32's
+        * PLL0, we're going to let the CODEC be in charge of all the clocks
+        */
+#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
+       const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+#else
+       struct ssc_clock_data cd;
+       const unsigned int fmt = (SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBS_CFS);
+#endif
+
+       if (ssc == NULL) {
+               pr_warning("playpaq_wm8510_hw_params: ssc is NULL!\n");
+               return -EINVAL;
+       }
+
+
+       /*
+        * Figure out PLL and BCLK dividers for WM8510
+        */
+       switch (params_rate(params)) {
+       case 48000:
+               pll_out = 12288000;
+               mclk_div = WM8510_MCLKDIV_1;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       case 44100:
+               pll_out = 11289600;
+               mclk_div = WM8510_MCLKDIV_1;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       case 22050:
+               pll_out = 11289600;
+               mclk_div = WM8510_MCLKDIV_2;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       case 16000:
+               pll_out = 12288000;
+               mclk_div = WM8510_MCLKDIV_3;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       case 11025:
+               pll_out = 11289600;
+               mclk_div = WM8510_MCLKDIV_4;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       case 8000:
+               pll_out = 12288000;
+               mclk_div = WM8510_MCLKDIV_6;
+               bclk = WM8510_BCLKDIV_8;
+               break;
+
+       default:
+               pr_warning("playpaq_wm8510: Unsupported sample rate %d\n",
+                          params_rate(params));
+               return -EINVAL;
+       }
+
+
+       /*
+        * set CPU and CODEC DAI configuration
+        */
+       ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: "
+                          "Failed to set CODEC DAI format (%d)\n",
+                          ret);
+               return ret;
+       }
+       ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: "
+                          "Failed to set CPU DAI format (%d)\n",
+                          ret);
+               return ret;
+       }
+
+
+       /*
+        * Set CPU clock configuration
+        */
+#if defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
+       cd = playpaq_wm8510_calc_ssc_clock(params, cpu_dai);
+       pr_debug("playpaq_wm8510: cmr_div = %d, period = %d\n",
+                cd.cmr_div, cd.period);
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_CMR_DIV, cd.cmr_div);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: Failed to set CPU CMR_DIV (%d)\n",
+                          ret);
+               return ret;
+       }
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, AT32_SSC_TCMR_PERIOD,
+                                         cd.period);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: "
+                          "Failed to set CPU transmit period (%d)\n",
+                          ret);
+               return ret;
+       }
+#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
+
+
+       /*
+        * Set CODEC clock configuration
+        */
+       pr_debug("playpaq_wm8510: "
+                "pll_in = %ld, pll_out = %u, bclk = %x, mclk = %x\n",
+                clk_get_rate(CODEC_CLK), pll_out, bclk, mclk_div);
+
+
+#if !defined CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE
+       ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_BCLKDIV, bclk);
+       if (ret < 0) {
+               pr_warning
+                   ("playpaq_wm8510: Failed to set CODEC DAI BCLKDIV (%d)\n",
+                    ret);
+               return ret;
+       }
+#endif /* CONFIG_SND_AT32_SOC_PLAYPAQ_SLAVE */
+
+
+       ret = snd_soc_dai_set_pll(codec_dai, 0,
+                                        clk_get_rate(CODEC_CLK), pll_out);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: Failed to set CODEC DAI PLL (%d)\n",
+                          ret);
+               return ret;
+       }
+
+
+       ret = snd_soc_dai_set_clkdiv(codec_dai, WM8510_MCLKDIV, mclk_div);
+       if (ret < 0) {
+               pr_warning("playpaq_wm8510: Failed to set CODEC MCLKDIV (%d)\n",
+                          ret);
+               return ret;
+       }
+
+
+       return 0;
+}
+
+
+
+static struct snd_soc_ops playpaq_wm8510_ops = {
+       .hw_params = playpaq_wm8510_hw_params,
+};
+
+
+
+static const struct snd_soc_dapm_widget playpaq_dapm_widgets[] = {
+       SND_SOC_DAPM_MIC("Int Mic", NULL),
+       SND_SOC_DAPM_SPK("Ext Spk", NULL),
+};
+
+
+
+static const struct snd_soc_dapm_route intercon[] = {
+       /* speaker connected to SPKOUT */
+       {"Ext Spk", NULL, "SPKOUTP"},
+       {"Ext Spk", NULL, "SPKOUTN"},
+
+       {"Mic Bias", NULL, "Int Mic"},
+       {"MICN", NULL, "Mic Bias"},
+       {"MICP", NULL, "Mic Bias"},
+};
+
+
+
+static int playpaq_wm8510_init(struct snd_soc_codec *codec)
+{
+       int i;
+
+       /*
+        * Add DAPM widgets
+        */
+       for (i = 0; i < ARRAY_SIZE(playpaq_dapm_widgets); i++)
+               snd_soc_dapm_new_control(codec, &playpaq_dapm_widgets[i]);
+
+
+
+       /*
+        * Setup audio path interconnects
+        */
+       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+
+
+       /* always connected pins */
+       snd_soc_dapm_enable_pin(codec, "Int Mic");
+       snd_soc_dapm_enable_pin(codec, "Ext Spk");
+       snd_soc_dapm_sync(codec);
+
+
+
+       /* Make CSB show PLL rate */
+       snd_soc_dai_set_clkdiv(codec->dai, WM8510_OPCLKDIV,
+                                      WM8510_OPCLKDIV_1 | 4);
+
+       return 0;
+}
+
+
+
+static struct snd_soc_dai_link playpaq_wm8510_dai = {
+       .name = "WM8510",
+       .stream_name = "WM8510 PCM",
+       .cpu_dai = &at32_ssc_dai[0],
+       .codec_dai = &wm8510_dai,
+       .init = playpaq_wm8510_init,
+       .ops = &playpaq_wm8510_ops,
+};
+
+
+
+static struct snd_soc_card snd_soc_playpaq = {
+       .name = "LRS_PlayPaq_WM8510",
+       .platform = &at32_soc_platform,
+       .dai_link = &playpaq_wm8510_dai,
+       .num_links = 1,
+};
+
+
+
+static struct wm8510_setup_data playpaq_wm8510_setup = {
+       .i2c_bus = 0,
+       .i2c_address = 0x1a,
+};
+
+
+
+static struct snd_soc_device playpaq_wm8510_snd_devdata = {
+       .card = &snd_soc_playpaq,
+       .codec_dev = &soc_codec_dev_wm8510,
+       .codec_data = &playpaq_wm8510_setup,
+};
+
+static struct platform_device *playpaq_snd_device;
+
+
+static int __init playpaq_asoc_init(void)
+{
+       int ret = 0;
+       struct at32_ssc_info *ssc_p = playpaq_wm8510_dai.cpu_dai->private_data;
+       struct ssc_device *ssc = NULL;
+
+
+       /*
+        * Request SSC device
+        */
+       ssc = ssc_request(0);
+       if (IS_ERR(ssc)) {
+               ret = PTR_ERR(ssc);
+               goto err_ssc;
+       }
+       ssc_p->ssc = ssc;
+
+
+       /*
+        * Configure MCLK for WM8510
+        */
+       _gclk0 = clk_get(NULL, "gclk0");
+       if (IS_ERR(_gclk0)) {
+               _gclk0 = NULL;
+               goto err_gclk0;
+       }
+       _pll0 = clk_get(NULL, "pll0");
+       if (IS_ERR(_pll0)) {
+               _pll0 = NULL;
+               goto err_pll0;
+       }
+       if (clk_set_parent(_gclk0, _pll0)) {
+               pr_warning("snd-soc-playpaq: "
+                          "Failed to set PLL0 as parent for DAC clock\n");
+               goto err_set_clk;
+       }
+       clk_set_rate(CODEC_CLK, 12000000);
+       clk_enable(CODEC_CLK);
+
+#if defined CONFIG_AT32_ENHANCED_PORTMUX
+       at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0);
+#endif
+
+
+       /*
+        * Create and register platform device
+        */
+       playpaq_snd_device = platform_device_alloc("soc-audio", 0);
+       if (playpaq_snd_device == NULL) {
+               ret = -ENOMEM;
+               goto err_device_alloc;
+       }
+
+       platform_set_drvdata(playpaq_snd_device, &playpaq_wm8510_snd_devdata);
+       playpaq_wm8510_snd_devdata.dev = &playpaq_snd_device->dev;
+
+       ret = platform_device_add(playpaq_snd_device);
+       if (ret) {
+               pr_warning("playpaq_wm8510: platform_device_add failed (%d)\n",
+                          ret);
+               goto err_device_add;
+       }
+
+       return 0;
+
+
+err_device_add:
+       if (playpaq_snd_device != NULL) {
+               platform_device_put(playpaq_snd_device);
+               playpaq_snd_device = NULL;
+       }
+err_device_alloc:
+err_set_clk:
+       if (_pll0 != NULL) {
+               clk_put(_pll0);
+               _pll0 = NULL;
+       }
+err_pll0:
+       if (_gclk0 != NULL) {
+               clk_put(_gclk0);
+               _gclk0 = NULL;
+       }
+err_gclk0:
+       ssc_free(ssc);
+err_ssc:
+       return ret;
+}
+
+
+static void __exit playpaq_asoc_exit(void)
+{
+       struct at32_ssc_info *ssc_p = playpaq_wm8510_dai.cpu_dai->private_data;
+       struct ssc_device *ssc;
+
+       if (ssc_p != NULL) {
+               ssc = ssc_p->ssc;
+               if (ssc != NULL)
+                       ssc_free(ssc);
+               ssc_p->ssc = NULL;
+       }
+
+       if (_gclk0 != NULL) {
+               clk_put(_gclk0);
+               _gclk0 = NULL;
+       }
+       if (_pll0 != NULL) {
+               clk_put(_pll0);
+               _pll0 = NULL;
+       }
+
+#if defined CONFIG_AT32_ENHANCED_PORTMUX
+       at32_free_pin(MCLK_PIN);
+#endif
+
+       platform_device_unregister(playpaq_snd_device);
+       playpaq_snd_device = NULL;
+}
+
+module_init(playpaq_asoc_init);
+module_exit(playpaq_asoc_exit);
+
+MODULE_AUTHOR("Geoffrey Wossum <gwossum@acm.org>");
+MODULE_DESCRIPTION("ASoC machine driver for LRS PlayPaq");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
new file mode 100644 (file)
index 0000000..1fb59a9
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * sam9g20_wm8731  --  SoC audio for AT91SAM9G20-based
+ *                     ATMEL AT91SAM9G20ek board.
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2008 Atmel
+ *
+ * Authors: Sedji Gaouaou <sedji.gaouaou@atmel.com>
+ *
+ * Based on ati_b1_wm8731.c by:
+ * Frank Mandarino <fmandarino@endrelia.com>
+ * Copyright 2006 Endrelia Technologies Inc.
+ * Based on corgi.c by:
+ * Copyright 2005 Wolfson Microelectronics PLC.
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/kernel.h>
+#include <linux/clk.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <linux/atmel-ssc.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <mach/hardware.h>
+#include <mach/gpio.h>
+
+#include "../codecs/wm8731.h"
+#include "atmel-pcm.h"
+#include "atmel_ssc_dai.h"
+
+
+static int at91sam9g20ek_startup(struct snd_pcm_substream *substream)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       int ret;
+
+       /* codec system clock is supplied by PCK0, set to 12MHz */
+       ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK,
+               12000000, SND_SOC_CLOCK_IN);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+
+static void at91sam9g20ek_shutdown(struct snd_pcm_substream *substream)
+{
+       struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
+
+       dev_dbg(rtd->socdev->dev, "shutdown");
+}
+
+static int at91sam9g20ek_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct atmel_ssc_info *ssc_p = cpu_dai->private_data;
+       struct ssc_device *ssc = ssc_p->ssc;
+       int ret;
+
+       unsigned int rate;
+       int cmr_div, period;
+
+       if (ssc == NULL) {
+               printk(KERN_INFO "at91sam9g20ek_hw_params: ssc is NULL!\n");
+               return -EINVAL;
+       }
+
+       /* set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       /* set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       /*
+        * The SSC clock dividers depend on the sample rate.  The CMR.DIV
+        * field divides the system master clock MCK to drive the SSC TK
+        * signal which provides the codec BCLK.  The TCMR.PERIOD and
+        * RCMR.PERIOD fields further divide the BCLK signal to drive
+        * the SSC TF and RF signals which provide the codec DACLRC and
+        * ADCLRC clocks.
+        *
+        * The dividers were determined through trial and error, where a
+        * CMR.DIV value is chosen such that the resulting BCLK value is
+        * divisible, or almost divisible, by (2 * sample rate), and then
+        * the TCMR.PERIOD or RCMR.PERIOD is BCLK / (2 * sample rate) - 1.
+        */
+       rate = params_rate(params);
+
+       switch (rate) {
+       case 8000:
+               cmr_div = 55;   /* BCLK = 133MHz/(2*55) = 1.209MHz */
+               period = 74;    /* LRC = BCLK/(2*(74+1)) ~= 8060,6Hz */
+               break;
+       case 11025:
+               cmr_div = 67;   /* BCLK = 133MHz/(2*60) = 1.108MHz */
+               period = 45;    /* LRC = BCLK/(2*(49+1)) = 11083,3Hz */
+               break;
+       case 16000:
+               cmr_div = 63;   /* BCLK = 133MHz/(2*63) = 1.055MHz */
+               period = 32;    /* LRC = BCLK/(2*(32+1)) = 15993,2Hz */
+               break;
+       case 22050:
+               cmr_div = 52;   /* BCLK = 133MHz/(2*52) = 1.278MHz */
+               period = 28;    /* LRC = BCLK/(2*(28+1)) = 22049Hz */
+               break;
+       case 32000:
+               cmr_div = 66;   /* BCLK = 133MHz/(2*66) = 1.007MHz */
+               period = 15;    /* LRC = BCLK/(2*(15+1)) = 31486,742Hz */
+               break;
+       case 44100:
+               cmr_div = 29;   /* BCLK = 133MHz/(2*29) = 2.293MHz */
+               period = 25;    /* LRC = BCLK/(2*(25+1)) = 44098Hz */
+               break;
+       case 48000:
+               cmr_div = 33;   /* BCLK = 133MHz/(2*33) = 2.015MHz */
+               period = 20;    /* LRC = BCLK/(2*(20+1)) = 47979,79Hz */
+               break;
+       case 88200:
+               cmr_div = 29;   /* BCLK = 133MHz/(2*29) = 2.293MHz */
+               period = 12;    /* LRC = BCLK/(2*(12+1)) = 88196Hz */
+               break;
+       case 96000:
+               cmr_div = 23;   /* BCLK = 133MHz/(2*23) = 2.891MHz */
+               period = 14;    /* LRC = BCLK/(2*(14+1)) = 96376Hz */
+               break;
+       default:
+               printk(KERN_WARNING "unsupported rate %d"
+                               " on at91sam9g20ek board\n", rate);
+               return -EINVAL;
+       }
+
+       /* set the MCK divider for BCLK */
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, ATMEL_SSC_CMR_DIV, cmr_div);
+       if (ret < 0)
+               return ret;
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               /* set the BCLK divider for DACLRC */
+               ret = snd_soc_dai_set_clkdiv(cpu_dai,
+                                               ATMEL_SSC_TCMR_PERIOD, period);
+       } else {
+               /* set the BCLK divider for ADCLRC */
+               ret = snd_soc_dai_set_clkdiv(cpu_dai,
+                                               ATMEL_SSC_RCMR_PERIOD, period);
+       }
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+
+static struct snd_soc_ops at91sam9g20ek_ops = {
+       .startup = at91sam9g20ek_startup,
+       .hw_params = at91sam9g20ek_hw_params,
+       .shutdown = at91sam9g20ek_shutdown,
+};
+
+
+static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = {
+       SND_SOC_DAPM_MIC("Int Mic", NULL),
+       SND_SOC_DAPM_SPK("Ext Spk", NULL),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+
+       /* speaker connected to LHPOUT */
+       {"Ext Spk", NULL, "LHPOUT"},
+
+       /* mic is connected to Mic Jack, with WM8731 Mic Bias */
+       {"MICIN", NULL, "Mic Bias"},
+       {"Mic Bias", NULL, "Int Mic"},
+};
+
+/*
+ * Logic for a wm8731 as connected on a at91sam9g20ek board.
+ */
+static int at91sam9g20ek_wm8731_init(struct snd_soc_codec *codec)
+{
+       printk(KERN_DEBUG
+                       "at91sam9g20ek_wm8731 "
+                       ": at91sam9g20ek_wm8731_init() called\n");
+
+       /* Add specific widgets */
+       snd_soc_dapm_new_controls(codec, at91sam9g20ek_dapm_widgets,
+                                 ARRAY_SIZE(at91sam9g20ek_dapm_widgets));
+       /* Set up specific audio path interconnects */
+       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+       /* not connected */
+       snd_soc_dapm_disable_pin(codec, "RLINEIN");
+       snd_soc_dapm_disable_pin(codec, "LLINEIN");
+
+       /* always connected */
+       snd_soc_dapm_enable_pin(codec, "Int Mic");
+       snd_soc_dapm_enable_pin(codec, "Ext Spk");
+
+       snd_soc_dapm_sync(codec);
+
+       return 0;
+}
+
+static struct snd_soc_dai_link at91sam9g20ek_dai = {
+       .name = "WM8731",
+       .stream_name = "WM8731 PCM",
+       .cpu_dai = &atmel_ssc_dai[0],
+       .codec_dai = &wm8731_dai,
+       .init = at91sam9g20ek_wm8731_init,
+       .ops = &at91sam9g20ek_ops,
+};
+
+static struct snd_soc_card snd_soc_at91sam9g20ek = {
+       .name = "WM8731",
+       .platform = &atmel_soc_platform,
+       .dai_link = &at91sam9g20ek_dai,
+       .num_links = 1,
+};
+
+static struct wm8731_setup_data at91sam9g20ek_wm8731_setup = {
+       .i2c_bus = 0,
+       .i2c_address = 0x1b,
+};
+
+static struct snd_soc_device at91sam9g20ek_snd_devdata = {
+       .card = &snd_soc_at91sam9g20ek,
+       .codec_dev = &soc_codec_dev_wm8731,
+       .codec_data = &at91sam9g20ek_wm8731_setup,
+};
+
+static struct platform_device *at91sam9g20ek_snd_device;
+
+static int __init at91sam9g20ek_init(void)
+{
+       struct atmel_ssc_info *ssc_p = at91sam9g20ek_dai.cpu_dai->private_data;
+       struct ssc_device *ssc = NULL;
+       int ret;
+
+       /*
+        * Request SSC device
+        */
+       ssc = ssc_request(0);
+       if (IS_ERR(ssc)) {
+               ret = PTR_ERR(ssc);
+               ssc = NULL;
+               goto err_ssc;
+       }
+       ssc_p->ssc = ssc;
+
+       at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!at91sam9g20ek_snd_device) {
+               printk(KERN_DEBUG
+                               "platform device allocation failed\n");
+               ret = -ENOMEM;
+       }
+
+       platform_set_drvdata(at91sam9g20ek_snd_device,
+                       &at91sam9g20ek_snd_devdata);
+       at91sam9g20ek_snd_devdata.dev = &at91sam9g20ek_snd_device->dev;
+
+       ret = platform_device_add(at91sam9g20ek_snd_device);
+       if (ret) {
+               printk(KERN_DEBUG
+                               "platform device allocation failed\n");
+               platform_device_put(at91sam9g20ek_snd_device);
+       }
+
+       return ret;
+
+err_ssc:
+       return ret;
+}
+
+static void __exit at91sam9g20ek_exit(void)
+{
+       struct atmel_ssc_info *ssc_p = at91sam9g20ek_dai.cpu_dai->private_data;
+       struct ssc_device *ssc;
+
+       if (ssc_p != NULL) {
+               ssc = ssc_p->ssc;
+               if (ssc != NULL)
+                       ssc_free(ssc);
+               ssc_p->ssc = NULL;
+       }
+
+       platform_device_unregister(at91sam9g20ek_snd_device);
+       at91sam9g20ek_snd_device = NULL;
+}
+
+module_init(at91sam9g20ek_init);
+module_exit(at91sam9g20ek_exit);
+
+/* Module information */
+MODULE_AUTHOR("Sedji Gaouaou <sedji.gaouaou@atmel.com>");
+MODULE_DESCRIPTION("ALSA SoC AT91SAM9G20EK_WM8731");
+MODULE_LICENSE("GPL");
index 1466d932880026a99cd32f9e339c55fda0c3033f..74c823d60f91b4662184dcf60b76eeb2eaae4303 100644 (file)
@@ -406,11 +406,12 @@ static int __init au1xpsc_audio_dbdma_init(void)
 {
        au1xpsc_audio_pcmdma[PCM_TX] = NULL;
        au1xpsc_audio_pcmdma[PCM_RX] = NULL;
-       return 0;
+       return snd_soc_register_platform(&au1xpsc_soc_platform);
 }
 
 static void __exit au1xpsc_audio_dbdma_exit(void)
 {
+       snd_soc_unregister_platform(&au1xpsc_soc_platform);
 }
 
 module_init(au1xpsc_audio_dbdma_init);
index 57facbad68254cc4b21ecb189bb3ad161afb495e..f0e30aec7f233621a23a35f9fa8100facdc4a189 100644 (file)
@@ -160,7 +160,8 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
 static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream,
-                                 struct snd_pcm_hw_params *params)
+                                 struct snd_pcm_hw_params *params,
+                                 struct snd_soc_dai *dai)
 {
        /* FIXME */
        struct au1xpsc_audio_data *pscdata = au1xpsc_ac97_workdata;
@@ -210,7 +211,7 @@ static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream,
 }
 
 static int au1xpsc_ac97_trigger(struct snd_pcm_substream *substream,
-                               int cmd)
+                               int cmd, struct snd_soc_dai *dai)
 {
        /* FIXME */
        struct au1xpsc_audio_data *pscdata = au1xpsc_ac97_workdata;
@@ -313,8 +314,7 @@ static void au1xpsc_ac97_remove(struct platform_device *pdev,
        au1xpsc_ac97_workdata = NULL;
 }
 
-static int au1xpsc_ac97_suspend(struct platform_device *pdev,
-                               struct snd_soc_dai *dai)
+static int au1xpsc_ac97_suspend(struct snd_soc_dai *dai)
 {
        /* save interesting registers and disable PSC */
        au1xpsc_ac97_workdata->pm[0] =
@@ -328,8 +328,7 @@ static int au1xpsc_ac97_suspend(struct platform_device *pdev,
        return 0;
 }
 
-static int au1xpsc_ac97_resume(struct platform_device *pdev,
-                              struct snd_soc_dai *dai)
+static int au1xpsc_ac97_resume(struct snd_soc_dai *dai)
 {
        /* restore PSC clock config */
        au_writel(au1xpsc_ac97_workdata->pm[0] | PSC_SEL_PS_AC97MODE,
@@ -345,7 +344,7 @@ static int au1xpsc_ac97_resume(struct platform_device *pdev,
 
 struct snd_soc_dai au1xpsc_ac97_dai = {
        .name                   = "au1xpsc_ac97",
-       .type                   = SND_SOC_DAI_AC97,
+       .ac97_control           = 1,
        .probe                  = au1xpsc_ac97_probe,
        .remove                 = au1xpsc_ac97_remove,
        .suspend                = au1xpsc_ac97_suspend,
@@ -372,11 +371,12 @@ EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai);
 static int __init au1xpsc_ac97_init(void)
 {
        au1xpsc_ac97_workdata = NULL;
-       return 0;
+       return snd_soc_register_dai(&au1xpsc_ac97_dai);
 }
 
 static void __exit au1xpsc_ac97_exit(void)
 {
+       snd_soc_unregister_dai(&au1xpsc_ac97_dai);
 }
 
 module_init(au1xpsc_ac97_init);
index 9384702c7ebd7c09f0df6d4e25f9161ac854cc37..f916de4400edcc358a58a33d227f9fafd0ce88af 100644 (file)
@@ -116,7 +116,8 @@ out:
 }
 
 static int au1xpsc_i2s_hw_params(struct snd_pcm_substream *substream,
-                                struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct au1xpsc_audio_data *pscdata = au1xpsc_i2s_workdata;
 
@@ -240,7 +241,8 @@ static int au1xpsc_i2s_stop(struct au1xpsc_audio_data *pscdata, int stype)
        return 0;
 }
 
-static int au1xpsc_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int au1xpsc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                              struct snd_soc_dai *dai)
 {
        struct au1xpsc_audio_data *pscdata = au1xpsc_i2s_workdata;
        int ret, stype = SUBSTREAM_TYPE(substream);
@@ -337,8 +339,7 @@ static void au1xpsc_i2s_remove(struct platform_device *pdev,
        au1xpsc_i2s_workdata = NULL;
 }
 
-static int au1xpsc_i2s_suspend(struct platform_device *pdev,
-                              struct snd_soc_dai *cpu_dai)
+static int au1xpsc_i2s_suspend(struct snd_soc_dai *cpu_dai)
 {
        /* save interesting register and disable PSC */
        au1xpsc_i2s_workdata->pm[0] =
@@ -352,8 +353,7 @@ static int au1xpsc_i2s_suspend(struct platform_device *pdev,
        return 0;
 }
 
-static int au1xpsc_i2s_resume(struct platform_device *pdev,
-                             struct snd_soc_dai *cpu_dai)
+static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai)
 {
        /* select I2S mode and PSC clock */
        au_writel(PSC_CTRL_DISABLE, PSC_CTRL(au1xpsc_i2s_workdata));
@@ -369,7 +369,6 @@ static int au1xpsc_i2s_resume(struct platform_device *pdev,
 
 struct snd_soc_dai au1xpsc_i2s_dai = {
        .name                   = "au1xpsc_i2s",
-       .type                   = SND_SOC_DAI_I2S,
        .probe                  = au1xpsc_i2s_probe,
        .remove                 = au1xpsc_i2s_remove,
        .suspend                = au1xpsc_i2s_suspend,
@@ -389,8 +388,6 @@ struct snd_soc_dai au1xpsc_i2s_dai = {
        .ops = {
                .trigger        = au1xpsc_i2s_trigger,
                .hw_params      = au1xpsc_i2s_hw_params,
-       },
-       .dai_ops = {
                .set_fmt        = au1xpsc_i2s_set_fmt,
        },
 };
@@ -399,11 +396,12 @@ EXPORT_SYMBOL(au1xpsc_i2s_dai);
 static int __init au1xpsc_i2s_init(void)
 {
        au1xpsc_i2s_workdata = NULL;
-       return 0;
+       return snd_soc_register_dai(&au1xpsc_i2s_dai);
 }
 
 static void __exit au1xpsc_i2s_exit(void)
 {
+       snd_soc_unregister_dai(&au1xpsc_i2s_dai);
 }
 
 module_init(au1xpsc_i2s_init);
index f75ae7f62c3d4c157ec1b51729b972e173464474..27683eb7905e305f800211dcfa21718e73a4c5c9 100644 (file)
@@ -42,14 +42,14 @@ static struct snd_soc_dai_link au1xpsc_sample_ac97_dai = {
        .ops            = NULL,
 };
 
-static struct snd_soc_machine au1xpsc_sample_ac97_machine = {
+static struct snd_soc_card au1xpsc_sample_ac97_machine = {
        .name           = "Au1xxx PSC AC97 Audio",
        .dai_link       = &au1xpsc_sample_ac97_dai,
        .num_links      = 1,
 };
 
 static struct snd_soc_device au1xpsc_sample_ac97_devdata = {
-       .machine        = &au1xpsc_sample_ac97_machine,
+       .card           = &au1xpsc_sample_ac97_machine,
        .platform       = &au1xpsc_soc_platform, /* see dbdma2.c */
        .codec_dev      = &soc_codec_dev_ac97,
 };
index dc006206f622d043d4257162e71466f3b77bf0fb..0a2f8f9eff53f616b32c330f5e1befb7dbf972d2 100644 (file)
@@ -1,6 +1,6 @@
 config SND_BF5XX_I2S
        tristate "SoC I2S Audio for the ADI BF5xx chip"
-       depends on BLACKFIN && SND_SOC
+       depends on BLACKFIN
        help
          Say Y or M if you want to add support for codecs attached to
          the Blackfin SPORT (synchronous serial ports) interface in I2S
@@ -13,7 +13,6 @@ config SND_BF5XX_SOC_SSM2602
        select SND_BF5XX_SOC_I2S
        select SND_SOC_SSM2602
        select I2C
-       select I2C_BLACKFIN_TWI
        help
          Say Y if you want to add support for SoC audio on BF527-EZKIT.
 
@@ -35,7 +34,7 @@ config SND_BFIN_AD73311_SE
 
 config SND_BF5XX_AC97
        tristate "SoC AC97 Audio for the ADI BF5xx chip"
-       depends on BLACKFIN && SND_SOC
+       depends on BLACKFIN
        help
          Say Y or M if you want to add support for codecs attached to
          the Blackfin SPORT (synchronous serial ports) interface in slot 16
@@ -47,7 +46,7 @@ config SND_BF5XX_AC97
          properly with this driver. This driver is known to work with the
          Analog Devices line of AC97 codecs.
 
-config SND_MMAP_SUPPORT
+config SND_BF5XX_MMAP_SUPPORT
        bool "Enable MMAP Support"
        depends on SND_BF5XX_AC97
        default y
@@ -55,9 +54,17 @@ config SND_MMAP_SUPPORT
          Say y if you want AC97 driver to support mmap mode.
          We introduce an intermediate buffer to simulate mmap.
 
+config SND_BF5XX_MULTICHAN_SUPPORT
+       bool "Enable Multichannel Support"
+       depends on SND_BF5XX_AC97
+       default n
+       help
+         Say y if you want AC97 driver to support up to 5.1 channel audio.
+         this mode will consume much more memory for DMA.
+
 config SND_BF5XX_SOC_SPORT
        tristate
-       
+
 config SND_BF5XX_SOC_I2S
        tristate
        select SND_BF5XX_SOC_SPORT
@@ -80,7 +87,7 @@ config SND_BF5XX_SPORT_NUM
        int "Set a SPORT for Sound chip"
        depends on (SND_BF5XX_I2S || SND_BF5XX_AC97)
        range 0 3 if BF54x
-       range 0 1 if (BF53x || BF561)
+       range 0 1 if !BF54x
        default 0
        help
          Set the correct SPORT for sound chip.
@@ -90,12 +97,13 @@ config SND_BF5XX_HAVE_COLD_RESET
        depends on SND_BF5XX_AC97
        default y if BFIN548_EZKIT
        default n if !BFIN548_EZKIT
-       
+
 config SND_BF5XX_RESET_GPIO_NUM
        int "Set a GPIO for cold reset"
        depends on SND_BF5XX_HAVE_COLD_RESET
        range 0 159
        default 19 if BFIN548_EZKIT
        default 5 if BFIN537_STAMP
+       default 0
        help
          Set the correct GPIO for RESET the sound chip.
index 25e50d2ea1ec321d4140295f6d6ce587d79f0a9a..8067cfafa3a703ea5e0f9dacb30f4c13e882f0ff 100644 (file)
 #include "bf5xx-ac97.h"
 #include "bf5xx-sport.h"
 
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+static unsigned int ac97_chan_mask[] = {
+       SP_FL, /* Mono */
+       SP_STEREO, /* Stereo */
+       SP_2DOT1, /* 2.1*/
+       SP_QUAD,/*Quadraquic*/
+       SP_FL | SP_FR | SP_FC | SP_SL | SP_SR,/*5 channels */
+       SP_5DOT1, /* 5.1 */
+};
+
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 static void bf5xx_mmap_copy(struct snd_pcm_substream *substream,
         snd_pcm_uframes_t count)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct sport_device *sport = runtime->private_data;
+       unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1];
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               bf5xx_pcm_to_ac97(
-                       (struct ac97_frame *)sport->tx_dma_buf + sport->tx_pos,
-                       (__u32 *)runtime->dma_area + sport->tx_pos, count);
+               bf5xx_pcm_to_ac97((struct ac97_frame *)sport->tx_dma_buf +
+               sport->tx_pos, (__u16 *)runtime->dma_area + sport->tx_pos *
+               runtime->channels, count, chan_mask);
                sport->tx_pos += runtime->period_size;
                if (sport->tx_pos >= runtime->buffer_size)
                        sport->tx_pos %= runtime->buffer_size;
                sport->tx_delay_pos = sport->tx_pos;
        } else {
-               bf5xx_ac97_to_pcm(
-                       (struct ac97_frame *)sport->rx_dma_buf + sport->rx_pos,
-                       (__u32 *)runtime->dma_area + sport->rx_pos, count);
+               bf5xx_ac97_to_pcm((struct ac97_frame *)sport->rx_dma_buf +
+               sport->rx_pos, (__u16 *)runtime->dma_area + sport->rx_pos *
+               runtime->channels, count);
                sport->rx_pos += runtime->period_size;
                if (sport->rx_pos >= runtime->buffer_size)
                        sport->rx_pos %= runtime->buffer_size;
@@ -71,7 +81,7 @@ static void bf5xx_mmap_copy(struct snd_pcm_substream *substream,
 static void bf5xx_dma_irq(void *data)
 {
        struct snd_pcm_substream *pcm = data;
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        struct snd_pcm_runtime *runtime = pcm->runtime;
        struct sport_device *sport = runtime->private_data;
        bf5xx_mmap_copy(pcm, runtime->period_size);
@@ -90,17 +100,14 @@ static void bf5xx_dma_irq(void *data)
  * The total rx/tx buffer is for ac97 frame to hold all pcm data
  * is  0x20000 * sizeof(struct ac97_frame) / 4.
  */
-#ifdef CONFIG_SND_MMAP_SUPPORT
 static const struct snd_pcm_hardware bf5xx_pcm_hardware = {
        .info                   = SNDRV_PCM_INFO_INTERLEAVED |
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
                                   SNDRV_PCM_INFO_MMAP |
                                   SNDRV_PCM_INFO_MMAP_VALID |
-                                  SNDRV_PCM_INFO_BLOCK_TRANSFER,
-#else
-static const struct snd_pcm_hardware bf5xx_pcm_hardware = {
-       .info                   = SNDRV_PCM_INFO_INTERLEAVED |
-                                 SNDRV_PCM_INFO_BLOCK_TRANSFER,
 #endif
+                                  SNDRV_PCM_INFO_BLOCK_TRANSFER,
+
        .formats                = SNDRV_PCM_FMTBIT_S16_LE,
        .period_bytes_min       = 32,
        .period_bytes_max       = 0x10000,
@@ -123,10 +130,20 @@ static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream,
 
 static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream)
 {
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        struct snd_pcm_runtime *runtime = substream->runtime;
+       struct sport_device *sport = runtime->private_data;
 
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-       memset(runtime->dma_area, 0, runtime->buffer_size);
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               sport->once = 0;
+               if (runtime->dma_area)
+                       memset(runtime->dma_area, 0, runtime->buffer_size);
+               memset(sport->tx_dma_buf, 0, runtime->buffer_size *
+                       sizeof(struct ac97_frame));
+       } else
+               memset(sport->rx_dma_buf, 0, runtime->buffer_size *
+                       sizeof(struct ac97_frame));
+#endif
        snd_pcm_lib_free_pages(substream);
        return 0;
 }
@@ -139,7 +156,7 @@ static int bf5xx_pcm_prepare(struct snd_pcm_substream *substream)
        /* An intermediate buffer is introduced for implementing mmap for
         * SPORT working in TMD mode(include AC97).
         */
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                sport_set_tx_callback(sport, bf5xx_dma_irq, substream);
                sport_config_tx_dma(sport, sport->tx_dma_buf, runtime->periods,
@@ -173,24 +190,24 @@ static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
                if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
                        bf5xx_mmap_copy(substream, runtime->period_size);
-                       snd_pcm_period_elapsed(substream);
                        sport->tx_delay_pos = 0;
+#endif
                        sport_tx_start(sport);
-               }
-               else
+               } else
                        sport_rx_start(sport);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
                if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
                        sport->tx_pos = 0;
 #endif
                        sport_tx_stop(sport);
                } else {
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
                        sport->rx_pos = 0;
 #endif
                        sport_rx_stop(sport);
@@ -208,7 +225,7 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
        struct sport_device *sport = runtime->private_data;
        unsigned int curr;
 
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                curr = sport->tx_delay_pos;
        else
@@ -249,22 +266,7 @@ static int bf5xx_pcm_open(struct snd_pcm_substream *substream)
        return ret;
 }
 
-static int bf5xx_pcm_close(struct snd_pcm_substream *substream)
-{
-       struct snd_pcm_runtime *runtime = substream->runtime;
-       struct sport_device *sport = runtime->private_data;
-
-       pr_debug("%s enter\n", __func__);
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               sport->once = 0;
-               memset(sport->tx_dma_buf, 0, runtime->buffer_size * sizeof(struct ac97_frame));
-       } else
-               memset(sport->rx_dma_buf, 0, runtime->buffer_size * sizeof(struct ac97_frame));
-
-       return 0;
-}
-
-#ifdef CONFIG_SND_MMAP_SUPPORT
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
 static int bf5xx_pcm_mmap(struct snd_pcm_substream *substream,
        struct vm_area_struct *vma)
 {
@@ -281,32 +283,29 @@ static    int bf5xx_pcm_copy(struct snd_pcm_substream *substream, int channel,
                    void __user *buf, snd_pcm_uframes_t count)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
-
+       unsigned int chan_mask = ac97_chan_mask[runtime->channels - 1];
        pr_debug("%s copy pos:0x%lx count:0x%lx\n",
                        substream->stream ? "Capture" : "Playback", pos, count);
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-               bf5xx_pcm_to_ac97(
-                               (struct ac97_frame *)runtime->dma_area + pos,
-                               buf, count);
+               bf5xx_pcm_to_ac97((struct ac97_frame *)runtime->dma_area + pos,
+                       (__u16 *)buf, count, chan_mask);
        else
-               bf5xx_ac97_to_pcm(
-                               (struct ac97_frame *)runtime->dma_area + pos,
-                               buf, count);
+               bf5xx_ac97_to_pcm((struct ac97_frame *)runtime->dma_area + pos,
+                       (__u16 *)buf, count);
        return 0;
 }
 #endif
 
 struct snd_pcm_ops bf5xx_pcm_ac97_ops = {
        .open           = bf5xx_pcm_open,
-       .close          = bf5xx_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
        .hw_params      = bf5xx_pcm_hw_params,
        .hw_free        = bf5xx_pcm_hw_free,
        .prepare        = bf5xx_pcm_prepare,
        .trigger        = bf5xx_pcm_trigger,
        .pointer        = bf5xx_pcm_pointer,
-#ifdef CONFIG_SND_MMAP_SUPPORT
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        .mmap           = bf5xx_pcm_mmap,
 #else
        .copy           = bf5xx_pcm_copy,
@@ -344,7 +343,7 @@ static int bf5xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
  * Need to allocate local buffer when enable
  * MMAP for SPORT working in TMD mode (include AC97).
  */
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                if (!sport_handle->tx_dma_buf) {
                        sport_handle->tx_dma_buf = dma_alloc_coherent(NULL, \
@@ -381,7 +380,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
        struct snd_pcm_substream *substream;
        struct snd_dma_buffer *buf;
        int stream;
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        size_t size = bf5xx_pcm_hardware.buffer_bytes_max *
                sizeof(struct ac97_frame) / 4;
 #endif
@@ -395,7 +394,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
                        continue;
                dma_free_coherent(NULL, buf->bytes, buf->area, 0);
                buf->area = NULL;
-#if defined(CONFIG_SND_MMAP_SUPPORT)
+#if defined(CONFIG_SND_BF5XX_MMAP_SUPPORT)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                if (sport_handle->tx_dma_buf)
                        dma_free_coherent(NULL, size, \
@@ -452,6 +451,18 @@ struct snd_soc_platform bf5xx_ac97_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(bf5xx_ac97_soc_platform);
 
+static int __init bfin_ac97_init(void)
+{
+       return snd_soc_register_platform(&bf5xx_ac97_soc_platform);
+}
+module_init(bfin_ac97_init);
+
+static void __exit bfin_ac97_exit(void)
+{
+       snd_soc_unregister_platform(&bf5xx_ac97_soc_platform);
+}
+module_exit(bfin_ac97_exit);
+
 MODULE_AUTHOR("Cliff Cai");
 MODULE_DESCRIPTION("ADI Blackfin AC97 PCM DMA module");
 MODULE_LICENSE("GPL");
index 5e5aafb6485f0bce67bf211a24bc475db69f686b..3be2be60576df8bc336f7a8130cdce27404d92a6 100644 (file)
 static int *cmd_count;
 static int sport_num = CONFIG_SND_BF5XX_SPORT_NUM;
 
-#if defined(CONFIG_BF54x)
+static u16 sport_req[][7] = {
+               PIN_REQ_SPORT_0,
+#ifdef PIN_REQ_SPORT_1
+               PIN_REQ_SPORT_1,
+#endif
+#ifdef PIN_REQ_SPORT_2
+               PIN_REQ_SPORT_2,
+#endif
+#ifdef PIN_REQ_SPORT_3
+               PIN_REQ_SPORT_3,
+#endif
+       };
+
 static struct sport_param sport_params[4] = {
        {
                .dma_rx_chan    = CH_SPORT0_RX,
                .dma_tx_chan    = CH_SPORT0_TX,
-               .err_irq        = IRQ_SPORT0_ERR,
+               .err_irq        = IRQ_SPORT0_ERROR,
                .regs           = (struct sport_register *)SPORT0_TCR1,
        },
+#ifdef PIN_REQ_SPORT_1
        {
                .dma_rx_chan    = CH_SPORT1_RX,
                .dma_tx_chan    = CH_SPORT1_TX,
-               .err_irq        = IRQ_SPORT1_ERR,
+               .err_irq        = IRQ_SPORT1_ERROR,
                .regs           = (struct sport_register *)SPORT1_TCR1,
        },
+#endif
+#ifdef PIN_REQ_SPORT_2
        {
                .dma_rx_chan    = CH_SPORT2_RX,
                .dma_tx_chan    = CH_SPORT2_TX,
-               .err_irq        = IRQ_SPORT2_ERR,
+               .err_irq        = IRQ_SPORT2_ERROR,
                .regs           = (struct sport_register *)SPORT2_TCR1,
        },
+#endif
+#ifdef PIN_REQ_SPORT_3
        {
                .dma_rx_chan    = CH_SPORT3_RX,
                .dma_tx_chan    = CH_SPORT3_TX,
-               .err_irq        = IRQ_SPORT3_ERR,
+               .err_irq        = IRQ_SPORT3_ERROR,
                .regs           = (struct sport_register *)SPORT3_TCR1,
        }
-};
-#else
-static struct sport_param sport_params[2] = {
-       {
-               .dma_rx_chan    = CH_SPORT0_RX,
-               .dma_tx_chan    = CH_SPORT0_TX,
-               .err_irq        = IRQ_SPORT0_ERROR,
-               .regs           = (struct sport_register *)SPORT0_TCR1,
-       },
-       {
-               .dma_rx_chan    = CH_SPORT1_RX,
-               .dma_tx_chan    = CH_SPORT1_TX,
-               .err_irq        = IRQ_SPORT1_ERROR,
-               .regs           = (struct sport_register *)SPORT1_TCR1,
-       }
-};
 #endif
+};
 
-void bf5xx_pcm_to_ac97(struct ac97_frame *dst, const __u32 *src, \
-               size_t count)
+void bf5xx_pcm_to_ac97(struct ac97_frame *dst, const __u16 *src,
+               size_t count, unsigned int chan_mask)
 {
        while (count--) {
-               dst->ac97_tag = TAG_VALID | TAG_PCM;
-               (dst++)->ac97_pcm = *src++;
+               dst->ac97_tag = TAG_VALID;
+               if (chan_mask & SP_FL) {
+                       dst->ac97_pcm_r = *src++;
+                       dst->ac97_tag |= TAG_PCM_RIGHT;
+               }
+               if (chan_mask & SP_FR) {
+                       dst->ac97_pcm_l = *src++;
+                       dst->ac97_tag |= TAG_PCM_LEFT;
+
+               }
+#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
+               if (chan_mask & SP_SR) {
+                       dst->ac97_sl = *src++;
+                       dst->ac97_tag |= TAG_PCM_SL;
+               }
+               if (chan_mask & SP_SL) {
+                       dst->ac97_sr = *src++;
+                       dst->ac97_tag |= TAG_PCM_SR;
+               }
+               if (chan_mask & SP_LFE) {
+                       dst->ac97_lfe = *src++;
+                       dst->ac97_tag |= TAG_PCM_LFE;
+               }
+               if (chan_mask & SP_FC) {
+                       dst->ac97_center = *src++;
+                       dst->ac97_tag |= TAG_PCM_CENTER;
+               }
+#endif
+               dst++;
        }
 }
 EXPORT_SYMBOL(bf5xx_pcm_to_ac97);
 
-void bf5xx_ac97_to_pcm(const struct ac97_frame *src, __u32 *dst, \
+void bf5xx_ac97_to_pcm(const struct ac97_frame *src, __u16 *dst,
                size_t count)
 {
-       while (count--)
-               *(dst++) = (src++)->ac97_pcm;
+       while (count--) {
+               *(dst++) = src->ac97_pcm_l;
+               *(dst++) = src->ac97_pcm_r;
+               src++;
+       }
 }
 EXPORT_SYMBOL(bf5xx_ac97_to_pcm);
 
 static unsigned int sport_tx_curr_frag(struct sport_device *sport)
 {
-       return sport->tx_curr_frag = sport_curr_offset_tx(sport) / \
+       return sport->tx_curr_frag = sport_curr_offset_tx(sport) /
                        sport->tx_fragsize;
 }
 
@@ -130,7 +162,7 @@ static void enqueue_cmd(struct snd_ac97 *ac97, __u16 addr, __u16 data)
 
        sport_incfrag(sport, &nextfrag, 1);
 
-       nextwrite = (struct ac97_frame *)(sport->tx_buf + \
+       nextwrite = (struct ac97_frame *)(sport->tx_buf +
                        nextfrag * sport->tx_fragsize);
        pr_debug("sport->tx_buf:%p, nextfrag:0x%x nextwrite:%p, cmd_count:%d\n",
                sport->tx_buf, nextfrag, nextwrite, cmd_count[nextfrag]);
@@ -237,8 +269,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
 #ifdef CONFIG_PM
-static int bf5xx_ac97_suspend(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
+static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
 {
        struct sport_device *sport =
                (struct sport_device *)dai->private_data;
@@ -253,8 +284,7 @@ static int bf5xx_ac97_suspend(struct platform_device *pdev,
        return 0;
 }
 
-static int bf5xx_ac97_resume(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
+static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
 {
        int ret;
        struct sport_device *sport =
@@ -297,20 +327,15 @@ static int bf5xx_ac97_resume(struct platform_device *pdev,
 static int bf5xx_ac97_probe(struct platform_device *pdev,
                            struct snd_soc_dai *dai)
 {
-       int ret;
-#if defined(CONFIG_BF54x)
-       u16 sport_req[][7] = {PIN_REQ_SPORT_0, PIN_REQ_SPORT_1,
-                                PIN_REQ_SPORT_2, PIN_REQ_SPORT_3};
-#else
-       u16 sport_req[][7] = {PIN_REQ_SPORT_0, PIN_REQ_SPORT_1};
-#endif
+       int ret = 0;
        cmd_count = (int *)get_zeroed_page(GFP_KERNEL);
        if (cmd_count == NULL)
                return -ENOMEM;
 
        if (peripheral_request_list(&sport_req[sport_num][0], "soc-audio")) {
                pr_err("Requesting Peripherals failed\n");
-               return -EFAULT;
+               ret =  -EFAULT;
+               goto peripheral_err;
                }
 
 #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
@@ -318,54 +343,54 @@ static int bf5xx_ac97_probe(struct platform_device *pdev,
        if (gpio_request(CONFIG_SND_BF5XX_RESET_GPIO_NUM, "SND_AD198x RESET")) {
                pr_err("Failed to request GPIO_%d for reset\n",
                                CONFIG_SND_BF5XX_RESET_GPIO_NUM);
-               peripheral_free_list(&sport_req[sport_num][0]);
-               return -1;
+               ret =  -1;
+               goto gpio_err;
        }
        gpio_direction_output(CONFIG_SND_BF5XX_RESET_GPIO_NUM, 1);
 #endif
        sport_handle = sport_init(&sport_params[sport_num], 2, \
                        sizeof(struct ac97_frame), NULL);
        if (!sport_handle) {
-               peripheral_free_list(&sport_req[sport_num][0]);
-#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
-               gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
-#endif
-               return -ENODEV;
+               ret = -ENODEV;
+               goto sport_err;
        }
        /*SPORT works in TDM mode to simulate AC97 transfers*/
        ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
        if (ret) {
                pr_err("SPORT is busy!\n");
-               kfree(sport_handle);
-               peripheral_free_list(&sport_req[sport_num][0]);
-#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
-               gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
-#endif
-               return -EBUSY;
+               ret = -EBUSY;
+               goto sport_config_err;
        }
 
        ret = sport_config_rx(sport_handle, IRFS, 0xF, 0, (16*16-1));
        if (ret) {
                pr_err("SPORT is busy!\n");
-               kfree(sport_handle);
-               peripheral_free_list(&sport_req[sport_num][0]);
-#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
-               gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
-#endif
-               return -EBUSY;
+               ret = -EBUSY;
+               goto sport_config_err;
        }
 
        ret = sport_config_tx(sport_handle, ITFS, 0xF, 0, (16*16-1));
        if (ret) {
                pr_err("SPORT is busy!\n");
-               kfree(sport_handle);
-               peripheral_free_list(&sport_req[sport_num][0]);
-#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
-               gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
-#endif
-               return -EBUSY;
+               ret = -EBUSY;
+               goto sport_config_err;
        }
+
        return 0;
+
+sport_config_err:
+       kfree(sport_handle);
+sport_err:
+#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
+       gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
+#endif
+gpio_err:
+       peripheral_free_list(&sport_req[sport_num][0]);
+peripheral_err:
+       free_page((unsigned long)cmd_count);
+       cmd_count = NULL;
+
+       return ret;
 }
 
 static void bf5xx_ac97_remove(struct platform_device *pdev,
@@ -373,6 +398,7 @@ static void bf5xx_ac97_remove(struct platform_device *pdev,
 {
        free_page((unsigned long)cmd_count);
        cmd_count = NULL;
+       peripheral_free_list(&sport_req[sport_num][0]);
 #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
        gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
 #endif
@@ -381,7 +407,7 @@ static void bf5xx_ac97_remove(struct platform_device *pdev,
 struct snd_soc_dai bfin_ac97_dai = {
        .name = "bf5xx-ac97",
        .id = 0,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .probe = bf5xx_ac97_probe,
        .remove = bf5xx_ac97_remove,
        .suspend = bf5xx_ac97_suspend,
@@ -389,7 +415,11 @@ struct snd_soc_dai bfin_ac97_dai = {
        .playback = {
                .stream_name = "AC97 Playback",
                .channels_min = 2,
+#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
+               .channels_max = 6,
+#else
                .channels_max = 2,
+#endif
                .rates = SNDRV_PCM_RATE_48000,
                .formats = SNDRV_PCM_FMTBIT_S16_LE, },
        .capture = {
@@ -401,6 +431,18 @@ struct snd_soc_dai bfin_ac97_dai = {
 };
 EXPORT_SYMBOL_GPL(bfin_ac97_dai);
 
+static int __init bfin_ac97_init(void)
+{
+       return snd_soc_register_dai(&bfin_ac97_dai);
+}
+module_init(bfin_ac97_init);
+
+static void __exit bfin_ac97_exit(void)
+{
+       snd_soc_unregister_dai(&bfin_ac97_dai);
+}
+module_exit(bfin_ac97_exit);
+
 MODULE_AUTHOR("Roy Huang");
 MODULE_DESCRIPTION("AC97 driver for ADI Blackfin");
 MODULE_LICENSE("GPL");
index 3f77cc558dc03fe4a4847096f5bc07f8152dd7d6..3f2a911fe0cb2adda1c45473babef9845d9280c9 100644 (file)
@@ -16,21 +16,46 @@ struct ac97_frame {
        u16 ac97_tag;           /* slot 0 */
        u16 ac97_addr;          /* slot 1 */
        u16 ac97_data;          /* slot 2 */
-       u32 ac97_pcm;           /* slot 3 and 4: left and right pcm data */
+       u16 ac97_pcm_l;         /*slot 3:front left*/
+       u16 ac97_pcm_r;         /*slot 4:front left*/
+#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
+       u16 ac97_mdm_l1;
+       u16 ac97_center;        /*slot 6:center*/
+       u16 ac97_sl;            /*slot 7:surround left*/
+       u16 ac97_sr;            /*slot 8:surround right*/
+       u16 ac97_lfe;           /*slot 9:lfe*/
+#endif
 } __attribute__ ((packed));
 
+/* Speaker location */
+#define SP_FL          0x0001
+#define SP_FR          0x0010
+#define SP_FC          0x0002
+#define SP_LFE         0x0020
+#define SP_SL          0x0004
+#define SP_SR          0x0040
+
+#define SP_STEREO      (SP_FL | SP_FR)
+#define SP_2DOT1       (SP_FL | SP_FR | SP_LFE)
+#define SP_QUAD                (SP_FL | SP_FR | SP_SL | SP_SR)
+#define SP_5DOT1       (SP_FL | SP_FR | SP_FC | SP_LFE | SP_SL | SP_SR)
+
 #define TAG_VALID              0x8000
 #define TAG_CMD                        0x6000
 #define TAG_PCM_LEFT           0x1000
 #define TAG_PCM_RIGHT          0x0800
-#define TAG_PCM                        (TAG_PCM_LEFT | TAG_PCM_RIGHT)
+#define TAG_PCM_MDM_L1         0x0400
+#define TAG_PCM_CENTER         0x0200
+#define TAG_PCM_SL             0x0100
+#define TAG_PCM_SR             0x0080
+#define TAG_PCM_LFE            0x0040
 
 extern struct snd_soc_dai bfin_ac97_dai;
 
-void bf5xx_pcm_to_ac97(struct ac97_frame *dst, const __u32 *src, \
-               size_t count);
+void bf5xx_pcm_to_ac97(struct ac97_frame *dst, const __u16 *src, \
+               size_t count, unsigned int chan_mask);
 
-void bf5xx_ac97_to_pcm(const struct ac97_frame *src, __u32 *dst, \
+void bf5xx_ac97_to_pcm(const struct ac97_frame *src, __u16 *dst, \
                size_t count);
 
 #endif
index 124425d223202aeb308a45023616e26a152dc4c0..d8f5912737788d871c1fd6478d45cc64a4c7ee79 100644 (file)
@@ -43,7 +43,7 @@
 #include "bf5xx-ac97-pcm.h"
 #include "bf5xx-ac97.h"
 
-static struct snd_soc_machine bf5xx_board;
+static struct snd_soc_card bf5xx_board;
 
 static int bf5xx_board_startup(struct snd_pcm_substream *substream)
 {
@@ -67,15 +67,15 @@ static struct snd_soc_dai_link bf5xx_board_dai = {
        .ops = &bf5xx_board_ops,
 };
 
-static struct snd_soc_machine bf5xx_board = {
+static struct snd_soc_card bf5xx_board = {
        .name = "bf5xx-board",
+       .platform = &bf5xx_ac97_soc_platform,
        .dai_link = &bf5xx_board_dai,
        .num_links = 1,
 };
 
 static struct snd_soc_device bf5xx_board_snd_devdata = {
-       .machine = &bf5xx_board,
-       .platform = &bf5xx_ac97_soc_platform,
+       .card = &bf5xx_board,
        .codec_dev = &soc_codec_dev_ad1980,
 };
 
index 622c9b9095328a46bdf9b5ed9619916a8d456c92..7f2a5e199075421ef0ebee1097139a2671f2f6d2 100644 (file)
@@ -65,7 +65,7 @@
 
 #define GPIO_SE CONFIG_SND_BFIN_AD73311_SE
 
-static struct snd_soc_machine bf5xx_ad73311;
+static struct snd_soc_card bf5xx_ad73311;
 
 static int snd_ad73311_startup(void)
 {
@@ -168,7 +168,7 @@ static int bf5xx_ad73311_hw_params(struct snd_pcm_substream *substream,
                params_format(params));
 
        /* set cpu DAI configuration */
-       ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
+       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
        if (ret < 0)
                return ret;
@@ -190,16 +190,16 @@ static struct snd_soc_dai_link bf5xx_ad73311_dai = {
        .ops = &bf5xx_ad73311_ops,
 };
 
-static struct snd_soc_machine bf5xx_ad73311 = {
+static struct snd_soc_card bf5xx_ad73311 = {
        .name = "bf5xx_ad73311",
+       .platform = &bf5xx_i2s_soc_platform,
        .probe = bf5xx_probe,
        .dai_link = &bf5xx_ad73311_dai,
        .num_links = 1,
 };
 
 static struct snd_soc_device bf5xx_ad73311_snd_devdata = {
-       .machine = &bf5xx_ad73311,
-       .platform = &bf5xx_i2s_soc_platform,
+       .card = &bf5xx_ad73311,
        .codec_dev = &soc_codec_dev_ad73311,
 };
 
index 61fccf925192e62697908fadcb1e78507125edb3..53d290b3ea47d9e2cf974cd1b83721f7199180da 100644 (file)
@@ -283,6 +283,18 @@ struct snd_soc_platform bf5xx_i2s_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(bf5xx_i2s_soc_platform);
 
+static int __init bfin_i2s_init(void)
+{
+       return snd_soc_register_platform(&bf5xx_i2s_soc_platform);
+}
+module_init(bfin_i2s_init);
+
+static void __exit bfin_i2s_exit(void)
+{
+       snd_soc_unregister_platform(&bf5xx_i2s_soc_platform);
+}
+module_exit(bfin_i2s_exit);
+
 MODULE_AUTHOR("Cliff Cai");
 MODULE_DESCRIPTION("ADI Blackfin I2S PCM DMA module");
 MODULE_LICENSE("GPL");
index e020c160ee441e815b6b6c59159cd30c77ed38ec..d1d95d2393feb81ea8352d52e04e00b6d59d3d1b 100644 (file)
@@ -132,7 +132,8 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
        return ret;
 }
 
-static int bf5xx_i2s_startup(struct snd_pcm_substream *substream)
+static int bf5xx_i2s_startup(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
 {
        pr_debug("%s enter\n", __func__);
 
@@ -142,7 +143,8 @@ static int bf5xx_i2s_startup(struct snd_pcm_substream *substream)
 }
 
 static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
-                               struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        int ret = 0;
 
@@ -193,7 +195,8 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream)
+static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
 {
        pr_debug("%s enter\n", __func__);
        bf5xx_i2s.counter--;
@@ -219,16 +222,14 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
        return 0;
 }
 
-static void bf5xx_i2s_remove(struct platform_device *pdev,
-                          struct snd_soc_dai *dai)
+static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
 {
        pr_debug("%s enter\n", __func__);
        peripheral_free_list(&sport_req[sport_num][0]);
 }
 
 #ifdef CONFIG_PM
-static int bf5xx_i2s_suspend(struct platform_device *dev,
-                            struct snd_soc_dai *dai)
+static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
 {
        struct sport_device *sport =
                (struct sport_device *)dai->private_data;
@@ -289,7 +290,6 @@ static int bf5xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai bf5xx_i2s_dai = {
        .name = "bf5xx-i2s",
        .id = 0,
-       .type = SND_SOC_DAI_I2S,
        .probe = bf5xx_i2s_probe,
        .remove = bf5xx_i2s_remove,
        .suspend = bf5xx_i2s_suspend,
@@ -307,13 +307,24 @@ struct snd_soc_dai bf5xx_i2s_dai = {
        .ops = {
                .startup   = bf5xx_i2s_startup,
                .shutdown  = bf5xx_i2s_shutdown,
-               .hw_params = bf5xx_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = bf5xx_i2s_hw_params,
                .set_fmt = bf5xx_i2s_set_dai_fmt,
        },
 };
 EXPORT_SYMBOL_GPL(bf5xx_i2s_dai);
 
+static int __init bfin_i2s_init(void)
+{
+       return snd_soc_register_dai(&bf5xx_i2s_dai);
+}
+module_init(bfin_i2s_init);
+
+static void __exit bfin_i2s_exit(void)
+{
+       snd_soc_unregister_dai(&bf5xx_i2s_dai);
+}
+module_exit(bfin_i2s_exit);
+
 /* Module information */
 MODULE_AUTHOR("Cliff Cai");
 MODULE_DESCRIPTION("I2S driver for ADI Blackfin");
index fcadcc081f7fe4994a2dc3dbc0514656c7c6cd06..2e63dea73e9c64631a980dd8cc5934504e19f84b 100644 (file)
@@ -116,7 +116,7 @@ struct sport_device {
        void *err_data;
        unsigned char *tx_dma_buf;
        unsigned char *rx_dma_buf;
-#ifdef CONFIG_SND_MMAP_SUPPORT
+#ifdef CONFIG_SND_BF5XX_MMAP_SUPPORT
        dma_addr_t tx_dma_phy;
        dma_addr_t rx_dma_phy;
        int tx_pos;/*pcm sample count*/
index e15f67fd7769a8b4fdb7a26c53ef5c3ecbcb8342..bc0cdded711664ccd0437e82fb62e41807a6a790 100644 (file)
@@ -44,7 +44,7 @@
 #include "bf5xx-i2s-pcm.h"
 #include "bf5xx-i2s.h"
 
-static struct snd_soc_machine bf5xx_ssm2602;
+static struct snd_soc_card bf5xx_ssm2602;
 
 static int bf5xx_ssm2602_startup(struct snd_pcm_substream *substream)
 {
@@ -92,17 +92,17 @@ static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream,
         */
 
        /* set codec DAI configuration */
-       ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
        if (ret < 0)
                return ret;
        /* set cpu DAI configuration */
-       ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
                SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
        if (ret < 0)
                return ret;
 
-       ret = codec_dai->dai_ops.set_sysclk(codec_dai, SSM2602_SYSCLK, clk,
+       ret = snd_soc_dai_set_sysclk(codec_dai, SSM2602_SYSCLK, clk,
                SND_SOC_CLOCK_IN);
        if (ret < 0)
                return ret;
@@ -135,15 +135,15 @@ static struct ssm2602_setup_data bf5xx_ssm2602_setup = {
        .i2c_address = 0x1b,
 };
 
-static struct snd_soc_machine bf5xx_ssm2602 = {
+static struct snd_soc_card bf5xx_ssm2602 = {
        .name = "bf5xx_ssm2602",
+       .platform = &bf5xx_i2s_soc_platform,
        .dai_link = &bf5xx_ssm2602_dai,
        .num_links = 1,
 };
 
 static struct snd_soc_device bf5xx_ssm2602_snd_devdata = {
-       .machine = &bf5xx_ssm2602,
-       .platform = &bf5xx_i2s_soc_platform,
+       .card = &bf5xx_ssm2602,
        .codec_dev = &soc_codec_dev_ssm2602,
        .codec_data = &bf5xx_ssm2602_setup,
 };
index 38a0e3b620a750ad4845ee861f18b323b74cf0f4..c41289b5f58671276d73b51b47b3448901136f0f 100644 (file)
@@ -1,31 +1,40 @@
 config SND_SOC_ALL_CODECS
        tristate "Build all ASoC CODEC drivers"
-       depends on I2C
-       select SPI
-       select SPI_MASTER
-       select SND_SOC_AD73311
-       select SND_SOC_AK4535
-       select SND_SOC_CS4270
-       select SND_SOC_SSM2602
-       select SND_SOC_TLV320AIC23
-       select SND_SOC_TLV320AIC26
-       select SND_SOC_TLV320AIC3X
-       select SND_SOC_UDA1380
-       select SND_SOC_WM8510
-       select SND_SOC_WM8580
-       select SND_SOC_WM8731
-       select SND_SOC_WM8750
-       select SND_SOC_WM8753
-       select SND_SOC_WM8900
-       select SND_SOC_WM8903
-       select SND_SOC_WM8971
-       select SND_SOC_WM8990
+       select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+       select SND_SOC_AD1980 if SND_SOC_AC97_BUS
+       select SND_SOC_AD73311 if I2C
+       select SND_SOC_AK4535 if I2C
+       select SND_SOC_CS4270 if I2C
+       select SND_SOC_PCM3008
+       select SND_SOC_SSM2602 if I2C
+       select SND_SOC_TLV320AIC23 if I2C
+       select SND_SOC_TLV320AIC26 if SPI_MASTER
+       select SND_SOC_TLV320AIC3X if I2C
+       select SND_SOC_TWL4030 if TWL4030_CORE
+       select SND_SOC_UDA134X
+       select SND_SOC_UDA1380 if I2C
+       select SND_SOC_WM8350 if MFD_WM8350
+       select SND_SOC_WM8510 if (I2C || SPI_MASTER)
+       select SND_SOC_WM8580 if I2C
+       select SND_SOC_WM8728 if (I2C || SPI_MASTER)
+       select SND_SOC_WM8731 if (I2C || SPI_MASTER)
+       select SND_SOC_WM8750 if (I2C || SPI_MASTER)
+       select SND_SOC_WM8753 if (I2C || SPI_MASTER)
+       select SND_SOC_WM8900 if I2C
+       select SND_SOC_WM8903 if I2C
+       select SND_SOC_WM8971 if I2C
+       select SND_SOC_WM8990 if I2C
+       select SND_SOC_WM9712 if SND_SOC_AC97_BUS
+       select SND_SOC_WM9713 if SND_SOC_AC97_BUS
         help
           Normally ASoC codec drivers are only built if a machine driver which
           uses them is also built since they are only usable with a machine
           driver.  Selecting this option will allow these drivers to be built
           without an explicit machine driver for test and development purposes.
 
+         Support for the bus types used to access the codecs to be built must
+         be selected separately.
+
           If unsure select "N".
 
 
@@ -60,6 +69,12 @@ config SND_SOC_CS4270_VD33_ERRATA
        bool
        depends on SND_SOC_CS4270
 
+config SND_SOC_L3
+       tristate
+
+config SND_SOC_PCM3008
+       tristate
+
 config SND_SOC_SSM2602
        tristate
 
@@ -75,15 +90,29 @@ config SND_SOC_TLV320AIC3X
        tristate
        depends on I2C
 
+config SND_SOC_TWL4030
+       tristate
+       depends on TWL4030_CORE
+
+config SND_SOC_UDA134X
+       tristate
+       select SND_SOC_L3
+
 config SND_SOC_UDA1380
         tristate
 
+config SND_SOC_WM8350
+       tristate
+
 config SND_SOC_WM8510
        tristate
 
 config SND_SOC_WM8580
        tristate
 
+config SND_SOC_WM8728
+       tristate
+
 config SND_SOC_WM8731
        tristate
 
index 90f0a585fc70e1f5a4d9a9be1b8514a22100917a..c4ddc9aa2bbd8aaa5a35bd7ecc3a487603990a97 100644 (file)
@@ -3,13 +3,19 @@ snd-soc-ad1980-objs := ad1980.o
 snd-soc-ad73311-objs := ad73311.o
 snd-soc-ak4535-objs := ak4535.o
 snd-soc-cs4270-objs := cs4270.o
+snd-soc-l3-objs := l3.o
+snd-soc-pcm3008-objs := pcm3008.o
 snd-soc-ssm2602-objs := ssm2602.o
 snd-soc-tlv320aic23-objs := tlv320aic23.o
 snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-twl4030-objs := twl4030.o
+snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
+snd-soc-wm8350-objs := wm8350.o
 snd-soc-wm8510-objs := wm8510.o
 snd-soc-wm8580-objs := wm8580.o
+snd-soc-wm8728-objs := wm8728.o
 snd-soc-wm8731-objs := wm8731.o
 snd-soc-wm8750-objs := wm8750.o
 snd-soc-wm8753-objs := wm8753.o
@@ -25,13 +31,19 @@ obj-$(CONFIG_SND_SOC_AD1980)        += snd-soc-ad1980.o
 obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
 obj-$(CONFIG_SND_SOC_AK4535)   += snd-soc-ak4535.o
 obj-$(CONFIG_SND_SOC_CS4270)   += snd-soc-cs4270.o
+obj-$(CONFIG_SND_SOC_L3)       += snd-soc-l3.o
+obj-$(CONFIG_SND_SOC_PCM3008)  += snd-soc-pcm3008.o
 obj-$(CONFIG_SND_SOC_SSM2602)  += snd-soc-ssm2602.o
 obj-$(CONFIG_SND_SOC_TLV320AIC23)      += snd-soc-tlv320aic23.o
 obj-$(CONFIG_SND_SOC_TLV320AIC26)      += snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)      += snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_TWL4030)  += snd-soc-twl4030.o
+obj-$(CONFIG_SND_SOC_UDA134X)  += snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)  += snd-soc-uda1380.o
+obj-$(CONFIG_SND_SOC_WM8350)   += snd-soc-wm8350.o
 obj-$(CONFIG_SND_SOC_WM8510)   += snd-soc-wm8510.o
 obj-$(CONFIG_SND_SOC_WM8580)   += snd-soc-wm8580.o
+obj-$(CONFIG_SND_SOC_WM8728)   += snd-soc-wm8728.o
 obj-$(CONFIG_SND_SOC_WM8731)   += snd-soc-wm8731.o
 obj-$(CONFIG_SND_SOC_WM8750)   += snd-soc-wm8750.o
 obj-$(CONFIG_SND_SOC_WM8753)   += snd-soc-wm8753.o
index bd1ebdc6c86ce0e6ef021139f5ac10b93831f4d4..fb53e6511af25d0b0d0dd164a1b1de0a511f73c7 100644 (file)
@@ -24,7 +24,8 @@
 
 #define AC97_VERSION "0.6"
 
-static int ac97_prepare(struct snd_pcm_substream *substream)
+static int ac97_prepare(struct snd_pcm_substream *substream,
+                       struct snd_soc_dai *dai)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -42,7 +43,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream)
 
 struct snd_soc_dai ac97_dai = {
        .name = "AC97 HiFi",
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .playback = {
                .stream_name = "AC97 Playback",
                .channels_min = 1,
@@ -113,7 +114,7 @@ static int ac97_soc_probe(struct platform_device *pdev)
        if (ret < 0)
                goto bus_err;
 
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0)
                goto bus_err;
        return 0;
index 1397b8e06c0b41eda7002815a276baba8f3ea035..73fdbb4d4a3d4702cbf6d9b3b25d59d00a287e2b 100644 (file)
@@ -85,6 +85,9 @@ SOC_DOUBLE("Line HP Swap Switch", AC97_AD_MISC, 10, 5, 1, 0),
 SOC_DOUBLE("Surround Playback Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
 SOC_DOUBLE("Surround Playback Switch", AC97_SURROUND_MASTER, 15, 7, 1, 1),
 
+SOC_DOUBLE("Center/LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 0, 31, 1),
+SOC_DOUBLE("Center/LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 7, 1, 1),
+
 SOC_ENUM("Capture Source", ad1980_cap_src),
 
 SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
@@ -142,10 +145,11 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
 
 struct snd_soc_dai ad1980_dai = {
        .name = "AC97",
+       .ac97_control = 1,
        .playback = {
                .stream_name = "Playback",
                .channels_min = 2,
-               .channels_max = 2,
+               .channels_max = 6,
                .rates = SNDRV_PCM_RATE_48000,
                .formats = SNDRV_PCM_FMTBIT_S16_LE, },
        .capture = {
@@ -192,6 +196,7 @@ static int ad1980_soc_probe(struct platform_device *pdev)
        struct snd_soc_codec *codec;
        int ret = 0;
        u16 vendor_id2;
+       u16 ext_status;
 
        printk(KERN_INFO "AD1980 SoC Audio Codec\n");
 
@@ -234,7 +239,7 @@ static int ad1980_soc_probe(struct platform_device *pdev)
 
        ret = ad1980_reset(codec, 0);
        if (ret < 0) {
-               printk(KERN_ERR "AC97 link error\n");
+               printk(KERN_ERR "Failed to reset AD1980: AC97 link error\n");
                goto reset_err;
        }
 
@@ -253,12 +258,19 @@ static int ad1980_soc_probe(struct platform_device *pdev)
                                "supported\n");
        }
 
-       ac97_write(codec, AC97_MASTER, 0x0000); /* unmute line out volume */
-       ac97_write(codec, AC97_PCM, 0x0000);    /* unmute PCM out volume */
-       ac97_write(codec, AC97_REC_GAIN, 0x0000);/* unmute record volume */
+       /* unmute captures and playbacks volume */
+       ac97_write(codec, AC97_MASTER, 0x0000);
+       ac97_write(codec, AC97_PCM, 0x0000);
+       ac97_write(codec, AC97_REC_GAIN, 0x0000);
+       ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
+       ac97_write(codec, AC97_SURROUND_MASTER, 0x0000);
+
+       /*power on LFE/CENTER/Surround DACs*/
+       ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
+       ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
 
        ad1980_add_controls(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "ad1980: failed to register card\n");
                goto reset_err;
index 37af8607b00a1f293aad10b8f5cfd3b120719549..b09289a1e55af93460f68cb6f5e76707a884a51a 100644 (file)
@@ -8,14 +8,10 @@
  *  under  the terms of  the GNU General  Public License as published by the
  *  Free Software Foundation;  either version 2 of the  License, or (at your
  *  option) any later version.
- *
- *  Revision history
- *    25th Sep 2008   Initial version.
  */
 
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <sound/core.h>
@@ -68,7 +64,7 @@ static int ad73311_soc_probe(struct platform_device *pdev)
                goto pcm_err;
        }
 
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "ad73311: failed to register card\n");
                goto register_err;
@@ -102,6 +98,18 @@ struct snd_soc_codec_device soc_codec_dev_ad73311 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_ad73311);
 
+static int __init ad73311_init(void)
+{
+       return snd_soc_register_dai(&ad73311_dai);
+}
+module_init(ad73311_init);
+
+static void __exit ad73311_exit(void)
+{
+       snd_soc_unregister_dai(&ad73311_dai);
+}
+module_exit(ad73311_exit);
+
 MODULE_DESCRIPTION("ASoC ad73311 driver");
 MODULE_AUTHOR("Cliff Cai ");
 MODULE_LICENSE("GPL");
index 2a89b5888e11c33bdedf44b817e0c61282b95d0d..81300d8d42ca2a5f2648665fec39aef5490c0f37 100644 (file)
@@ -339,7 +339,8 @@ static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 }
 
 static int ak4535_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -451,8 +452,6 @@ struct snd_soc_dai ak4535_dai = {
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
        .ops = {
                .hw_params = ak4535_hw_params,
-       },
-       .dai_ops = {
                .set_fmt = ak4535_set_dai_fmt,
                .digital_mute = ak4535_mute,
                .set_sysclk = ak4535_set_dai_sysclk,
@@ -513,7 +512,7 @@ static int ak4535_init(struct snd_soc_device *socdev)
 
        ak4535_add_controls(codec);
        ak4535_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "ak4535: failed to register card\n");
                goto card_err;
@@ -689,6 +688,18 @@ struct snd_soc_codec_device soc_codec_dev_ak4535 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_ak4535);
 
+static int __init ak4535_modinit(void)
+{
+       return snd_soc_register_dai(&ak4535_dai);
+}
+module_init(ak4535_modinit);
+
+static void __exit ak4535_exit(void)
+{
+       snd_soc_unregister_dai(&ak4535_dai);
+}
+module_exit(ak4535_exit);
+
 MODULE_DESCRIPTION("Soc AK4535 driver");
 MODULE_AUTHOR("Richard Purdie");
 MODULE_LICENSE("GPL");
index 0bbd94501d7ea45f1aa8b491bf43d275ffb779c9..f1aa0c34421c76f5e63f029847a62fc1a26d954f 100644 (file)
@@ -360,13 +360,14 @@ static int cs4270_i2c_write(struct snd_soc_codec *codec, unsigned int reg,
 /*
  * Program the CS4270 with the given hardware parameters.
  *
- * The .dai_ops functions are used to provide board-specific data, like
+ * The .ops functions are used to provide board-specific data, like
  * input frequencies, to this driver.  This function takes that information,
  * combines it with the hardware parameters provided, and programs the
  * hardware accordingly.
  */
 static int cs4270_hw_params(struct snd_pcm_substream *substream,
-                           struct snd_pcm_hw_params *params)
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -450,6 +451,19 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
                return ret;
        }
 
+       /* Disable automatic volume control.  It's enabled by default, and
+        * it causes volume change commands to be delayed, sometimes until
+        * after playback has started.
+        */
+
+       reg = cs4270_read_reg_cache(codec, CS4270_TRANS);
+       reg &= ~(CS4270_TRANS_SOFT | CS4270_TRANS_ZERO);
+       ret = cs4270_i2c_write(codec, CS4270_TRANS, reg);
+       if (ret < 0) {
+               printk(KERN_ERR "I2C write failed\n");
+               return ret;
+       }
+
        /* Thaw and power-up the codec */
 
        ret = snd_soc_write(codec, CS4270_PWRCTL, 0);
@@ -697,10 +711,10 @@ static int cs4270_probe(struct platform_device *pdev)
        if (codec->control_data) {
                /* Initialize codec ops */
                cs4270_dai.ops.hw_params = cs4270_hw_params;
-               cs4270_dai.dai_ops.set_sysclk = cs4270_set_dai_sysclk;
-               cs4270_dai.dai_ops.set_fmt = cs4270_set_dai_fmt;
+               cs4270_dai.ops.set_sysclk = cs4270_set_dai_sysclk;
+               cs4270_dai.ops.set_fmt = cs4270_set_dai_fmt;
 #ifdef CONFIG_SND_SOC_CS4270_HWMUTE
-               cs4270_dai.dai_ops.digital_mute = cs4270_mute;
+               cs4270_dai.ops.digital_mute = cs4270_mute;
 #endif
        } else
                printk(KERN_INFO "cs4270: no I2C device found, "
@@ -709,7 +723,7 @@ static int cs4270_probe(struct platform_device *pdev)
        printk(KERN_INFO "cs4270: I2C disabled, using stand-alone mode\n");
 #endif
 
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "cs4270: failed to register card\n");
                goto error_del_driver;
@@ -760,6 +774,18 @@ struct snd_soc_codec_device soc_codec_device_cs4270 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_device_cs4270);
 
+static int __init cs4270_init(void)
+{
+       return snd_soc_register_dai(&cs4270_dai);
+}
+module_init(cs4270_init);
+
+static void __exit cs4270_exit(void)
+{
+       snd_soc_unregister_dai(&cs4270_dai);
+}
+module_exit(cs4270_exit);
+
 MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
 MODULE_DESCRIPTION("Cirrus Logic CS4270 ALSA SoC Codec Driver");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/l3.c b/sound/soc/codecs/l3.c
new file mode 100644 (file)
index 0000000..5353af5
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * L3 code
+ *
+ *  Copyright (C) 2008, Christian Pellegrin <chripell@evolware.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *
+ * based on:
+ *
+ * L3 bus algorithm module.
+ *
+ *  Copyright (C) 2001 Russell King, All Rights Reserved.
+ *
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+
+#include <sound/l3.h>
+
+/*
+ * Send one byte of data to the chip.  Data is latched into the chip on
+ * the rising edge of the clock.
+ */
+static void sendbyte(struct l3_pins *adap, unsigned int byte)
+{
+       int i;
+
+       for (i = 0; i < 8; i++) {
+               adap->setclk(0);
+               udelay(adap->data_hold);
+               adap->setdat(byte & 1);
+               udelay(adap->data_setup);
+               adap->setclk(1);
+               udelay(adap->clock_high);
+               byte >>= 1;
+       }
+}
+
+/*
+ * Send a set of bytes to the chip.  We need to pulse the MODE line
+ * between each byte, but never at the start nor at the end of the
+ * transfer.
+ */
+static void sendbytes(struct l3_pins *adap, const u8 *buf,
+                     int len)
+{
+       int i;
+
+       for (i = 0; i < len; i++) {
+               if (i) {
+                       udelay(adap->mode_hold);
+                       adap->setmode(0);
+                       udelay(adap->mode);
+               }
+               adap->setmode(1);
+               udelay(adap->mode_setup);
+               sendbyte(adap, buf[i]);
+       }
+}
+
+int l3_write(struct l3_pins *adap, u8 addr, u8 *data, int len)
+{
+       adap->setclk(1);
+       adap->setdat(1);
+       adap->setmode(1);
+       udelay(adap->mode);
+
+       adap->setmode(0);
+       udelay(adap->mode_setup);
+       sendbyte(adap, addr);
+       udelay(adap->mode_hold);
+
+       sendbytes(adap, data, len);
+
+       adap->setclk(1);
+       adap->setdat(1);
+       adap->setmode(0);
+
+       return len;
+}
+EXPORT_SYMBOL_GPL(l3_write);
+
+MODULE_DESCRIPTION("L3 bit-banging driver");
+MODULE_AUTHOR("Christian Pellegrin <chripell@evolware.org>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c
new file mode 100644 (file)
index 0000000..9a3e67e
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * ALSA Soc PCM3008 codec support
+ *
+ * Author:     Hugo Villeneuve
+ * Copyright (C) 2008 Lyrtech inc
+ *
+ * Based on AC97 Soc codec, original copyright follow:
+ * Copyright 2005 Wolfson Microelectronics PLC.
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ * Generic PCM3008 support.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/gpio.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/initval.h>
+#include <sound/soc.h>
+
+#include "pcm3008.h"
+
+#define PCM3008_VERSION "0.2"
+
+#define PCM3008_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |   \
+                      SNDRV_PCM_RATE_48000)
+
+struct snd_soc_dai pcm3008_dai = {
+       .name = "PCM3008 HiFi",
+       .playback = {
+               .stream_name = "PCM3008 Playback",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = PCM3008_RATES,
+               .formats = SNDRV_PCM_FMTBIT_S16_LE,
+       },
+       .capture = {
+               .stream_name = "PCM3008 Capture",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = PCM3008_RATES,
+               .formats = SNDRV_PCM_FMTBIT_S16_LE,
+       },
+};
+EXPORT_SYMBOL_GPL(pcm3008_dai);
+
+static void pcm3008_gpio_free(struct pcm3008_setup_data *setup)
+{
+       gpio_free(setup->dem0_pin);
+       gpio_free(setup->dem1_pin);
+       gpio_free(setup->pdad_pin);
+       gpio_free(setup->pdda_pin);
+}
+
+static int pcm3008_soc_probe(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec;
+       struct pcm3008_setup_data *setup = socdev->codec_data;
+       int ret = 0;
+
+       printk(KERN_INFO "PCM3008 SoC Audio Codec %s\n", PCM3008_VERSION);
+
+       socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+       if (!socdev->codec)
+               return -ENOMEM;
+
+       codec = socdev->codec;
+       mutex_init(&codec->mutex);
+
+       codec->name = "PCM3008";
+       codec->owner = THIS_MODULE;
+       codec->dai = &pcm3008_dai;
+       codec->num_dai = 1;
+       codec->write = NULL;
+       codec->read = NULL;
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+
+       /* Register PCMs. */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               printk(KERN_ERR "pcm3008: failed to create pcms\n");
+               goto pcm_err;
+       }
+
+       /* Register Card. */
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               printk(KERN_ERR "pcm3008: failed to register card\n");
+               goto card_err;
+       }
+
+       /* DEM1  DEM0  DE-EMPHASIS_MODE
+        * Low   Low   De-emphasis 44.1 kHz ON
+        * Low   High  De-emphasis OFF
+        * High  Low   De-emphasis 48 kHz ON
+        * High  High  De-emphasis 32 kHz ON
+        */
+
+       /* Configure DEM0 GPIO (turning OFF DAC De-emphasis). */
+       ret = gpio_request(setup->dem0_pin, "codec_dem0");
+       if (ret == 0)
+               ret = gpio_direction_output(setup->dem0_pin, 1);
+       if (ret != 0)
+               goto gpio_err;
+
+       /* Configure DEM1 GPIO (turning OFF DAC De-emphasis). */
+       ret = gpio_request(setup->dem1_pin, "codec_dem1");
+       if (ret == 0)
+               ret = gpio_direction_output(setup->dem1_pin, 0);
+       if (ret != 0)
+               goto gpio_err;
+
+       /* Configure PDAD GPIO. */
+       ret = gpio_request(setup->pdad_pin, "codec_pdad");
+       if (ret == 0)
+               ret = gpio_direction_output(setup->pdad_pin, 1);
+       if (ret != 0)
+               goto gpio_err;
+
+       /* Configure PDDA GPIO. */
+       ret = gpio_request(setup->pdda_pin, "codec_pdda");
+       if (ret == 0)
+               ret = gpio_direction_output(setup->pdda_pin, 1);
+       if (ret != 0)
+               goto gpio_err;
+
+       return ret;
+
+gpio_err:
+       pcm3008_gpio_free(setup);
+card_err:
+       snd_soc_free_pcms(socdev);
+pcm_err:
+       kfree(socdev->codec);
+
+       return ret;
+}
+
+static int pcm3008_soc_remove(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+       struct pcm3008_setup_data *setup = socdev->codec_data;
+
+       if (!codec)
+               return 0;
+
+       pcm3008_gpio_free(setup);
+       snd_soc_free_pcms(socdev);
+       kfree(socdev->codec);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int pcm3008_soc_suspend(struct platform_device *pdev, pm_message_t msg)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct pcm3008_setup_data *setup = socdev->codec_data;
+
+       gpio_set_value(setup->pdad_pin, 0);
+       gpio_set_value(setup->pdda_pin, 0);
+
+       return 0;
+}
+
+static int pcm3008_soc_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct pcm3008_setup_data *setup = socdev->codec_data;
+
+       gpio_set_value(setup->pdad_pin, 1);
+       gpio_set_value(setup->pdda_pin, 1);
+
+       return 0;
+}
+#else
+#define pcm3008_soc_suspend NULL
+#define pcm3008_soc_resume NULL
+#endif
+
+struct snd_soc_codec_device soc_codec_dev_pcm3008 = {
+       .probe =        pcm3008_soc_probe,
+       .remove =       pcm3008_soc_remove,
+       .suspend =      pcm3008_soc_suspend,
+       .resume =       pcm3008_soc_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_pcm3008);
+
+static int __init pcm3008_init(void)
+{
+       return snd_soc_register_dai(&pcm3008_dai);
+}
+module_init(pcm3008_init);
+
+static void __exit pcm3008_exit(void)
+{
+       snd_soc_unregister_dai(&pcm3008_dai);
+}
+module_exit(pcm3008_exit);
+
+MODULE_DESCRIPTION("Soc PCM3008 driver");
+MODULE_AUTHOR("Hugo Villeneuve");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/pcm3008.h b/sound/soc/codecs/pcm3008.h
new file mode 100644 (file)
index 0000000..d04e87d
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * PCM3008 ALSA SoC Layer
+ *
+ * Author:     Hugo Villeneuve
+ * Copyright (C) 2008 Lyrtech inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_SND_SOC_PCM3008_H
+#define __LINUX_SND_SOC_PCM3008_H
+
+struct pcm3008_setup_data {
+       unsigned dem0_pin;
+       unsigned dem1_pin;
+       unsigned pdad_pin;
+       unsigned pdda_pin;
+};
+
+extern struct snd_soc_codec_device soc_codec_dev_pcm3008;
+extern struct snd_soc_dai pcm3008_dai;
+
+#endif
index 44ef0dacd564701b3999316d9c2e21c5b41ec4a8..cac373616768b67f8accb9ddad91fb1805bb3876 100644 (file)
@@ -285,16 +285,23 @@ static inline int get_coeff(int mclk, int rate)
 }
 
 static int ssm2602_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
 {
        u16 srate;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
        struct ssm2602_priv *ssm2602 = codec->private_data;
+       struct i2c_client *i2c = codec->control_data;
        u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3;
        int i = get_coeff(ssm2602->sysclk, params_rate(params));
 
+       if (substream == ssm2602->slave_substream) {
+               dev_dbg(&i2c->dev, "Ignoring hw_params for slave substream\n");
+               return 0;
+       }
+
        /*no match is found*/
        if (i == ARRAY_SIZE(coeff_div))
                return -EINVAL;
@@ -324,19 +331,26 @@ static int ssm2602_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int ssm2602_startup(struct snd_pcm_substream *substream)
+static int ssm2602_startup(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
        struct ssm2602_priv *ssm2602 = codec->private_data;
+       struct i2c_client *i2c = codec->control_data;
        struct snd_pcm_runtime *master_runtime;
 
        /* The DAI has shared clocks so if we already have a playback or
         * capture going then constrain this substream to match it.
+        * TODO: the ssm2602 allows pairs of non-matching PB/REC rates
         */
        if (ssm2602->master_substream) {
                master_runtime = ssm2602->master_substream->runtime;
+               dev_dbg(&i2c->dev, "Constraining to %d bits at %dHz\n",
+                       master_runtime->sample_bits,
+                       master_runtime->rate);
+
                snd_pcm_hw_constraint_minmax(substream->runtime,
                                             SNDRV_PCM_HW_PARAM_RATE,
                                             master_runtime->rate,
@@ -354,7 +368,8 @@ static int ssm2602_startup(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream)
+static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -365,14 +380,21 @@ static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static void ssm2602_shutdown(struct snd_pcm_substream *substream)
+static void ssm2602_shutdown(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
+       struct ssm2602_priv *ssm2602 = codec->private_data;
        /* deactivate */
        if (!codec->active)
                ssm2602_write(codec, SSM2602_ACTIVE, 0);
+
+       if (ssm2602->master_substream == substream)
+               ssm2602->master_substream = ssm2602->slave_substream;
+
+       ssm2602->slave_substream = NULL;
 }
 
 static int ssm2602_mute(struct snd_soc_dai *dai, int mute)
@@ -432,10 +454,10 @@ static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
                iface |= 0x0001;
                break;
        case SND_SOC_DAIFMT_DSP_A:
-               iface |= 0x0003;
+               iface |= 0x0013;
                break;
        case SND_SOC_DAIFMT_DSP_B:
-               iface |= 0x0013;
+               iface |= 0x0003;
                break;
        default:
                return -EINVAL;
@@ -496,6 +518,9 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
                SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
                SNDRV_PCM_RATE_96000)
 
+#define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
+               SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
+
 struct snd_soc_dai ssm2602_dai = {
        .name = "SSM2602",
        .playback = {
@@ -503,20 +528,18 @@ struct snd_soc_dai ssm2602_dai = {
                .channels_min = 2,
                .channels_max = 2,
                .rates = SSM2602_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+               .formats = SSM2602_FORMATS,},
        .capture = {
                .stream_name = "Capture",
                .channels_min = 2,
                .channels_max = 2,
                .rates = SSM2602_RATES,
-               .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+               .formats = SSM2602_FORMATS,},
        .ops = {
                .startup = ssm2602_startup,
                .prepare = ssm2602_pcm_prepare,
                .hw_params = ssm2602_hw_params,
                .shutdown = ssm2602_shutdown,
-       },
-       .dai_ops = {
                .digital_mute = ssm2602_mute,
                .set_sysclk = ssm2602_set_dai_sysclk,
                .set_fmt = ssm2602_set_dai_fmt,
@@ -601,7 +624,7 @@ static int ssm2602_init(struct snd_soc_device *socdev)
 
        ssm2602_add_controls(codec);
        ssm2602_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                pr_err("ssm2602: failed to register card\n");
                goto card_err;
@@ -770,6 +793,18 @@ struct snd_soc_codec_device soc_codec_dev_ssm2602 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_ssm2602);
 
+static int __init ssm2602_modinit(void)
+{
+       return snd_soc_register_dai(&ssm2602_dai);
+}
+module_init(ssm2602_modinit);
+
+static void __exit ssm2602_exit(void)
+{
+       snd_soc_unregister_dai(&ssm2602_dai);
+}
+module_exit(ssm2602_exit);
+
 MODULE_DESCRIPTION("ASoC ssm2602 driver");
 MODULE_AUTHOR("Cliff Cai");
 MODULE_LICENSE("GPL");
index 44308dac9e18de9d268ccea819f5376c1ec24a92..cfdea007c4cb3ca7536ca14a7527363af7b849ee 100644 (file)
 
 #define AIC23_VERSION "0.1"
 
-struct tlv320aic23_srate_reg_info {
-       u32 sample_rate;
-       u8 control;             /* SR3, SR2, SR1, SR0 and BOSR */
-       u8 divider;             /* if 0 CLKIN = MCLK, if 1 CLKIN = MCLK/2 */
-};
-
 /*
  * AIC23 register cache
  */
@@ -261,20 +255,156 @@ static const struct snd_soc_dapm_route intercon[] = {
 
 };
 
-/* tlv320aic23 related */
-static const struct tlv320aic23_srate_reg_info srate_reg_info[] = {
-       {4000, 0x06, 1},        /*  4000 */
-       {8000, 0x06, 0},        /*  8000 */
-       {16000, 0x0C, 1},       /* 16000 */
-       {22050, 0x11, 1},       /* 22050 */
-       {24000, 0x00, 1},       /* 24000 */
-       {32000, 0x0C, 0},       /* 32000 */
-       {44100, 0x11, 0},       /* 44100 */
-       {48000, 0x00, 0},       /* 48000 */
-       {88200, 0x1F, 0},       /* 88200 */
-       {96000, 0x0E, 0},       /* 96000 */
+/* AIC23 driver data */
+struct aic23 {
+       struct snd_soc_codec codec;
+       int mclk;
+       int requested_adc;
+       int requested_dac;
+};
+
+/*
+ * Common Crystals used
+ * 11.2896 Mhz /128 = *88.2k  /192 = 58.8k
+ * 12.0000 Mhz /125 = *96k    /136 = 88.235K
+ * 12.2880 Mhz /128 = *96k    /192 = 64k
+ * 16.9344 Mhz /128 = 132.3k /192 = *88.2k
+ * 18.4320 Mhz /128 = 144k   /192 = *96k
+ */
+
+/*
+ * Normal BOSR 0-256/2 = 128, 1-384/2 = 192
+ * USB BOSR 0-250/2 = 125, 1-272/2 = 136
+ */
+static const int bosr_usb_divisor_table[] = {
+       128, 125, 192, 136
+};
+#define LOWER_GROUP ((1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<6) | (1<<7))
+#define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11)        | (1<<15))
+static const unsigned short sr_valid_mask[] = {
+       LOWER_GROUP|UPPER_GROUP,        /* Normal, bosr - 0*/
+       LOWER_GROUP|UPPER_GROUP,        /* Normal, bosr - 1*/
+       LOWER_GROUP,                    /* Usb, bosr - 0*/
+       UPPER_GROUP,                    /* Usb, bosr - 1*/
+};
+/*
+ * Every divisor is a factor of 11*12
+ */
+#define SR_MULT (11*12)
+#define A(x) (x) ? (SR_MULT/x) : 0
+static const unsigned char sr_adc_mult_table[] = {
+       A(2), A(2), A(12), A(12),  A(0), A(0), A(3), A(1),
+       A(2), A(2), A(11), A(11),  A(0), A(0), A(0), A(1)
+};
+static const unsigned char sr_dac_mult_table[] = {
+       A(2), A(12), A(2), A(12),  A(0), A(0), A(3), A(1),
+       A(2), A(11), A(2), A(11),  A(0), A(0), A(0), A(1)
 };
 
+static unsigned get_score(int adc, int adc_l, int adc_h, int need_adc,
+               int dac, int dac_l, int dac_h, int need_dac)
+{
+       if ((adc >= adc_l) && (adc <= adc_h) &&
+                       (dac >= dac_l) && (dac <= dac_h)) {
+               int diff_adc = need_adc - adc;
+               int diff_dac = need_dac - dac;
+               return abs(diff_adc) + abs(diff_dac);
+       }
+       return UINT_MAX;
+}
+
+static int find_rate(int mclk, u32 need_adc, u32 need_dac)
+{
+       int i, j;
+       int best_i = -1;
+       int best_j = -1;
+       int best_div = 0;
+       unsigned best_score = UINT_MAX;
+       int adc_l, adc_h, dac_l, dac_h;
+
+       need_adc *= SR_MULT;
+       need_dac *= SR_MULT;
+       /*
+        * rates given are +/- 1/32
+        */
+       adc_l = need_adc - (need_adc >> 5);
+       adc_h = need_adc + (need_adc >> 5);
+       dac_l = need_dac - (need_dac >> 5);
+       dac_h = need_dac + (need_dac >> 5);
+       for (i = 0; i < ARRAY_SIZE(bosr_usb_divisor_table); i++) {
+               int base = mclk / bosr_usb_divisor_table[i];
+               int mask = sr_valid_mask[i];
+               for (j = 0; j < ARRAY_SIZE(sr_adc_mult_table);
+                               j++, mask >>= 1) {
+                       int adc;
+                       int dac;
+                       int score;
+                       if ((mask & 1) == 0)
+                               continue;
+                       adc = base * sr_adc_mult_table[j];
+                       dac = base * sr_dac_mult_table[j];
+                       score = get_score(adc, adc_l, adc_h, need_adc,
+                                       dac, dac_l, dac_h, need_dac);
+                       if (best_score > score) {
+                               best_score = score;
+                               best_i = i;
+                               best_j = j;
+                               best_div = 0;
+                       }
+                       score = get_score((adc >> 1), adc_l, adc_h, need_adc,
+                                       (dac >> 1), dac_l, dac_h, need_dac);
+                       /* prefer to have a /2 */
+                       if ((score != UINT_MAX) && (best_score >= score)) {
+                               best_score = score;
+                               best_i = i;
+                               best_j = j;
+                               best_div = 1;
+                       }
+               }
+       }
+       return (best_j << 2) | best_i | (best_div << TLV320AIC23_CLKIN_SHIFT);
+}
+
+#ifdef DEBUG
+static void get_current_sample_rates(struct snd_soc_codec *codec, int mclk,
+               u32 *sample_rate_adc, u32 *sample_rate_dac)
+{
+       int src = tlv320aic23_read_reg_cache(codec, TLV320AIC23_SRATE);
+       int sr = (src >> 2) & 0x0f;
+       int val = (mclk / bosr_usb_divisor_table[src & 3]);
+       int adc = (val * sr_adc_mult_table[sr]) / SR_MULT;
+       int dac = (val * sr_dac_mult_table[sr]) / SR_MULT;
+       if (src & TLV320AIC23_CLKIN_HALF) {
+               adc >>= 1;
+               dac >>= 1;
+       }
+       *sample_rate_adc = adc;
+       *sample_rate_dac = dac;
+}
+#endif
+
+static int set_sample_rate_control(struct snd_soc_codec *codec, int mclk,
+               u32 sample_rate_adc, u32 sample_rate_dac)
+{
+       /* Search for the right sample rate */
+       int data = find_rate(mclk, sample_rate_adc, sample_rate_dac);
+       if (data < 0) {
+               printk(KERN_ERR "%s:Invalid rate %u,%u requested\n",
+                               __func__, sample_rate_adc, sample_rate_dac);
+               return -EINVAL;
+       }
+       tlv320aic23_write(codec, TLV320AIC23_SRATE, data);
+#ifdef DEBUG
+       {
+               u32 adc, dac;
+               get_current_sample_rates(codec, mclk, &adc, &dac);
+               printk(KERN_DEBUG "actual samplerate = %u,%u reg=%x\n",
+                       adc, dac, data);
+       }
+#endif
+       return 0;
+}
+
 static int tlv320aic23_add_widgets(struct snd_soc_codec *codec)
 {
        snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets,
@@ -288,32 +418,36 @@ static int tlv320aic23_add_widgets(struct snd_soc_codec *codec)
 }
 
 static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
-                                struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
-       u16 iface_reg, data;
-       u8 count = 0;
+       u16 iface_reg;
+       int ret;
+       struct aic23 *aic23 = container_of(codec, struct aic23, codec);
+       u32 sample_rate_adc = aic23->requested_adc;
+       u32 sample_rate_dac = aic23->requested_dac;
+       u32 sample_rate = params_rate(params);
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               aic23->requested_dac = sample_rate_dac = sample_rate;
+               if (!sample_rate_adc)
+                       sample_rate_adc = sample_rate;
+       } else {
+               aic23->requested_adc = sample_rate_adc = sample_rate;
+               if (!sample_rate_dac)
+                       sample_rate_dac = sample_rate;
+       }
+       ret = set_sample_rate_control(codec, aic23->mclk, sample_rate_adc,
+                       sample_rate_dac);
+       if (ret < 0)
+               return ret;
 
        iface_reg =
            tlv320aic23_read_reg_cache(codec,
                                       TLV320AIC23_DIGT_FMT) & ~(0x03 << 2);
-
-       /* Search for the right sample rate */
-       /* Verify what happens if the rate is not supported
-        * now it goes to 96Khz */
-       while ((srate_reg_info[count].sample_rate != params_rate(params)) &&
-              (count < ARRAY_SIZE(srate_reg_info))) {
-               count++;
-       }
-
-       data =  (srate_reg_info[count].divider << TLV320AIC23_CLKIN_SHIFT) |
-               (srate_reg_info[count]. control << TLV320AIC23_BOSR_SHIFT) |
-               TLV320AIC23_USB_CLK_ON;
-
-       tlv320aic23_write(codec, TLV320AIC23_SRATE, data);
-
        switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S16_LE:
                break;
@@ -332,7 +466,8 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream)
+static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream,
+                                  struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -344,17 +479,23 @@ static int tlv320aic23_pcm_prepare(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static void tlv320aic23_shutdown(struct snd_pcm_substream *substream)
+static void tlv320aic23_shutdown(struct snd_pcm_substream *substream,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
+       struct aic23 *aic23 = container_of(codec, struct aic23, codec);
 
        /* deactivate */
        if (!codec->active) {
                udelay(50);
                tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x0);
        }
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               aic23->requested_dac = 0;
+       else
+               aic23->requested_adc = 0;
 }
 
 static int tlv320aic23_mute(struct snd_soc_dai *dai, int mute)
@@ -400,7 +541,7 @@ static int tlv320aic23_set_dai_fmt(struct snd_soc_dai *codec_dai,
        case SND_SOC_DAIFMT_I2S:
                iface_reg |= TLV320AIC23_FOR_I2S;
                break;
-       case SND_SOC_DAIFMT_DSP_A:
+       case SND_SOC_DAIFMT_DSP_B:
                iface_reg |= TLV320AIC23_FOR_DSP;
                break;
        case SND_SOC_DAIFMT_RIGHT_J:
@@ -422,12 +563,9 @@ static int tlv320aic23_set_dai_sysclk(struct snd_soc_dai *codec_dai,
                                      int clk_id, unsigned int freq, int dir)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
-
-       switch (freq) {
-       case 12000000:
-               return 0;
-       }
-       return -EINVAL;
+       struct aic23 *aic23 = container_of(codec, struct aic23, codec);
+       aic23->mclk = freq;
+       return 0;
 }
 
 static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
@@ -478,12 +616,10 @@ struct snd_soc_dai tlv320aic23_dai = {
                .prepare = tlv320aic23_pcm_prepare,
                .hw_params = tlv320aic23_hw_params,
                .shutdown = tlv320aic23_shutdown,
-               },
-       .dai_ops = {
-                   .digital_mute = tlv320aic23_mute,
-                   .set_fmt = tlv320aic23_set_dai_fmt,
-                   .set_sysclk = tlv320aic23_set_dai_sysclk,
-                   }
+               .digital_mute = tlv320aic23_mute,
+               .set_fmt = tlv320aic23_set_dai_fmt,
+               .set_sysclk = tlv320aic23_set_dai_sysclk,
+       }
 };
 EXPORT_SYMBOL_GPL(tlv320aic23_dai);
 
@@ -584,7 +720,7 @@ static int tlv320aic23_init(struct snd_soc_device *socdev)
 
        tlv320aic23_add_controls(codec);
        tlv320aic23_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "tlv320aic23: failed to register card\n");
                goto card_err;
@@ -659,14 +795,15 @@ static int tlv320aic23_probe(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_codec *codec;
+       struct aic23 *aic23;
        int ret = 0;
 
        printk(KERN_INFO "AIC23 Audio Codec %s\n", AIC23_VERSION);
 
-       codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
-       if (codec == NULL)
+       aic23 = kzalloc(sizeof(struct aic23), GFP_KERNEL);
+       if (aic23 == NULL)
                return -ENOMEM;
-
+       codec = &aic23->codec;
        socdev->codec = codec;
        mutex_init(&codec->mutex);
        INIT_LIST_HEAD(&codec->dapm_widgets);
@@ -687,6 +824,7 @@ static int tlv320aic23_remove(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_codec *codec = socdev->codec;
+       struct aic23 *aic23 = container_of(codec, struct aic23, codec);
 
        if (codec->control_data)
                tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_OFF);
@@ -697,7 +835,7 @@ static int tlv320aic23_remove(struct platform_device *pdev)
        i2c_del_driver(&tlv320aic23_i2c_driver);
 #endif
        kfree(codec->reg_cache);
-       kfree(codec);
+       kfree(aic23);
 
        return 0;
 }
@@ -709,6 +847,18 @@ struct snd_soc_codec_device soc_codec_dev_tlv320aic23 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_tlv320aic23);
 
+static int __init tlv320aic23_modinit(void)
+{
+       return snd_soc_register_dai(&tlv320aic23_dai);
+}
+module_init(tlv320aic23_modinit);
+
+static void __exit tlv320aic23_exit(void)
+{
+       snd_soc_unregister_dai(&tlv320aic23_dai);
+}
+module_exit(tlv320aic23_exit);
+
 MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver");
 MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
 MODULE_LICENSE("GPL");
index bed8a9e63ddc86fd0a8c2d9274b812867149fcb4..29f2f1a017fde8744816005584ca9b676d6fdfa5 100644 (file)
@@ -125,7 +125,8 @@ static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg,
  * Digital Audio Interface Operations
  */
 static int aic26_hw_params(struct snd_pcm_substream *substream,
-                          struct snd_pcm_hw_params *params)
+                          struct snd_pcm_hw_params *params,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -287,8 +288,6 @@ struct snd_soc_dai aic26_dai = {
        },
        .ops = {
                .hw_params = aic26_hw_params,
-       },
-       .dai_ops = {
                .digital_mute = aic26_mute,
                .set_sysclk = aic26_set_sysclk,
                .set_fmt = aic26_set_fmt,
@@ -360,7 +359,7 @@ static int aic26_probe(struct platform_device *pdev)
 
        /* CODEC is setup, we can register the card now */
        dev_dbg(&pdev->dev, "Registering card\n");
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                dev_err(&pdev->dev, "aic26: failed to register card\n");
                goto card_err;
@@ -427,7 +426,7 @@ static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set);
 static int aic26_spi_probe(struct spi_device *spi)
 {
        struct aic26 *aic26;
-       int rc, i, reg;
+       int ret, i, reg;
 
        dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n");
 
@@ -457,6 +456,14 @@ static int aic26_spi_probe(struct spi_device *spi)
        aic26->codec.reg_cache_size = AIC26_NUM_REGS;
        aic26->codec.reg_cache = aic26->reg_cache;
 
+       aic26_dai.dev = &spi->dev;
+       ret = snd_soc_register_dai(&aic26_dai);
+       if (ret != 0) {
+               dev_err(&spi->dev, "Failed to register DAI: %d\n", ret);
+               kfree(aic26);
+               return ret;
+       }
+
        /* Reset the codec to power on defaults */
        aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00);
 
@@ -475,8 +482,8 @@ static int aic26_spi_probe(struct spi_device *spi)
 
        /* Register the sysfs files for debugging */
        /* Create SysFS files */
-       rc = device_create_file(&spi->dev, &dev_attr_keyclick);
-       if (rc)
+       ret = device_create_file(&spi->dev, &dev_attr_keyclick);
+       if (ret)
                dev_info(&spi->dev, "error creating sysfs files\n");
 
 #if defined(CONFIG_SND_SOC_OF_SIMPLE)
@@ -493,6 +500,7 @@ static int aic26_spi_remove(struct spi_device *spi)
 {
        struct aic26 *aic26 = dev_get_drvdata(&spi->dev);
 
+       snd_soc_unregister_dai(&aic26_dai);
        kfree(aic26);
 
        return 0;
index cff276ee261e7a2ecca843b23bc74d4fec761df7..b47a749c5ea2aecaf08e92fe0eb03b9538ad14f2 100644 (file)
@@ -253,11 +253,17 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = {
 
        SOC_DOUBLE_R("Line DAC Playback Volume", DACL1_2_LLOPM_VOL,
                     DACR1_2_RLOPM_VOL, 0, 0x7f, 1),
-       SOC_DOUBLE_R("Line DAC Playback Switch", LLOPM_CTRL, RLOPM_CTRL, 3,
-                    0x01, 0),
-       SOC_DOUBLE_R("Line PGA Bypass Playback Volume", PGAL_2_LLOPM_VOL,
-                    PGAR_2_RLOPM_VOL, 0, 0x7f, 1),
-       SOC_DOUBLE_R("Line Line2 Bypass Playback Volume", LINE2L_2_LLOPM_VOL,
+       SOC_SINGLE("LineL Playback Switch", LLOPM_CTRL, 3, 0x01, 0),
+       SOC_SINGLE("LineR Playback Switch", RLOPM_CTRL, 3, 0x01, 0),
+       SOC_DOUBLE_R("LineL DAC Playback Volume", DACL1_2_LLOPM_VOL,
+                    DACR1_2_LLOPM_VOL, 0, 0x7f, 1),
+       SOC_SINGLE("LineL Left PGA Bypass Playback Volume", PGAL_2_LLOPM_VOL,
+                    0, 0x7f, 1),
+       SOC_SINGLE("LineR Right PGA Bypass Playback Volume", PGAR_2_RLOPM_VOL,
+                    0, 0x7f, 1),
+       SOC_DOUBLE_R("LineL Line2 Bypass Playback Volume", LINE2L_2_LLOPM_VOL,
+                    LINE2R_2_LLOPM_VOL, 0, 0x7f, 1),
+       SOC_DOUBLE_R("LineR Line2 Bypass Playback Volume", LINE2L_2_RLOPM_VOL,
                     LINE2R_2_RLOPM_VOL, 0, 0x7f, 1),
 
        SOC_DOUBLE_R("Mono DAC Playback Volume", DACL1_2_MONOLOPM_VOL,
@@ -272,8 +278,12 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = {
                     DACR1_2_HPROUT_VOL, 0, 0x7f, 1),
        SOC_DOUBLE_R("HP DAC Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3,
                     0x01, 0),
-       SOC_DOUBLE_R("HP PGA Bypass Playback Volume", PGAL_2_HPLOUT_VOL,
+       SOC_DOUBLE_R("HP Right PGA Bypass Playback Volume", PGAR_2_HPLOUT_VOL,
                     PGAR_2_HPROUT_VOL, 0, 0x7f, 1),
+       SOC_SINGLE("HPL PGA Bypass Playback Volume", PGAL_2_HPLOUT_VOL,
+                    0, 0x7f, 1),
+       SOC_SINGLE("HPR PGA Bypass Playback Volume", PGAL_2_HPROUT_VOL,
+                    0, 0x7f, 1),
        SOC_DOUBLE_R("HP Line2 Bypass Playback Volume", LINE2L_2_HPLOUT_VOL,
                     LINE2R_2_HPROUT_VOL, 0, 0x7f, 1),
 
@@ -281,8 +291,10 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] = {
                     DACR1_2_HPRCOM_VOL, 0, 0x7f, 1),
        SOC_DOUBLE_R("HPCOM DAC Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3,
                     0x01, 0),
-       SOC_DOUBLE_R("HPCOM PGA Bypass Playback Volume", PGAL_2_HPLCOM_VOL,
-                    PGAR_2_HPRCOM_VOL, 0, 0x7f, 1),
+       SOC_SINGLE("HPLCOM PGA Bypass Playback Volume", PGAL_2_HPLCOM_VOL,
+                    0, 0x7f, 1),
+       SOC_SINGLE("HPRCOM PGA Bypass Playback Volume", PGAL_2_HPRCOM_VOL,
+                    0, 0x7f, 1),
        SOC_DOUBLE_R("HPCOM Line2 Bypass Playback Volume", LINE2L_2_HPLCOM_VOL,
                     LINE2R_2_HPRCOM_VOL, 0, 0x7f, 1),
 
@@ -333,7 +345,8 @@ SOC_DAPM_ENUM("Route", aic3x_enum[RHPCOM_ENUM]);
 
 /* Left DAC_L1 Mixer */
 static const struct snd_kcontrol_new aic3x_left_dac_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", DACL1_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", DACL1_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", DACL1_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", DACL1_2_MONOLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HP Switch", DACL1_2_HPLOUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HPCOM Switch", DACL1_2_HPLCOM_VOL, 7, 1, 0),
@@ -341,7 +354,8 @@ static const struct snd_kcontrol_new aic3x_left_dac_mixer_controls[] = {
 
 /* Right DAC_R1 Mixer */
 static const struct snd_kcontrol_new aic3x_right_dac_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", DACR1_2_RLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", DACR1_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", DACR1_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", DACR1_2_MONOLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HP Switch", DACR1_2_HPROUT_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HPCOM Switch", DACR1_2_HPRCOM_VOL, 7, 1, 0),
@@ -350,14 +364,18 @@ static const struct snd_kcontrol_new aic3x_right_dac_mixer_controls[] = {
 /* Left PGA Mixer */
 static const struct snd_kcontrol_new aic3x_left_pga_mixer_controls[] = {
        SOC_DAPM_SINGLE_AIC3X("Line1L Switch", LINE1L_2_LADC_CTRL, 3, 1, 1),
+       SOC_DAPM_SINGLE_AIC3X("Line1R Switch", LINE1R_2_LADC_CTRL, 3, 1, 1),
        SOC_DAPM_SINGLE_AIC3X("Line2L Switch", LINE2L_2_LADC_CTRL, 3, 1, 1),
        SOC_DAPM_SINGLE_AIC3X("Mic3L Switch", MIC3LR_2_LADC_CTRL, 4, 1, 1),
+       SOC_DAPM_SINGLE_AIC3X("Mic3R Switch", MIC3LR_2_LADC_CTRL, 0, 1, 1),
 };
 
 /* Right PGA Mixer */
 static const struct snd_kcontrol_new aic3x_right_pga_mixer_controls[] = {
        SOC_DAPM_SINGLE_AIC3X("Line1R Switch", LINE1R_2_RADC_CTRL, 3, 1, 1),
+       SOC_DAPM_SINGLE_AIC3X("Line1L Switch", LINE1L_2_RADC_CTRL, 3, 1, 1),
        SOC_DAPM_SINGLE_AIC3X("Line2R Switch", LINE2R_2_RADC_CTRL, 3, 1, 1),
+       SOC_DAPM_SINGLE_AIC3X("Mic3L Switch", MIC3LR_2_RADC_CTRL, 4, 1, 1),
        SOC_DAPM_SINGLE_AIC3X("Mic3R Switch", MIC3LR_2_RADC_CTRL, 0, 1, 1),
 };
 
@@ -379,34 +397,42 @@ SOC_DAPM_ENUM("Route", aic3x_enum[LINE2R_ENUM]);
 
 /* Left PGA Bypass Mixer */
 static const struct snd_kcontrol_new aic3x_left_pga_bp_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", PGAL_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", PGAL_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", PGAL_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", PGAL_2_MONOLOPM_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HP Switch", PGAL_2_HPLOUT_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HPCOM Switch", PGAL_2_HPLCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPL Switch", PGAL_2_HPLOUT_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPR Switch", PGAL_2_HPROUT_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPLCOM Switch", PGAL_2_HPLCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPRCOM Switch", PGAL_2_HPRCOM_VOL, 7, 1, 0),
 };
 
 /* Right PGA Bypass Mixer */
 static const struct snd_kcontrol_new aic3x_right_pga_bp_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", PGAR_2_RLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", PGAR_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", PGAR_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", PGAR_2_MONOLOPM_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HP Switch", PGAR_2_HPROUT_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HPCOM Switch", PGAR_2_HPRCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPL Switch", PGAR_2_HPLOUT_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPR Switch", PGAR_2_HPROUT_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPLCOM Switch", PGAR_2_HPLCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPRCOM Switch", PGAR_2_HPRCOM_VOL, 7, 1, 0),
 };
 
 /* Left Line2 Bypass Mixer */
 static const struct snd_kcontrol_new aic3x_left_line2_bp_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", LINE2L_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", LINE2L_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", LINE2L_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", LINE2L_2_MONOLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HP Switch", LINE2L_2_HPLOUT_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HPCOM Switch", LINE2L_2_HPLCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPLCOM Switch", LINE2L_2_HPLCOM_VOL, 7, 1, 0),
 };
 
 /* Right Line2 Bypass Mixer */
 static const struct snd_kcontrol_new aic3x_right_line2_bp_mixer_controls[] = {
-       SOC_DAPM_SINGLE("Line Switch", LINE2R_2_RLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineL Switch", LINE2R_2_LLOPM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("LineR Switch", LINE2R_2_RLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("Mono Switch", LINE2R_2_MONOLOPM_VOL, 7, 1, 0),
        SOC_DAPM_SINGLE("HP Switch", LINE2R_2_HPROUT_VOL, 7, 1, 0),
-       SOC_DAPM_SINGLE("HPCOM Switch", LINE2R_2_HPRCOM_VOL, 7, 1, 0),
+       SOC_DAPM_SINGLE("HPRCOM Switch", LINE2R_2_HPRCOM_VOL, 7, 1, 0),
 };
 
 static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
@@ -439,22 +465,26 @@ static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
        /* Mono Output */
        SND_SOC_DAPM_PGA("Mono Out", MONOLOPM_CTRL, 0, 0, NULL, 0),
 
-       /* Left Inputs to Left ADC */
+       /* Inputs to Left ADC */
        SND_SOC_DAPM_ADC("Left ADC", "Left Capture", LINE1L_2_LADC_CTRL, 2, 0),
        SND_SOC_DAPM_MIXER("Left PGA Mixer", SND_SOC_NOPM, 0, 0,
                           &aic3x_left_pga_mixer_controls[0],
                           ARRAY_SIZE(aic3x_left_pga_mixer_controls)),
        SND_SOC_DAPM_MUX("Left Line1L Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_left_line1_mux_controls),
+       SND_SOC_DAPM_MUX("Left Line1R Mux", SND_SOC_NOPM, 0, 0,
+                        &aic3x_left_line1_mux_controls),
        SND_SOC_DAPM_MUX("Left Line2L Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_left_line2_mux_controls),
 
-       /* Right Inputs to Right ADC */
+       /* Inputs to Right ADC */
        SND_SOC_DAPM_ADC("Right ADC", "Right Capture",
                         LINE1R_2_RADC_CTRL, 2, 0),
        SND_SOC_DAPM_MIXER("Right PGA Mixer", SND_SOC_NOPM, 0, 0,
                           &aic3x_right_pga_mixer_controls[0],
                           ARRAY_SIZE(aic3x_right_pga_mixer_controls)),
+       SND_SOC_DAPM_MUX("Right Line1L Mux", SND_SOC_NOPM, 0, 0,
+                        &aic3x_right_line1_mux_controls),
        SND_SOC_DAPM_MUX("Right Line1R Mux", SND_SOC_NOPM, 0, 0,
                         &aic3x_right_line1_mux_controls),
        SND_SOC_DAPM_MUX("Right Line2R Mux", SND_SOC_NOPM, 0, 0,
@@ -531,7 +561,8 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Left DAC Mux", "DAC_L2", "Left DAC"},
        {"Left DAC Mux", "DAC_L3", "Left DAC"},
 
-       {"Left DAC_L1 Mixer", "Line Switch", "Left DAC Mux"},
+       {"Left DAC_L1 Mixer", "LineL Switch", "Left DAC Mux"},
+       {"Left DAC_L1 Mixer", "LineR Switch", "Left DAC Mux"},
        {"Left DAC_L1 Mixer", "Mono Switch", "Left DAC Mux"},
        {"Left DAC_L1 Mixer", "HP Switch", "Left DAC Mux"},
        {"Left DAC_L1 Mixer", "HPCOM Switch", "Left DAC Mux"},
@@ -557,7 +588,8 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Right DAC Mux", "DAC_R2", "Right DAC"},
        {"Right DAC Mux", "DAC_R3", "Right DAC"},
 
-       {"Right DAC_R1 Mixer", "Line Switch", "Right DAC Mux"},
+       {"Right DAC_R1 Mixer", "LineL Switch", "Right DAC Mux"},
+       {"Right DAC_R1 Mixer", "LineR Switch", "Right DAC Mux"},
        {"Right DAC_R1 Mixer", "Mono Switch", "Right DAC Mux"},
        {"Right DAC_R1 Mixer", "HP Switch", "Right DAC Mux"},
        {"Right DAC_R1 Mixer", "HPCOM Switch", "Right DAC Mux"},
@@ -592,8 +624,10 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Left Line2L Mux", "differential", "LINE2L"},
 
        {"Left PGA Mixer", "Line1L Switch", "Left Line1L Mux"},
+       {"Left PGA Mixer", "Line1R Switch", "Left Line1R Mux"},
        {"Left PGA Mixer", "Line2L Switch", "Left Line2L Mux"},
        {"Left PGA Mixer", "Mic3L Switch", "MIC3L"},
+       {"Left PGA Mixer", "Mic3R Switch", "MIC3R"},
 
        {"Left ADC", NULL, "Left PGA Mixer"},
        {"Left ADC", NULL, "GPIO1 dmic modclk"},
@@ -605,18 +639,23 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Right Line2R Mux", "single-ended", "LINE2R"},
        {"Right Line2R Mux", "differential", "LINE2R"},
 
+       {"Right PGA Mixer", "Line1L Switch", "Right Line1L Mux"},
        {"Right PGA Mixer", "Line1R Switch", "Right Line1R Mux"},
        {"Right PGA Mixer", "Line2R Switch", "Right Line2R Mux"},
+       {"Right PGA Mixer", "Mic3L Switch", "MIC3L"},
        {"Right PGA Mixer", "Mic3R Switch", "MIC3R"},
 
        {"Right ADC", NULL, "Right PGA Mixer"},
        {"Right ADC", NULL, "GPIO1 dmic modclk"},
 
        /* Left PGA Bypass */
-       {"Left PGA Bypass Mixer", "Line Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "LineL Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "LineR Switch", "Left PGA Mixer"},
        {"Left PGA Bypass Mixer", "Mono Switch", "Left PGA Mixer"},
-       {"Left PGA Bypass Mixer", "HP Switch", "Left PGA Mixer"},
-       {"Left PGA Bypass Mixer", "HPCOM Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "HPL Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "HPR Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "HPLCOM Switch", "Left PGA Mixer"},
+       {"Left PGA Bypass Mixer", "HPRCOM Switch", "Left PGA Mixer"},
 
        {"Left HPCOM Mux", "differential of HPLOUT", "Left PGA Bypass Mixer"},
        {"Left HPCOM Mux", "constant VCM", "Left PGA Bypass Mixer"},
@@ -627,10 +666,13 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Left HP Out", NULL, "Left PGA Bypass Mixer"},
 
        /* Right PGA Bypass */
-       {"Right PGA Bypass Mixer", "Line Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "LineL Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "LineR Switch", "Right PGA Mixer"},
        {"Right PGA Bypass Mixer", "Mono Switch", "Right PGA Mixer"},
-       {"Right PGA Bypass Mixer", "HP Switch", "Right PGA Mixer"},
-       {"Right PGA Bypass Mixer", "HPCOM Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "HPL Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "HPR Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "HPLCOM Switch", "Right PGA Mixer"},
+       {"Right PGA Bypass Mixer", "HPRCOM Switch", "Right PGA Mixer"},
 
        {"Right HPCOM Mux", "differential of HPROUT", "Right PGA Bypass Mixer"},
        {"Right HPCOM Mux", "constant VCM", "Right PGA Bypass Mixer"},
@@ -643,10 +685,11 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Right HP Out", NULL, "Right PGA Bypass Mixer"},
 
        /* Left Line2 Bypass */
-       {"Left Line2 Bypass Mixer", "Line Switch", "Left Line2L Mux"},
+       {"Left Line2 Bypass Mixer", "LineL Switch", "Left Line2L Mux"},
+       {"Left Line2 Bypass Mixer", "LineR Switch", "Left Line2L Mux"},
        {"Left Line2 Bypass Mixer", "Mono Switch", "Left Line2L Mux"},
        {"Left Line2 Bypass Mixer", "HP Switch", "Left Line2L Mux"},
-       {"Left Line2 Bypass Mixer", "HPCOM Switch", "Left Line2L Mux"},
+       {"Left Line2 Bypass Mixer", "HPLCOM Switch", "Left Line2L Mux"},
 
        {"Left HPCOM Mux", "differential of HPLOUT", "Left Line2 Bypass Mixer"},
        {"Left HPCOM Mux", "constant VCM", "Left Line2 Bypass Mixer"},
@@ -657,10 +700,11 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"Left HP Out", NULL, "Left Line2 Bypass Mixer"},
 
        /* Right Line2 Bypass */
-       {"Right Line2 Bypass Mixer", "Line Switch", "Right Line2R Mux"},
+       {"Right Line2 Bypass Mixer", "LineL Switch", "Right Line2R Mux"},
+       {"Right Line2 Bypass Mixer", "LineR Switch", "Right Line2R Mux"},
        {"Right Line2 Bypass Mixer", "Mono Switch", "Right Line2R Mux"},
        {"Right Line2 Bypass Mixer", "HP Switch", "Right Line2R Mux"},
-       {"Right Line2 Bypass Mixer", "HPCOM Switch", "Right Line2R Mux"},
+       {"Right Line2 Bypass Mixer", "HPRCOM Switch", "Right Line2R Mux"},
 
        {"Right HPCOM Mux", "differential of HPROUT", "Right Line2 Bypass Mixer"},
        {"Right HPCOM Mux", "constant VCM", "Right Line2 Bypass Mixer"},
@@ -694,7 +738,8 @@ static int aic3x_add_widgets(struct snd_soc_codec *codec)
 }
 
 static int aic3x_hw_params(struct snd_pcm_substream *substream,
-                          struct snd_pcm_hw_params *params)
+                          struct snd_pcm_hw_params *params,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -846,6 +891,7 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
        struct snd_soc_codec *codec = codec_dai->codec;
        struct aic3x_priv *aic3x = codec->private_data;
        u8 iface_areg, iface_breg;
+       int delay = 0;
 
        iface_areg = aic3x_read_reg_cache(codec, AIC3X_ASD_INTF_CTRLA) & 0x3f;
        iface_breg = aic3x_read_reg_cache(codec, AIC3X_ASD_INTF_CTRLB) & 0x3f;
@@ -871,6 +917,8 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
                       SND_SOC_DAIFMT_INV_MASK)) {
        case (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF):
                break;
+       case (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF):
+               delay = 1;
        case (SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF):
                iface_breg |= (0x01 << 6);
                break;
@@ -887,6 +935,7 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
        /* set iface */
        aic3x_write(codec, AIC3X_ASD_INTF_CTRLA, iface_areg);
        aic3x_write(codec, AIC3X_ASD_INTF_CTRLB, iface_breg);
+       aic3x_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
 
        return 0;
 }
@@ -981,14 +1030,41 @@ int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio)
 }
 EXPORT_SYMBOL_GPL(aic3x_get_gpio);
 
+void aic3x_set_headset_detection(struct snd_soc_codec *codec, int detect,
+                                int headset_debounce, int button_debounce)
+{
+       u8 val;
+
+       val = ((detect & AIC3X_HEADSET_DETECT_MASK)
+               << AIC3X_HEADSET_DETECT_SHIFT) |
+             ((headset_debounce & AIC3X_HEADSET_DEBOUNCE_MASK)
+               << AIC3X_HEADSET_DEBOUNCE_SHIFT) |
+             ((button_debounce & AIC3X_BUTTON_DEBOUNCE_MASK)
+               << AIC3X_BUTTON_DEBOUNCE_SHIFT);
+
+       if (detect & AIC3X_HEADSET_DETECT_MASK)
+               val |= AIC3X_HEADSET_DETECT_ENABLED;
+
+       aic3x_write(codec, AIC3X_HEADSET_DETECT_CTRL_A, val);
+}
+EXPORT_SYMBOL_GPL(aic3x_set_headset_detection);
+
 int aic3x_headset_detected(struct snd_soc_codec *codec)
 {
        u8 val;
-       aic3x_read(codec, AIC3X_RT_IRQ_FLAGS_REG, &val);
-       return (val >> 2) & 1;
+       aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val);
+       return (val >> 4) & 1;
 }
 EXPORT_SYMBOL_GPL(aic3x_headset_detected);
 
+int aic3x_button_pressed(struct snd_soc_codec *codec)
+{
+       u8 val;
+       aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val);
+       return (val >> 5) & 1;
+}
+EXPORT_SYMBOL_GPL(aic3x_button_pressed);
+
 #define AIC3X_RATES    SNDRV_PCM_RATE_8000_96000
 #define AIC3X_FORMATS  (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                         SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
@@ -1009,8 +1085,6 @@ struct snd_soc_dai aic3x_dai = {
                .formats = AIC3X_FORMATS,},
        .ops = {
                .hw_params = aic3x_hw_params,
-       },
-       .dai_ops = {
                .digital_mute = aic3x_mute,
                .set_sysclk = aic3x_set_dai_sysclk,
                .set_fmt = aic3x_set_dai_fmt,
@@ -1152,7 +1226,7 @@ static int aic3x_init(struct snd_soc_device *socdev)
 
        aic3x_add_controls(codec);
        aic3x_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "aic3x: failed to register card\n");
                goto card_err;
@@ -1341,6 +1415,18 @@ struct snd_soc_codec_device soc_codec_dev_aic3x = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_aic3x);
 
+static int __init aic3x_modinit(void)
+{
+       return snd_soc_register_dai(&aic3x_dai);
+}
+module_init(aic3x_modinit);
+
+static void __exit aic3x_exit(void)
+{
+       snd_soc_unregister_dai(&aic3x_dai);
+}
+module_exit(aic3x_exit);
+
 MODULE_DESCRIPTION("ASoC TLV320AIC3X codec driver");
 MODULE_AUTHOR("Vladimir Barinov");
 MODULE_LICENSE("GPL");
index 00a195aa02e4e2321d9437f964688f532cf0fde8..ac827e578c4d0548a7d64b7da037ecc7313d55d6 100644 (file)
 #define AIC3X_ASD_INTF_CTRLA           8
 /* Audio serial data interface control register B */
 #define AIC3X_ASD_INTF_CTRLB           9
+/* Audio serial data interface control register C */
+#define AIC3X_ASD_INTF_CTRLC           10
 /* Audio overflow status and PLL R value programming register */
 #define AIC3X_OVRF_STATUS_AND_PLLR_REG 11
 /* Audio codec digital filter control register */
 #define AIC3X_CODEC_DFILT_CTRL         12
-
+/* Headset/button press detection register */
+#define AIC3X_HEADSET_DETECT_CTRL_A    13
+#define AIC3X_HEADSET_DETECT_CTRL_B    14
 /* ADC PGA Gain control registers */
 #define LADC_VOL                       15
 #define RADC_VOL                       16
@@ -48,7 +52,9 @@
 #define MIC3LR_2_RADC_CTRL             18
 /* Line1 Input control registers */
 #define LINE1L_2_LADC_CTRL             19
+#define LINE1R_2_LADC_CTRL             21
 #define LINE1R_2_RADC_CTRL             22
+#define LINE1L_2_RADC_CTRL             24
 /* Line2 Input control registers */
 #define LINE2L_2_LADC_CTRL             20
 #define LINE2R_2_RADC_CTRL             23
@@ -79,6 +85,8 @@
 #define LINE2L_2_HPLOUT_VOL            45
 #define LINE2R_2_HPROUT_VOL            62
 #define PGAL_2_HPLOUT_VOL              46
+#define PGAL_2_HPROUT_VOL              60
+#define PGAR_2_HPLOUT_VOL              49
 #define PGAR_2_HPROUT_VOL              63
 #define DACL1_2_HPLOUT_VOL             47
 #define DACR1_2_HPROUT_VOL             64
@@ -88,6 +96,8 @@
 #define LINE2L_2_HPLCOM_VOL            52
 #define LINE2R_2_HPRCOM_VOL            69
 #define PGAL_2_HPLCOM_VOL              53
+#define PGAR_2_HPLCOM_VOL              56
+#define PGAL_2_HPRCOM_VOL              67
 #define PGAR_2_HPRCOM_VOL              70
 #define DACL1_2_HPLCOM_VOL             54
 #define DACR1_2_HPRCOM_VOL             71
 #define MONOLOPM_CTRL                  79
 /* Line Output Plus/Minus control registers */
 #define LINE2L_2_LLOPM_VOL             80
+#define LINE2L_2_RLOPM_VOL             87
+#define LINE2R_2_LLOPM_VOL             83
 #define LINE2R_2_RLOPM_VOL             90
 #define PGAL_2_LLOPM_VOL               81
+#define PGAL_2_RLOPM_VOL               88
+#define PGAR_2_LLOPM_VOL               84
 #define PGAR_2_RLOPM_VOL               91
 #define DACL1_2_LLOPM_VOL              82
+#define DACL1_2_RLOPM_VOL              89
 #define DACR1_2_RLOPM_VOL              92
+#define DACR1_2_LLOPM_VOL              85
 #define LLOPM_CTRL                     86
 #define RLOPM_CTRL                     93
 /* GPIO/IRQ registers */
@@ -221,7 +237,49 @@ enum {
 
 void aic3x_set_gpio(struct snd_soc_codec *codec, int gpio, int state);
 int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio);
+
+/* headset detection / button API */
+
+/* The AIC3x supports detection of stereo headsets (GND + left + right signal)
+ * and cellular headsets (GND + speaker output + microphone input).
+ * It is recommended to enable MIC bias for this function to work properly.
+ * For more information, please refer to the datasheet. */
+enum {
+       AIC3X_HEADSET_DETECT_OFF        = 0,
+       AIC3X_HEADSET_DETECT_STEREO     = 1,
+       AIC3X_HEADSET_DETECT_CELLULAR   = 2,
+       AIC3X_HEADSET_DETECT_BOTH       = 3
+};
+
+enum {
+       AIC3X_HEADSET_DEBOUNCE_16MS     = 0,
+       AIC3X_HEADSET_DEBOUNCE_32MS     = 1,
+       AIC3X_HEADSET_DEBOUNCE_64MS     = 2,
+       AIC3X_HEADSET_DEBOUNCE_128MS    = 3,
+       AIC3X_HEADSET_DEBOUNCE_256MS    = 4,
+       AIC3X_HEADSET_DEBOUNCE_512MS    = 5
+};
+
+enum {
+       AIC3X_BUTTON_DEBOUNCE_0MS       = 0,
+       AIC3X_BUTTON_DEBOUNCE_8MS       = 1,
+       AIC3X_BUTTON_DEBOUNCE_16MS      = 2,
+       AIC3X_BUTTON_DEBOUNCE_32MS      = 3
+};
+
+#define AIC3X_HEADSET_DETECT_ENABLED   0x80
+#define AIC3X_HEADSET_DETECT_SHIFT     5
+#define AIC3X_HEADSET_DETECT_MASK      3
+#define AIC3X_HEADSET_DEBOUNCE_SHIFT   2
+#define AIC3X_HEADSET_DEBOUNCE_MASK    7
+#define AIC3X_BUTTON_DEBOUNCE_SHIFT    0
+#define AIC3X_BUTTON_DEBOUNCE_MASK     3
+
+/* see the enums above for valid parameters to this function */
+void aic3x_set_headset_detection(struct snd_soc_codec *codec, int detect,
+                                int headset_debounce, int button_debounce);
 int aic3x_headset_detected(struct snd_soc_codec *codec);
+int aic3x_button_pressed(struct snd_soc_codec *codec);
 
 struct aic3x_setup_data {
        int i2c_bus;
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
new file mode 100644 (file)
index 0000000..5184888
--- /dev/null
@@ -0,0 +1,1317 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author:      Steve Sakoman, <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <linux/i2c/twl4030.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+#include <sound/tlv.h>
+
+#include "twl4030.h"
+
+/*
+ * twl4030 register cache & default register settings
+ */
+static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+       0x00, /* this register not used         */
+       0x93, /* REG_CODEC_MODE         (0x1)   */
+       0xc3, /* REG_OPTION             (0x2)   */
+       0x00, /* REG_UNKNOWN            (0x3)   */
+       0x00, /* REG_MICBIAS_CTL        (0x4)   */
+       0x20, /* REG_ANAMICL            (0x5)   */
+       0x00, /* REG_ANAMICR            (0x6)   */
+       0x00, /* REG_AVADC_CTL          (0x7)   */
+       0x00, /* REG_ADCMICSEL          (0x8)   */
+       0x00, /* REG_DIGMIXING          (0x9)   */
+       0x0c, /* REG_ATXL1PGA           (0xA)   */
+       0x0c, /* REG_ATXR1PGA           (0xB)   */
+       0x00, /* REG_AVTXL2PGA          (0xC)   */
+       0x00, /* REG_AVTXR2PGA          (0xD)   */
+       0x01, /* REG_AUDIO_IF           (0xE)   */
+       0x00, /* REG_VOICE_IF           (0xF)   */
+       0x00, /* REG_ARXR1PGA           (0x10)  */
+       0x00, /* REG_ARXL1PGA           (0x11)  */
+       0x6c, /* REG_ARXR2PGA           (0x12)  */
+       0x6c, /* REG_ARXL2PGA           (0x13)  */
+       0x00, /* REG_VRXPGA             (0x14)  */
+       0x00, /* REG_VSTPGA             (0x15)  */
+       0x00, /* REG_VRX2ARXPGA         (0x16)  */
+       0x0c, /* REG_AVDAC_CTL          (0x17)  */
+       0x00, /* REG_ARX2VTXPGA         (0x18)  */
+       0x00, /* REG_ARXL1_APGA_CTL     (0x19)  */
+       0x00, /* REG_ARXR1_APGA_CTL     (0x1A)  */
+       0x4b, /* REG_ARXL2_APGA_CTL     (0x1B)  */
+       0x4b, /* REG_ARXR2_APGA_CTL     (0x1C)  */
+       0x00, /* REG_ATX2ARXPGA         (0x1D)  */
+       0x00, /* REG_BT_IF              (0x1E)  */
+       0x00, /* REG_BTPGA              (0x1F)  */
+       0x00, /* REG_BTSTPGA            (0x20)  */
+       0x00, /* REG_EAR_CTL            (0x21)  */
+       0x24, /* REG_HS_SEL             (0x22)  */
+       0x0a, /* REG_HS_GAIN_SET        (0x23)  */
+       0x00, /* REG_HS_POPN_SET        (0x24)  */
+       0x00, /* REG_PREDL_CTL          (0x25)  */
+       0x00, /* REG_PREDR_CTL          (0x26)  */
+       0x00, /* REG_PRECKL_CTL         (0x27)  */
+       0x00, /* REG_PRECKR_CTL         (0x28)  */
+       0x00, /* REG_HFL_CTL            (0x29)  */
+       0x00, /* REG_HFR_CTL            (0x2A)  */
+       0x00, /* REG_ALC_CTL            (0x2B)  */
+       0x00, /* REG_ALC_SET1           (0x2C)  */
+       0x00, /* REG_ALC_SET2           (0x2D)  */
+       0x00, /* REG_BOOST_CTL          (0x2E)  */
+       0x00, /* REG_SOFTVOL_CTL        (0x2F)  */
+       0x00, /* REG_DTMF_FREQSEL       (0x30)  */
+       0x00, /* REG_DTMF_TONEXT1H      (0x31)  */
+       0x00, /* REG_DTMF_TONEXT1L      (0x32)  */
+       0x00, /* REG_DTMF_TONEXT2H      (0x33)  */
+       0x00, /* REG_DTMF_TONEXT2L      (0x34)  */
+       0x00, /* REG_DTMF_TONOFF        (0x35)  */
+       0x00, /* REG_DTMF_WANONOFF      (0x36)  */
+       0x00, /* REG_I2S_RX_SCRAMBLE_H  (0x37)  */
+       0x00, /* REG_I2S_RX_SCRAMBLE_M  (0x38)  */
+       0x00, /* REG_I2S_RX_SCRAMBLE_L  (0x39)  */
+       0x16, /* REG_APLL_CTL           (0x3A)  */
+       0x00, /* REG_DTMF_CTL           (0x3B)  */
+       0x00, /* REG_DTMF_PGA_CTL2      (0x3C)  */
+       0x00, /* REG_DTMF_PGA_CTL1      (0x3D)  */
+       0x00, /* REG_MISC_SET_1         (0x3E)  */
+       0x00, /* REG_PCMBTMUX           (0x3F)  */
+       0x00, /* not used               (0x40)  */
+       0x00, /* not used               (0x41)  */
+       0x00, /* not used               (0x42)  */
+       0x00, /* REG_RX_PATH_SEL        (0x43)  */
+       0x00, /* REG_VDL_APGA_CTL       (0x44)  */
+       0x00, /* REG_VIBRA_CTL          (0x45)  */
+       0x00, /* REG_VIBRA_SET          (0x46)  */
+       0x00, /* REG_VIBRA_PWM_SET      (0x47)  */
+       0x00, /* REG_ANAMIC_GAIN        (0x48)  */
+       0x00, /* REG_MISC_SET_2         (0x49)  */
+};
+
+/*
+ * read twl4030 register cache
+ */
+static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec,
+       unsigned int reg)
+{
+       u8 *cache = codec->reg_cache;
+
+       return cache[reg];
+}
+
+/*
+ * write twl4030 register cache
+ */
+static inline void twl4030_write_reg_cache(struct snd_soc_codec *codec,
+                                               u8 reg, u8 value)
+{
+       u8 *cache = codec->reg_cache;
+
+       if (reg >= TWL4030_CACHEREGNUM)
+               return;
+       cache[reg] = value;
+}
+
+/*
+ * write to the twl4030 register space
+ */
+static int twl4030_write(struct snd_soc_codec *codec,
+                       unsigned int reg, unsigned int value)
+{
+       twl4030_write_reg_cache(codec, reg, value);
+       return twl4030_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value, reg);
+}
+
+static void twl4030_clear_codecpdz(struct snd_soc_codec *codec)
+{
+       u8 mode;
+
+       mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+       twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+               mode & ~TWL4030_CODECPDZ);
+
+       /* REVISIT: this delay is present in TI sample drivers */
+       /* but there seems to be no TRM requirement for it     */
+       udelay(10);
+}
+
+static void twl4030_set_codecpdz(struct snd_soc_codec *codec)
+{
+       u8 mode;
+
+       mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+       twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+               mode | TWL4030_CODECPDZ);
+
+       /* REVISIT: this delay is present in TI sample drivers */
+       /* but there seems to be no TRM requirement for it     */
+       udelay(10);
+}
+
+static void twl4030_init_chip(struct snd_soc_codec *codec)
+{
+       int i;
+
+       /* clear CODECPDZ prior to setting register defaults */
+       twl4030_clear_codecpdz(codec);
+
+       /* set all audio section registers to reasonable defaults */
+       for (i = TWL4030_REG_OPTION; i <= TWL4030_REG_MISC_SET_2; i++)
+               twl4030_write(codec, i, twl4030_reg[i]);
+
+}
+
+/* Earpiece */
+static const char *twl4030_earpiece_texts[] =
+               {"Off", "DACL1", "DACL2", "Invalid", "DACR1"};
+
+static const struct soc_enum twl4030_earpiece_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_EAR_CTL, 1,
+                       ARRAY_SIZE(twl4030_earpiece_texts),
+                       twl4030_earpiece_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_earpiece_control =
+SOC_DAPM_ENUM("Route", twl4030_earpiece_enum);
+
+/* PreDrive Left */
+static const char *twl4030_predrivel_texts[] =
+               {"Off", "DACL1", "DACL2", "Invalid", "DACR2"};
+
+static const struct soc_enum twl4030_predrivel_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_PREDL_CTL, 1,
+                       ARRAY_SIZE(twl4030_predrivel_texts),
+                       twl4030_predrivel_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_predrivel_control =
+SOC_DAPM_ENUM("Route", twl4030_predrivel_enum);
+
+/* PreDrive Right */
+static const char *twl4030_predriver_texts[] =
+               {"Off", "DACR1", "DACR2", "Invalid", "DACL2"};
+
+static const struct soc_enum twl4030_predriver_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_PREDR_CTL, 1,
+                       ARRAY_SIZE(twl4030_predriver_texts),
+                       twl4030_predriver_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_predriver_control =
+SOC_DAPM_ENUM("Route", twl4030_predriver_enum);
+
+/* Headset Left */
+static const char *twl4030_hsol_texts[] =
+               {"Off", "DACL1", "DACL2"};
+
+static const struct soc_enum twl4030_hsol_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 1,
+                       ARRAY_SIZE(twl4030_hsol_texts),
+                       twl4030_hsol_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_hsol_control =
+SOC_DAPM_ENUM("Route", twl4030_hsol_enum);
+
+/* Headset Right */
+static const char *twl4030_hsor_texts[] =
+               {"Off", "DACR1", "DACR2"};
+
+static const struct soc_enum twl4030_hsor_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_HS_SEL, 4,
+                       ARRAY_SIZE(twl4030_hsor_texts),
+                       twl4030_hsor_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_hsor_control =
+SOC_DAPM_ENUM("Route", twl4030_hsor_enum);
+
+/* Carkit Left */
+static const char *twl4030_carkitl_texts[] =
+               {"Off", "DACL1", "DACL2"};
+
+static const struct soc_enum twl4030_carkitl_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_PRECKL_CTL, 1,
+                       ARRAY_SIZE(twl4030_carkitl_texts),
+                       twl4030_carkitl_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_carkitl_control =
+SOC_DAPM_ENUM("Route", twl4030_carkitl_enum);
+
+/* Carkit Right */
+static const char *twl4030_carkitr_texts[] =
+               {"Off", "DACR1", "DACR2"};
+
+static const struct soc_enum twl4030_carkitr_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_PRECKR_CTL, 1,
+                       ARRAY_SIZE(twl4030_carkitr_texts),
+                       twl4030_carkitr_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_carkitr_control =
+SOC_DAPM_ENUM("Route", twl4030_carkitr_enum);
+
+/* Handsfree Left */
+static const char *twl4030_handsfreel_texts[] =
+               {"Voice", "DACL1", "DACL2", "DACR2"};
+
+static const struct soc_enum twl4030_handsfreel_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_HFL_CTL, 0,
+                       ARRAY_SIZE(twl4030_handsfreel_texts),
+                       twl4030_handsfreel_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_handsfreel_control =
+SOC_DAPM_ENUM("Route", twl4030_handsfreel_enum);
+
+/* Handsfree Right */
+static const char *twl4030_handsfreer_texts[] =
+               {"Voice", "DACR1", "DACR2", "DACL2"};
+
+static const struct soc_enum twl4030_handsfreer_enum =
+       SOC_ENUM_SINGLE(TWL4030_REG_HFR_CTL, 0,
+                       ARRAY_SIZE(twl4030_handsfreer_texts),
+                       twl4030_handsfreer_texts);
+
+static const struct snd_kcontrol_new twl4030_dapm_handsfreer_control =
+SOC_DAPM_ENUM("Route", twl4030_handsfreer_enum);
+
+static int outmixer_event(struct snd_soc_dapm_widget *w,
+       struct snd_kcontrol *kcontrol, int event)
+{
+       struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+       int ret = 0;
+       int val;
+
+       switch (e->reg) {
+       case TWL4030_REG_PREDL_CTL:
+       case TWL4030_REG_PREDR_CTL:
+       case TWL4030_REG_EAR_CTL:
+               val = w->value >> e->shift_l;
+               if (val == 3) {
+                       printk(KERN_WARNING
+                       "Invalid MUX setting for register 0x%02x (%d)\n",
+                             e->reg, val);
+                       ret = -1;
+               }
+               break;
+       }
+
+       return ret;
+}
+
+static int handsfree_event(struct snd_soc_dapm_widget *w,
+               struct snd_kcontrol *kcontrol, int event)
+{
+       struct soc_enum *e = (struct soc_enum *)w->kcontrols->private_value;
+       unsigned char hs_ctl;
+
+       hs_ctl = twl4030_read_reg_cache(w->codec, e->reg);
+
+       if (hs_ctl & TWL4030_HF_CTL_REF_EN) {
+               hs_ctl |= TWL4030_HF_CTL_RAMP_EN;
+               twl4030_write(w->codec, e->reg, hs_ctl);
+               hs_ctl |= TWL4030_HF_CTL_LOOP_EN;
+               twl4030_write(w->codec, e->reg, hs_ctl);
+               hs_ctl |= TWL4030_HF_CTL_HB_EN;
+               twl4030_write(w->codec, e->reg, hs_ctl);
+       } else {
+               hs_ctl &= ~(TWL4030_HF_CTL_RAMP_EN | TWL4030_HF_CTL_LOOP_EN
+                               | TWL4030_HF_CTL_HB_EN);
+               twl4030_write(w->codec, e->reg, hs_ctl);
+       }
+
+       return 0;
+}
+
+/*
+ * Some of the gain controls in TWL (mostly those which are associated with
+ * the outputs) are implemented in an interesting way:
+ * 0x0 : Power down (mute)
+ * 0x1 : 6dB
+ * 0x2 : 0 dB
+ * 0x3 : -6 dB
+ * Inverting not going to help with these.
+ * Custom volsw and volsw_2r get/put functions to handle these gain bits.
+ */
+#define SOC_DOUBLE_TLV_TWL4030(xname, xreg, shift_left, shift_right, xmax,\
+                              xinvert, tlv_array) \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+       .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+                SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+       .tlv.p = (tlv_array), \
+       .info = snd_soc_info_volsw, \
+       .get = snd_soc_get_volsw_twl4030, \
+       .put = snd_soc_put_volsw_twl4030, \
+       .private_value = (unsigned long)&(struct soc_mixer_control) \
+               {.reg = xreg, .shift = shift_left, .rshift = shift_right,\
+                .max = xmax, .invert = xinvert} }
+#define SOC_DOUBLE_R_TLV_TWL4030(xname, reg_left, reg_right, xshift, xmax,\
+                                xinvert, tlv_array) \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+       .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+                SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+       .tlv.p = (tlv_array), \
+       .info = snd_soc_info_volsw_2r, \
+       .get = snd_soc_get_volsw_r2_twl4030,\
+       .put = snd_soc_put_volsw_r2_twl4030, \
+       .private_value = (unsigned long)&(struct soc_mixer_control) \
+               {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
+                .rshift = xshift, .max = xmax, .invert = xinvert} }
+#define SOC_SINGLE_TLV_TWL4030(xname, xreg, xshift, xmax, xinvert, tlv_array) \
+       SOC_DOUBLE_TLV_TWL4030(xname, xreg, xshift, xshift, xmax, \
+                              xinvert, tlv_array)
+
+static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       unsigned int reg = mc->reg;
+       unsigned int shift = mc->shift;
+       unsigned int rshift = mc->rshift;
+       int max = mc->max;
+       int mask = (1 << fls(max)) - 1;
+
+       ucontrol->value.integer.value[0] =
+               (snd_soc_read(codec, reg) >> shift) & mask;
+       if (ucontrol->value.integer.value[0])
+               ucontrol->value.integer.value[0] =
+                       max + 1 - ucontrol->value.integer.value[0];
+
+       if (shift != rshift) {
+               ucontrol->value.integer.value[1] =
+                       (snd_soc_read(codec, reg) >> rshift) & mask;
+               if (ucontrol->value.integer.value[1])
+                       ucontrol->value.integer.value[1] =
+                               max + 1 - ucontrol->value.integer.value[1];
+       }
+
+       return 0;
+}
+
+static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       unsigned int reg = mc->reg;
+       unsigned int shift = mc->shift;
+       unsigned int rshift = mc->rshift;
+       int max = mc->max;
+       int mask = (1 << fls(max)) - 1;
+       unsigned short val, val2, val_mask;
+
+       val = (ucontrol->value.integer.value[0] & mask);
+
+       val_mask = mask << shift;
+       if (val)
+               val = max + 1 - val;
+       val = val << shift;
+       if (shift != rshift) {
+               val2 = (ucontrol->value.integer.value[1] & mask);
+               val_mask |= mask << rshift;
+               if (val2)
+                       val2 = max + 1 - val2;
+               val |= val2 << rshift;
+       }
+       return snd_soc_update_bits(codec, reg, val_mask, val);
+}
+
+static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       unsigned int reg = mc->reg;
+       unsigned int reg2 = mc->rreg;
+       unsigned int shift = mc->shift;
+       int max = mc->max;
+       int mask = (1<<fls(max))-1;
+
+       ucontrol->value.integer.value[0] =
+               (snd_soc_read(codec, reg) >> shift) & mask;
+       ucontrol->value.integer.value[1] =
+               (snd_soc_read(codec, reg2) >> shift) & mask;
+
+       if (ucontrol->value.integer.value[0])
+               ucontrol->value.integer.value[0] =
+                       max + 1 - ucontrol->value.integer.value[0];
+       if (ucontrol->value.integer.value[1])
+               ucontrol->value.integer.value[1] =
+                       max + 1 - ucontrol->value.integer.value[1];
+
+       return 0;
+}
+
+static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       unsigned int reg = mc->reg;
+       unsigned int reg2 = mc->rreg;
+       unsigned int shift = mc->shift;
+       int max = mc->max;
+       int mask = (1 << fls(max)) - 1;
+       int err;
+       unsigned short val, val2, val_mask;
+
+       val_mask = mask << shift;
+       val = (ucontrol->value.integer.value[0] & mask);
+       val2 = (ucontrol->value.integer.value[1] & mask);
+
+       if (val)
+               val = max + 1 - val;
+       if (val2)
+               val2 = max + 1 - val2;
+
+       val = val << shift;
+       val2 = val2 << shift;
+
+       err = snd_soc_update_bits(codec, reg, val_mask, val);
+       if (err < 0)
+               return err;
+
+       err = snd_soc_update_bits(codec, reg2, val_mask, val2);
+       return err;
+}
+
+static int twl4030_get_left_input(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = kcontrol->private_data;
+       u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
+       int result = 0;
+
+       /* one bit must be set a time */
+       reg &= TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN
+                       | TWL4030_MAINMIC_EN;
+       if (reg != 0) {
+               result++;
+               while ((reg & 1) == 0) {
+                       result++;
+                       reg >>= 1;
+               }
+       }
+
+       ucontrol->value.integer.value[0] = result;
+       return 0;
+}
+
+static int twl4030_put_left_input(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = kcontrol->private_data;
+       int value = ucontrol->value.integer.value[0];
+       u8 anamicl, micbias, avadc_ctl;
+
+       anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
+       anamicl &= ~(TWL4030_CKMIC_EN | TWL4030_AUXL_EN | TWL4030_HSMIC_EN
+                       | TWL4030_MAINMIC_EN);
+       micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL);
+       micbias &= ~(TWL4030_HSMICBIAS_EN | TWL4030_MICBIAS1_EN);
+       avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL);
+
+       switch (value) {
+       case 1:
+               anamicl |= TWL4030_MAINMIC_EN;
+               micbias |= TWL4030_MICBIAS1_EN;
+               break;
+       case 2:
+               anamicl |= TWL4030_HSMIC_EN;
+               micbias |= TWL4030_HSMICBIAS_EN;
+               break;
+       case 3:
+               anamicl |= TWL4030_AUXL_EN;
+               break;
+       case 4:
+               anamicl |= TWL4030_CKMIC_EN;
+               break;
+       default:
+               break;
+       }
+
+       /* If some input is selected, enable amp and ADC */
+       if (value != 0) {
+               anamicl |= TWL4030_MICAMPL_EN;
+               avadc_ctl |= TWL4030_ADCL_EN;
+       } else {
+               anamicl &= ~TWL4030_MICAMPL_EN;
+               avadc_ctl &= ~TWL4030_ADCL_EN;
+       }
+
+       twl4030_write(codec, TWL4030_REG_ANAMICL, anamicl);
+       twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias);
+       twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl);
+
+       return 1;
+}
+
+static int twl4030_get_right_input(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = kcontrol->private_data;
+       u8 reg = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR);
+       int value = 0;
+
+       reg &= TWL4030_SUBMIC_EN|TWL4030_AUXR_EN;
+       switch (reg) {
+       case TWL4030_SUBMIC_EN:
+               value = 1;
+               break;
+       case TWL4030_AUXR_EN:
+               value = 2;
+               break;
+       default:
+               break;
+       }
+
+       ucontrol->value.integer.value[0] = value;
+       return 0;
+}
+
+static int twl4030_put_right_input(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = kcontrol->private_data;
+       int value = ucontrol->value.integer.value[0];
+       u8 anamicr, micbias, avadc_ctl;
+
+       anamicr = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICR);
+       anamicr &= ~(TWL4030_SUBMIC_EN|TWL4030_AUXR_EN);
+       micbias = twl4030_read_reg_cache(codec, TWL4030_REG_MICBIAS_CTL);
+       micbias &= ~TWL4030_MICBIAS2_EN;
+       avadc_ctl = twl4030_read_reg_cache(codec, TWL4030_REG_AVADC_CTL);
+
+       switch (value) {
+       case 1:
+               anamicr |= TWL4030_SUBMIC_EN;
+               micbias |= TWL4030_MICBIAS2_EN;
+               break;
+       case 2:
+               anamicr |= TWL4030_AUXR_EN;
+               break;
+       default:
+               break;
+       }
+
+       if (value != 0) {
+               anamicr |= TWL4030_MICAMPR_EN;
+               avadc_ctl |= TWL4030_ADCR_EN;
+       } else {
+               anamicr &= ~TWL4030_MICAMPR_EN;
+               avadc_ctl &= ~TWL4030_ADCR_EN;
+       }
+
+       twl4030_write(codec, TWL4030_REG_ANAMICR, anamicr);
+       twl4030_write(codec, TWL4030_REG_MICBIAS_CTL, micbias);
+       twl4030_write(codec, TWL4030_REG_AVADC_CTL, avadc_ctl);
+
+       return 1;
+}
+
+static const char *twl4030_left_in_sel[] = {
+       "None",
+       "Main Mic",
+       "Headset Mic",
+       "Line In",
+       "Carkit Mic",
+};
+
+static const char *twl4030_right_in_sel[] = {
+       "None",
+       "Sub Mic",
+       "Line In",
+};
+
+static const struct soc_enum twl4030_left_input_mux =
+       SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_left_in_sel),
+               twl4030_left_in_sel);
+
+static const struct soc_enum twl4030_right_input_mux =
+       SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl4030_right_in_sel),
+               twl4030_right_in_sel);
+
+/*
+ * FGAIN volume control:
+ * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
+ */
+static DECLARE_TLV_DB_SCALE(digital_fine_tlv, -6300, 100, 1);
+
+/*
+ * CGAIN volume control:
+ * 0 dB to 12 dB in 6 dB steps
+ * value 2 and 3 means 12 dB
+ */
+static DECLARE_TLV_DB_SCALE(digital_coarse_tlv, 0, 600, 0);
+
+/*
+ * Analog playback gain
+ * -24 dB to 12 dB in 2 dB steps
+ */
+static DECLARE_TLV_DB_SCALE(analog_tlv, -2400, 200, 0);
+
+/*
+ * Gain controls tied to outputs
+ * -6 dB to 6 dB in 6 dB steps (mute instead of -12)
+ */
+static DECLARE_TLV_DB_SCALE(output_tvl, -1200, 600, 1);
+
+/*
+ * Capture gain after the ADCs
+ * from 0 dB to 31 dB in 1 dB steps
+ */
+static DECLARE_TLV_DB_SCALE(digital_capture_tlv, 0, 100, 0);
+
+/*
+ * Gain control for input amplifiers
+ * 0 dB to 30 dB in 6 dB steps
+ */
+static DECLARE_TLV_DB_SCALE(input_gain_tlv, 0, 600, 0);
+
+static const struct snd_kcontrol_new twl4030_snd_controls[] = {
+       /* Common playback gain controls */
+       SOC_DOUBLE_R_TLV("DAC1 Digital Fine Playback Volume",
+               TWL4030_REG_ARXL1PGA, TWL4030_REG_ARXR1PGA,
+               0, 0x3f, 0, digital_fine_tlv),
+       SOC_DOUBLE_R_TLV("DAC2 Digital Fine Playback Volume",
+               TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+               0, 0x3f, 0, digital_fine_tlv),
+
+       SOC_DOUBLE_R_TLV("DAC1 Digital Coarse Playback Volume",
+               TWL4030_REG_ARXL1PGA, TWL4030_REG_ARXR1PGA,
+               6, 0x2, 0, digital_coarse_tlv),
+       SOC_DOUBLE_R_TLV("DAC2 Digital Coarse Playback Volume",
+               TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+               6, 0x2, 0, digital_coarse_tlv),
+
+       SOC_DOUBLE_R_TLV("DAC1 Analog Playback Volume",
+               TWL4030_REG_ARXL1_APGA_CTL, TWL4030_REG_ARXR1_APGA_CTL,
+               3, 0x12, 1, analog_tlv),
+       SOC_DOUBLE_R_TLV("DAC2 Analog Playback Volume",
+               TWL4030_REG_ARXL2_APGA_CTL, TWL4030_REG_ARXR2_APGA_CTL,
+               3, 0x12, 1, analog_tlv),
+       SOC_DOUBLE_R("DAC1 Analog Playback Switch",
+               TWL4030_REG_ARXL1_APGA_CTL, TWL4030_REG_ARXR1_APGA_CTL,
+               1, 1, 0),
+       SOC_DOUBLE_R("DAC2 Analog Playback Switch",
+               TWL4030_REG_ARXL2_APGA_CTL, TWL4030_REG_ARXR2_APGA_CTL,
+               1, 1, 0),
+
+       /* Separate output gain controls */
+       SOC_DOUBLE_R_TLV_TWL4030("PreDriv Playback Volume",
+               TWL4030_REG_PREDL_CTL, TWL4030_REG_PREDR_CTL,
+               4, 3, 0, output_tvl),
+
+       SOC_DOUBLE_TLV_TWL4030("Headset Playback Volume",
+               TWL4030_REG_HS_GAIN_SET, 0, 2, 3, 0, output_tvl),
+
+       SOC_DOUBLE_R_TLV_TWL4030("Carkit Playback Volume",
+               TWL4030_REG_PRECKL_CTL, TWL4030_REG_PRECKR_CTL,
+               4, 3, 0, output_tvl),
+
+       SOC_SINGLE_TLV_TWL4030("Earpiece Playback Volume",
+               TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl),
+
+       /* Common capture gain controls */
+       SOC_DOUBLE_R_TLV("Capture Volume",
+               TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
+               0, 0x1f, 0, digital_capture_tlv),
+
+       SOC_DOUBLE_TLV("Input Boost Volume", TWL4030_REG_ANAMIC_GAIN,
+               0, 3, 5, 0, input_gain_tlv),
+
+       /* Input source controls */
+       SOC_ENUM_EXT("Left Input Source", twl4030_left_input_mux,
+               twl4030_get_left_input, twl4030_put_left_input),
+       SOC_ENUM_EXT("Right Input Source", twl4030_right_input_mux,
+               twl4030_get_right_input, twl4030_put_right_input),
+};
+
+/* add non dapm controls */
+static int twl4030_add_controls(struct snd_soc_codec *codec)
+{
+       int err, i;
+
+       for (i = 0; i < ARRAY_SIZE(twl4030_snd_controls); i++) {
+               err = snd_ctl_add(codec->card,
+                                 snd_soc_cnew(&twl4030_snd_controls[i],
+                                               codec, NULL));
+               if (err < 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
+       SND_SOC_DAPM_INPUT("INL"),
+       SND_SOC_DAPM_INPUT("INR"),
+
+       SND_SOC_DAPM_OUTPUT("OUTL"),
+       SND_SOC_DAPM_OUTPUT("OUTR"),
+       SND_SOC_DAPM_OUTPUT("EARPIECE"),
+       SND_SOC_DAPM_OUTPUT("PREDRIVEL"),
+       SND_SOC_DAPM_OUTPUT("PREDRIVER"),
+       SND_SOC_DAPM_OUTPUT("HSOL"),
+       SND_SOC_DAPM_OUTPUT("HSOR"),
+       SND_SOC_DAPM_OUTPUT("CARKITL"),
+       SND_SOC_DAPM_OUTPUT("CARKITR"),
+       SND_SOC_DAPM_OUTPUT("HFL"),
+       SND_SOC_DAPM_OUTPUT("HFR"),
+
+       /* DACs */
+       SND_SOC_DAPM_DAC("DAC Right1", "Right Front Playback",
+                       TWL4030_REG_AVDAC_CTL, 0, 0),
+       SND_SOC_DAPM_DAC("DAC Left1", "Left Front Playback",
+                       TWL4030_REG_AVDAC_CTL, 1, 0),
+       SND_SOC_DAPM_DAC("DAC Right2", "Right Rear Playback",
+                       TWL4030_REG_AVDAC_CTL, 2, 0),
+       SND_SOC_DAPM_DAC("DAC Left2", "Left Rear Playback",
+                       TWL4030_REG_AVDAC_CTL, 3, 0),
+
+       /* Analog PGAs */
+       SND_SOC_DAPM_PGA("ARXR1_APGA", TWL4030_REG_ARXR1_APGA_CTL,
+                       0, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("ARXL1_APGA", TWL4030_REG_ARXL1_APGA_CTL,
+                       0, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("ARXR2_APGA", TWL4030_REG_ARXR2_APGA_CTL,
+                       0, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("ARXL2_APGA", TWL4030_REG_ARXL2_APGA_CTL,
+                       0, 0, NULL, 0),
+
+       /* Output MUX controls */
+       /* Earpiece */
+       SND_SOC_DAPM_MUX_E("Earpiece Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_earpiece_control, outmixer_event,
+               SND_SOC_DAPM_PRE_REG),
+       /* PreDrivL/R */
+       SND_SOC_DAPM_MUX_E("PredriveL Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_predrivel_control, outmixer_event,
+               SND_SOC_DAPM_PRE_REG),
+       SND_SOC_DAPM_MUX_E("PredriveR Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_predriver_control, outmixer_event,
+               SND_SOC_DAPM_PRE_REG),
+       /* HeadsetL/R */
+       SND_SOC_DAPM_MUX("HeadsetL Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_hsol_control),
+       SND_SOC_DAPM_MUX("HeadsetR Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_hsor_control),
+       /* CarkitL/R */
+       SND_SOC_DAPM_MUX("CarkitL Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_carkitl_control),
+       SND_SOC_DAPM_MUX("CarkitR Mux", SND_SOC_NOPM, 0, 0,
+               &twl4030_dapm_carkitr_control),
+       /* HandsfreeL/R */
+       SND_SOC_DAPM_MUX_E("HandsfreeL Mux", TWL4030_REG_HFL_CTL, 5, 0,
+               &twl4030_dapm_handsfreel_control, handsfree_event,
+               SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
+       SND_SOC_DAPM_MUX_E("HandsfreeR Mux", TWL4030_REG_HFR_CTL, 5, 0,
+               &twl4030_dapm_handsfreer_control, handsfree_event,
+               SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD),
+
+       SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0),
+       SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+       {"ARXL1_APGA", NULL, "DAC Left1"},
+       {"ARXR1_APGA", NULL, "DAC Right1"},
+       {"ARXL2_APGA", NULL, "DAC Left2"},
+       {"ARXR2_APGA", NULL, "DAC Right2"},
+
+       /* Internal playback routings */
+       /* Earpiece */
+       {"Earpiece Mux", "DACL1", "ARXL1_APGA"},
+       {"Earpiece Mux", "DACL2", "ARXL2_APGA"},
+       {"Earpiece Mux", "DACR1", "ARXR1_APGA"},
+       /* PreDrivL */
+       {"PredriveL Mux", "DACL1", "ARXL1_APGA"},
+       {"PredriveL Mux", "DACL2", "ARXL2_APGA"},
+       {"PredriveL Mux", "DACR2", "ARXR2_APGA"},
+       /* PreDrivR */
+       {"PredriveR Mux", "DACR1", "ARXR1_APGA"},
+       {"PredriveR Mux", "DACR2", "ARXR2_APGA"},
+       {"PredriveR Mux", "DACL2", "ARXL2_APGA"},
+       /* HeadsetL */
+       {"HeadsetL Mux", "DACL1", "ARXL1_APGA"},
+       {"HeadsetL Mux", "DACL2", "ARXL2_APGA"},
+       /* HeadsetR */
+       {"HeadsetR Mux", "DACR1", "ARXR1_APGA"},
+       {"HeadsetR Mux", "DACR2", "ARXR2_APGA"},
+       /* CarkitL */
+       {"CarkitL Mux", "DACL1", "ARXL1_APGA"},
+       {"CarkitL Mux", "DACL2", "ARXL2_APGA"},
+       /* CarkitR */
+       {"CarkitR Mux", "DACR1", "ARXR1_APGA"},
+       {"CarkitR Mux", "DACR2", "ARXR2_APGA"},
+       /* HandsfreeL */
+       {"HandsfreeL Mux", "DACL1", "ARXL1_APGA"},
+       {"HandsfreeL Mux", "DACL2", "ARXL2_APGA"},
+       {"HandsfreeL Mux", "DACR2", "ARXR2_APGA"},
+       /* HandsfreeR */
+       {"HandsfreeR Mux", "DACR1", "ARXR1_APGA"},
+       {"HandsfreeR Mux", "DACR2", "ARXR2_APGA"},
+       {"HandsfreeR Mux", "DACL2", "ARXL2_APGA"},
+
+       /* outputs */
+       {"OUTL", NULL, "ARXL2_APGA"},
+       {"OUTR", NULL, "ARXR2_APGA"},
+       {"EARPIECE", NULL, "Earpiece Mux"},
+       {"PREDRIVEL", NULL, "PredriveL Mux"},
+       {"PREDRIVER", NULL, "PredriveR Mux"},
+       {"HSOL", NULL, "HeadsetL Mux"},
+       {"HSOR", NULL, "HeadsetR Mux"},
+       {"CARKITL", NULL, "CarkitL Mux"},
+       {"CARKITR", NULL, "CarkitR Mux"},
+       {"HFL", NULL, "HandsfreeL Mux"},
+       {"HFR", NULL, "HandsfreeR Mux"},
+
+       /* inputs */
+       {"ADCL", NULL, "INL"},
+       {"ADCR", NULL, "INR"},
+};
+
+static int twl4030_add_widgets(struct snd_soc_codec *codec)
+{
+       snd_soc_dapm_new_controls(codec, twl4030_dapm_widgets,
+                                ARRAY_SIZE(twl4030_dapm_widgets));
+
+       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+       snd_soc_dapm_new_widgets(codec);
+       return 0;
+}
+
+static void twl4030_power_up(struct snd_soc_codec *codec)
+{
+       u8 anamicl, regmisc1, byte, popn;
+       int i = 0;
+
+       /* set CODECPDZ to turn on codec */
+       twl4030_set_codecpdz(codec);
+
+       /* initiate offset cancellation */
+       anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
+       twl4030_write(codec, TWL4030_REG_ANAMICL,
+               anamicl | TWL4030_CNCL_OFFSET_START);
+
+       /* wait for offset cancellation to complete */
+       do {
+               /* this takes a little while, so don't slam i2c */
+               udelay(2000);
+               twl4030_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &byte,
+                                   TWL4030_REG_ANAMICL);
+       } while ((i++ < 100) &&
+                ((byte & TWL4030_CNCL_OFFSET_START) ==
+                 TWL4030_CNCL_OFFSET_START));
+
+       /* anti-pop when changing analog gain */
+       regmisc1 = twl4030_read_reg_cache(codec, TWL4030_REG_MISC_SET_1);
+       twl4030_write(codec, TWL4030_REG_MISC_SET_1,
+               regmisc1 | TWL4030_SMOOTH_ANAVOL_EN);
+
+       /* toggle CODECPDZ as per TRM */
+       twl4030_clear_codecpdz(codec);
+       twl4030_set_codecpdz(codec);
+
+       /* program anti-pop with bias ramp delay */
+       popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+       popn &= TWL4030_RAMP_DELAY;
+       popn |= TWL4030_RAMP_DELAY_645MS;
+       twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+       popn |= TWL4030_VMID_EN;
+       twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+       /* enable anti-pop ramp */
+       popn |= TWL4030_RAMP_EN;
+       twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+}
+
+static void twl4030_power_down(struct snd_soc_codec *codec)
+{
+       u8 popn;
+
+       /* disable anti-pop ramp */
+       popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+       popn &= ~TWL4030_RAMP_EN;
+       twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+       /* disable bias out */
+       popn &= ~TWL4030_VMID_EN;
+       twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+       /* power down */
+       twl4030_clear_codecpdz(codec);
+}
+
+static int twl4030_set_bias_level(struct snd_soc_codec *codec,
+                                 enum snd_soc_bias_level level)
+{
+       switch (level) {
+       case SND_SOC_BIAS_ON:
+               twl4030_power_up(codec);
+               break;
+       case SND_SOC_BIAS_PREPARE:
+               /* TODO: develop a twl4030_prepare function */
+               break;
+       case SND_SOC_BIAS_STANDBY:
+               /* TODO: develop a twl4030_standby function */
+               twl4030_power_down(codec);
+               break;
+       case SND_SOC_BIAS_OFF:
+               twl4030_power_down(codec);
+               break;
+       }
+       codec->bias_level = level;
+
+       return 0;
+}
+
+static int twl4030_hw_params(struct snd_pcm_substream *substream,
+                          struct snd_pcm_hw_params *params,
+                          struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       u8 mode, old_mode, format, old_format;
+
+
+       /* bit rate */
+       old_mode = twl4030_read_reg_cache(codec,
+                       TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ;
+       mode = old_mode & ~TWL4030_APLL_RATE;
+
+       switch (params_rate(params)) {
+       case 8000:
+               mode |= TWL4030_APLL_RATE_8000;
+               break;
+       case 11025:
+               mode |= TWL4030_APLL_RATE_11025;
+               break;
+       case 12000:
+               mode |= TWL4030_APLL_RATE_12000;
+               break;
+       case 16000:
+               mode |= TWL4030_APLL_RATE_16000;
+               break;
+       case 22050:
+               mode |= TWL4030_APLL_RATE_22050;
+               break;
+       case 24000:
+               mode |= TWL4030_APLL_RATE_24000;
+               break;
+       case 32000:
+               mode |= TWL4030_APLL_RATE_32000;
+               break;
+       case 44100:
+               mode |= TWL4030_APLL_RATE_44100;
+               break;
+       case 48000:
+               mode |= TWL4030_APLL_RATE_48000;
+               break;
+       default:
+               printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n",
+                       params_rate(params));
+               return -EINVAL;
+       }
+
+       if (mode != old_mode) {
+               /* change rate and set CODECPDZ */
+               twl4030_write(codec, TWL4030_REG_CODEC_MODE, mode);
+               twl4030_set_codecpdz(codec);
+       }
+
+       /* sample size */
+       old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+       format = old_format;
+       format &= ~TWL4030_DATA_WIDTH;
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S16_LE:
+               format |= TWL4030_DATA_WIDTH_16S_16W;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+               format |= TWL4030_DATA_WIDTH_32S_24W;
+               break;
+       default:
+               printk(KERN_ERR "TWL4030 hw params: unknown format %d\n",
+                       params_format(params));
+               return -EINVAL;
+       }
+
+       if (format != old_format) {
+
+               /* clear CODECPDZ before changing format (codec requirement) */
+               twl4030_clear_codecpdz(codec);
+
+               /* change format */
+               twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+               /* set CODECPDZ afterwards */
+               twl4030_set_codecpdz(codec);
+       }
+       return 0;
+}
+
+static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+               int clk_id, unsigned int freq, int dir)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u8 infreq;
+
+       switch (freq) {
+       case 19200000:
+               infreq = TWL4030_APLL_INFREQ_19200KHZ;
+               break;
+       case 26000000:
+               infreq = TWL4030_APLL_INFREQ_26000KHZ;
+               break;
+       case 38400000:
+               infreq = TWL4030_APLL_INFREQ_38400KHZ;
+               break;
+       default:
+               printk(KERN_ERR "TWL4030 set sysclk: unknown rate %d\n",
+                       freq);
+               return -EINVAL;
+       }
+
+       infreq |= TWL4030_APLL_EN;
+       twl4030_write(codec, TWL4030_REG_APLL_CTL, infreq);
+
+       return 0;
+}
+
+static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai,
+                            unsigned int fmt)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u8 old_format, format;
+
+       /* get format */
+       old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+       format = old_format;
+
+       /* set master/slave audio interface */
+       switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+       case SND_SOC_DAIFMT_CBM_CFM:
+               format &= ~(TWL4030_AIF_SLAVE_EN);
+               format &= ~(TWL4030_CLK256FS_EN);
+               break;
+       case SND_SOC_DAIFMT_CBS_CFS:
+               format |= TWL4030_AIF_SLAVE_EN;
+               format |= TWL4030_CLK256FS_EN;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* interface format */
+       format &= ~TWL4030_AIF_FORMAT;
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               format |= TWL4030_AIF_FORMAT_CODEC;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (format != old_format) {
+
+               /* clear CODECPDZ before changing format (codec requirement) */
+               twl4030_clear_codecpdz(codec);
+
+               /* change format */
+               twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+               /* set CODECPDZ afterwards */
+               twl4030_set_codecpdz(codec);
+       }
+
+       return 0;
+}
+
+#define TWL4030_RATES   (SNDRV_PCM_RATE_8000_48000)
+#define TWL4030_FORMATS         (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE)
+
+struct snd_soc_dai twl4030_dai = {
+       .name = "twl4030",
+       .playback = {
+               .stream_name = "Playback",
+               .channels_min = 2,
+               .channels_max = 2,
+               .rates = TWL4030_RATES,
+               .formats = TWL4030_FORMATS,},
+       .capture = {
+               .stream_name = "Capture",
+               .channels_min = 2,
+               .channels_max = 2,
+               .rates = TWL4030_RATES,
+               .formats = TWL4030_FORMATS,},
+       .ops = {
+               .hw_params = twl4030_hw_params,
+               .set_sysclk = twl4030_set_dai_sysclk,
+               .set_fmt = twl4030_set_dai_fmt,
+       }
+};
+EXPORT_SYMBOL_GPL(twl4030_dai);
+
+static int twl4030_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+       return 0;
+}
+
+static int twl4030_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       twl4030_set_bias_level(codec, codec->suspend_bias_level);
+       return 0;
+}
+
+/*
+ * initialize the driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+
+static int twl4030_init(struct snd_soc_device *socdev)
+{
+       struct snd_soc_codec *codec = socdev->codec;
+       int ret = 0;
+
+       printk(KERN_INFO "TWL4030 Audio Codec init \n");
+
+       codec->name = "twl4030";
+       codec->owner = THIS_MODULE;
+       codec->read = twl4030_read_reg_cache;
+       codec->write = twl4030_write;
+       codec->set_bias_level = twl4030_set_bias_level;
+       codec->dai = &twl4030_dai;
+       codec->num_dai = 1;
+       codec->reg_cache_size = sizeof(twl4030_reg);
+       codec->reg_cache = kmemdup(twl4030_reg, sizeof(twl4030_reg),
+                                       GFP_KERNEL);
+       if (codec->reg_cache == NULL)
+               return -ENOMEM;
+
+       /* register pcms */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               printk(KERN_ERR "twl4030: failed to create pcms\n");
+               goto pcm_err;
+       }
+
+       twl4030_init_chip(codec);
+
+       /* power on device */
+       twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+       twl4030_add_controls(codec);
+       twl4030_add_widgets(codec);
+
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               printk(KERN_ERR "twl4030: failed to register card\n");
+               goto card_err;
+       }
+
+       return ret;
+
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+pcm_err:
+       kfree(codec->reg_cache);
+       return ret;
+}
+
+static struct snd_soc_device *twl4030_socdev;
+
+static int twl4030_probe(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec;
+
+       codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+       if (codec == NULL)
+               return -ENOMEM;
+
+       socdev->codec = codec;
+       mutex_init(&codec->mutex);
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+
+       twl4030_socdev = socdev;
+       twl4030_init(socdev);
+
+       return 0;
+}
+
+static int twl4030_remove(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       printk(KERN_INFO "TWL4030 Audio Codec remove\n");
+       kfree(codec);
+
+       return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_twl4030 = {
+       .probe = twl4030_probe,
+       .remove = twl4030_remove,
+       .suspend = twl4030_suspend,
+       .resume = twl4030_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_twl4030);
+
+static int __init twl4030_modinit(void)
+{
+       return snd_soc_register_dai(&twl4030_dai);
+}
+module_init(twl4030_modinit);
+
+static void __exit twl4030_exit(void)
+{
+       snd_soc_unregister_dai(&twl4030_dai);
+}
+module_exit(twl4030_exit);
+
+MODULE_DESCRIPTION("ASoC TWL4030 codec driver");
+MODULE_AUTHOR("Steve Sakoman");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
new file mode 100644 (file)
index 0000000..54615c7
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __TWL4030_AUDIO_H__
+#define __TWL4030_AUDIO_H__
+
+#define TWL4030_REG_CODEC_MODE         0x1
+#define TWL4030_REG_OPTION             0x2
+#define TWL4030_REG_UNKNOWN            0x3
+#define TWL4030_REG_MICBIAS_CTL                0x4
+#define TWL4030_REG_ANAMICL            0x5
+#define TWL4030_REG_ANAMICR            0x6
+#define TWL4030_REG_AVADC_CTL          0x7
+#define TWL4030_REG_ADCMICSEL          0x8
+#define TWL4030_REG_DIGMIXING          0x9
+#define TWL4030_REG_ATXL1PGA           0xA
+#define TWL4030_REG_ATXR1PGA           0xB
+#define TWL4030_REG_AVTXL2PGA          0xC
+#define TWL4030_REG_AVTXR2PGA          0xD
+#define TWL4030_REG_AUDIO_IF           0xE
+#define TWL4030_REG_VOICE_IF           0xF
+#define TWL4030_REG_ARXR1PGA           0x10
+#define TWL4030_REG_ARXL1PGA           0x11
+#define TWL4030_REG_ARXR2PGA           0x12
+#define TWL4030_REG_ARXL2PGA           0x13
+#define TWL4030_REG_VRXPGA             0x14
+#define TWL4030_REG_VSTPGA             0x15
+#define TWL4030_REG_VRX2ARXPGA         0x16
+#define TWL4030_REG_AVDAC_CTL          0x17
+#define TWL4030_REG_ARX2VTXPGA         0x18
+#define TWL4030_REG_ARXL1_APGA_CTL     0x19
+#define TWL4030_REG_ARXR1_APGA_CTL     0x1A
+#define TWL4030_REG_ARXL2_APGA_CTL     0x1B
+#define TWL4030_REG_ARXR2_APGA_CTL     0x1C
+#define TWL4030_REG_ATX2ARXPGA         0x1D
+#define TWL4030_REG_BT_IF              0x1E
+#define TWL4030_REG_BTPGA              0x1F
+#define TWL4030_REG_BTSTPGA            0x20
+#define TWL4030_REG_EAR_CTL            0x21
+#define TWL4030_REG_HS_SEL             0x22
+#define TWL4030_REG_HS_GAIN_SET                0x23
+#define TWL4030_REG_HS_POPN_SET                0x24
+#define TWL4030_REG_PREDL_CTL          0x25
+#define TWL4030_REG_PREDR_CTL          0x26
+#define TWL4030_REG_PRECKL_CTL         0x27
+#define TWL4030_REG_PRECKR_CTL         0x28
+#define TWL4030_REG_HFL_CTL            0x29
+#define TWL4030_REG_HFR_CTL            0x2A
+#define TWL4030_REG_ALC_CTL            0x2B
+#define TWL4030_REG_ALC_SET1           0x2C
+#define TWL4030_REG_ALC_SET2           0x2D
+#define TWL4030_REG_BOOST_CTL          0x2E
+#define TWL4030_REG_SOFTVOL_CTL                0x2F
+#define TWL4030_REG_DTMF_FREQSEL       0x30
+#define TWL4030_REG_DTMF_TONEXT1H      0x31
+#define TWL4030_REG_DTMF_TONEXT1L      0x32
+#define TWL4030_REG_DTMF_TONEXT2H      0x33
+#define TWL4030_REG_DTMF_TONEXT2L      0x34
+#define TWL4030_REG_DTMF_TONOFF                0x35
+#define TWL4030_REG_DTMF_WANONOFF      0x36
+#define TWL4030_REG_I2S_RX_SCRAMBLE_H  0x37
+#define TWL4030_REG_I2S_RX_SCRAMBLE_M  0x38
+#define TWL4030_REG_I2S_RX_SCRAMBLE_L  0x39
+#define TWL4030_REG_APLL_CTL           0x3A
+#define TWL4030_REG_DTMF_CTL           0x3B
+#define TWL4030_REG_DTMF_PGA_CTL2      0x3C
+#define TWL4030_REG_DTMF_PGA_CTL1      0x3D
+#define TWL4030_REG_MISC_SET_1         0x3E
+#define TWL4030_REG_PCMBTMUX           0x3F
+#define TWL4030_REG_RX_PATH_SEL                0x43
+#define TWL4030_REG_VDL_APGA_CTL       0x44
+#define TWL4030_REG_VIBRA_CTL          0x45
+#define TWL4030_REG_VIBRA_SET          0x46
+#define TWL4030_REG_VIBRA_PWM_SET      0x47
+#define TWL4030_REG_ANAMIC_GAIN                0x48
+#define TWL4030_REG_MISC_SET_2         0x49
+
+#define TWL4030_CACHEREGNUM    (TWL4030_REG_MISC_SET_2 + 1)
+
+/* Bitfield Definitions */
+
+/* TWL4030_CODEC_MODE (0x01) Fields */
+
+#define TWL4030_APLL_RATE              0xF0
+#define TWL4030_APLL_RATE_8000         0x00
+#define TWL4030_APLL_RATE_11025                0x10
+#define TWL4030_APLL_RATE_12000                0x20
+#define TWL4030_APLL_RATE_16000                0x40
+#define TWL4030_APLL_RATE_22050                0x50
+#define TWL4030_APLL_RATE_24000                0x60
+#define TWL4030_APLL_RATE_32000                0x80
+#define TWL4030_APLL_RATE_44100                0x90
+#define TWL4030_APLL_RATE_48000                0xA0
+#define TWL4030_SEL_16K                        0x04
+#define TWL4030_CODECPDZ               0x02
+#define TWL4030_OPT_MODE               0x01
+
+/* TWL4030_REG_MICBIAS_CTL (0x04) Fields */
+
+#define TWL4030_MICBIAS2_CTL           0x40
+#define TWL4030_MICBIAS1_CTL           0x20
+#define TWL4030_HSMICBIAS_EN           0x04
+#define TWL4030_MICBIAS2_EN            0x02
+#define TWL4030_MICBIAS1_EN            0x01
+
+/* ANAMICL (0x05) Fields */
+
+#define TWL4030_CNCL_OFFSET_START      0x80
+#define TWL4030_OFFSET_CNCL_SEL                0x60
+#define TWL4030_OFFSET_CNCL_SEL_ARX1   0x00
+#define TWL4030_OFFSET_CNCL_SEL_ARX2   0x20
+#define TWL4030_OFFSET_CNCL_SEL_VRX    0x40
+#define TWL4030_OFFSET_CNCL_SEL_ALL    0x60
+#define TWL4030_MICAMPL_EN             0x10
+#define TWL4030_CKMIC_EN               0x08
+#define TWL4030_AUXL_EN                        0x04
+#define TWL4030_HSMIC_EN               0x02
+#define TWL4030_MAINMIC_EN             0x01
+
+/* ANAMICR (0x06) Fields */
+
+#define TWL4030_MICAMPR_EN             0x10
+#define TWL4030_AUXR_EN                        0x04
+#define TWL4030_SUBMIC_EN              0x01
+
+/* AVADC_CTL (0x07) Fields */
+
+#define TWL4030_ADCL_EN                        0x08
+#define TWL4030_AVADC_CLK_PRIORITY     0x04
+#define TWL4030_ADCR_EN                        0x02
+
+/* AUDIO_IF (0x0E) Fields */
+
+#define TWL4030_AIF_SLAVE_EN           0x80
+#define TWL4030_DATA_WIDTH             0x60
+#define TWL4030_DATA_WIDTH_16S_16W     0x00
+#define TWL4030_DATA_WIDTH_32S_16W     0x40
+#define TWL4030_DATA_WIDTH_32S_24W     0x60
+#define TWL4030_AIF_FORMAT             0x18
+#define TWL4030_AIF_FORMAT_CODEC       0x00
+#define TWL4030_AIF_FORMAT_LEFT                0x08
+#define TWL4030_AIF_FORMAT_RIGHT       0x10
+#define TWL4030_AIF_FORMAT_TDM         0x18
+#define TWL4030_AIF_TRI_EN             0x04
+#define TWL4030_CLK256FS_EN            0x02
+#define TWL4030_AIF_EN                 0x01
+
+/* HS_GAIN_SET (0x23) Fields */
+
+#define TWL4030_HSR_GAIN               0x0C
+#define TWL4030_HSR_GAIN_PWR_DOWN      0x00
+#define TWL4030_HSR_GAIN_PLUS_6DB      0x04
+#define TWL4030_HSR_GAIN_0DB           0x08
+#define TWL4030_HSR_GAIN_MINUS_6DB     0x0C
+#define TWL4030_HSL_GAIN               0x03
+#define TWL4030_HSL_GAIN_PWR_DOWN      0x00
+#define TWL4030_HSL_GAIN_PLUS_6DB      0x01
+#define TWL4030_HSL_GAIN_0DB           0x02
+#define TWL4030_HSL_GAIN_MINUS_6DB     0x03
+
+/* HS_POPN_SET (0x24) Fields */
+
+#define TWL4030_VMID_EN                        0x40
+#define        TWL4030_EXTMUTE                 0x20
+#define TWL4030_RAMP_DELAY             0x1C
+#define TWL4030_RAMP_DELAY_20MS                0x00
+#define TWL4030_RAMP_DELAY_40MS                0x04
+#define TWL4030_RAMP_DELAY_81MS                0x08
+#define TWL4030_RAMP_DELAY_161MS       0x0C
+#define TWL4030_RAMP_DELAY_323MS       0x10
+#define TWL4030_RAMP_DELAY_645MS       0x14
+#define TWL4030_RAMP_DELAY_1291MS      0x18
+#define TWL4030_RAMP_DELAY_2581MS      0x1C
+#define TWL4030_RAMP_EN                        0x02
+
+/* HFL_CTL (0x29, 0x2A) Fields */
+#define TWL4030_HF_CTL_HB_EN           0x04
+#define TWL4030_HF_CTL_LOOP_EN         0x08
+#define TWL4030_HF_CTL_RAMP_EN         0x10
+#define TWL4030_HF_CTL_REF_EN          0x20
+
+/* APLL_CTL (0x3A) Fields */
+
+#define TWL4030_APLL_EN                        0x10
+#define TWL4030_APLL_INFREQ            0x0F
+#define TWL4030_APLL_INFREQ_19200KHZ   0x05
+#define TWL4030_APLL_INFREQ_26000KHZ   0x06
+#define TWL4030_APLL_INFREQ_38400KHZ   0x0F
+
+/* REG_MISC_SET_1 (0x3E) Fields */
+
+#define TWL4030_CLK64_EN               0x80
+#define TWL4030_SCRAMBLE_EN            0x40
+#define TWL4030_FMLOOP_EN              0x20
+#define TWL4030_SMOOTH_ANAVOL_EN       0x02
+#define TWL4030_DIGMIC_LR_SWAP_EN      0x01
+
+extern struct snd_soc_dai twl4030_dai;
+extern struct snd_soc_codec_device soc_codec_dev_twl4030;
+
+#endif /* End of __TWL4030_AUDIO_H__ */
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
new file mode 100644 (file)
index 0000000..a2c5064
--- /dev/null
@@ -0,0 +1,668 @@
+/*
+ * uda134x.c  --  UDA134X ALSA SoC Codec driver
+ *
+ * Modifications by Christian Pellegrin <chripell@evolware.org>
+ *
+ * Copyright 2007 Dension Audio Systems Ltd.
+ * Author: Zoltan Devai
+ *
+ * Based on the WM87xx drivers by Liam Girdwood and Richard Purdie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+
+#include <sound/uda134x.h>
+#include <sound/l3.h>
+
+#include "uda134x.h"
+
+
+#define POWER_OFF_ON_STANDBY 1
+/*
+  ALSA SOC usually puts the device in standby mode when it's not used
+  for sometime. If you define POWER_OFF_ON_STANDBY the driver will
+  turn off the ADC/DAC when this callback is invoked and turn it back
+  on when needed. Unfortunately this will result in a very light bump
+  (it can be audible only with good earphones). If this bothers you
+  just comment this line, you will have slightly higher power
+  consumption . Please note that sending the L3 command for ADC is
+  enough to make the bump, so it doesn't make difference if you
+  completely take off power from the codec.
+ */
+
+#define UDA134X_RATES SNDRV_PCM_RATE_8000_48000
+#define UDA134X_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \
+               SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE)
+
+struct uda134x_priv {
+       int sysclk;
+       int dai_fmt;
+
+       struct snd_pcm_substream *master_substream;
+       struct snd_pcm_substream *slave_substream;
+};
+
+/* In-data addresses are hard-coded into the reg-cache values */
+static const char uda134x_reg[UDA134X_REGS_NUM] = {
+       /* Extended address registers */
+       0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+       /* Status, data regs */
+       0x00, 0x83, 0x00, 0x40, 0x80, 0x00,
+};
+
+/*
+ * The codec has no support for reading its registers except for peak level...
+ */
+static inline unsigned int uda134x_read_reg_cache(struct snd_soc_codec *codec,
+       unsigned int reg)
+{
+       u8 *cache = codec->reg_cache;
+
+       if (reg >= UDA134X_REGS_NUM)
+               return -1;
+       return cache[reg];
+}
+
+/*
+ * Write the register cache
+ */
+static inline void uda134x_write_reg_cache(struct snd_soc_codec *codec,
+       u8 reg, unsigned int value)
+{
+       u8 *cache = codec->reg_cache;
+
+       if (reg >= UDA134X_REGS_NUM)
+               return;
+       cache[reg] = value;
+}
+
+/*
+ * Write to the uda134x registers
+ *
+ */
+static int uda134x_write(struct snd_soc_codec *codec, unsigned int reg,
+       unsigned int value)
+{
+       int ret;
+       u8 addr;
+       u8 data = value;
+       struct uda134x_platform_data *pd = codec->control_data;
+
+       pr_debug("%s reg: %02X, value:%02X\n", __func__, reg, value);
+
+       if (reg >= UDA134X_REGS_NUM) {
+               printk(KERN_ERR "%s unkown register: reg: %d",
+                      __func__, reg);
+               return -EINVAL;
+       }
+
+       uda134x_write_reg_cache(codec, reg, value);
+
+       switch (reg) {
+       case UDA134X_STATUS0:
+       case UDA134X_STATUS1:
+               addr = UDA134X_STATUS_ADDR;
+               break;
+       case UDA134X_DATA000:
+       case UDA134X_DATA001:
+       case UDA134X_DATA010:
+               addr = UDA134X_DATA0_ADDR;
+               break;
+       case UDA134X_DATA1:
+               addr = UDA134X_DATA1_ADDR;
+               break;
+       default:
+               /* It's an extended address register */
+               addr =  (reg | UDA134X_EXTADDR_PREFIX);
+
+               ret = l3_write(&pd->l3,
+                              UDA134X_DATA0_ADDR, &addr, 1);
+               if (ret != 1)
+                       return -EIO;
+
+               addr = UDA134X_DATA0_ADDR;
+               data = (value | UDA134X_EXTDATA_PREFIX);
+               break;
+       }
+
+       ret = l3_write(&pd->l3,
+                      addr, &data, 1);
+       if (ret != 1)
+               return -EIO;
+
+       return 0;
+}
+
+static inline void uda134x_reset(struct snd_soc_codec *codec)
+{
+       u8 reset_reg = uda134x_read_reg_cache(codec, UDA134X_STATUS0);
+       uda134x_write(codec, UDA134X_STATUS0, reset_reg | (1<<6));
+       msleep(1);
+       uda134x_write(codec, UDA134X_STATUS0, reset_reg & ~(1<<6));
+}
+
+static int uda134x_mute(struct snd_soc_dai *dai, int mute)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       u8 mute_reg = uda134x_read_reg_cache(codec, UDA134X_DATA010);
+
+       pr_debug("%s mute: %d\n", __func__, mute);
+
+       if (mute)
+               mute_reg |= (1<<2);
+       else
+               mute_reg &= ~(1<<2);
+
+       uda134x_write(codec, UDA134X_DATA010, mute_reg & ~(1<<2));
+
+       return 0;
+}
+
+static int uda134x_startup(struct snd_pcm_substream *substream,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       struct uda134x_priv *uda134x = codec->private_data;
+       struct snd_pcm_runtime *master_runtime;
+
+       if (uda134x->master_substream) {
+               master_runtime = uda134x->master_substream->runtime;
+
+               pr_debug("%s constraining to %d bits at %d\n", __func__,
+                        master_runtime->sample_bits,
+                        master_runtime->rate);
+
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                                            SNDRV_PCM_HW_PARAM_RATE,
+                                            master_runtime->rate,
+                                            master_runtime->rate);
+
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                                            SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+                                            master_runtime->sample_bits,
+                                            master_runtime->sample_bits);
+
+               uda134x->slave_substream = substream;
+       } else
+               uda134x->master_substream = substream;
+
+       return 0;
+}
+
+static void uda134x_shutdown(struct snd_pcm_substream *substream,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       struct uda134x_priv *uda134x = codec->private_data;
+
+       if (uda134x->master_substream == substream)
+               uda134x->master_substream = uda134x->slave_substream;
+
+       uda134x->slave_substream = NULL;
+}
+
+static int uda134x_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       struct uda134x_priv *uda134x = codec->private_data;
+       u8 hw_params;
+
+       if (substream == uda134x->slave_substream) {
+               pr_debug("%s ignoring hw_params for slave substream\n",
+                        __func__);
+               return 0;
+       }
+
+       hw_params = uda134x_read_reg_cache(codec, UDA134X_STATUS0);
+       hw_params &= STATUS0_SYSCLK_MASK;
+       hw_params &= STATUS0_DAIFMT_MASK;
+
+       pr_debug("%s sysclk: %d, rate:%d\n", __func__,
+                uda134x->sysclk, params_rate(params));
+
+       /* set SYSCLK / fs ratio */
+       switch (uda134x->sysclk / params_rate(params)) {
+       case 512:
+               break;
+       case 384:
+               hw_params |= (1<<4);
+               break;
+       case 256:
+               hw_params |= (1<<5);
+               break;
+       default:
+               printk(KERN_ERR "%s unsupported fs\n", __func__);
+               return -EINVAL;
+       }
+
+       pr_debug("%s dai_fmt: %d, params_format:%d\n", __func__,
+                uda134x->dai_fmt, params_format(params));
+
+       /* set DAI format and word length */
+       switch (uda134x->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               break;
+       case SND_SOC_DAIFMT_RIGHT_J:
+               switch (params_format(params)) {
+               case SNDRV_PCM_FORMAT_S16_LE:
+                       hw_params |= (1<<1);
+                       break;
+               case SNDRV_PCM_FORMAT_S18_3LE:
+                       hw_params |= (1<<2);
+                       break;
+               case SNDRV_PCM_FORMAT_S20_3LE:
+                       hw_params |= ((1<<2) | (1<<1));
+                       break;
+               default:
+                       printk(KERN_ERR "%s unsupported format (right)\n",
+                              __func__);
+                       return -EINVAL;
+               }
+               break;
+       case SND_SOC_DAIFMT_LEFT_J:
+               hw_params |= (1<<3);
+               break;
+       default:
+               printk(KERN_ERR "%s unsupported format\n", __func__);
+               return -EINVAL;
+       }
+
+       uda134x_write(codec, UDA134X_STATUS0, hw_params);
+
+       return 0;
+}
+
+static int uda134x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+                                 int clk_id, unsigned int freq, int dir)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       struct uda134x_priv *uda134x = codec->private_data;
+
+       pr_debug("%s clk_id: %d, freq: %d, dir: %d\n", __func__,
+                clk_id, freq, dir);
+
+       /* Anything between 256fs*8Khz and 512fs*48Khz should be acceptable
+          because the codec is slave. Of course limitations of the clock
+          master (the IIS controller) apply.
+          We'll error out on set_hw_params if it's not OK */
+       if ((freq >= (256 * 8000)) && (freq <= (512 * 48000))) {
+               uda134x->sysclk = freq;
+               return 0;
+       }
+
+       printk(KERN_ERR "%s unsupported sysclk\n", __func__);
+       return -EINVAL;
+}
+
+static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai,
+                              unsigned int fmt)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       struct uda134x_priv *uda134x = codec->private_data;
+
+       pr_debug("%s fmt: %08X\n", __func__, fmt);
+
+       /* codec supports only full slave mode */
+       if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS) {
+               printk(KERN_ERR "%s unsupported slave mode\n", __func__);
+               return -EINVAL;
+       }
+
+       /* no support for clock inversion */
+       if ((fmt & SND_SOC_DAIFMT_INV_MASK) != SND_SOC_DAIFMT_NB_NF) {
+               printk(KERN_ERR "%s unsupported clock inversion\n", __func__);
+               return -EINVAL;
+       }
+
+       /* We can't setup DAI format here as it depends on the word bit num */
+       /* so let's just store the value for later */
+       uda134x->dai_fmt = fmt;
+
+       return 0;
+}
+
+static int uda134x_set_bias_level(struct snd_soc_codec *codec,
+                                 enum snd_soc_bias_level level)
+{
+       u8 reg;
+       struct uda134x_platform_data *pd = codec->control_data;
+       int i;
+       u8 *cache = codec->reg_cache;
+
+       pr_debug("%s bias level %d\n", __func__, level);
+
+       switch (level) {
+       case SND_SOC_BIAS_ON:
+               /* ADC, DAC on */
+               reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1);
+               uda134x_write(codec, UDA134X_STATUS1, reg | 0x03);
+               break;
+       case SND_SOC_BIAS_PREPARE:
+               /* power on */
+               if (pd->power) {
+                       pd->power(1);
+                       /* Sync reg_cache with the hardware */
+                       for (i = 0; i < ARRAY_SIZE(uda134x_reg); i++)
+                               codec->write(codec, i, *cache++);
+               }
+               break;
+       case SND_SOC_BIAS_STANDBY:
+               /* ADC, DAC power off */
+               reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1);
+               uda134x_write(codec, UDA134X_STATUS1, reg & ~(0x03));
+               break;
+       case SND_SOC_BIAS_OFF:
+               /* power off */
+               if (pd->power)
+                       pd->power(0);
+               break;
+       }
+       codec->bias_level = level;
+       return 0;
+}
+
+static const char *uda134x_dsp_setting[] = {"Flat", "Minimum1",
+                                           "Minimum2", "Maximum"};
+static const char *uda134x_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
+static const char *uda134x_mixmode[] = {"Differential", "Analog1",
+                                       "Analog2", "Both"};
+
+static const struct soc_enum uda134x_mixer_enum[] = {
+SOC_ENUM_SINGLE(UDA134X_DATA010, 0, 0x04, uda134x_dsp_setting),
+SOC_ENUM_SINGLE(UDA134X_DATA010, 3, 0x04, uda134x_deemph),
+SOC_ENUM_SINGLE(UDA134X_EA010, 0, 0x04, uda134x_mixmode),
+};
+
+static const struct snd_kcontrol_new uda1341_snd_controls[] = {
+SOC_SINGLE("Master Playback Volume", UDA134X_DATA000, 0, 0x3F, 1),
+SOC_SINGLE("Capture Volume", UDA134X_EA010, 2, 0x07, 0),
+SOC_SINGLE("Analog1 Volume", UDA134X_EA000, 0, 0x1F, 1),
+SOC_SINGLE("Analog2 Volume", UDA134X_EA001, 0, 0x1F, 1),
+
+SOC_SINGLE("Mic Sensitivity", UDA134X_EA010, 2, 7, 0),
+SOC_SINGLE("Mic Volume", UDA134X_EA101, 0, 0x1F, 0),
+
+SOC_SINGLE("Tone Control - Bass", UDA134X_DATA001, 2, 0xF, 0),
+SOC_SINGLE("Tone Control - Treble", UDA134X_DATA001, 0, 3, 0),
+
+SOC_ENUM("Sound Processing Filter", uda134x_mixer_enum[0]),
+SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]),
+SOC_ENUM("Input Mux", uda134x_mixer_enum[2]),
+
+SOC_SINGLE("AGC Switch", UDA134X_EA100, 4, 1, 0),
+SOC_SINGLE("AGC Target Volume", UDA134X_EA110, 0, 0x03, 1),
+SOC_SINGLE("AGC Timing", UDA134X_EA110, 2, 0x07, 0),
+
+SOC_SINGLE("DAC +6dB Switch", UDA134X_STATUS1, 6, 1, 0),
+SOC_SINGLE("ADC +6dB Switch", UDA134X_STATUS1, 5, 1, 0),
+SOC_SINGLE("ADC Polarity Switch", UDA134X_STATUS1, 4, 1, 0),
+SOC_SINGLE("DAC Polarity Switch", UDA134X_STATUS1, 3, 1, 0),
+SOC_SINGLE("Double Speed Playback Switch", UDA134X_STATUS1, 2, 1, 0),
+SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0),
+};
+
+static const struct snd_kcontrol_new uda1340_snd_controls[] = {
+SOC_SINGLE("Master Playback Volume", UDA134X_DATA000, 0, 0x3F, 1),
+
+SOC_SINGLE("Tone Control - Bass", UDA134X_DATA001, 2, 0xF, 0),
+SOC_SINGLE("Tone Control - Treble", UDA134X_DATA001, 0, 3, 0),
+
+SOC_ENUM("Sound Processing Filter", uda134x_mixer_enum[0]),
+SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]),
+
+SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0),
+};
+
+static int uda134x_add_controls(struct snd_soc_codec *codec)
+{
+       int err, i, n;
+       const struct snd_kcontrol_new *ctrls;
+       struct uda134x_platform_data *pd = codec->control_data;
+
+       switch (pd->model) {
+       case UDA134X_UDA1340:
+       case UDA134X_UDA1344:
+               n = ARRAY_SIZE(uda1340_snd_controls);
+               ctrls = uda1340_snd_controls;
+               break;
+       case UDA134X_UDA1341:
+               n = ARRAY_SIZE(uda1341_snd_controls);
+               ctrls = uda1341_snd_controls;
+               break;
+       default:
+               printk(KERN_ERR "%s unkown codec type: %d",
+                      __func__, pd->model);
+               return -EINVAL;
+       }
+
+       for (i = 0; i < n; i++) {
+               err = snd_ctl_add(codec->card,
+                                 snd_soc_cnew(&ctrls[i],
+                                              codec, NULL));
+               if (err < 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+struct snd_soc_dai uda134x_dai = {
+       .name = "UDA134X",
+       /* playback capabilities */
+       .playback = {
+               .stream_name = "Playback",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = UDA134X_RATES,
+               .formats = UDA134X_FORMATS,
+       },
+       /* capture capabilities */
+       .capture = {
+               .stream_name = "Capture",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = UDA134X_RATES,
+               .formats = UDA134X_FORMATS,
+       },
+       /* pcm operations */
+       .ops = {
+               .startup = uda134x_startup,
+               .shutdown = uda134x_shutdown,
+               .hw_params = uda134x_hw_params,
+               .digital_mute = uda134x_mute,
+               .set_sysclk = uda134x_set_dai_sysclk,
+               .set_fmt = uda134x_set_dai_fmt,
+       }
+};
+EXPORT_SYMBOL(uda134x_dai);
+
+
+static int uda134x_soc_probe(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec;
+       struct uda134x_priv *uda134x;
+       void *codec_setup_data = socdev->codec_data;
+       int ret = -ENOMEM;
+       struct uda134x_platform_data *pd;
+
+       printk(KERN_INFO "UDA134X SoC Audio Codec\n");
+
+       if (!codec_setup_data) {
+               printk(KERN_ERR "UDA134X SoC codec: "
+                      "missing L3 bitbang function\n");
+               return -ENODEV;
+       }
+
+       pd = codec_setup_data;
+       switch (pd->model) {
+       case UDA134X_UDA1340:
+       case UDA134X_UDA1341:
+       case UDA134X_UDA1344:
+               break;
+       default:
+               printk(KERN_ERR "UDA134X SoC codec: "
+                      "unsupported model %d\n",
+                       pd->model);
+               return -EINVAL;
+       }
+
+       socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+       if (socdev->codec == NULL)
+               return ret;
+
+       codec = socdev->codec;
+
+       uda134x = kzalloc(sizeof(struct uda134x_priv), GFP_KERNEL);
+       if (uda134x == NULL)
+               goto priv_err;
+       codec->private_data = uda134x;
+
+       codec->reg_cache = kmemdup(uda134x_reg, sizeof(uda134x_reg),
+                                  GFP_KERNEL);
+       if (codec->reg_cache == NULL)
+               goto reg_err;
+
+       mutex_init(&codec->mutex);
+
+       codec->reg_cache_size = sizeof(uda134x_reg);
+       codec->reg_cache_step = 1;
+
+       codec->name = "UDA134X";
+       codec->owner = THIS_MODULE;
+       codec->dai = &uda134x_dai;
+       codec->num_dai = 1;
+       codec->read = uda134x_read_reg_cache;
+       codec->write = uda134x_write;
+#ifdef POWER_OFF_ON_STANDBY
+       codec->set_bias_level = uda134x_set_bias_level;
+#endif
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+
+       codec->control_data = codec_setup_data;
+
+       if (pd->power)
+               pd->power(1);
+
+       uda134x_reset(codec);
+
+       /* register pcms */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               printk(KERN_ERR "UDA134X: failed to register pcms\n");
+               goto pcm_err;
+       }
+
+       ret = uda134x_add_controls(codec);
+       if (ret < 0) {
+               printk(KERN_ERR "UDA134X: failed to register controls\n");
+               goto pcm_err;
+       }
+
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               printk(KERN_ERR "UDA134X: failed to register card\n");
+               goto card_err;
+       }
+
+       return 0;
+
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+pcm_err:
+       kfree(codec->reg_cache);
+reg_err:
+       kfree(codec->private_data);
+priv_err:
+       kfree(codec);
+       return ret;
+}
+
+/* power down chip */
+static int uda134x_soc_remove(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+
+       kfree(codec->private_data);
+       kfree(codec->reg_cache);
+       kfree(codec);
+
+       return 0;
+}
+
+#if defined(CONFIG_PM)
+static int uda134x_soc_suspend(struct platform_device *pdev,
+                                               pm_message_t state)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       return 0;
+}
+
+static int uda134x_soc_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_PREPARE);
+       uda134x_set_bias_level(codec, SND_SOC_BIAS_ON);
+       return 0;
+}
+#else
+#define uda134x_soc_suspend NULL
+#define uda134x_soc_resume NULL
+#endif /* CONFIG_PM */
+
+struct snd_soc_codec_device soc_codec_dev_uda134x = {
+       .probe =        uda134x_soc_probe,
+       .remove =       uda134x_soc_remove,
+       .suspend =      uda134x_soc_suspend,
+       .resume =       uda134x_soc_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_uda134x);
+
+static int __init uda134x_init(void)
+{
+       return snd_soc_register_dai(&uda134x_dai);
+}
+module_init(uda134x_init);
+
+static void __exit uda134x_exit(void)
+{
+       snd_soc_unregister_dai(&uda134x_dai);
+}
+module_exit(uda134x_exit);
+
+MODULE_DESCRIPTION("UDA134X ALSA soc codec driver");
+MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/uda134x.h b/sound/soc/codecs/uda134x.h
new file mode 100644 (file)
index 0000000..94f4404
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _UDA134X_CODEC_H
+#define _UDA134X_CODEC_H
+
+#define UDA134X_L3ADDR 5
+#define UDA134X_DATA0_ADDR     ((UDA134X_L3ADDR << 2) | 0)
+#define UDA134X_DATA1_ADDR     ((UDA134X_L3ADDR << 2) | 1)
+#define UDA134X_STATUS_ADDR    ((UDA134X_L3ADDR << 2) | 2)
+
+#define UDA134X_EXTADDR_PREFIX 0xC0
+#define UDA134X_EXTDATA_PREFIX 0xE0
+
+/* UDA134X registers */
+#define UDA134X_EA000  0
+#define UDA134X_EA001  1
+#define UDA134X_EA010  2
+#define UDA134X_EA011  3
+#define UDA134X_EA100  4
+#define UDA134X_EA101  5
+#define UDA134X_EA110  6
+#define UDA134X_EA111  7
+#define UDA134X_STATUS0 8
+#define UDA134X_STATUS1 9
+#define UDA134X_DATA000 10
+#define UDA134X_DATA001 11
+#define UDA134X_DATA010 12
+#define UDA134X_DATA1  13
+
+#define UDA134X_REGS_NUM 14
+
+#define STATUS0_DAIFMT_MASK (~(7<<1))
+#define STATUS0_SYSCLK_MASK (~(3<<4))
+
+extern struct snd_soc_dai uda134x_dai;
+extern struct snd_soc_codec_device soc_codec_dev_uda134x;
+
+#endif
index a69ee72a7af553ca3f36d03d2c63288d97914232..e6bf0844fbf3e4dd770b293bf01673f1be78c86d 100644 (file)
@@ -407,7 +407,8 @@ static int uda1380_set_dai_fmt(struct snd_soc_dai *codec_dai,
  * when the DAI is being clocked by the CPU DAI. It's up to the
  * machine and cpu DAI driver to do this before we are called.
  */
-static int uda1380_pcm_prepare(struct snd_pcm_substream *substream)
+static int uda1380_pcm_prepare(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -439,7 +440,8 @@ static int uda1380_pcm_prepare(struct snd_pcm_substream *substream)
 }
 
 static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -477,7 +479,8 @@ static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream)
+static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -560,8 +563,6 @@ struct snd_soc_dai uda1380_dai[] = {
                .hw_params = uda1380_pcm_hw_params,
                .shutdown = uda1380_pcm_shutdown,
                .prepare = uda1380_pcm_prepare,
-       },
-       .dai_ops = {
                .digital_mute = uda1380_mute,
                .set_fmt = uda1380_set_dai_fmt,
        },
@@ -579,8 +580,6 @@ struct snd_soc_dai uda1380_dai[] = {
                .hw_params = uda1380_pcm_hw_params,
                .shutdown = uda1380_pcm_shutdown,
                .prepare = uda1380_pcm_prepare,
-       },
-       .dai_ops = {
                .digital_mute = uda1380_mute,
                .set_fmt = uda1380_set_dai_fmt,
        },
@@ -598,8 +597,6 @@ struct snd_soc_dai uda1380_dai[] = {
                .hw_params = uda1380_pcm_hw_params,
                .shutdown = uda1380_pcm_shutdown,
                .prepare = uda1380_pcm_prepare,
-       },
-       .dai_ops = {
                .set_fmt = uda1380_set_dai_fmt,
        },
 },
@@ -680,7 +677,7 @@ static int uda1380_init(struct snd_soc_device *socdev, int dac_clk)
        /* uda1380 init */
        uda1380_add_controls(codec);
        uda1380_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                pr_err("uda1380: failed to register card\n");
                goto card_err;
@@ -844,6 +841,18 @@ struct snd_soc_codec_device soc_codec_dev_uda1380 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_uda1380);
 
+static int __init uda1380_modinit(void)
+{
+       return snd_soc_register_dais(uda1380_dai, ARRAY_SIZE(uda1380_dai));
+}
+module_init(uda1380_modinit);
+
+static void __exit uda1380_exit(void)
+{
+       snd_soc_unregister_dais(uda1380_dai, ARRAY_SIZE(uda1380_dai));
+}
+module_exit(uda1380_exit);
+
 MODULE_AUTHOR("Giorgio Padrin");
 MODULE_DESCRIPTION("Audio support for codec Philips UDA1380");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
new file mode 100644 (file)
index 0000000..e3989d4
--- /dev/null
@@ -0,0 +1,1583 @@
+/*
+ * wm8350.c -- WM8350 ALSA SoC audio driver
+ *
+ * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ *
+ * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/wm8350/audio.h>
+#include <linux/mfd/wm8350/core.h>
+#include <linux/regulator/consumer.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+#include <sound/tlv.h>
+
+#include "wm8350.h"
+
+#define WM8350_OUTn_0dB 0x39
+
+#define WM8350_RAMP_NONE       0
+#define WM8350_RAMP_UP         1
+#define WM8350_RAMP_DOWN       2
+
+/* We only include the analogue supplies here; the digital supplies
+ * need to be available well before this driver can be probed.
+ */
+static const char *supply_names[] = {
+       "AVDD",
+       "HPVDD",
+};
+
+struct wm8350_output {
+       u16 active;
+       u16 left_vol;
+       u16 right_vol;
+       u16 ramp;
+       u16 mute;
+};
+
+struct wm8350_data {
+       struct snd_soc_codec codec;
+       struct wm8350_output out1;
+       struct wm8350_output out2;
+       struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)];
+};
+
+static unsigned int wm8350_codec_cache_read(struct snd_soc_codec *codec,
+                                           unsigned int reg)
+{
+       struct wm8350 *wm8350 = codec->control_data;
+       return wm8350->reg_cache[reg];
+}
+
+static unsigned int wm8350_codec_read(struct snd_soc_codec *codec,
+                                     unsigned int reg)
+{
+       struct wm8350 *wm8350 = codec->control_data;
+       return wm8350_reg_read(wm8350, reg);
+}
+
+static int wm8350_codec_write(struct snd_soc_codec *codec, unsigned int reg,
+                             unsigned int value)
+{
+       struct wm8350 *wm8350 = codec->control_data;
+       return wm8350_reg_write(wm8350, reg, value);
+}
+
+/*
+ * Ramp OUT1 PGA volume to minimise pops at stream startup and shutdown.
+ */
+static inline int wm8350_out1_ramp_step(struct snd_soc_codec *codec)
+{
+       struct wm8350_data *wm8350_data = codec->private_data;
+       struct wm8350_output *out1 = &wm8350_data->out1;
+       struct wm8350 *wm8350 = codec->control_data;
+       int left_complete = 0, right_complete = 0;
+       u16 reg, val;
+
+       /* left channel */
+       reg = wm8350_reg_read(wm8350, WM8350_LOUT1_VOLUME);
+       val = (reg & WM8350_OUT1L_VOL_MASK) >> WM8350_OUT1L_VOL_SHIFT;
+
+       if (out1->ramp == WM8350_RAMP_UP) {
+               /* ramp step up */
+               if (val < out1->left_vol) {
+                       val++;
+                       reg &= ~WM8350_OUT1L_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_LOUT1_VOLUME,
+                                        reg | (val << WM8350_OUT1L_VOL_SHIFT));
+               } else
+                       left_complete = 1;
+       } else if (out1->ramp == WM8350_RAMP_DOWN) {
+               /* ramp step down */
+               if (val > 0) {
+                       val--;
+                       reg &= ~WM8350_OUT1L_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_LOUT1_VOLUME,
+                                        reg | (val << WM8350_OUT1L_VOL_SHIFT));
+               } else
+                       left_complete = 1;
+       } else
+               return 1;
+
+       /* right channel */
+       reg = wm8350_reg_read(wm8350, WM8350_ROUT1_VOLUME);
+       val = (reg & WM8350_OUT1R_VOL_MASK) >> WM8350_OUT1R_VOL_SHIFT;
+       if (out1->ramp == WM8350_RAMP_UP) {
+               /* ramp step up */
+               if (val < out1->right_vol) {
+                       val++;
+                       reg &= ~WM8350_OUT1R_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_ROUT1_VOLUME,
+                                        reg | (val << WM8350_OUT1R_VOL_SHIFT));
+               } else
+                       right_complete = 1;
+       } else if (out1->ramp == WM8350_RAMP_DOWN) {
+               /* ramp step down */
+               if (val > 0) {
+                       val--;
+                       reg &= ~WM8350_OUT1R_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_ROUT1_VOLUME,
+                                        reg | (val << WM8350_OUT1R_VOL_SHIFT));
+               } else
+                       right_complete = 1;
+       }
+
+       /* only hit the update bit if either volume has changed this step */
+       if (!left_complete || !right_complete)
+               wm8350_set_bits(wm8350, WM8350_LOUT1_VOLUME, WM8350_OUT1_VU);
+
+       return left_complete & right_complete;
+}
+
+/*
+ * Ramp OUT2 PGA volume to minimise pops at stream startup and shutdown.
+ */
+static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)
+{
+       struct wm8350_data *wm8350_data = codec->private_data;
+       struct wm8350_output *out2 = &wm8350_data->out2;
+       struct wm8350 *wm8350 = codec->control_data;
+       int left_complete = 0, right_complete = 0;
+       u16 reg, val;
+
+       /* left channel */
+       reg = wm8350_reg_read(wm8350, WM8350_LOUT2_VOLUME);
+       val = (reg & WM8350_OUT2L_VOL_MASK) >> WM8350_OUT1L_VOL_SHIFT;
+       if (out2->ramp == WM8350_RAMP_UP) {
+               /* ramp step up */
+               if (val < out2->left_vol) {
+                       val++;
+                       reg &= ~WM8350_OUT2L_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_LOUT2_VOLUME,
+                                        reg | (val << WM8350_OUT1L_VOL_SHIFT));
+               } else
+                       left_complete = 1;
+       } else if (out2->ramp == WM8350_RAMP_DOWN) {
+               /* ramp step down */
+               if (val > 0) {
+                       val--;
+                       reg &= ~WM8350_OUT2L_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_LOUT2_VOLUME,
+                                        reg | (val << WM8350_OUT1L_VOL_SHIFT));
+               } else
+                       left_complete = 1;
+       } else
+               return 1;
+
+       /* right channel */
+       reg = wm8350_reg_read(wm8350, WM8350_ROUT2_VOLUME);
+       val = (reg & WM8350_OUT2R_VOL_MASK) >> WM8350_OUT1R_VOL_SHIFT;
+       if (out2->ramp == WM8350_RAMP_UP) {
+               /* ramp step up */
+               if (val < out2->right_vol) {
+                       val++;
+                       reg &= ~WM8350_OUT2R_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_ROUT2_VOLUME,
+                                        reg | (val << WM8350_OUT1R_VOL_SHIFT));
+               } else
+                       right_complete = 1;
+       } else if (out2->ramp == WM8350_RAMP_DOWN) {
+               /* ramp step down */
+               if (val > 0) {
+                       val--;
+                       reg &= ~WM8350_OUT2R_VOL_MASK;
+                       wm8350_reg_write(wm8350, WM8350_ROUT2_VOLUME,
+                                        reg | (val << WM8350_OUT1R_VOL_SHIFT));
+               } else
+                       right_complete = 1;
+       }
+
+       /* only hit the update bit if either volume has changed this step */
+       if (!left_complete || !right_complete)
+               wm8350_set_bits(wm8350, WM8350_LOUT2_VOLUME, WM8350_OUT2_VU);
+
+       return left_complete & right_complete;
+}
+
+/*
+ * This work ramps both output PGAs at stream start/stop time to
+ * minimise pop associated with DAPM power switching.
+ * It's best to enable Zero Cross when ramping occurs to minimise any
+ * zipper noises.
+ */
+static void wm8350_pga_work(struct work_struct *work)
+{
+       struct snd_soc_codec *codec =
+           container_of(work, struct snd_soc_codec, delayed_work.work);
+       struct wm8350_data *wm8350_data = codec->private_data;
+       struct wm8350_output *out1 = &wm8350_data->out1,
+           *out2 = &wm8350_data->out2;
+       int i, out1_complete, out2_complete;
+
+       /* do we need to ramp at all ? */
+       if (out1->ramp == WM8350_RAMP_NONE && out2->ramp == WM8350_RAMP_NONE)
+               return;
+
+       /* PGA volumes have 6 bits of resolution to ramp */
+       for (i = 0; i <= 63; i++) {
+               out1_complete = 1, out2_complete = 1;
+               if (out1->ramp != WM8350_RAMP_NONE)
+                       out1_complete = wm8350_out1_ramp_step(codec);
+               if (out2->ramp != WM8350_RAMP_NONE)
+                       out2_complete = wm8350_out2_ramp_step(codec);
+
+               /* ramp finished ? */
+               if (out1_complete && out2_complete)
+                       break;
+
+               /* we need to delay longer on the up ramp */
+               if (out1->ramp == WM8350_RAMP_UP ||
+                   out2->ramp == WM8350_RAMP_UP) {
+                       /* delay is longer over 0dB as increases are larger */
+                       if (i >= WM8350_OUTn_0dB)
+                               schedule_timeout_interruptible(msecs_to_jiffies
+                                                              (2));
+                       else
+                               schedule_timeout_interruptible(msecs_to_jiffies
+                                                              (1));
+               } else
+                       udelay(50);     /* doesn't matter if we delay longer */
+       }
+
+       out1->ramp = WM8350_RAMP_NONE;
+       out2->ramp = WM8350_RAMP_NONE;
+}
+
+/*
+ * WM8350 Controls
+ */
+
+static int pga_event(struct snd_soc_dapm_widget *w,
+                    struct snd_kcontrol *kcontrol, int event)
+{
+       struct snd_soc_codec *codec = w->codec;
+       struct wm8350_data *wm8350_data = codec->private_data;
+       struct wm8350_output *out;
+
+       switch (w->shift) {
+       case 0:
+       case 1:
+               out = &wm8350_data->out1;
+               break;
+       case 2:
+       case 3:
+               out = &wm8350_data->out2;
+               break;
+
+       default:
+               BUG();
+               return -1;
+       }
+
+       switch (event) {
+       case SND_SOC_DAPM_POST_PMU:
+               out->ramp = WM8350_RAMP_UP;
+               out->active = 1;
+
+               if (!delayed_work_pending(&codec->delayed_work))
+                       schedule_delayed_work(&codec->delayed_work,
+                                             msecs_to_jiffies(1));
+               break;
+
+       case SND_SOC_DAPM_PRE_PMD:
+               out->ramp = WM8350_RAMP_DOWN;
+               out->active = 0;
+
+               if (!delayed_work_pending(&codec->delayed_work))
+                       schedule_delayed_work(&codec->delayed_work,
+                                             msecs_to_jiffies(1));
+               break;
+       }
+
+       return 0;
+}
+
+static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol,
+                                 struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct wm8350_data *wm8350_priv = codec->private_data;
+       struct wm8350_output *out = NULL;
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       int ret;
+       unsigned int reg = mc->reg;
+       u16 val;
+
+       /* For OUT1 and OUT2 we shadow the values and only actually write
+        * them out when active in order to ensure the amplifier comes on
+        * as quietly as possible. */
+       switch (reg) {
+       case WM8350_LOUT1_VOLUME:
+               out = &wm8350_priv->out1;
+               break;
+       case WM8350_LOUT2_VOLUME:
+               out = &wm8350_priv->out2;
+               break;
+       default:
+               break;
+       }
+
+       if (out) {
+               out->left_vol = ucontrol->value.integer.value[0];
+               out->right_vol = ucontrol->value.integer.value[1];
+               if (!out->active)
+                       return 1;
+       }
+
+       ret = snd_soc_put_volsw_2r(kcontrol, ucontrol);
+       if (ret < 0)
+               return ret;
+
+       /* now hit the volume update bits (always bit 8) */
+       val = wm8350_codec_read(codec, reg);
+       wm8350_codec_write(codec, reg, val | WM8350_OUT1_VU);
+       return 1;
+}
+
+static int wm8350_get_volsw_2r(struct snd_kcontrol *kcontrol,
+                              struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct wm8350_data *wm8350_priv = codec->private_data;
+       struct wm8350_output *out1 = &wm8350_priv->out1;
+       struct wm8350_output *out2 = &wm8350_priv->out2;
+       struct soc_mixer_control *mc =
+               (struct soc_mixer_control *)kcontrol->private_value;
+       unsigned int reg = mc->reg;
+
+       /* If these are cached registers use the cache */
+       switch (reg) {
+       case WM8350_LOUT1_VOLUME:
+               ucontrol->value.integer.value[0] = out1->left_vol;
+               ucontrol->value.integer.value[1] = out1->right_vol;
+               return 0;
+
+       case WM8350_LOUT2_VOLUME:
+               ucontrol->value.integer.value[0] = out2->left_vol;
+               ucontrol->value.integer.value[1] = out2->right_vol;
+               return 0;
+
+       default:
+               break;
+       }
+
+       return snd_soc_get_volsw_2r(kcontrol, ucontrol);
+}
+
+/* double control with volume update */
+#define SOC_WM8350_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, \
+                               xinvert, tlv_array) \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
+       .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
+               SNDRV_CTL_ELEM_ACCESS_READWRITE | \
+               SNDRV_CTL_ELEM_ACCESS_VOLATILE, \
+       .tlv.p = (tlv_array), \
+       .info = snd_soc_info_volsw_2r, \
+       .get = wm8350_get_volsw_2r, .put = wm8350_put_volsw_2r_vu, \
+       .private_value = (unsigned long)&(struct soc_mixer_control) \
+               {.reg = reg_left, .rreg = reg_right, .shift = xshift, \
+                .rshift = xshift, .max = xmax, .invert = xinvert}, }
+
+static const char *wm8350_deemp[] = { "None", "32kHz", "44.1kHz", "48kHz" };
+static const char *wm8350_pol[] = { "Normal", "Inv R", "Inv L", "Inv L & R" };
+static const char *wm8350_dacmutem[] = { "Normal", "Soft" };
+static const char *wm8350_dacmutes[] = { "Fast", "Slow" };
+static const char *wm8350_dacfilter[] = { "Normal", "Sloping" };
+static const char *wm8350_adcfilter[] = { "None", "High Pass" };
+static const char *wm8350_adchp[] = { "44.1kHz", "8kHz", "16kHz", "32kHz" };
+static const char *wm8350_lr[] = { "Left", "Right" };
+
+static const struct soc_enum wm8350_enum[] = {
+       SOC_ENUM_SINGLE(WM8350_DAC_CONTROL, 4, 4, wm8350_deemp),
+       SOC_ENUM_SINGLE(WM8350_DAC_CONTROL, 0, 4, wm8350_pol),
+       SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 14, 2, wm8350_dacmutem),
+       SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 13, 2, wm8350_dacmutes),
+       SOC_ENUM_SINGLE(WM8350_DAC_MUTE_VOLUME, 12, 2, wm8350_dacfilter),
+       SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 15, 2, wm8350_adcfilter),
+       SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 8, 4, wm8350_adchp),
+       SOC_ENUM_SINGLE(WM8350_ADC_CONTROL, 0, 4, wm8350_pol),
+       SOC_ENUM_SINGLE(WM8350_INPUT_MIXER_VOLUME, 15, 2, wm8350_lr),
+};
+
+static DECLARE_TLV_DB_LINEAR(pre_amp_tlv, -1200, 3525);
+static DECLARE_TLV_DB_LINEAR(out_pga_tlv, -5700, 600);
+static DECLARE_TLV_DB_SCALE(dac_pcm_tlv, -7163, 36, 1);
+static DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -12700, 50, 1);
+static DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 1);
+
+static const unsigned int capture_sd_tlv[] = {
+       TLV_DB_RANGE_HEAD(2),
+       0, 12, TLV_DB_SCALE_ITEM(-3600, 300, 1),
+       13, 15, TLV_DB_SCALE_ITEM(0, 0, 0),
+};
+
+static const struct snd_kcontrol_new wm8350_snd_controls[] = {
+       SOC_ENUM("Playback Deemphasis", wm8350_enum[0]),
+       SOC_ENUM("Playback DAC Inversion", wm8350_enum[1]),
+       SOC_WM8350_DOUBLE_R_TLV("Playback PCM Volume",
+                               WM8350_DAC_DIGITAL_VOLUME_L,
+                               WM8350_DAC_DIGITAL_VOLUME_R,
+                               0, 255, 0, dac_pcm_tlv),
+       SOC_ENUM("Playback PCM Mute Function", wm8350_enum[2]),
+       SOC_ENUM("Playback PCM Mute Speed", wm8350_enum[3]),
+       SOC_ENUM("Playback PCM Filter", wm8350_enum[4]),
+       SOC_ENUM("Capture PCM Filter", wm8350_enum[5]),
+       SOC_ENUM("Capture PCM HP Filter", wm8350_enum[6]),
+       SOC_ENUM("Capture ADC Inversion", wm8350_enum[7]),
+       SOC_WM8350_DOUBLE_R_TLV("Capture PCM Volume",
+                               WM8350_ADC_DIGITAL_VOLUME_L,
+                               WM8350_ADC_DIGITAL_VOLUME_R,
+                               0, 255, 0, adc_pcm_tlv),
+       SOC_DOUBLE_TLV("Capture Sidetone Volume",
+                      WM8350_ADC_DIVIDER,
+                      8, 4, 15, 1, capture_sd_tlv),
+       SOC_WM8350_DOUBLE_R_TLV("Capture Volume",
+                               WM8350_LEFT_INPUT_VOLUME,
+                               WM8350_RIGHT_INPUT_VOLUME,
+                               2, 63, 0, pre_amp_tlv),
+       SOC_DOUBLE_R("Capture ZC Switch",
+                    WM8350_LEFT_INPUT_VOLUME,
+                    WM8350_RIGHT_INPUT_VOLUME, 13, 1, 0),
+       SOC_SINGLE_TLV("Left Input Left Sidetone Volume",
+                      WM8350_OUTPUT_LEFT_MIXER_VOLUME, 1, 7, 0, out_mix_tlv),
+       SOC_SINGLE_TLV("Left Input Right Sidetone Volume",
+                      WM8350_OUTPUT_LEFT_MIXER_VOLUME,
+                      5, 7, 0, out_mix_tlv),
+       SOC_SINGLE_TLV("Left Input Bypass Volume",
+                      WM8350_OUTPUT_LEFT_MIXER_VOLUME,
+                      9, 7, 0, out_mix_tlv),
+       SOC_SINGLE_TLV("Right Input Left Sidetone Volume",
+                      WM8350_OUTPUT_RIGHT_MIXER_VOLUME,
+                      1, 7, 0, out_mix_tlv),
+       SOC_SINGLE_TLV("Right Input Right Sidetone Volume",
+                      WM8350_OUTPUT_RIGHT_MIXER_VOLUME,
+                      5, 7, 0, out_mix_tlv),
+       SOC_SINGLE_TLV("Right Input Bypass Volume",
+                      WM8350_OUTPUT_RIGHT_MIXER_VOLUME,
+                      13, 7, 0, out_mix_tlv),
+       SOC_SINGLE("Left Input Mixer +20dB Switch",
+                  WM8350_INPUT_MIXER_VOLUME_L, 0, 1, 0),
+       SOC_SINGLE("Right Input Mixer +20dB Switch",
+                  WM8350_INPUT_MIXER_VOLUME_R, 0, 1, 0),
+       SOC_SINGLE_TLV("Out4 Capture Volume",
+                      WM8350_INPUT_MIXER_VOLUME,
+                      1, 7, 0, out_mix_tlv),
+       SOC_WM8350_DOUBLE_R_TLV("Out1 Playback Volume",
+                               WM8350_LOUT1_VOLUME,
+                               WM8350_ROUT1_VOLUME,
+                               2, 63, 0, out_pga_tlv),
+       SOC_DOUBLE_R("Out1 Playback ZC Switch",
+                    WM8350_LOUT1_VOLUME,
+                    WM8350_ROUT1_VOLUME, 13, 1, 0),
+       SOC_WM8350_DOUBLE_R_TLV("Out2 Playback Volume",
+                               WM8350_LOUT2_VOLUME,
+                               WM8350_ROUT2_VOLUME,
+                               2, 63, 0, out_pga_tlv),
+       SOC_DOUBLE_R("Out2 Playback ZC Switch", WM8350_LOUT2_VOLUME,
+                    WM8350_ROUT2_VOLUME, 13, 1, 0),
+       SOC_SINGLE("Out2 Right Invert Switch", WM8350_ROUT2_VOLUME, 10, 1, 0),
+       SOC_SINGLE_TLV("Out2 Beep Volume", WM8350_BEEP_VOLUME,
+                      5, 7, 0, out_mix_tlv),
+
+       SOC_DOUBLE_R("Out1 Playback Switch",
+                    WM8350_LOUT1_VOLUME,
+                    WM8350_ROUT1_VOLUME,
+                    14, 1, 1),
+       SOC_DOUBLE_R("Out2 Playback Switch",
+                    WM8350_LOUT2_VOLUME,
+                    WM8350_ROUT2_VOLUME,
+                    14, 1, 1),
+};
+
+/*
+ * DAPM Controls
+ */
+
+/* Left Playback Mixer */
+static const struct snd_kcontrol_new wm8350_left_play_mixer_controls[] = {
+       SOC_DAPM_SINGLE("Playback Switch",
+                       WM8350_LEFT_MIXER_CONTROL, 11, 1, 0),
+       SOC_DAPM_SINGLE("Left Bypass Switch",
+                       WM8350_LEFT_MIXER_CONTROL, 2, 1, 0),
+       SOC_DAPM_SINGLE("Right Playback Switch",
+                       WM8350_LEFT_MIXER_CONTROL, 12, 1, 0),
+       SOC_DAPM_SINGLE("Left Sidetone Switch",
+                       WM8350_LEFT_MIXER_CONTROL, 0, 1, 0),
+       SOC_DAPM_SINGLE("Right Sidetone Switch",
+                       WM8350_LEFT_MIXER_CONTROL, 1, 1, 0),
+};
+
+/* Right Playback Mixer */
+static const struct snd_kcontrol_new wm8350_right_play_mixer_controls[] = {
+       SOC_DAPM_SINGLE("Playback Switch",
+                       WM8350_RIGHT_MIXER_CONTROL, 12, 1, 0),
+       SOC_DAPM_SINGLE("Right Bypass Switch",
+                       WM8350_RIGHT_MIXER_CONTROL, 3, 1, 0),
+       SOC_DAPM_SINGLE("Left Playback Switch",
+                       WM8350_RIGHT_MIXER_CONTROL, 11, 1, 0),
+       SOC_DAPM_SINGLE("Left Sidetone Switch",
+                       WM8350_RIGHT_MIXER_CONTROL, 0, 1, 0),
+       SOC_DAPM_SINGLE("Right Sidetone Switch",
+                       WM8350_RIGHT_MIXER_CONTROL, 1, 1, 0),
+};
+
+/* Out4 Mixer */
+static const struct snd_kcontrol_new wm8350_out4_mixer_controls[] = {
+       SOC_DAPM_SINGLE("Right Playback Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 12, 1, 0),
+       SOC_DAPM_SINGLE("Left Playback Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 11, 1, 0),
+       SOC_DAPM_SINGLE("Right Capture Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 9, 1, 0),
+       SOC_DAPM_SINGLE("Out3 Playback Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 2, 1, 0),
+       SOC_DAPM_SINGLE("Right Mixer Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 1, 1, 0),
+       SOC_DAPM_SINGLE("Left Mixer Switch",
+                       WM8350_OUT4_MIXER_CONTROL, 0, 1, 0),
+};
+
+/* Out3 Mixer */
+static const struct snd_kcontrol_new wm8350_out3_mixer_controls[] = {
+       SOC_DAPM_SINGLE("Left Playback Switch",
+                       WM8350_OUT3_MIXER_CONTROL, 11, 1, 0),
+       SOC_DAPM_SINGLE("Left Capture Switch",
+                       WM8350_OUT3_MIXER_CONTROL, 8, 1, 0),
+       SOC_DAPM_SINGLE("Out4 Playback Switch",
+                       WM8350_OUT3_MIXER_CONTROL, 3, 1, 0),
+       SOC_DAPM_SINGLE("Left Mixer Switch",
+                       WM8350_OUT3_MIXER_CONTROL, 0, 1, 0),
+};
+
+/* Left Input Mixer */
+static const struct snd_kcontrol_new wm8350_left_capt_mixer_controls[] = {
+       SOC_DAPM_SINGLE_TLV("L2 Capture Volume",
+                           WM8350_INPUT_MIXER_VOLUME_L, 1, 7, 0, out_mix_tlv),
+       SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
+                           WM8350_INPUT_MIXER_VOLUME_L, 9, 7, 0, out_mix_tlv),
+       SOC_DAPM_SINGLE("PGA Capture Switch",
+                       WM8350_LEFT_INPUT_VOLUME, 14, 1, 0),
+};
+
+/* Right Input Mixer */
+static const struct snd_kcontrol_new wm8350_right_capt_mixer_controls[] = {
+       SOC_DAPM_SINGLE_TLV("L2 Capture Volume",
+                           WM8350_INPUT_MIXER_VOLUME_R, 5, 7, 0, out_mix_tlv),
+       SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
+                           WM8350_INPUT_MIXER_VOLUME_R, 13, 7, 0, out_mix_tlv),
+       SOC_DAPM_SINGLE("PGA Capture Switch",
+                       WM8350_RIGHT_INPUT_VOLUME, 14, 1, 0),
+};
+
+/* Left Mic Mixer */
+static const struct snd_kcontrol_new wm8350_left_mic_mixer_controls[] = {
+       SOC_DAPM_SINGLE("INN Capture Switch", WM8350_INPUT_CONTROL, 1, 1, 0),
+       SOC_DAPM_SINGLE("INP Capture Switch", WM8350_INPUT_CONTROL, 0, 1, 0),
+       SOC_DAPM_SINGLE("IN2 Capture Switch", WM8350_INPUT_CONTROL, 2, 1, 0),
+};
+
+/* Right Mic Mixer */
+static const struct snd_kcontrol_new wm8350_right_mic_mixer_controls[] = {
+       SOC_DAPM_SINGLE("INN Capture Switch", WM8350_INPUT_CONTROL, 9, 1, 0),
+       SOC_DAPM_SINGLE("INP Capture Switch", WM8350_INPUT_CONTROL, 8, 1, 0),
+       SOC_DAPM_SINGLE("IN2 Capture Switch", WM8350_INPUT_CONTROL, 10, 1, 0),
+};
+
+/* Beep Switch */
+static const struct snd_kcontrol_new wm8350_beep_switch_controls =
+SOC_DAPM_SINGLE("Switch", WM8350_BEEP_VOLUME, 15, 1, 1);
+
+/* Out4 Capture Mux */
+static const struct snd_kcontrol_new wm8350_out4_capture_controls =
+SOC_DAPM_ENUM("Route", wm8350_enum[8]);
+
+static const struct snd_soc_dapm_widget wm8350_dapm_widgets[] = {
+
+       SND_SOC_DAPM_PGA("IN3R PGA", WM8350_POWER_MGMT_2, 11, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("IN3L PGA", WM8350_POWER_MGMT_2, 10, 0, NULL, 0),
+       SND_SOC_DAPM_PGA_E("Right Out2 PGA", WM8350_POWER_MGMT_3, 3, 0, NULL,
+                          0, pga_event,
+                          SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+       SND_SOC_DAPM_PGA_E("Left Out2 PGA", WM8350_POWER_MGMT_3, 2, 0, NULL, 0,
+                          pga_event,
+                          SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+       SND_SOC_DAPM_PGA_E("Right Out1 PGA", WM8350_POWER_MGMT_3, 1, 0, NULL,
+                          0, pga_event,
+                          SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+       SND_SOC_DAPM_PGA_E("Left Out1 PGA", WM8350_POWER_MGMT_3, 0, 0, NULL, 0,
+                          pga_event,
+                          SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+
+       SND_SOC_DAPM_MIXER("Right Capture Mixer", WM8350_POWER_MGMT_2,
+                          7, 0, &wm8350_right_capt_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_right_capt_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Left Capture Mixer", WM8350_POWER_MGMT_2,
+                          6, 0, &wm8350_left_capt_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_left_capt_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Out4 Mixer", WM8350_POWER_MGMT_2, 5, 0,
+                          &wm8350_out4_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_out4_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Out3 Mixer", WM8350_POWER_MGMT_2, 4, 0,
+                          &wm8350_out3_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_out3_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Right Playback Mixer", WM8350_POWER_MGMT_2, 1, 0,
+                          &wm8350_right_play_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_right_play_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Left Playback Mixer", WM8350_POWER_MGMT_2, 0, 0,
+                          &wm8350_left_play_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_left_play_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Left Mic Mixer", WM8350_POWER_MGMT_2, 8, 0,
+                          &wm8350_left_mic_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_left_mic_mixer_controls)),
+
+       SND_SOC_DAPM_MIXER("Right Mic Mixer", WM8350_POWER_MGMT_2, 9, 0,
+                          &wm8350_right_mic_mixer_controls[0],
+                          ARRAY_SIZE(wm8350_right_mic_mixer_controls)),
+
+       /* virtual mixer for Beep and Out2R */
+       SND_SOC_DAPM_MIXER("Out2 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
+
+       SND_SOC_DAPM_SWITCH("Beep", WM8350_POWER_MGMT_3, 7, 0,
+                           &wm8350_beep_switch_controls),
+
+       SND_SOC_DAPM_ADC("Right ADC", "Right Capture",
+                        WM8350_POWER_MGMT_4, 3, 0),
+       SND_SOC_DAPM_ADC("Left ADC", "Left Capture",
+                        WM8350_POWER_MGMT_4, 2, 0),
+       SND_SOC_DAPM_DAC("Right DAC", "Right Playback",
+                        WM8350_POWER_MGMT_4, 5, 0),
+       SND_SOC_DAPM_DAC("Left DAC", "Left Playback",
+                        WM8350_POWER_MGMT_4, 4, 0),
+
+       SND_SOC_DAPM_MICBIAS("Mic Bias", WM8350_POWER_MGMT_1, 4, 0),
+
+       SND_SOC_DAPM_MUX("Out4 Capture Channel", SND_SOC_NOPM, 0, 0,
+                        &wm8350_out4_capture_controls),
+
+       SND_SOC_DAPM_OUTPUT("OUT1R"),
+       SND_SOC_DAPM_OUTPUT("OUT1L"),
+       SND_SOC_DAPM_OUTPUT("OUT2R"),
+       SND_SOC_DAPM_OUTPUT("OUT2L"),
+       SND_SOC_DAPM_OUTPUT("OUT3"),
+       SND_SOC_DAPM_OUTPUT("OUT4"),
+
+       SND_SOC_DAPM_INPUT("IN1RN"),
+       SND_SOC_DAPM_INPUT("IN1RP"),
+       SND_SOC_DAPM_INPUT("IN2R"),
+       SND_SOC_DAPM_INPUT("IN1LP"),
+       SND_SOC_DAPM_INPUT("IN1LN"),
+       SND_SOC_DAPM_INPUT("IN2L"),
+       SND_SOC_DAPM_INPUT("IN3R"),
+       SND_SOC_DAPM_INPUT("IN3L"),
+};
+
+static const struct snd_soc_dapm_route audio_map[] = {
+
+       /* left playback mixer */
+       {"Left Playback Mixer", "Playback Switch", "Left DAC"},
+       {"Left Playback Mixer", "Left Bypass Switch", "IN3L PGA"},
+       {"Left Playback Mixer", "Right Playback Switch", "Right DAC"},
+       {"Left Playback Mixer", "Left Sidetone Switch", "Left Mic Mixer"},
+       {"Left Playback Mixer", "Right Sidetone Switch", "Right Mic Mixer"},
+
+       /* right playback mixer */
+       {"Right Playback Mixer", "Playback Switch", "Right DAC"},
+       {"Right Playback Mixer", "Right Bypass Switch", "IN3R PGA"},
+       {"Right Playback Mixer", "Left Playback Switch", "Left DAC"},
+       {"Right Playback Mixer", "Left Sidetone Switch", "Left Mic Mixer"},
+       {"Right Playback Mixer", "Right Sidetone Switch", "Right Mic Mixer"},
+
+       /* out4 playback mixer */
+       {"Out4 Mixer", "Right Playback Switch", "Right DAC"},
+       {"Out4 Mixer", "Left Playback Switch", "Left DAC"},
+       {"Out4 Mixer", "Right Capture Switch", "Right Capture Mixer"},
+       {"Out4 Mixer", "Out3 Playback Switch", "Out3 Mixer"},
+       {"Out4 Mixer", "Right Mixer Switch", "Right Playback Mixer"},
+       {"Out4 Mixer", "Left Mixer Switch", "Left Playback Mixer"},
+       {"OUT4", NULL, "Out4 Mixer"},
+
+       /* out3 playback mixer */
+       {"Out3 Mixer", "Left Playback Switch", "Left DAC"},
+       {"Out3 Mixer", "Left Capture Switch", "Left Capture Mixer"},
+       {"Out3 Mixer", "Left Mixer Switch", "Left Playback Mixer"},
+       {"Out3 Mixer", "Out4 Playback Switch", "Out4 Mixer"},
+       {"OUT3", NULL, "Out3 Mixer"},
+
+       /* out2 */
+       {"Right Out2 PGA", NULL, "Right Playback Mixer"},
+       {"Left Out2 PGA", NULL, "Left Playback Mixer"},
+       {"OUT2L", NULL, "Left Out2 PGA"},
+       {"OUT2R", NULL, "Right Out2 PGA"},
+
+       /* out1 */
+       {"Right Out1 PGA", NULL, "Right Playback Mixer"},
+       {"Left Out1 PGA", NULL, "Left Playback Mixer"},
+       {"OUT1L", NULL, "Left Out1 PGA"},
+       {"OUT1R", NULL, "Right Out1 PGA"},
+
+       /* ADCs */
+       {"Left ADC", NULL, "Left Capture Mixer"},
+       {"Right ADC", NULL, "Right Capture Mixer"},
+
+       /* Left capture mixer */
+       {"Left Capture Mixer", "L2 Capture Volume", "IN2L"},
+       {"Left Capture Mixer", "L3 Capture Volume", "IN3L PGA"},
+       {"Left Capture Mixer", "PGA Capture Switch", "Left Mic Mixer"},
+       {"Left Capture Mixer", NULL, "Out4 Capture Channel"},
+
+       /* Right capture mixer */
+       {"Right Capture Mixer", "L2 Capture Volume", "IN2R"},
+       {"Right Capture Mixer", "L3 Capture Volume", "IN3R PGA"},
+       {"Right Capture Mixer", "PGA Capture Switch", "Right Mic Mixer"},
+       {"Right Capture Mixer", NULL, "Out4 Capture Channel"},
+
+       /* L3 Inputs */
+       {"IN3L PGA", NULL, "IN3L"},
+       {"IN3R PGA", NULL, "IN3R"},
+
+       /* Left Mic mixer */
+       {"Left Mic Mixer", "INN Capture Switch", "IN1LN"},
+       {"Left Mic Mixer", "INP Capture Switch", "IN1LP"},
+       {"Left Mic Mixer", "IN2 Capture Switch", "IN2L"},
+
+       /* Right Mic mixer */
+       {"Right Mic Mixer", "INN Capture Switch", "IN1RN"},
+       {"Right Mic Mixer", "INP Capture Switch", "IN1RP"},
+       {"Right Mic Mixer", "IN2 Capture Switch", "IN2R"},
+
+       /* out 4 capture */
+       {"Out4 Capture Channel", NULL, "Out4 Mixer"},
+
+       /* Beep */
+       {"Beep", NULL, "IN3R PGA"},
+};
+
+static int wm8350_add_controls(struct snd_soc_codec *codec)
+{
+       int err, i;
+
+       for (i = 0; i < ARRAY_SIZE(wm8350_snd_controls); i++) {
+               err = snd_ctl_add(codec->card,
+                                 snd_soc_cnew(&wm8350_snd_controls[i],
+                                              codec, NULL));
+               if (err < 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+static int wm8350_add_widgets(struct snd_soc_codec *codec)
+{
+       int ret;
+
+       ret = snd_soc_dapm_new_controls(codec,
+                                       wm8350_dapm_widgets,
+                                       ARRAY_SIZE(wm8350_dapm_widgets));
+       if (ret != 0) {
+               dev_err(codec->dev, "dapm control register failed\n");
+               return ret;
+       }
+
+       /* set up audio paths */
+       ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+       if (ret != 0) {
+               dev_err(codec->dev, "DAPM route register failed\n");
+               return ret;
+       }
+
+       return snd_soc_dapm_new_widgets(codec);
+}
+
+static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+                                int clk_id, unsigned int freq, int dir)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       struct wm8350 *wm8350 = codec->control_data;
+       u16 fll_4;
+
+       switch (clk_id) {
+       case WM8350_MCLK_SEL_MCLK:
+               wm8350_clear_bits(wm8350, WM8350_CLOCK_CONTROL_1,
+                                 WM8350_MCLK_SEL);
+               break;
+       case WM8350_MCLK_SEL_PLL_MCLK:
+       case WM8350_MCLK_SEL_PLL_DAC:
+       case WM8350_MCLK_SEL_PLL_ADC:
+       case WM8350_MCLK_SEL_PLL_32K:
+               wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_1,
+                               WM8350_MCLK_SEL);
+               fll_4 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_4) &
+                   ~WM8350_FLL_CLK_SRC_MASK;
+               wm8350_codec_write(codec, WM8350_FLL_CONTROL_4, fll_4 | clk_id);
+               break;
+       }
+
+       /* MCLK direction */
+       if (dir == WM8350_MCLK_DIR_OUT)
+               wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2,
+                               WM8350_MCLK_DIR);
+       else
+               wm8350_clear_bits(wm8350, WM8350_CLOCK_CONTROL_2,
+                                 WM8350_MCLK_DIR);
+
+       return 0;
+}
+
+static int wm8350_set_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u16 val;
+
+       switch (div_id) {
+       case WM8350_ADC_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_ADC_DIVIDER) &
+                   ~WM8350_ADC_CLKDIV_MASK;
+               wm8350_codec_write(codec, WM8350_ADC_DIVIDER, val | div);
+               break;
+       case WM8350_DAC_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_DAC_CLOCK_CONTROL) &
+                   ~WM8350_DAC_CLKDIV_MASK;
+               wm8350_codec_write(codec, WM8350_DAC_CLOCK_CONTROL, val | div);
+               break;
+       case WM8350_BCLK_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) &
+                   ~WM8350_BCLK_DIV_MASK;
+               wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div);
+               break;
+       case WM8350_OPCLK_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) &
+                   ~WM8350_OPCLK_DIV_MASK;
+               wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div);
+               break;
+       case WM8350_SYS_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) &
+                   ~WM8350_MCLK_DIV_MASK;
+               wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div);
+               break;
+       case WM8350_DACLR_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_DAC_LR_RATE) &
+                   ~WM8350_DACLRC_RATE_MASK;
+               wm8350_codec_write(codec, WM8350_DAC_LR_RATE, val | div);
+               break;
+       case WM8350_ADCLR_CLKDIV:
+               val = wm8350_codec_read(codec, WM8350_ADC_LR_RATE) &
+                   ~WM8350_ADCLRC_RATE_MASK;
+               wm8350_codec_write(codec, WM8350_ADC_LR_RATE, val | div);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u16 iface = wm8350_codec_read(codec, WM8350_AI_FORMATING) &
+           ~(WM8350_AIF_BCLK_INV | WM8350_AIF_LRCLK_INV | WM8350_AIF_FMT_MASK);
+       u16 master = wm8350_codec_read(codec, WM8350_AI_DAC_CONTROL) &
+           ~WM8350_BCLK_MSTR;
+       u16 dac_lrc = wm8350_codec_read(codec, WM8350_DAC_LR_RATE) &
+           ~WM8350_DACLRC_ENA;
+       u16 adc_lrc = wm8350_codec_read(codec, WM8350_ADC_LR_RATE) &
+           ~WM8350_ADCLRC_ENA;
+
+       /* set master/slave audio interface */
+       switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+       case SND_SOC_DAIFMT_CBM_CFM:
+               master |= WM8350_BCLK_MSTR;
+               dac_lrc |= WM8350_DACLRC_ENA;
+               adc_lrc |= WM8350_ADCLRC_ENA;
+               break;
+       case SND_SOC_DAIFMT_CBS_CFS:
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* interface format */
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               iface |= 0x2 << 8;
+               break;
+       case SND_SOC_DAIFMT_RIGHT_J:
+               break;
+       case SND_SOC_DAIFMT_LEFT_J:
+               iface |= 0x1 << 8;
+               break;
+       case SND_SOC_DAIFMT_DSP_A:
+               iface |= 0x3 << 8;
+               break;
+       case SND_SOC_DAIFMT_DSP_B:
+               iface |= 0x3 << 8;      /* lg not sure which mode */
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* clock inversion */
+       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+       case SND_SOC_DAIFMT_NB_NF:
+               break;
+       case SND_SOC_DAIFMT_IB_IF:
+               iface |= WM8350_AIF_LRCLK_INV | WM8350_AIF_BCLK_INV;
+               break;
+       case SND_SOC_DAIFMT_IB_NF:
+               iface |= WM8350_AIF_BCLK_INV;
+               break;
+       case SND_SOC_DAIFMT_NB_IF:
+               iface |= WM8350_AIF_LRCLK_INV;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       wm8350_codec_write(codec, WM8350_AI_FORMATING, iface);
+       wm8350_codec_write(codec, WM8350_AI_DAC_CONTROL, master);
+       wm8350_codec_write(codec, WM8350_DAC_LR_RATE, dac_lrc);
+       wm8350_codec_write(codec, WM8350_ADC_LR_RATE, adc_lrc);
+       return 0;
+}
+
+static int wm8350_pcm_trigger(struct snd_pcm_substream *substream,
+                             int cmd, struct snd_soc_dai *codec_dai)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       int master = wm8350_codec_cache_read(codec, WM8350_AI_DAC_CONTROL) &
+           WM8350_BCLK_MSTR;
+       int enabled = 0;
+
+       /* Check that the DACs or ADCs are enabled since they are
+        * required for LRC in master mode. The DACs or ADCs need a
+        * valid audio path i.e. pin -> ADC or DAC -> pin before
+        * the LRC will be enabled in master mode. */
+       if (!master && cmd != SNDRV_PCM_TRIGGER_START)
+               return 0;
+
+       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+               enabled = wm8350_codec_cache_read(codec, WM8350_POWER_MGMT_4) &
+                   (WM8350_ADCR_ENA | WM8350_ADCL_ENA);
+       } else {
+               enabled = wm8350_codec_cache_read(codec, WM8350_POWER_MGMT_4) &
+                   (WM8350_DACR_ENA | WM8350_DACL_ENA);
+       }
+
+       if (!enabled) {
+               dev_err(codec->dev,
+                      "%s: invalid audio path - no clocks available\n",
+                      __func__);
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream,
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *codec_dai)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u16 iface = wm8350_codec_read(codec, WM8350_AI_FORMATING) &
+           ~WM8350_AIF_WL_MASK;
+
+       /* bit size */
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S16_LE:
+               break;
+       case SNDRV_PCM_FORMAT_S20_3LE:
+               iface |= 0x1 << 10;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+               iface |= 0x2 << 10;
+               break;
+       case SNDRV_PCM_FORMAT_S32_LE:
+               iface |= 0x3 << 10;
+               break;
+       }
+
+       wm8350_codec_write(codec, WM8350_AI_FORMATING, iface);
+       return 0;
+}
+
+static int wm8350_mute(struct snd_soc_dai *dai, int mute)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       struct wm8350 *wm8350 = codec->control_data;
+
+       if (mute)
+               wm8350_set_bits(wm8350, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA);
+       else
+               wm8350_clear_bits(wm8350, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA);
+       return 0;
+}
+
+/* FLL divisors */
+struct _fll_div {
+       int div;                /* FLL_OUTDIV */
+       int n;
+       int k;
+       int ratio;              /* FLL_FRATIO */
+};
+
+/* The size in bits of the fll divide multiplied by 10
+ * to allow rounding later */
+#define FIXED_FLL_SIZE ((1 << 16) * 10)
+
+static inline int fll_factors(struct _fll_div *fll_div, unsigned int input,
+                             unsigned int output)
+{
+       u64 Kpart;
+       unsigned int t1, t2, K, Nmod;
+
+       if (output >= 2815250 && output <= 3125000)
+               fll_div->div = 0x4;
+       else if (output >= 5625000 && output <= 6250000)
+               fll_div->div = 0x3;
+       else if (output >= 11250000 && output <= 12500000)
+               fll_div->div = 0x2;
+       else if (output >= 22500000 && output <= 25000000)
+               fll_div->div = 0x1;
+       else {
+               printk(KERN_ERR "wm8350: fll freq %d out of range\n", output);
+               return -EINVAL;
+       }
+
+       if (input > 48000)
+               fll_div->ratio = 1;
+       else
+               fll_div->ratio = 8;
+
+       t1 = output * (1 << (fll_div->div + 1));
+       t2 = input * fll_div->ratio;
+
+       fll_div->n = t1 / t2;
+       Nmod = t1 % t2;
+
+       if (Nmod) {
+               Kpart = FIXED_FLL_SIZE * (long long)Nmod;
+               do_div(Kpart, t2);
+               K = Kpart & 0xFFFFFFFF;
+
+               /* Check if we need to round */
+               if ((K % 10) >= 5)
+                       K += 5;
+
+               /* Move down to proper range now rounding is done */
+               K /= 10;
+               fll_div->k = K;
+       } else
+               fll_div->k = 0;
+
+       return 0;
+}
+
+static int wm8350_set_fll(struct snd_soc_dai *codec_dai,
+                         int pll_id, unsigned int freq_in,
+                         unsigned int freq_out)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       struct wm8350 *wm8350 = codec->control_data;
+       struct _fll_div fll_div;
+       int ret = 0;
+       u16 fll_1, fll_4;
+
+       /* power down FLL - we need to do this for reconfiguration */
+       wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_4,
+                         WM8350_FLL_ENA | WM8350_FLL_OSC_ENA);
+
+       if (freq_out == 0 || freq_in == 0)
+               return ret;
+
+       ret = fll_factors(&fll_div, freq_in, freq_out);
+       if (ret < 0)
+               return ret;
+       dev_dbg(wm8350->dev,
+               "FLL in %d FLL out %d N 0x%x K 0x%x div %d ratio %d",
+               freq_in, freq_out, fll_div.n, fll_div.k, fll_div.div,
+               fll_div.ratio);
+
+       /* set up N.K & dividers */
+       fll_1 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_1) &
+           ~(WM8350_FLL_OUTDIV_MASK | WM8350_FLL_RSP_RATE_MASK | 0xc000);
+       wm8350_codec_write(codec, WM8350_FLL_CONTROL_1,
+                          fll_1 | (fll_div.div << 8) | 0x50);
+       wm8350_codec_write(codec, WM8350_FLL_CONTROL_2,
+                          (fll_div.ratio << 11) | (fll_div.
+                                                   n & WM8350_FLL_N_MASK));
+       wm8350_codec_write(codec, WM8350_FLL_CONTROL_3, fll_div.k);
+       fll_4 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_4) &
+           ~(WM8350_FLL_FRAC | WM8350_FLL_SLOW_LOCK_REF);
+       wm8350_codec_write(codec, WM8350_FLL_CONTROL_4,
+                          fll_4 | (fll_div.k ? WM8350_FLL_FRAC : 0) |
+                          (fll_div.ratio == 8 ? WM8350_FLL_SLOW_LOCK_REF : 0));
+
+       /* power FLL on */
+       wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_FLL_OSC_ENA);
+       wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4, WM8350_FLL_ENA);
+
+       return 0;
+}
+
+static int wm8350_set_bias_level(struct snd_soc_codec *codec,
+                                enum snd_soc_bias_level level)
+{
+       struct wm8350 *wm8350 = codec->control_data;
+       struct wm8350_data *priv = codec->private_data;
+       struct wm8350_audio_platform_data *platform =
+               wm8350->codec.platform_data;
+       u16 pm1;
+       int ret;
+
+       switch (level) {
+       case SND_SOC_BIAS_ON:
+               pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1) &
+                   ~(WM8350_VMID_MASK | WM8350_CODEC_ISEL_MASK);
+               wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                pm1 | WM8350_VMID_50K |
+                                platform->codec_current_on << 14);
+               break;
+
+       case SND_SOC_BIAS_PREPARE:
+               pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1);
+               pm1 &= ~WM8350_VMID_MASK;
+               wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                pm1 | WM8350_VMID_50K);
+               break;
+
+       case SND_SOC_BIAS_STANDBY:
+               if (codec->bias_level == SND_SOC_BIAS_OFF) {
+                       ret = regulator_bulk_enable(ARRAY_SIZE(priv->supplies),
+                                                   priv->supplies);
+                       if (ret != 0)
+                               return ret;
+
+                       /* Enable the system clock */
+                       wm8350_set_bits(wm8350, WM8350_POWER_MGMT_4,
+                                       WM8350_SYSCLK_ENA);
+
+                       /* mute DAC & outputs */
+                       wm8350_set_bits(wm8350, WM8350_DAC_MUTE,
+                                       WM8350_DAC_MUTE_ENA);
+
+                       /* discharge cap memory */
+                       wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL,
+                                        platform->dis_out1 |
+                                        (platform->dis_out2 << 2) |
+                                        (platform->dis_out3 << 4) |
+                                        (platform->dis_out4 << 6));
+
+                       /* wait for discharge */
+                       schedule_timeout_interruptible(msecs_to_jiffies
+                                                      (platform->
+                                                       cap_discharge_msecs));
+
+                       /* enable antipop */
+                       wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL,
+                                        (platform->vmid_s_curve << 8));
+
+                       /* ramp up vmid */
+                       wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                        (platform->
+                                         codec_current_charge << 14) |
+                                        WM8350_VMID_5K | WM8350_VMIDEN |
+                                        WM8350_VBUFEN);
+
+                       /* wait for vmid */
+                       schedule_timeout_interruptible(msecs_to_jiffies
+                                                      (platform->
+                                                       vmid_charge_msecs));
+
+                       /* turn on vmid 300k  */
+                       pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1) &
+                           ~(WM8350_VMID_MASK | WM8350_CODEC_ISEL_MASK);
+                       pm1 |= WM8350_VMID_300K |
+                               (platform->codec_current_standby << 14);
+                       wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                        pm1);
+
+
+                       /* enable analogue bias */
+                       pm1 |= WM8350_BIASEN;
+                       wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1, pm1);
+
+                       /* disable antipop */
+                       wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL, 0);
+
+               } else {
+                       /* turn on vmid 300k and reduce current */
+                       pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1) &
+                           ~(WM8350_VMID_MASK | WM8350_CODEC_ISEL_MASK);
+                       wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                        pm1 | WM8350_VMID_300K |
+                                        (platform->
+                                         codec_current_standby << 14));
+
+               }
+               break;
+
+       case SND_SOC_BIAS_OFF:
+
+               /* mute DAC & enable outputs */
+               wm8350_set_bits(wm8350, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA);
+
+               wm8350_set_bits(wm8350, WM8350_POWER_MGMT_3,
+                               WM8350_OUT1L_ENA | WM8350_OUT1R_ENA |
+                               WM8350_OUT2L_ENA | WM8350_OUT2R_ENA);
+
+               /* enable anti pop S curve */
+               wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL,
+                                (platform->vmid_s_curve << 8));
+
+               /* turn off vmid  */
+               pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1) &
+                   ~WM8350_VMIDEN;
+               wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1, pm1);
+
+               /* wait */
+               schedule_timeout_interruptible(msecs_to_jiffies
+                                              (platform->
+                                               vmid_discharge_msecs));
+
+               wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL,
+                                (platform->vmid_s_curve << 8) |
+                                platform->dis_out1 |
+                                (platform->dis_out2 << 2) |
+                                (platform->dis_out3 << 4) |
+                                (platform->dis_out4 << 6));
+
+               /* turn off VBuf and drain */
+               pm1 = wm8350_reg_read(wm8350, WM8350_POWER_MGMT_1) &
+                   ~(WM8350_VBUFEN | WM8350_VMID_MASK);
+               wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1,
+                                pm1 | WM8350_OUTPUT_DRAIN_EN);
+
+               /* wait */
+               schedule_timeout_interruptible(msecs_to_jiffies
+                                              (platform->drain_msecs));
+
+               pm1 &= ~WM8350_BIASEN;
+               wm8350_reg_write(wm8350, WM8350_POWER_MGMT_1, pm1);
+
+               /* disable anti-pop */
+               wm8350_reg_write(wm8350, WM8350_ANTI_POP_CONTROL, 0);
+
+               wm8350_clear_bits(wm8350, WM8350_LOUT1_VOLUME,
+                                 WM8350_OUT1L_ENA);
+               wm8350_clear_bits(wm8350, WM8350_ROUT1_VOLUME,
+                                 WM8350_OUT1R_ENA);
+               wm8350_clear_bits(wm8350, WM8350_LOUT2_VOLUME,
+                                 WM8350_OUT2L_ENA);
+               wm8350_clear_bits(wm8350, WM8350_ROUT2_VOLUME,
+                                 WM8350_OUT2R_ENA);
+
+               /* disable clock gen */
+               wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_4,
+                                 WM8350_SYSCLK_ENA);
+
+               regulator_bulk_disable(ARRAY_SIZE(priv->supplies),
+                                      priv->supplies);
+               break;
+       }
+       codec->bias_level = level;
+       return 0;
+}
+
+static int wm8350_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF);
+       return 0;
+}
+
+static int wm8350_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+       if (codec->suspend_bias_level == SND_SOC_BIAS_ON)
+               wm8350_set_bias_level(codec, SND_SOC_BIAS_ON);
+
+       return 0;
+}
+
+static struct snd_soc_codec *wm8350_codec;
+
+static int wm8350_probe(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec;
+       struct wm8350 *wm8350;
+       struct wm8350_data *priv;
+       int ret;
+       struct wm8350_output *out1;
+       struct wm8350_output *out2;
+
+       BUG_ON(!wm8350_codec);
+
+       socdev->codec = wm8350_codec;
+       codec = socdev->codec;
+       wm8350 = codec->control_data;
+       priv = codec->private_data;
+
+       /* Enable the codec */
+       wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
+
+       /* Enable robust clocking mode in ADC */
+       wm8350_codec_write(codec, WM8350_SECURITY, 0xa7);
+       wm8350_codec_write(codec, 0xde, 0x13);
+       wm8350_codec_write(codec, WM8350_SECURITY, 0);
+
+       /* read OUT1 & OUT2 volumes */
+       out1 = &priv->out1;
+       out2 = &priv->out2;
+       out1->left_vol = (wm8350_reg_read(wm8350, WM8350_LOUT1_VOLUME) &
+                         WM8350_OUT1L_VOL_MASK) >> WM8350_OUT1L_VOL_SHIFT;
+       out1->right_vol = (wm8350_reg_read(wm8350, WM8350_ROUT1_VOLUME) &
+                          WM8350_OUT1R_VOL_MASK) >> WM8350_OUT1R_VOL_SHIFT;
+       out2->left_vol = (wm8350_reg_read(wm8350, WM8350_LOUT2_VOLUME) &
+                         WM8350_OUT2L_VOL_MASK) >> WM8350_OUT1L_VOL_SHIFT;
+       out2->right_vol = (wm8350_reg_read(wm8350, WM8350_ROUT2_VOLUME) &
+                          WM8350_OUT2R_VOL_MASK) >> WM8350_OUT1R_VOL_SHIFT;
+       wm8350_reg_write(wm8350, WM8350_LOUT1_VOLUME, 0);
+       wm8350_reg_write(wm8350, WM8350_ROUT1_VOLUME, 0);
+       wm8350_reg_write(wm8350, WM8350_LOUT2_VOLUME, 0);
+       wm8350_reg_write(wm8350, WM8350_ROUT2_VOLUME, 0);
+
+       /* Latch VU bits & mute */
+       wm8350_set_bits(wm8350, WM8350_LOUT1_VOLUME,
+                       WM8350_OUT1_VU | WM8350_OUT1L_MUTE);
+       wm8350_set_bits(wm8350, WM8350_LOUT2_VOLUME,
+                       WM8350_OUT2_VU | WM8350_OUT2L_MUTE);
+       wm8350_set_bits(wm8350, WM8350_ROUT1_VOLUME,
+                       WM8350_OUT1_VU | WM8350_OUT1R_MUTE);
+       wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME,
+                       WM8350_OUT2_VU | WM8350_OUT2R_MUTE);
+
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to create pcms\n");
+               return ret;
+       }
+
+       wm8350_add_controls(codec);
+       wm8350_add_widgets(codec);
+
+       wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to register card\n");
+               goto card_err;
+       }
+
+       return 0;
+
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+       return ret;
+}
+
+static int wm8350_remove(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+       struct wm8350 *wm8350 = codec->control_data;
+       int ret;
+
+       /* cancel any work waiting to be queued. */
+       ret = cancel_delayed_work(&codec->delayed_work);
+
+       /* if there was any work waiting then we run it now and
+        * wait for its completion */
+       if (ret) {
+               schedule_delayed_work(&codec->delayed_work, 0);
+               flush_scheduled_work();
+       }
+
+       wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+       wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
+
+       return 0;
+}
+
+#define WM8350_RATES (SNDRV_PCM_RATE_8000_96000)
+
+#define WM8350_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
+                       SNDRV_PCM_FMTBIT_S20_3LE |\
+                       SNDRV_PCM_FMTBIT_S24_LE)
+
+struct snd_soc_dai wm8350_dai = {
+       .name = "WM8350",
+       .playback = {
+               .stream_name = "Playback",
+               .channels_min = 1,
+               .channels_max = 2,
+               .rates = WM8350_RATES,
+               .formats = WM8350_FORMATS,
+       },
+       .capture = {
+                .stream_name = "Capture",
+                .channels_min = 1,
+                .channels_max = 2,
+                .rates = WM8350_RATES,
+                .formats = WM8350_FORMATS,
+        },
+       .ops = {
+                .hw_params = wm8350_pcm_hw_params,
+                .digital_mute = wm8350_mute,
+                .trigger = wm8350_pcm_trigger,
+                .set_fmt = wm8350_set_dai_fmt,
+                .set_sysclk = wm8350_set_dai_sysclk,
+                .set_pll = wm8350_set_fll,
+                .set_clkdiv = wm8350_set_clkdiv,
+        },
+};
+EXPORT_SYMBOL_GPL(wm8350_dai);
+
+struct snd_soc_codec_device soc_codec_dev_wm8350 = {
+       .probe =        wm8350_probe,
+       .remove =       wm8350_remove,
+       .suspend =      wm8350_suspend,
+       .resume =       wm8350_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_wm8350);
+
+static int wm8350_codec_probe(struct platform_device *pdev)
+{
+       struct wm8350 *wm8350 = platform_get_drvdata(pdev);
+       struct wm8350_data *priv;
+       struct snd_soc_codec *codec;
+       int ret, i;
+
+       if (wm8350->codec.platform_data == NULL) {
+               dev_err(&pdev->dev, "No audio platform data supplied\n");
+               return -EINVAL;
+       }
+
+       priv = kzalloc(sizeof(struct wm8350_data), GFP_KERNEL);
+       if (priv == NULL)
+               return -ENOMEM;
+
+       for (i = 0; i < ARRAY_SIZE(supply_names); i++)
+               priv->supplies[i].supply = supply_names[i];
+
+       ret = regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies),
+                                priv->supplies);
+       if (ret != 0)
+               goto err_priv;
+
+       codec = &priv->codec;
+       wm8350->codec.codec = codec;
+
+       wm8350_dai.dev = &pdev->dev;
+
+       mutex_init(&codec->mutex);
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+       codec->dev = &pdev->dev;
+       codec->name = "WM8350";
+       codec->owner = THIS_MODULE;
+       codec->read = wm8350_codec_read;
+       codec->write = wm8350_codec_write;
+       codec->bias_level = SND_SOC_BIAS_OFF;
+       codec->set_bias_level = wm8350_set_bias_level;
+       codec->dai = &wm8350_dai;
+       codec->num_dai = 1;
+       codec->reg_cache_size = WM8350_MAX_REGISTER;
+       codec->private_data = priv;
+       codec->control_data = wm8350;
+
+       /* Put the codec into reset if it wasn't already */
+       wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
+
+       INIT_DELAYED_WORK(&codec->delayed_work, wm8350_pga_work);
+       ret = snd_soc_register_codec(codec);
+       if (ret != 0)
+               goto err_supply;
+
+       wm8350_codec = codec;
+
+       ret = snd_soc_register_dai(&wm8350_dai);
+       if (ret != 0)
+               goto err_codec;
+       return 0;
+
+err_codec:
+       snd_soc_unregister_codec(codec);
+err_supply:
+       regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies);
+err_priv:
+       kfree(priv);
+       wm8350_codec = NULL;
+       return ret;
+}
+
+static int __devexit wm8350_codec_remove(struct platform_device *pdev)
+{
+       struct wm8350 *wm8350 = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = wm8350->codec.codec;
+       struct wm8350_data *priv = codec->private_data;
+
+       snd_soc_unregister_dai(&wm8350_dai);
+       snd_soc_unregister_codec(codec);
+       regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies);
+       kfree(priv);
+       wm8350_codec = NULL;
+       return 0;
+}
+
+static struct platform_driver wm8350_codec_driver = {
+       .driver = {
+                  .name = "wm8350-codec",
+                  .owner = THIS_MODULE,
+                  },
+       .probe = wm8350_codec_probe,
+       .remove = __devexit_p(wm8350_codec_remove),
+};
+
+static __init int wm8350_init(void)
+{
+       return platform_driver_register(&wm8350_codec_driver);
+}
+module_init(wm8350_init);
+
+static __exit void wm8350_exit(void)
+{
+       platform_driver_unregister(&wm8350_codec_driver);
+}
+module_exit(wm8350_exit);
+
+MODULE_DESCRIPTION("ASoC WM8350 driver");
+MODULE_AUTHOR("Liam Girdwood");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:wm8350-codec");
diff --git a/sound/soc/codecs/wm8350.h b/sound/soc/codecs/wm8350.h
new file mode 100644 (file)
index 0000000..cc2887a
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * wm8350.h - WM8903 audio codec interface
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef _WM8350_H
+#define _WM8350_H
+
+#include <sound/soc.h>
+
+extern struct snd_soc_dai wm8350_dai;
+extern struct snd_soc_codec_device soc_codec_dev_wm8350;
+
+#endif
index d8ca2da8d634e5e2a827339f3f3939d196d89941..40f8238df7174d65b6c306fbd23e51d505a85d1c 100644 (file)
@@ -463,7 +463,8 @@ static int wm8510_set_dai_fmt(struct snd_soc_dai *codec_dai,
 }
 
 static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -585,8 +586,6 @@ struct snd_soc_dai wm8510_dai = {
                .formats = WM8510_FORMATS,},
        .ops = {
                .hw_params = wm8510_pcm_hw_params,
-       },
-       .dai_ops = {
                .digital_mute = wm8510_mute,
                .set_fmt = wm8510_set_dai_fmt,
                .set_clkdiv = wm8510_set_dai_clkdiv,
@@ -659,7 +658,7 @@ static int wm8510_init(struct snd_soc_device *socdev)
        wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
        wm8510_add_controls(codec);
        wm8510_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8510: failed to register card\n");
                goto card_err;
@@ -890,6 +889,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8510 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8510);
 
+static int __init wm8510_modinit(void)
+{
+       return snd_soc_register_dai(&wm8510_dai);
+}
+module_init(wm8510_modinit);
+
+static void __exit wm8510_exit(void)
+{
+       snd_soc_unregister_dai(&wm8510_dai);
+}
+module_exit(wm8510_exit);
+
 MODULE_DESCRIPTION("ASoC WM8510 driver");
 MODULE_AUTHOR("Liam Girdwood");
 MODULE_LICENSE("GPL");
index 627ebfb4209b72b786ad66f992b0659491f8f74d..d004e5845298d2b8e6f4871629b75c78702e8724 100644 (file)
@@ -548,13 +548,13 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai,
  * Set PCM DAI bit size and sample rate.
  */
 static int wm8580_paif_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_dai_link *dai = rtd->dai;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_codec *codec = socdev->codec;
-       u16 paifb = wm8580_read(codec, WM8580_PAIF3 + dai->codec_dai->id);
+       u16 paifb = wm8580_read(codec, WM8580_PAIF3 + dai->id);
 
        paifb &= ~WM8580_AIF_LENGTH_MASK;
        /* bit size */
@@ -574,7 +574,7 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       wm8580_write(codec, WM8580_PAIF3 + dai->codec_dai->id, paifb);
+       wm8580_write(codec, WM8580_PAIF3 + dai->id, paifb);
        return 0;
 }
 
@@ -798,8 +798,6 @@ struct snd_soc_dai wm8580_dai[] = {
                },
                .ops = {
                         .hw_params = wm8580_paif_hw_params,
-                },
-               .dai_ops = {
                         .set_fmt = wm8580_set_paif_dai_fmt,
                         .set_clkdiv = wm8580_set_dai_clkdiv,
                         .set_pll = wm8580_set_dai_pll,
@@ -818,8 +816,6 @@ struct snd_soc_dai wm8580_dai[] = {
                },
                .ops = {
                         .hw_params = wm8580_paif_hw_params,
-                },
-               .dai_ops = {
                         .set_fmt = wm8580_set_paif_dai_fmt,
                         .set_clkdiv = wm8580_set_dai_clkdiv,
                         .set_pll = wm8580_set_dai_pll,
@@ -873,7 +869,7 @@ static int wm8580_init(struct snd_soc_device *socdev)
        wm8580_add_controls(codec);
        wm8580_add_widgets(codec);
 
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8580: failed to register card\n");
                goto card_err;
@@ -900,85 +896,85 @@ static struct snd_soc_device *wm8580_socdev;
  *    low  = 0x1a
  *    high = 0x1b
  */
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
 
-static struct i2c_driver wm8580_i2c_driver;
-static struct i2c_client client_template;
-
-static int wm8580_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8580_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
 {
        struct snd_soc_device *socdev = wm8580_socdev;
-       struct wm8580_setup_data *setup = socdev->codec_data;
        struct snd_soc_codec *codec = socdev->codec;
-       struct i2c_client *i2c;
        int ret;
 
-       if (addr != setup->i2c_address)
-               return -ENODEV;
-
-       client_template.adapter = adap;
-       client_template.addr = addr;
-
-       i2c =  kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
-       if (i2c == NULL) {
-               kfree(codec);
-               return -ENOMEM;
-       }
        i2c_set_clientdata(i2c, codec);
        codec->control_data = i2c;
 
-       ret = i2c_attach_client(i2c);
-       if (ret < 0) {
-               dev_err(&i2c->dev, "failed to attach codec at addr %x\n", addr);
-               goto err;
-       }
-
        ret = wm8580_init(socdev);
-       if (ret < 0) {
+       if (ret < 0)
                dev_err(&i2c->dev, "failed to initialise WM8580\n");
-               goto err;
-       }
-
-       return ret;
-
-err:
-       kfree(codec);
-       kfree(i2c);
        return ret;
 }
 
-static int wm8580_i2c_detach(struct i2c_client *client)
+static int wm8580_i2c_remove(struct i2c_client *client)
 {
        struct snd_soc_codec *codec = i2c_get_clientdata(client);
-       i2c_detach_client(client);
        kfree(codec->reg_cache);
-       kfree(client);
        return 0;
 }
 
-static int wm8580_i2c_attach(struct i2c_adapter *adap)
-{
-       return i2c_probe(adap, &addr_data, wm8580_codec_probe);
-}
+static const struct i2c_device_id wm8580_i2c_id[] = {
+       { "wm8580", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8580_i2c_id);
 
-/* corgi i2c codec control layer */
 static struct i2c_driver wm8580_i2c_driver = {
        .driver = {
                .name = "WM8580 I2C Codec",
                .owner = THIS_MODULE,
        },
-       .attach_adapter = wm8580_i2c_attach,
-       .detach_client =  wm8580_i2c_detach,
-       .command =        NULL,
+       .probe =    wm8580_i2c_probe,
+       .remove =   wm8580_i2c_remove,
+       .id_table = wm8580_i2c_id,
 };
 
-static struct i2c_client client_template = {
-       .name =   "WM8580",
-       .driver = &wm8580_i2c_driver,
-};
+static int wm8580_add_i2c_device(struct platform_device *pdev,
+                                const struct wm8580_setup_data *setup)
+{
+       struct i2c_board_info info;
+       struct i2c_adapter *adapter;
+       struct i2c_client *client;
+       int ret;
+
+       ret = i2c_add_driver(&wm8580_i2c_driver);
+       if (ret != 0) {
+               dev_err(&pdev->dev, "can't add i2c driver\n");
+               return ret;
+       }
+
+       memset(&info, 0, sizeof(struct i2c_board_info));
+       info.addr = setup->i2c_address;
+       strlcpy(info.type, "wm8580", I2C_NAME_SIZE);
+
+       adapter = i2c_get_adapter(setup->i2c_bus);
+       if (!adapter) {
+               dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+                       setup->i2c_bus);
+               goto err_driver;
+       }
+
+       client = i2c_new_device(adapter, &info);
+       i2c_put_adapter(adapter);
+       if (!client) {
+               dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+                       (unsigned int)info.addr);
+               goto err_driver;
+       }
+
+       return 0;
+
+err_driver:
+       i2c_del_driver(&wm8580_i2c_driver);
+       return -ENODEV;
+}
 #endif
 
 static int wm8580_probe(struct platform_device *pdev)
@@ -1011,11 +1007,8 @@ static int wm8580_probe(struct platform_device *pdev)
 
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
        if (setup->i2c_address) {
-               normal_i2c[0] = setup->i2c_address;
                codec->hw_write = (hw_write_t)i2c_master_send;
-               ret = i2c_add_driver(&wm8580_i2c_driver);
-               if (ret != 0)
-                       printk(KERN_ERR "can't add i2c driver");
+               ret = wm8580_add_i2c_device(pdev, setup);
        }
 #else
                /* Add other interfaces here */
@@ -1034,6 +1027,7 @@ static int wm8580_remove(struct platform_device *pdev)
        snd_soc_free_pcms(socdev);
        snd_soc_dapm_free(socdev);
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+       i2c_unregister_device(codec->control_data);
        i2c_del_driver(&wm8580_i2c_driver);
 #endif
        kfree(codec->private_data);
@@ -1048,6 +1042,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8580 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8580);
 
+static int __init wm8580_modinit(void)
+{
+       return snd_soc_register_dais(wm8580_dai, ARRAY_SIZE(wm8580_dai));
+}
+module_init(wm8580_modinit);
+
+static void __exit wm8580_exit(void)
+{
+       snd_soc_unregister_dais(wm8580_dai, ARRAY_SIZE(wm8580_dai));
+}
+module_exit(wm8580_exit);
+
 MODULE_DESCRIPTION("ASoC WM8580 driver");
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_LICENSE("GPL");
index 589ddaba21d777515545cc8a5f4b70ce3b366eea..09e4422f6f2fbfeda01f4d068b5eb13532a69a84 100644 (file)
@@ -29,6 +29,7 @@
 #define WM8580_CLKSRC_NONE 5
 
 struct wm8580_setup_data {
+       int i2c_bus;
        unsigned short i2c_address;
 };
 
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c
new file mode 100644 (file)
index 0000000..80b1198
--- /dev/null
@@ -0,0 +1,585 @@
+/*
+ * wm8728.c  --  WM8728 ALSA SoC Audio driver
+ *
+ * Copyright 2008 Wolfson Microelectronics plc
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+#include <sound/tlv.h>
+
+#include "wm8728.h"
+
+struct snd_soc_codec_device soc_codec_dev_wm8728;
+
+/*
+ * We can't read the WM8728 register space so we cache them instead.
+ * Note that the defaults here aren't the physical defaults, we latch
+ * the volume update bits, mute the output and enable infinite zero
+ * detect.
+ */
+static const u16 wm8728_reg_defaults[] = {
+       0x1ff,
+       0x1ff,
+       0x001,
+       0x100,
+};
+
+static inline unsigned int wm8728_read_reg_cache(struct snd_soc_codec *codec,
+       unsigned int reg)
+{
+       u16 *cache = codec->reg_cache;
+       BUG_ON(reg > ARRAY_SIZE(wm8728_reg_defaults));
+       return cache[reg];
+}
+
+static inline void wm8728_write_reg_cache(struct snd_soc_codec *codec,
+       u16 reg, unsigned int value)
+{
+       u16 *cache = codec->reg_cache;
+       BUG_ON(reg > ARRAY_SIZE(wm8728_reg_defaults));
+       cache[reg] = value;
+}
+
+/*
+ * write to the WM8728 register space
+ */
+static int wm8728_write(struct snd_soc_codec *codec, unsigned int reg,
+       unsigned int value)
+{
+       u8 data[2];
+
+       /* data is
+        *   D15..D9 WM8728 register offset
+        *   D8...D0 register data
+        */
+       data[0] = (reg << 1) | ((value >> 8) & 0x0001);
+       data[1] = value & 0x00ff;
+
+       wm8728_write_reg_cache(codec, reg, value);
+
+       if (codec->hw_write(codec->control_data, data, 2) == 2)
+               return 0;
+       else
+               return -EIO;
+}
+
+static const DECLARE_TLV_DB_SCALE(wm8728_tlv, -12750, 50, 1);
+
+static const struct snd_kcontrol_new wm8728_snd_controls[] = {
+
+SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8728_DACLVOL, WM8728_DACRVOL,
+                0, 255, 0, wm8728_tlv),
+
+SOC_SINGLE("Deemphasis", WM8728_DACCTL, 1, 1, 0),
+};
+
+static int wm8728_add_controls(struct snd_soc_codec *codec)
+{
+       int err, i;
+
+       for (i = 0; i < ARRAY_SIZE(wm8728_snd_controls); i++) {
+               err = snd_ctl_add(codec->card,
+                                 snd_soc_cnew(&wm8728_snd_controls[i],
+                                               codec, NULL));
+               if (err < 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+/*
+ * DAPM controls.
+ */
+static const struct snd_soc_dapm_widget wm8728_dapm_widgets[] = {
+SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0),
+SND_SOC_DAPM_OUTPUT("VOUTL"),
+SND_SOC_DAPM_OUTPUT("VOUTR"),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+       {"VOUTL", NULL, "DAC"},
+       {"VOUTR", NULL, "DAC"},
+};
+
+static int wm8728_add_widgets(struct snd_soc_codec *codec)
+{
+       snd_soc_dapm_new_controls(codec, wm8728_dapm_widgets,
+                                 ARRAY_SIZE(wm8728_dapm_widgets));
+
+       snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+       snd_soc_dapm_new_widgets(codec);
+
+       return 0;
+}
+
+static int wm8728_mute(struct snd_soc_dai *dai, int mute)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       u16 mute_reg = wm8728_read_reg_cache(codec, WM8728_DACCTL);
+
+       if (mute)
+               wm8728_write(codec, WM8728_DACCTL, mute_reg | 1);
+       else
+               wm8728_write(codec, WM8728_DACCTL, mute_reg & ~1);
+
+       return 0;
+}
+
+static int wm8728_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       u16 dac = wm8728_read_reg_cache(codec, WM8728_DACCTL);
+
+       dac &= ~0x18;
+
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S16_LE:
+               break;
+       case SNDRV_PCM_FORMAT_S20_3LE:
+               dac |= 0x10;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+               dac |= 0x08;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       wm8728_write(codec, WM8728_DACCTL, dac);
+
+       return 0;
+}
+
+static int wm8728_set_dai_fmt(struct snd_soc_dai *codec_dai,
+               unsigned int fmt)
+{
+       struct snd_soc_codec *codec = codec_dai->codec;
+       u16 iface = wm8728_read_reg_cache(codec, WM8728_IFCTL);
+
+       /* Currently only I2S is supported by the driver, though the
+        * hardware is more flexible.
+        */
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               iface |= 1;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* The hardware only support full slave mode */
+       switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+       case SND_SOC_DAIFMT_CBS_CFS:
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+       case SND_SOC_DAIFMT_NB_NF:
+               iface &= ~0x22;
+               break;
+       case SND_SOC_DAIFMT_IB_NF:
+               iface |=  0x20;
+               iface &= ~0x02;
+               break;
+       case SND_SOC_DAIFMT_NB_IF:
+               iface |= 0x02;
+               iface &= ~0x20;
+               break;
+       case SND_SOC_DAIFMT_IB_IF:
+               iface |= 0x22;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       wm8728_write(codec, WM8728_IFCTL, iface);
+       return 0;
+}
+
+static int wm8728_set_bias_level(struct snd_soc_codec *codec,
+                                enum snd_soc_bias_level level)
+{
+       u16 reg;
+       int i;
+
+       switch (level) {
+       case SND_SOC_BIAS_ON:
+       case SND_SOC_BIAS_PREPARE:
+       case SND_SOC_BIAS_STANDBY:
+               if (codec->bias_level == SND_SOC_BIAS_OFF) {
+                       /* Power everything up... */
+                       reg = wm8728_read_reg_cache(codec, WM8728_DACCTL);
+                       wm8728_write(codec, WM8728_DACCTL, reg & ~0x4);
+
+                       /* ..then sync in the register cache. */
+                       for (i = 0; i < ARRAY_SIZE(wm8728_reg_defaults); i++)
+                               wm8728_write(codec, i,
+                                            wm8728_read_reg_cache(codec, i));
+               }
+               break;
+
+       case SND_SOC_BIAS_OFF:
+               reg = wm8728_read_reg_cache(codec, WM8728_DACCTL);
+               wm8728_write(codec, WM8728_DACCTL, reg | 0x4);
+               break;
+       }
+       codec->bias_level = level;
+       return 0;
+}
+
+#define WM8728_RATES (SNDRV_PCM_RATE_8000_192000)
+
+#define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
+       SNDRV_PCM_FMTBIT_S24_LE)
+
+struct snd_soc_dai wm8728_dai = {
+       .name = "WM8728",
+       .playback = {
+               .stream_name = "Playback",
+               .channels_min = 2,
+               .channels_max = 2,
+               .rates = WM8728_RATES,
+               .formats = WM8728_FORMATS,
+       },
+       .ops = {
+                .hw_params = wm8728_hw_params,
+                .digital_mute = wm8728_mute,
+                .set_fmt = wm8728_set_dai_fmt,
+       }
+};
+EXPORT_SYMBOL_GPL(wm8728_dai);
+
+static int wm8728_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+       return 0;
+}
+
+static int wm8728_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       wm8728_set_bias_level(codec, codec->suspend_bias_level);
+
+       return 0;
+}
+
+/*
+ * initialise the WM8728 driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+static int wm8728_init(struct snd_soc_device *socdev)
+{
+       struct snd_soc_codec *codec = socdev->codec;
+       int ret = 0;
+
+       codec->name = "WM8728";
+       codec->owner = THIS_MODULE;
+       codec->read = wm8728_read_reg_cache;
+       codec->write = wm8728_write;
+       codec->set_bias_level = wm8728_set_bias_level;
+       codec->dai = &wm8728_dai;
+       codec->num_dai = 1;
+       codec->bias_level = SND_SOC_BIAS_OFF;
+       codec->reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults);
+       codec->reg_cache = kmemdup(wm8728_reg_defaults,
+                                  sizeof(wm8728_reg_defaults),
+                                  GFP_KERNEL);
+       if (codec->reg_cache == NULL)
+               return -ENOMEM;
+
+       /* register pcms */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               printk(KERN_ERR "wm8728: failed to create pcms\n");
+               goto pcm_err;
+       }
+
+       /* power on device */
+       wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+       wm8728_add_controls(codec);
+       wm8728_add_widgets(codec);
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               printk(KERN_ERR "wm8728: failed to register card\n");
+               goto card_err;
+       }
+
+       return ret;
+
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+pcm_err:
+       kfree(codec->reg_cache);
+       return ret;
+}
+
+static struct snd_soc_device *wm8728_socdev;
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+
+/*
+ * WM8728 2 wire address is determined by GPIO5
+ * state during powerup.
+ *    low  = 0x1a
+ *    high = 0x1b
+ */
+
+static int wm8728_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
+{
+       struct snd_soc_device *socdev = wm8728_socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       int ret;
+
+       i2c_set_clientdata(i2c, codec);
+       codec->control_data = i2c;
+
+       ret = wm8728_init(socdev);
+       if (ret < 0)
+               pr_err("failed to initialise WM8728\n");
+
+       return ret;
+}
+
+static int wm8728_i2c_remove(struct i2c_client *client)
+{
+       struct snd_soc_codec *codec = i2c_get_clientdata(client);
+       kfree(codec->reg_cache);
+       return 0;
+}
+
+static const struct i2c_device_id wm8728_i2c_id[] = {
+       { "wm8728", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8728_i2c_id);
+
+static struct i2c_driver wm8728_i2c_driver = {
+       .driver = {
+               .name = "WM8728 I2C Codec",
+               .owner = THIS_MODULE,
+       },
+       .probe =    wm8728_i2c_probe,
+       .remove =   wm8728_i2c_remove,
+       .id_table = wm8728_i2c_id,
+};
+
+static int wm8728_add_i2c_device(struct platform_device *pdev,
+                                const struct wm8728_setup_data *setup)
+{
+       struct i2c_board_info info;
+       struct i2c_adapter *adapter;
+       struct i2c_client *client;
+       int ret;
+
+       ret = i2c_add_driver(&wm8728_i2c_driver);
+       if (ret != 0) {
+               dev_err(&pdev->dev, "can't add i2c driver\n");
+               return ret;
+       }
+
+       memset(&info, 0, sizeof(struct i2c_board_info));
+       info.addr = setup->i2c_address;
+       strlcpy(info.type, "wm8728", I2C_NAME_SIZE);
+
+       adapter = i2c_get_adapter(setup->i2c_bus);
+       if (!adapter) {
+               dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+                       setup->i2c_bus);
+               goto err_driver;
+       }
+
+       client = i2c_new_device(adapter, &info);
+       i2c_put_adapter(adapter);
+       if (!client) {
+               dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+                       (unsigned int)info.addr);
+               goto err_driver;
+       }
+
+       return 0;
+
+err_driver:
+       i2c_del_driver(&wm8728_i2c_driver);
+       return -ENODEV;
+}
+#endif
+
+#if defined(CONFIG_SPI_MASTER)
+static int __devinit wm8728_spi_probe(struct spi_device *spi)
+{
+       struct snd_soc_device *socdev = wm8728_socdev;
+       struct snd_soc_codec *codec = socdev->codec;
+       int ret;
+
+       codec->control_data = spi;
+
+       ret = wm8728_init(socdev);
+       if (ret < 0)
+               dev_err(&spi->dev, "failed to initialise WM8728\n");
+
+       return ret;
+}
+
+static int __devexit wm8728_spi_remove(struct spi_device *spi)
+{
+       return 0;
+}
+
+static struct spi_driver wm8728_spi_driver = {
+       .driver = {
+               .name   = "wm8728",
+               .bus    = &spi_bus_type,
+               .owner  = THIS_MODULE,
+       },
+       .probe          = wm8728_spi_probe,
+       .remove         = __devexit_p(wm8728_spi_remove),
+};
+
+static int wm8728_spi_write(struct spi_device *spi, const char *data, int len)
+{
+       struct spi_transfer t;
+       struct spi_message m;
+       u8 msg[2];
+
+       if (len <= 0)
+               return 0;
+
+       msg[0] = data[0];
+       msg[1] = data[1];
+
+       spi_message_init(&m);
+       memset(&t, 0, (sizeof t));
+
+       t.tx_buf = &msg[0];
+       t.len = len;
+
+       spi_message_add_tail(&t, &m);
+       spi_sync(spi, &m);
+
+       return len;
+}
+#endif /* CONFIG_SPI_MASTER */
+
+static int wm8728_probe(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct wm8728_setup_data *setup;
+       struct snd_soc_codec *codec;
+       int ret = 0;
+
+       setup = socdev->codec_data;
+       codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+       if (codec == NULL)
+               return -ENOMEM;
+
+       socdev->codec = codec;
+       mutex_init(&codec->mutex);
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+
+       wm8728_socdev = socdev;
+       ret = -ENODEV;
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+       if (setup->i2c_address) {
+               codec->hw_write = (hw_write_t)i2c_master_send;
+               ret = wm8728_add_i2c_device(pdev, setup);
+       }
+#endif
+#if defined(CONFIG_SPI_MASTER)
+       if (setup->spi) {
+               codec->hw_write = (hw_write_t)wm8728_spi_write;
+               ret = spi_register_driver(&wm8728_spi_driver);
+               if (ret != 0)
+                       printk(KERN_ERR "can't add spi driver");
+       }
+#endif
+
+       if (ret != 0)
+               kfree(codec);
+
+       return ret;
+}
+
+/* power down chip */
+static int wm8728_remove(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_codec *codec = socdev->codec;
+
+       if (codec->control_data)
+               wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+       i2c_unregister_device(codec->control_data);
+       i2c_del_driver(&wm8728_i2c_driver);
+#endif
+#if defined(CONFIG_SPI_MASTER)
+       spi_unregister_driver(&wm8728_spi_driver);
+#endif
+       kfree(codec);
+
+       return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_wm8728 = {
+       .probe =        wm8728_probe,
+       .remove =       wm8728_remove,
+       .suspend =      wm8728_suspend,
+       .resume =       wm8728_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_wm8728);
+
+static int __init wm8728_modinit(void)
+{
+       return snd_soc_register_dai(&wm8728_dai);
+}
+module_init(wm8728_modinit);
+
+static void __exit wm8728_exit(void)
+{
+       snd_soc_unregister_dai(&wm8728_dai);
+}
+module_exit(wm8728_exit);
+
+MODULE_DESCRIPTION("ASoC WM8728 driver");
+MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/wm8728.h b/sound/soc/codecs/wm8728.h
new file mode 100644 (file)
index 0000000..d269c13
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * wm8728.h  --  WM8728 ASoC codec driver
+ *
+ * Copyright 2008 Wolfson Microelectronics plc
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _WM8728_H
+#define _WM8728_H
+
+#define WM8728_DACLVOL   0x00
+#define WM8728_DACRVOL   0x01
+#define WM8728_DACCTL    0x02
+#define WM8728_IFCTL     0x03
+
+struct wm8728_setup_data {
+       int            spi;
+       int            i2c_bus;
+       unsigned short i2c_address;
+};
+
+extern struct snd_soc_dai wm8728_dai;
+extern struct snd_soc_codec_device soc_codec_dev_wm8728;
+
+#endif
index 7f8a7e36b33e9124d0c3d924301d9cccb6cb9c5f..c444b9f2701ed7625baa550cc0030bf35d6d6712 100644 (file)
@@ -264,7 +264,8 @@ static inline int get_coeff(int mclk, int rate)
 }
 
 static int wm8731_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -293,7 +294,8 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int wm8731_pcm_prepare(struct snd_pcm_substream *substream)
+static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
+                             struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -305,7 +307,8 @@ static int wm8731_pcm_prepare(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static void wm8731_shutdown(struct snd_pcm_substream *substream)
+static void wm8731_shutdown(struct snd_pcm_substream *substream,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -461,8 +464,6 @@ struct snd_soc_dai wm8731_dai = {
                .prepare = wm8731_pcm_prepare,
                .hw_params = wm8731_hw_params,
                .shutdown = wm8731_shutdown,
-       },
-       .dai_ops = {
                .digital_mute = wm8731_mute,
                .set_sysclk = wm8731_set_dai_sysclk,
                .set_fmt = wm8731_set_dai_fmt,
@@ -544,7 +545,7 @@ static int wm8731_init(struct snd_soc_device *socdev)
 
        wm8731_add_controls(codec);
        wm8731_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8731: failed to register card\n");
                goto card_err;
@@ -792,6 +793,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8731 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8731);
 
+static int __init wm8731_modinit(void)
+{
+       return snd_soc_register_dai(&wm8731_dai);
+}
+module_init(wm8731_modinit);
+
+static void __exit wm8731_exit(void)
+{
+       snd_soc_unregister_dai(&wm8731_dai);
+}
+module_exit(wm8731_exit);
+
 MODULE_DESCRIPTION("ASoC WM8731 driver");
 MODULE_AUTHOR("Richard Purdie");
 MODULE_LICENSE("GPL");
index 9b7296ee5b08fa541c6dfdbc44f9b5b8b31f92d6..5997fa68e0d58f08c1fb5af468e953bbb2a64ded 100644 (file)
@@ -614,7 +614,8 @@ static int wm8750_set_dai_fmt(struct snd_soc_dai *codec_dai,
 }
 
 static int wm8750_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -709,8 +710,6 @@ struct snd_soc_dai wm8750_dai = {
                .formats = WM8750_FORMATS,},
        .ops = {
                .hw_params = wm8750_pcm_hw_params,
-       },
-       .dai_ops = {
                .digital_mute = wm8750_mute,
                .set_fmt = wm8750_set_dai_fmt,
                .set_sysclk = wm8750_set_dai_sysclk,
@@ -819,7 +818,7 @@ static int wm8750_init(struct snd_soc_device *socdev)
 
        wm8750_add_controls(codec);
        wm8750_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8750: failed to register card\n");
                goto card_err;
@@ -1086,6 +1085,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8750 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8750);
 
+static int __init wm8750_modinit(void)
+{
+       return snd_soc_register_dai(&wm8750_dai);
+}
+module_init(wm8750_modinit);
+
+static void __exit wm8750_exit(void)
+{
+       snd_soc_unregister_dai(&wm8750_dai);
+}
+module_exit(wm8750_exit);
+
 MODULE_DESCRIPTION("ASoC WM8750 driver");
 MODULE_AUTHOR("Liam Girdwood");
 MODULE_LICENSE("GPL");
index d426eaa2218575b75004a48f86cfe9079d84fa21..6c21b50c93758f28c7aea6d59ae396405d232530 100644 (file)
@@ -922,7 +922,8 @@ static int wm8753_vdac_adc_set_dai_fmt(struct snd_soc_dai *codec_dai,
  * Set PCM DAI bit size and sample rate.
  */
 static int wm8753_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1155,7 +1156,8 @@ static int wm8753_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai,
  * Set PCM DAI bit size and sample rate.
  */
 static int wm8753_i2s_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1323,16 +1325,15 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM8753_RATES,
-               .formats = WM8753_FORMATS,},
+               .formats = WM8753_FORMATS},
        .capture = { /* dummy for fast DAI switching */
                .stream_name = "Capture",
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM8753_RATES,
-               .formats = WM8753_FORMATS,},
+               .formats = WM8753_FORMATS},
        .ops = {
-               .hw_params = wm8753_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8753_i2s_hw_params,
                .digital_mute = wm8753_mute,
                .set_fmt = wm8753_mode1h_set_dai_fmt,
                .set_clkdiv = wm8753_set_dai_clkdiv,
@@ -1356,8 +1357,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
        .ops = {
-               .hw_params = wm8753_pcm_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8753_pcm_hw_params,
                .digital_mute = wm8753_mute,
                .set_fmt = wm8753_mode1v_set_dai_fmt,
                .set_clkdiv = wm8753_set_dai_clkdiv,
@@ -1385,8 +1385,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
        .ops = {
-               .hw_params = wm8753_pcm_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8753_pcm_hw_params,
                .digital_mute = wm8753_mute,
                .set_fmt = wm8753_mode2_set_dai_fmt,
                .set_clkdiv = wm8753_set_dai_clkdiv,
@@ -1410,8 +1409,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
        .ops = {
-               .hw_params = wm8753_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8753_i2s_hw_params,
                .digital_mute = wm8753_mute,
                .set_fmt = wm8753_mode3_4_set_dai_fmt,
                .set_clkdiv = wm8753_set_dai_clkdiv,
@@ -1439,8 +1437,7 @@ static const struct snd_soc_dai wm8753_all_dai[] = {
                .rates = WM8753_RATES,
                .formats = WM8753_FORMATS,},
        .ops = {
-               .hw_params = wm8753_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8753_i2s_hw_params,
                .digital_mute = wm8753_mute,
                .set_fmt = wm8753_mode3_4_set_dai_fmt,
                .set_clkdiv = wm8753_set_dai_clkdiv,
@@ -1608,7 +1605,7 @@ static int wm8753_init(struct snd_soc_device *socdev)
 
        wm8753_add_controls(codec);
        wm8753_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8753: failed to register card\n");
                goto card_err;
@@ -1877,6 +1874,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
 
+static int __init wm8753_modinit(void)
+{
+       return snd_soc_register_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai));
+}
+module_init(wm8753_modinit);
+
+static void __exit wm8753_exit(void)
+{
+       snd_soc_unregister_dais(wm8753_dai, ARRAY_SIZE(wm8753_dai));
+}
+module_exit(wm8753_exit);
+
 MODULE_DESCRIPTION("ASoC WM8753 driver");
 MODULE_AUTHOR("Liam Girdwood");
 MODULE_LICENSE("GPL");
index 3b326c9b55866bba7a81c1421329026bed290247..6767de10ded0a64ff008e7c1d039d42569b9a4e4 100644 (file)
 struct snd_soc_codec_device soc_codec_dev_wm8900;
 
 struct wm8900_priv {
+       struct snd_soc_codec codec;
+
+       u16 reg_cache[WM8900_MAXREG];
+
        u32 fll_in; /* FLL input frequency */
        u32 fll_out; /* FLL output frequency */
 };
@@ -727,7 +731,8 @@ static int wm8900_add_widgets(struct snd_soc_codec *codec)
 }
 
 static int wm8900_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1117,8 +1122,6 @@ struct snd_soc_dai wm8900_dai = {
         },
        .ops = {
                .hw_params = wm8900_hw_params,
-        },
-       .dai_ops = {
                 .set_clkdiv = wm8900_set_dai_clkdiv,
                 .set_pll = wm8900_set_dai_pll,
                 .set_fmt = wm8900_set_dai_fmt,
@@ -1283,16 +1286,28 @@ static int wm8900_resume(struct platform_device *pdev)
        return 0;
 }
 
-/*
- * initialise the WM8900 driver
- * register the mixer and dsp interfaces with the kernel
- */
-static int wm8900_init(struct snd_soc_device *socdev)
+static struct snd_soc_codec *wm8900_codec;
+
+static int wm8900_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
 {
-       struct snd_soc_codec *codec = socdev->codec;
-       int ret = 0;
+       struct wm8900_priv *wm8900;
+       struct snd_soc_codec *codec;
        unsigned int reg;
-       struct i2c_client *i2c_client = socdev->codec->control_data;
+       int ret;
+
+       wm8900 = kzalloc(sizeof(struct wm8900_priv), GFP_KERNEL);
+       if (wm8900 == NULL)
+               return -ENOMEM;
+
+       codec = &wm8900->codec;
+       codec->private_data = wm8900;
+       codec->reg_cache = &wm8900->reg_cache[0];
+       codec->reg_cache_size = WM8900_MAXREG;
+
+       mutex_init(&codec->mutex);
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
 
        codec->name = "WM8900";
        codec->owner = THIS_MODULE;
@@ -1300,33 +1315,28 @@ static int wm8900_init(struct snd_soc_device *socdev)
        codec->write = wm8900_write;
        codec->dai = &wm8900_dai;
        codec->num_dai = 1;
-       codec->reg_cache_size = WM8900_MAXREG;
-       codec->reg_cache = kmemdup(wm8900_reg_defaults,
-                                  sizeof(wm8900_reg_defaults), GFP_KERNEL);
-
-       if (codec->reg_cache == NULL)
-               return -ENOMEM;
+       codec->hw_write = (hw_write_t)i2c_master_send;
+       codec->control_data = i2c;
+       codec->set_bias_level = wm8900_set_bias_level;
+       codec->dev = &i2c->dev;
 
        reg = wm8900_read(codec, WM8900_REG_ID);
        if (reg != 0x8900) {
-               dev_err(&i2c_client->dev, "Device is not a WM8900 - ID %x\n",
-                       reg);
-               return -ENODEV;
-       }
-
-       codec->private_data = kzalloc(sizeof(struct wm8900_priv), GFP_KERNEL);
-       if (codec->private_data == NULL) {
-               ret = -ENOMEM;
-               goto priv_err;
+               dev_err(&i2c->dev, "Device is not a WM8900 - ID %x\n", reg);
+               ret = -ENODEV;
+               goto err;
        }
 
        /* Read back from the chip */
        reg = wm8900_chip_read(codec, WM8900_REG_POWER1);
        reg = (reg >> 12) & 0xf;
-       dev_info(&i2c_client->dev, "WM8900 revision %d\n", reg);
+       dev_info(&i2c->dev, "WM8900 revision %d\n", reg);
 
        wm8900_reset(codec);
 
+       /* Turn the chip on */
+       wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
        /* Latch the volume update bits */
        wm8900_write(codec, WM8900_REG_LINVOL,
                     wm8900_read(codec, WM8900_REG_LINVOL) | 0x100);
@@ -1352,160 +1362,98 @@ static int wm8900_init(struct snd_soc_device *socdev)
        /* Set the DAC and mixer output bias */
        wm8900_write(codec, WM8900_REG_OUTBIASCTL, 0x81);
 
-       /* Register pcms */
-       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
-       if (ret < 0) {
-               dev_err(&i2c_client->dev, "Failed to register new PCMs\n");
-               goto pcm_err;
-       }
-
-       /* Turn the chip on */
-       codec->bias_level = SND_SOC_BIAS_OFF;
-       wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       wm8900_add_controls(codec);
-       wm8900_add_widgets(codec);
-
-       ret = snd_soc_register_card(socdev);
-       if (ret < 0) {
-               dev_err(&i2c_client->dev, "Failed to register card\n");
-               goto card_err;
-       }
-       return ret;
-
-card_err:
-       snd_soc_free_pcms(socdev);
-       snd_soc_dapm_free(socdev);
-pcm_err:
-       kfree(codec->reg_cache);
-priv_err:
-       kfree(codec->private_data);
-       return ret;
-}
+       wm8900_dai.dev = &i2c->dev;
 
-static struct snd_soc_device *wm8900_socdev;
+       wm8900_codec = codec;
 
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8900_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
-   around */
-static int wm8900_codec_probe(struct i2c_adapter *adap, int addr, int kind)
-{
-       struct snd_soc_device *socdev = wm8900_socdev;
-       struct wm8900_setup_data *setup = socdev->codec_data;
-       struct snd_soc_codec *codec = socdev->codec;
-       struct i2c_client *i2c;
-       int ret;
-
-       if (addr != setup->i2c_address)
-               return -ENODEV;
-
-       dev_err(&adap->dev, "Probe on %x\n", addr);
-
-       client_template.adapter = adap;
-       client_template.addr = addr;
-
-       i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
-       if (i2c == NULL) {
-               kfree(codec);
-               return -ENOMEM;
-       }
-       i2c_set_clientdata(i2c, codec);
-       codec->control_data = i2c;
-
-       ret = i2c_attach_client(i2c);
-       if (ret < 0) {
-               dev_err(&adap->dev,
-                       "failed to attach codec at addr %x\n", addr);
+       ret = snd_soc_register_codec(codec);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to register codec: %d\n", ret);
                goto err;
        }
 
-       ret = wm8900_init(socdev);
-       if (ret < 0) {
-               dev_err(&adap->dev, "failed to initialise WM8900\n");
-               goto err;
+       ret = snd_soc_register_dai(&wm8900_dai);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to register DAI: %d\n", ret);
+               goto err_codec;
        }
+
        return ret;
 
+err_codec:
+       snd_soc_unregister_codec(codec);
 err:
-       kfree(codec);
-       kfree(i2c);
+       kfree(wm8900);
+       wm8900_codec = NULL;
        return ret;
 }
 
-static int wm8900_i2c_detach(struct i2c_client *client)
+static int wm8900_i2c_remove(struct i2c_client *client)
 {
-       struct snd_soc_codec *codec = i2c_get_clientdata(client);
-       i2c_detach_client(client);
-       kfree(codec->reg_cache);
-       kfree(client);
+       snd_soc_unregister_dai(&wm8900_dai);
+       snd_soc_unregister_codec(wm8900_codec);
+
+       wm8900_set_bias_level(wm8900_codec, SND_SOC_BIAS_OFF);
+
+       wm8900_dai.dev = NULL;
+       kfree(wm8900_codec->private_data);
+       wm8900_codec = NULL;
+
        return 0;
 }
 
-static int wm8900_i2c_attach(struct i2c_adapter *adap)
-{
-       return i2c_probe(adap, &addr_data, wm8900_codec_probe);
-}
+static const struct i2c_device_id wm8900_i2c_id[] = {
+       { "wm8900", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8900_i2c_id);
 
-/* corgi i2c codec control layer */
 static struct i2c_driver wm8900_i2c_driver = {
        .driver = {
-               .name = "WM8900 I2C codec",
+               .name = "WM8900",
                .owner = THIS_MODULE,
        },
-       .attach_adapter = wm8900_i2c_attach,
-       .detach_client =  wm8900_i2c_detach,
-       .command =        NULL,
-};
-
-static struct i2c_client client_template = {
-       .name =   "WM8900",
-       .driver = &wm8900_i2c_driver,
+       .probe = wm8900_i2c_probe,
+       .remove = wm8900_i2c_remove,
+       .id_table = wm8900_i2c_id,
 };
-#endif
 
 static int wm8900_probe(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct wm8900_setup_data *setup;
        struct snd_soc_codec *codec;
        int ret = 0;
 
-       dev_info(&pdev->dev, "WM8900 Audio Codec\n");
-
-       setup = socdev->codec_data;
-       codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
-       if (codec == NULL)
-               return -ENOMEM;
-
-       mutex_init(&codec->mutex);
-       INIT_LIST_HEAD(&codec->dapm_widgets);
-       INIT_LIST_HEAD(&codec->dapm_paths);
+       if (!wm8900_codec) {
+               dev_err(&pdev->dev, "I2C client not yet instantiated\n");
+               return -ENODEV;
+       }
 
+       codec = wm8900_codec;
        socdev->codec = codec;
 
-       codec->set_bias_level = wm8900_set_bias_level;
+       /* Register pcms */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "Failed to register new PCMs\n");
+               goto pcm_err;
+       }
 
-       wm8900_socdev = socdev;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-       if (setup->i2c_address) {
-               normal_i2c[0] = setup->i2c_address;
-               codec->hw_write = (hw_write_t)i2c_master_send;
-               ret = i2c_add_driver(&wm8900_i2c_driver);
-               if (ret != 0)
-                       printk(KERN_ERR "can't add i2c driver");
+       wm8900_add_controls(codec);
+       wm8900_add_widgets(codec);
+
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "Failed to register card\n");
+               goto card_err;
        }
-#else
-#error Non-I2C interfaces not yet supported
-#endif
+
+       return ret;
+
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+pcm_err:
        return ret;
 }
 
@@ -1513,17 +1461,9 @@ static int wm8900_probe(struct platform_device *pdev)
 static int wm8900_remove(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_codec *codec = socdev->codec;
-
-       if (codec->control_data)
-               wm8900_set_bias_level(codec, SND_SOC_BIAS_OFF);
 
        snd_soc_free_pcms(socdev);
        snd_soc_dapm_free(socdev);
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-       i2c_del_driver(&wm8900_i2c_driver);
-#endif
-       kfree(codec);
 
        return 0;
 }
@@ -1536,6 +1476,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8900 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8900);
 
+static int __init wm8900_modinit(void)
+{
+       return i2c_add_driver(&wm8900_i2c_driver);
+}
+module_init(wm8900_modinit);
+
+static void __exit wm8900_exit(void)
+{
+       i2c_del_driver(&wm8900_i2c_driver);
+}
+module_exit(wm8900_exit);
+
 MODULE_DESCRIPTION("ASoC WM8900 driver");
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfonmicro.com>");
 MODULE_LICENSE("GPL");
index ba450d99e9026c1114d90c402f3b3a6d37e13e0d..fd15007d10c7ec22950174758a9b688247eede08 100644 (file)
 #define WM8900_DAC_CLKDIV_5_5 0x14
 #define WM8900_DAC_CLKDIV_6   0x18
 
-#define WM8900_
-
-struct wm8900_setup_data {
-       unsigned short i2c_address;
-};
-
 extern struct snd_soc_dai wm8900_dai;
 extern struct snd_soc_codec_device soc_codec_dev_wm8900;
 
index ce40d78776058456782f5d723152250bfc79e681..bde74546db4a7050ee28e1617dc190390822fcc1 100644 (file)
 
 #include "wm8903.h"
 
-struct wm8903_priv {
-       int sysclk;
-
-       /* Reference counts */
-       int charge_pump_users;
-       int class_w_users;
-       int playback_active;
-       int capture_active;
-
-       struct snd_pcm_substream *master_substream;
-       struct snd_pcm_substream *slave_substream;
-};
-
 /* Register defaults at reset */
 static u16 wm8903_reg_defaults[] = {
        0x8903,     /* R0   - SW Reset and ID */
@@ -223,6 +210,23 @@ static u16 wm8903_reg_defaults[] = {
        0x0000,     /* R172 - Analogue Output Bias 0 */
 };
 
+struct wm8903_priv {
+       struct snd_soc_codec codec;
+       u16 reg_cache[ARRAY_SIZE(wm8903_reg_defaults)];
+
+       int sysclk;
+
+       /* Reference counts */
+       int charge_pump_users;
+       int class_w_users;
+       int playback_active;
+       int capture_active;
+
+       struct snd_pcm_substream *master_substream;
+       struct snd_pcm_substream *slave_substream;
+};
+
+
 static unsigned int wm8903_read_reg_cache(struct snd_soc_codec *codec,
                                                 unsigned int reg)
 {
@@ -360,6 +364,8 @@ static void wm8903_sync_reg_cache(struct snd_soc_codec *codec, u16 *cache)
 static void wm8903_reset(struct snd_soc_codec *codec)
 {
        wm8903_write(codec, WM8903_SW_RESET_AND_ID, 0);
+       memcpy(codec->reg_cache, wm8903_reg_defaults,
+              sizeof(wm8903_reg_defaults));
 }
 
 #define WM8903_OUTPUT_SHORT 0x8
@@ -392,6 +398,7 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
                break;
        default:
                BUG();
+               return -EINVAL;  /* Spurious warning from some compilers */
        }
 
        switch (w->shift) {
@@ -403,6 +410,7 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
                break;
        default:
                BUG();
+               return -EINVAL;  /* Spurious warning from some compilers */
        }
 
        if (event & SND_SOC_DAPM_PRE_PMU) {
@@ -773,14 +781,14 @@ static const struct snd_kcontrol_new left_output_mixer[] = {
 SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_LEFT_MIX_0, 3, 1, 0),
 SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_LEFT_MIX_0, 2, 1, 0),
 SOC_DAPM_SINGLE_W("Left Bypass Switch", WM8903_ANALOGUE_LEFT_MIX_0, 1, 1, 0),
-SOC_DAPM_SINGLE_W("Right Bypass Switch", WM8903_ANALOGUE_LEFT_MIX_0, 1, 1, 0),
+SOC_DAPM_SINGLE_W("Right Bypass Switch", WM8903_ANALOGUE_LEFT_MIX_0, 0, 1, 0),
 };
 
 static const struct snd_kcontrol_new right_output_mixer[] = {
 SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_RIGHT_MIX_0, 3, 1, 0),
 SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_RIGHT_MIX_0, 2, 1, 0),
 SOC_DAPM_SINGLE_W("Left Bypass Switch", WM8903_ANALOGUE_RIGHT_MIX_0, 1, 1, 0),
-SOC_DAPM_SINGLE_W("Right Bypass Switch", WM8903_ANALOGUE_RIGHT_MIX_0, 1, 1, 0),
+SOC_DAPM_SINGLE_W("Right Bypass Switch", WM8903_ANALOGUE_RIGHT_MIX_0, 0, 1, 0),
 };
 
 static const struct snd_kcontrol_new left_speaker_mixer[] = {
@@ -788,7 +796,7 @@ SOC_DAPM_SINGLE("DACL Switch", WM8903_ANALOGUE_SPK_MIX_LEFT_0, 3, 1, 0),
 SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_SPK_MIX_LEFT_0, 2, 1, 0),
 SOC_DAPM_SINGLE("Left Bypass Switch", WM8903_ANALOGUE_SPK_MIX_LEFT_0, 1, 1, 0),
 SOC_DAPM_SINGLE("Right Bypass Switch", WM8903_ANALOGUE_SPK_MIX_LEFT_0,
-               1, 1, 0),
+               0, 1, 0),
 };
 
 static const struct snd_kcontrol_new right_speaker_mixer[] = {
@@ -797,7 +805,7 @@ SOC_DAPM_SINGLE("DACR Switch", WM8903_ANALOGUE_SPK_MIX_RIGHT_0, 2, 1, 0),
 SOC_DAPM_SINGLE("Left Bypass Switch", WM8903_ANALOGUE_SPK_MIX_RIGHT_0,
                1, 1, 0),
 SOC_DAPM_SINGLE("Right Bypass Switch", WM8903_ANALOGUE_SPK_MIX_RIGHT_0,
-               1, 1, 0),
+               0, 1, 0),
 };
 
 static const struct snd_soc_dapm_widget wm8903_dapm_widgets[] = {
@@ -989,6 +997,9 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,
 
        case SND_SOC_BIAS_STANDBY:
                if (codec->bias_level == SND_SOC_BIAS_OFF) {
+                       wm8903_write(codec, WM8903_CLOCK_RATES_2,
+                                    WM8903_CLK_SYS_ENA);
+
                        wm8903_run_sequence(codec, 0);
                        wm8903_sync_reg_cache(codec, codec->reg_cache);
 
@@ -1019,6 +1030,9 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,
 
        case SND_SOC_BIAS_OFF:
                wm8903_run_sequence(codec, 32);
+               reg = wm8903_read(codec, WM8903_CLOCK_RATES_2);
+               reg &= ~WM8903_CLK_SYS_ENA;
+               wm8903_write(codec, WM8903_CLOCK_RATES_2, reg);
                break;
        }
 
@@ -1257,7 +1271,8 @@ static struct {
        { 0,      0 },
 };
 
-static int wm8903_startup(struct snd_pcm_substream *substream)
+static int wm8903_startup(struct snd_pcm_substream *substream,
+                         struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1298,7 +1313,8 @@ static int wm8903_startup(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static void wm8903_shutdown(struct snd_pcm_substream *substream)
+static void wm8903_shutdown(struct snd_pcm_substream *substream,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1317,7 +1333,8 @@ static void wm8903_shutdown(struct snd_pcm_substream *substream)
 }
 
 static int wm8903_hw_params(struct snd_pcm_substream *substream,
-                           struct snd_pcm_hw_params *params)
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1515,8 +1532,6 @@ struct snd_soc_dai wm8903_dai = {
                 .startup = wm8903_startup,
                 .shutdown = wm8903_shutdown,
                 .hw_params = wm8903_hw_params,
-       },
-       .dai_ops = {
                 .digital_mute = wm8903_digital_mute,
                 .set_fmt = wm8903_set_dai_fmt,
                 .set_sysclk = wm8903_set_dai_sysclk
@@ -1560,39 +1575,48 @@ static int wm8903_resume(struct platform_device *pdev)
        return 0;
 }
 
-/*
- * initialise the WM8903 driver
- * register the mixer and dsp interfaces with the kernel
- */
-static int wm8903_init(struct snd_soc_device *socdev)
+static struct snd_soc_codec *wm8903_codec;
+
+static int wm8903_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
 {
-       struct snd_soc_codec *codec = socdev->codec;
-       struct i2c_client *i2c = codec->control_data;
-       int ret = 0;
+       struct wm8903_priv *wm8903;
+       struct snd_soc_codec *codec;
+       int ret;
        u16 val;
 
-       val = wm8903_hw_read(codec, WM8903_SW_RESET_AND_ID);
-       if (val != wm8903_reg_defaults[WM8903_SW_RESET_AND_ID]) {
-               dev_err(&i2c->dev,
-                       "Device with ID register %x is not a WM8903\n", val);
-               return -ENODEV;
-       }
+       wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL);
+       if (wm8903 == NULL)
+               return -ENOMEM;
+
+       codec = &wm8903->codec;
 
+       mutex_init(&codec->mutex);
+       INIT_LIST_HEAD(&codec->dapm_widgets);
+       INIT_LIST_HEAD(&codec->dapm_paths);
+
+       codec->dev = &i2c->dev;
        codec->name = "WM8903";
        codec->owner = THIS_MODULE;
        codec->read = wm8903_read;
        codec->write = wm8903_write;
+       codec->hw_write = (hw_write_t)i2c_master_send;
        codec->bias_level = SND_SOC_BIAS_OFF;
        codec->set_bias_level = wm8903_set_bias_level;
        codec->dai = &wm8903_dai;
        codec->num_dai = 1;
-       codec->reg_cache_size = ARRAY_SIZE(wm8903_reg_defaults);
-       codec->reg_cache = kmemdup(wm8903_reg_defaults,
-                                  sizeof(wm8903_reg_defaults),
-                                  GFP_KERNEL);
-       if (codec->reg_cache == NULL) {
-               dev_err(&i2c->dev, "Failed to allocate register cache\n");
-               return -ENOMEM;
+       codec->reg_cache_size = ARRAY_SIZE(wm8903->reg_cache);
+       codec->reg_cache = &wm8903->reg_cache[0];
+       codec->private_data = wm8903;
+
+       i2c_set_clientdata(i2c, codec);
+       codec->control_data = i2c;
+
+       val = wm8903_hw_read(codec, WM8903_SW_RESET_AND_ID);
+       if (val != wm8903_reg_defaults[WM8903_SW_RESET_AND_ID]) {
+               dev_err(&i2c->dev,
+                       "Device with ID register %x is not a WM8903\n", val);
+               return -ENODEV;
        }
 
        val = wm8903_read(codec, WM8903_REVISION_NUMBER);
@@ -1601,16 +1625,6 @@ static int wm8903_init(struct snd_soc_device *socdev)
 
        wm8903_reset(codec);
 
-       /* register pcms */
-       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
-       if (ret < 0) {
-               dev_err(&i2c->dev, "failed to create pcms\n");
-               goto pcm_err;
-       }
-
-       /* SYSCLK is required for pretty much anything */
-       wm8903_write(codec, WM8903_CLOCK_RATES_2, WM8903_CLK_SYS_ENA);
-
        /* power on device */
        wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
@@ -1645,47 +1659,45 @@ static int wm8903_init(struct snd_soc_device *socdev)
        val |= WM8903_DAC_MUTEMODE;
        wm8903_write(codec, WM8903_DAC_DIGITAL_1, val);
 
-       wm8903_add_controls(codec);
-       wm8903_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
-       if (ret < 0) {
-               dev_err(&i2c->dev, "wm8903: failed to register card\n");
-               goto card_err;
+       wm8903_dai.dev = &i2c->dev;
+       wm8903_codec = codec;
+
+       ret = snd_soc_register_codec(codec);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to register codec: %d\n", ret);
+               goto err;
+       }
+
+       ret = snd_soc_register_dai(&wm8903_dai);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to register DAI: %d\n", ret);
+               goto err_codec;
        }
 
        return ret;
 
-card_err:
-       snd_soc_free_pcms(socdev);
-       snd_soc_dapm_free(socdev);
-pcm_err:
-       kfree(codec->reg_cache);
+err_codec:
+       snd_soc_unregister_codec(codec);
+err:
+       wm8903_codec = NULL;
+       kfree(wm8903);
        return ret;
 }
 
-static struct snd_soc_device *wm8903_socdev;
-
-static int wm8903_i2c_probe(struct i2c_client *i2c,
-                           const struct i2c_device_id *id)
+static int wm8903_i2c_remove(struct i2c_client *client)
 {
-       struct snd_soc_device *socdev = wm8903_socdev;
-       struct snd_soc_codec *codec = socdev->codec;
-       int ret;
+       struct snd_soc_codec *codec = i2c_get_clientdata(client);
 
-       i2c_set_clientdata(i2c, codec);
-       codec->control_data = i2c;
+       snd_soc_unregister_dai(&wm8903_dai);
+       snd_soc_unregister_codec(codec);
 
-       ret = wm8903_init(socdev);
-       if (ret < 0)
-               dev_err(&i2c->dev, "Device initialisation failed\n");
+       wm8903_set_bias_level(codec, SND_SOC_BIAS_OFF);
 
-       return ret;
-}
+       kfree(codec->private_data);
+
+       wm8903_codec = NULL;
+       wm8903_dai.dev = NULL;
 
-static int wm8903_i2c_remove(struct i2c_client *client)
-{
-       struct snd_soc_codec *codec = i2c_get_clientdata(client);
-       kfree(codec->reg_cache);
        return 0;
 }
 
@@ -1709,75 +1721,37 @@ static struct i2c_driver wm8903_i2c_driver = {
 static int wm8903_probe(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct wm8903_setup_data *setup;
-       struct snd_soc_codec *codec;
-       struct wm8903_priv *wm8903;
-       struct i2c_board_info board_info;
-       struct i2c_adapter *adapter;
-       struct i2c_client *i2c_client;
        int ret = 0;
 
-       setup = socdev->codec_data;
-
-       if (!setup->i2c_address) {
-               dev_err(&pdev->dev, "No codec address provided\n");
-               return -ENODEV;
+       if (!wm8903_codec) {
+               dev_err(&pdev->dev, "I2C device not yet probed\n");
+               goto err;
        }
 
-       codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
-       if (codec == NULL)
-               return -ENOMEM;
+       socdev->codec = wm8903_codec;
 
-       wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL);
-       if (wm8903 == NULL) {
-               ret = -ENOMEM;
-               goto err_codec;
+       /* register pcms */
+       ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to create pcms\n");
+               goto err;
        }
 
-       codec->private_data = wm8903;
-       socdev->codec = codec;
-       mutex_init(&codec->mutex);
-       INIT_LIST_HEAD(&codec->dapm_widgets);
-       INIT_LIST_HEAD(&codec->dapm_paths);
-
-       wm8903_socdev = socdev;
+       wm8903_add_controls(socdev->codec);
+       wm8903_add_widgets(socdev->codec);
 
-       codec->hw_write = (hw_write_t)i2c_master_send;
-       ret = i2c_add_driver(&wm8903_i2c_driver);
-       if (ret != 0) {
-               dev_err(&pdev->dev, "can't add i2c driver\n");
-               goto err_priv;
-       } else {
-               memset(&board_info, 0, sizeof(board_info));
-               strlcpy(board_info.type, "wm8903", I2C_NAME_SIZE);
-               board_info.addr = setup->i2c_address;
-
-               adapter = i2c_get_adapter(setup->i2c_bus);
-               if (!adapter) {
-                       dev_err(&pdev->dev, "Can't get I2C bus %d\n",
-                               setup->i2c_bus);
-                       ret = -ENODEV;
-                       goto err_adapter;
-               }
-
-               i2c_client = i2c_new_device(adapter, &board_info);
-               i2c_put_adapter(adapter);
-               if (i2c_client == NULL) {
-                       dev_err(&pdev->dev,
-                               "I2C driver registration failed\n");
-                       ret = -ENODEV;
-                       goto err_adapter;
-               }
+       ret = snd_soc_init_card(socdev);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "wm8903: failed to register card\n");
+               goto card_err;
        }
 
        return ret;
 
-err_adapter:
-       i2c_del_driver(&wm8903_i2c_driver);
-err_priv:
-       kfree(codec->private_data);
-err_codec:
-       kfree(codec);
+card_err:
+       snd_soc_free_pcms(socdev);
+       snd_soc_dapm_free(socdev);
+err:
        return ret;
 }
 
@@ -1792,10 +1766,6 @@ static int wm8903_remove(struct platform_device *pdev)
 
        snd_soc_free_pcms(socdev);
        snd_soc_dapm_free(socdev);
-       i2c_unregister_device(socdev->codec->control_data);
-       i2c_del_driver(&wm8903_i2c_driver);
-       kfree(codec->private_data);
-       kfree(codec);
 
        return 0;
 }
@@ -1808,6 +1778,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8903 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8903);
 
+static int __init wm8903_modinit(void)
+{
+       return i2c_add_driver(&wm8903_i2c_driver);
+}
+module_init(wm8903_modinit);
+
+static void __exit wm8903_exit(void)
+{
+       i2c_del_driver(&wm8903_i2c_driver);
+}
+module_exit(wm8903_exit);
+
 MODULE_DESCRIPTION("ASoC WM8903 driver");
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.cm>");
 MODULE_LICENSE("GPL");
index cec622f2f66020c3a41923b440baad33fe6df225..0ea27e2b9963922b4da5899773f256c9b76813ce 100644 (file)
 extern struct snd_soc_dai wm8903_dai;
 extern struct snd_soc_codec_device soc_codec_dev_wm8903;
 
-struct wm8903_setup_data {
-       int i2c_bus;
-       int i2c_address;
-};
-
 #define WM8903_MCLK_DIV_2 1
 #define WM8903_CLK_SYS    2
 #define WM8903_BCLK       3
index f41a578ddd4fabe908053cee4b273a43155b0e77..88ead7f8dd98007cf4b909a06b30679ff65721d3 100644 (file)
@@ -541,7 +541,8 @@ static int wm8971_set_dai_fmt(struct snd_soc_dai *codec_dai,
 }
 
 static int wm8971_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -634,8 +635,6 @@ struct snd_soc_dai wm8971_dai = {
                .formats = WM8971_FORMATS,},
        .ops = {
                .hw_params = wm8971_pcm_hw_params,
-       },
-       .dai_ops = {
                .digital_mute = wm8971_mute,
                .set_fmt = wm8971_set_dai_fmt,
                .set_sysclk = wm8971_set_dai_sysclk,
@@ -748,7 +747,7 @@ static int wm8971_init(struct snd_soc_device *socdev)
 
        wm8971_add_controls(codec);
        wm8971_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8971: failed to register card\n");
                goto card_err;
@@ -936,6 +935,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8971 = {
 
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8971);
 
+static int __init wm8971_modinit(void)
+{
+       return snd_soc_register_dai(&wm8971_dai);
+}
+module_init(wm8971_modinit);
+
+static void __exit wm8971_exit(void)
+{
+       snd_soc_unregister_dai(&wm8971_dai);
+}
+module_exit(wm8971_exit);
+
 MODULE_DESCRIPTION("ASoC WM8971 driver");
 MODULE_AUTHOR("Lab126");
 MODULE_LICENSE("GPL");
index 572d22b0880b5b1f1033e244cee6269831cd9216..5b5afc14447817ede31e23807af451f4def6e989 100644 (file)
@@ -106,6 +106,7 @@ static const u16 wm8990_reg[] = {
        0x0008,     /* R60 - PLL1 */
        0x0031,     /* R61 - PLL2 */
        0x0026,     /* R62 - PLL3 */
+       0x0000,     /* R63 - Driver internal */
 };
 
 /*
@@ -126,10 +127,9 @@ static inline void wm8990_write_reg_cache(struct snd_soc_codec *codec,
        unsigned int reg, unsigned int value)
 {
        u16 *cache = codec->reg_cache;
-       BUG_ON(reg > (ARRAY_SIZE(wm8990_reg)) - 1);
 
-       /* Reset register is uncached */
-       if (reg == 0)
+       /* Reset register and reserved registers are uncached */
+       if (reg == 0 || reg > ARRAY_SIZE(wm8990_reg) - 1)
                return;
 
        cache[reg] = value;
@@ -1172,7 +1172,8 @@ static int wm8990_set_dai_clkdiv(struct snd_soc_dai *codec_dai,
  * Set PCM DAI bit size and sample rate.
  */
 static int wm8990_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
@@ -1222,8 +1223,14 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
        switch (level) {
        case SND_SOC_BIAS_ON:
                break;
+
        case SND_SOC_BIAS_PREPARE:
+               /* VMID=2*50k */
+               val = wm8990_read_reg_cache(codec, WM8990_POWER_MANAGEMENT_1) &
+                       ~WM8990_VMID_MODE_MASK;
+               wm8990_write(codec, WM8990_POWER_MANAGEMENT_1, val | 0x2);
                break;
+
        case SND_SOC_BIAS_STANDBY:
                if (codec->bias_level == SND_SOC_BIAS_OFF) {
                        /* Enable all output discharge bits */
@@ -1272,10 +1279,17 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
 
                        /* disable POBCTRL, SOFT_ST and BUFDCOPEN */
                        wm8990_write(codec, WM8990_ANTIPOP2, WM8990_BUFIOEN);
-               } else {
-                       /* ON -> standby */
 
+                       /* Enable workaround for ADC clocking issue. */
+                       wm8990_write(codec, WM8990_EXT_ACCESS_ENA, 0x2);
+                       wm8990_write(codec, WM8990_EXT_CTL1, 0xa003);
+                       wm8990_write(codec, WM8990_EXT_ACCESS_ENA, 0);
                }
+
+               /* VMID=2*250k */
+               val = wm8990_read_reg_cache(codec, WM8990_POWER_MANAGEMENT_1) &
+                       ~WM8990_VMID_MODE_MASK;
+               wm8990_write(codec, WM8990_POWER_MANAGEMENT_1, val | 0x4);
                break;
 
        case SND_SOC_BIAS_OFF:
@@ -1349,8 +1363,7 @@ struct snd_soc_dai wm8990_dai = {
                .rates = WM8990_RATES,
                .formats = WM8990_FORMATS,},
        .ops = {
-               .hw_params = wm8990_hw_params,},
-       .dai_ops = {
+               .hw_params = wm8990_hw_params,
                .digital_mute = wm8990_mute,
                .set_fmt = wm8990_set_dai_fmt,
                .set_clkdiv = wm8990_set_dai_clkdiv,
@@ -1449,7 +1462,7 @@ static int wm8990_init(struct snd_soc_device *socdev)
 
        wm8990_add_controls(codec);
        wm8990_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm8990: failed to register card\n");
                goto card_err;
@@ -1630,6 +1643,18 @@ struct snd_soc_codec_device soc_codec_dev_wm8990 = {
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8990);
 
+static int __init wm8990_modinit(void)
+{
+       return snd_soc_register_dai(&wm8990_dai);
+}
+module_init(wm8990_modinit);
+
+static void __exit wm8990_exit(void)
+{
+       snd_soc_unregister_dai(&wm8990_dai);
+}
+module_exit(wm8990_exit);
+
 MODULE_DESCRIPTION("ASoC WM8990 driver");
 MODULE_AUTHOR("Liam Girdwood");
 MODULE_LICENSE("GPL");
index 0e192f3b07882a44cb7950486c3f8bacafa4a09f..7114ddc88b4ba5fb6c2dff17712b7b05c36ac39c 100644 (file)
@@ -80,8 +80,8 @@
 #define WM8990_PLL3                             0x3E
 #define WM8990_INTDRIVBITS                     0x3F
 
-#define WM8990_REGISTER_COUNT                   60
-#define WM8990_MAX_REGISTER                     0x3F
+#define WM8990_EXT_ACCESS_ENA                  0x75
+#define WM8990_EXT_CTL1                                0x7a
 
 /*
  * Field Definitions.
index ffb471e420e2e76718f931420135c8b99cf21864..af83d629078a47f2dbaac75d6d47036086b57ce1 100644 (file)
@@ -487,7 +487,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
        return 0;
 }
 
-static int ac97_prepare(struct snd_pcm_substream *substream)
+static int ac97_prepare(struct snd_pcm_substream *substream,
+                       struct snd_soc_dai *dai)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -507,7 +508,8 @@ static int ac97_prepare(struct snd_pcm_substream *substream)
        return ac97_write(codec, reg, runtime->rate);
 }
 
-static int ac97_aux_prepare(struct snd_pcm_substream *substream)
+static int ac97_aux_prepare(struct snd_pcm_substream *substream,
+                           struct snd_soc_dai *dai)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -533,7 +535,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
 struct snd_soc_dai wm9712_dai[] = {
 {
        .name = "AC97 HiFi",
-       .type = SND_SOC_DAI_AC97_BUS,
+       .ac97_control = 1,
        .playback = {
                .stream_name = "HiFi Playback",
                .channels_min = 1,
@@ -688,7 +690,7 @@ static int wm9712_soc_probe(struct platform_device *pdev)
 
        ret = wm9712_reset(codec, 0);
        if (ret < 0) {
-               printk(KERN_ERR "AC97 link error\n");
+               printk(KERN_ERR "Failed to reset WM9712: AC97 link error\n");
                goto reset_err;
        }
 
@@ -698,7 +700,7 @@ static int wm9712_soc_probe(struct platform_device *pdev)
        wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
        wm9712_add_controls(codec);
        wm9712_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0) {
                printk(KERN_ERR "wm9712: failed to register card\n");
                goto reset_err;
index 945b32ed98840039a93289c108c27fd69656a927..f3ca8aaf013944a33a9516f9c7fd9bbc690e17f0 100644 (file)
@@ -928,11 +928,10 @@ static int wm9713_set_dai_fmt(struct snd_soc_dai *codec_dai,
 }
 
 static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_device *socdev = rtd->socdev;
-       struct snd_soc_codec *codec = socdev->codec;
+       struct snd_soc_codec *codec = dai->codec;
        u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xfff3;
 
        switch (params_format(params)) {
@@ -954,11 +953,10 @@ static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static void wm9713_voiceshutdown(struct snd_pcm_substream *substream)
+static void wm9713_voiceshutdown(struct snd_pcm_substream *substream,
+                                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_device *socdev = rtd->socdev;
-       struct snd_soc_codec *codec = socdev->codec;
+       struct snd_soc_codec *codec = dai->codec;
        u16 status;
 
        /* Gracefully shut down the voice interface. */
@@ -969,12 +967,11 @@ static void wm9713_voiceshutdown(struct snd_pcm_substream *substream)
        ac97_write(codec, AC97_EXTENDED_MID, status);
 }
 
-static int ac97_hifi_prepare(struct snd_pcm_substream *substream)
+static int ac97_hifi_prepare(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
 {
+       struct snd_soc_codec *codec = dai->codec;
        struct snd_pcm_runtime *runtime = substream->runtime;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_device *socdev = rtd->socdev;
-       struct snd_soc_codec *codec = socdev->codec;
        int reg;
        u16 vra;
 
@@ -989,12 +986,11 @@ static int ac97_hifi_prepare(struct snd_pcm_substream *substream)
        return ac97_write(codec, reg, runtime->rate);
 }
 
-static int ac97_aux_prepare(struct snd_pcm_substream *substream)
+static int ac97_aux_prepare(struct snd_pcm_substream *substream,
+                           struct snd_soc_dai *dai)
 {
+       struct snd_soc_codec *codec = dai->codec;
        struct snd_pcm_runtime *runtime = substream->runtime;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_device *socdev = rtd->socdev;
-       struct snd_soc_codec *codec = socdev->codec;
        u16 vra, xsle;
 
        vra = ac97_read(codec, AC97_EXTENDED_STATUS);
@@ -1028,7 +1024,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
 struct snd_soc_dai wm9713_dai[] = {
 {
        .name = "AC97 HiFi",
-       .type = SND_SOC_DAI_AC97_BUS,
+       .ac97_control = 1,
        .playback = {
                .stream_name = "HiFi Playback",
                .channels_min = 1,
@@ -1042,8 +1038,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .rates = WM9713_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
        .ops = {
-               .prepare = ac97_hifi_prepare,},
-       .dai_ops = {
+               .prepare = ac97_hifi_prepare,
                .set_clkdiv = wm9713_set_dai_clkdiv,
                .set_pll = wm9713_set_dai_pll,},
        },
@@ -1056,8 +1051,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .rates = WM9713_RATES,
                .formats = SNDRV_PCM_FMTBIT_S16_LE,},
        .ops = {
-               .prepare = ac97_aux_prepare,},
-       .dai_ops = {
+               .prepare = ac97_aux_prepare,
                .set_clkdiv = wm9713_set_dai_clkdiv,
                .set_pll = wm9713_set_dai_pll,},
        },
@@ -1077,8 +1071,7 @@ struct snd_soc_dai wm9713_dai[] = {
                .formats = WM9713_PCM_FORMATS,},
        .ops = {
                .hw_params = wm9713_pcm_hw_params,
-               .shutdown = wm9713_voiceshutdown,},
-       .dai_ops = {
+               .shutdown = wm9713_voiceshutdown,
                .set_clkdiv = wm9713_set_dai_clkdiv,
                .set_pll = wm9713_set_dai_pll,
                .set_fmt = wm9713_set_dai_fmt,
@@ -1097,6 +1090,8 @@ int wm9713_reset(struct snd_soc_codec *codec, int try_warm)
        }
 
        soc_ac97_ops.reset(codec->ac97);
+       if (soc_ac97_ops.warm_reset)
+               soc_ac97_ops.warm_reset(codec->ac97);
        if (ac97_read(codec, 0) != wm9713_reg[0])
                return -EIO;
        return 0;
@@ -1240,7 +1235,7 @@ static int wm9713_soc_probe(struct platform_device *pdev)
        wm9713_reset(codec, 0);
        ret = wm9713_reset(codec, 1);
        if (ret < 0) {
-               printk(KERN_ERR "AC97 link error\n");
+               printk(KERN_ERR "Failed to reset WM9713: AC97 link error\n");
                goto reset_err;
        }
 
@@ -1252,7 +1247,7 @@ static int wm9713_soc_probe(struct platform_device *pdev)
 
        wm9713_add_controls(codec);
        wm9713_add_widgets(codec);
-       ret = snd_soc_register_card(socdev);
+       ret = snd_soc_init_card(socdev);
        if (ret < 0)
                goto reset_err;
        return 0;
@@ -1288,7 +1283,6 @@ static int wm9713_soc_remove(struct platform_device *pdev)
        snd_soc_free_ac97_codec(codec);
        kfree(codec->private_data);
        kfree(codec->reg_cache);
-       kfree(codec->dai);
        kfree(codec);
        return 0;
 }
index 8f7e3383490246e81c66c4dc7b92849d768b804e..b502741692d6ba866047917046c04d267a3ac89f 100644 (file)
@@ -17,3 +17,13 @@ config SND_DAVINCI_SOC_EVM
        help
          Say Y if you want to add support for SoC audio on TI
          DaVinci EVM platform.
+
+config SND_DAVINCI_SOC_SFFSDR
+       tristate "SoC Audio support for SFFSDR"
+       depends on SND_DAVINCI_SOC && MACH_DAVINCI_SFFSDR
+       select SND_DAVINCI_SOC_I2S
+       select SND_SOC_PCM3008
+       select SFFSDR_FPGA
+       help
+         Say Y if you want to add support for SoC audio on
+         Lyrtech SFFSDR board.
index ca772e5b463727b1a7bb32d22e845fdf634b7d17..ca8bae1fc3f6ff00b062dd42094bd4c7035fe619 100644 (file)
@@ -7,5 +7,7 @@ obj-$(CONFIG_SND_DAVINCI_SOC_I2S) += snd-soc-davinci-i2s.o
 
 # DAVINCI Machine Support
 snd-soc-evm-objs := davinci-evm.o
+snd-soc-sffsdr-objs := davinci-sffsdr.o
 
 obj-$(CONFIG_SND_DAVINCI_SOC_EVM) += snd-soc-evm.o
+obj-$(CONFIG_SND_DAVINCI_SOC_SFFSDR) += snd-soc-sffsdr.o
index 9e6062cd6b59957f6df964470a52b8756f7f9398..01b948bb55a1ee6fdc5f5a13a43713980d8f0d32 100644 (file)
@@ -28,6 +28,8 @@
 
 #define EVM_CODEC_CLOCK 22579200
 
+#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
+               SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF)
 static int evm_hw_params(struct snd_pcm_substream *substream,
                         struct snd_pcm_hw_params *params)
 {
@@ -37,14 +39,12 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
        int ret = 0;
 
        /* set codec DAI configuration */
-       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
-                                        SND_SOC_DAIFMT_CBM_CFM);
+       ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
        if (ret < 0)
                return ret;
 
        /* set cpu DAI configuration */
-       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_CBM_CFM |
-                                      SND_SOC_DAIFMT_IB_NF);
+       ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
        if (ret < 0)
                return ret;
 
@@ -128,8 +128,9 @@ static struct snd_soc_dai_link evm_dai = {
 };
 
 /* davinci-evm audio machine driver */
-static struct snd_soc_machine snd_soc_machine_evm = {
+static struct snd_soc_card snd_soc_card_evm = {
        .name = "DaVinci EVM",
+       .platform = &davinci_soc_platform,
        .dai_link = &evm_dai,
        .num_links = 1,
 };
@@ -142,8 +143,7 @@ static struct aic3x_setup_data evm_aic3x_setup = {
 
 /* evm audio subsystem */
 static struct snd_soc_device evm_snd_devdata = {
-       .machine = &snd_soc_machine_evm,
-       .platform = &davinci_soc_platform,
+       .card = &snd_soc_card_evm,
        .codec_dev = &soc_codec_dev_aic3x,
        .codec_data = &evm_aic3x_setup,
 };
index abb5fedb0b1e0952ecb17fedb7592ab966c0ffda..0fee779e3c7601168334bc6e60506d302c9da7ab 100644 (file)
@@ -59,6 +59,7 @@
 #define DAVINCI_MCBSP_PCR_CLKXP                (1 << 1)
 #define DAVINCI_MCBSP_PCR_FSRP         (1 << 2)
 #define DAVINCI_MCBSP_PCR_FSXP         (1 << 3)
+#define DAVINCI_MCBSP_PCR_SCLKME       (1 << 7)
 #define DAVINCI_MCBSP_PCR_CLKRM                (1 << 8)
 #define DAVINCI_MCBSP_PCR_CLKXM                (1 << 9)
 #define DAVINCI_MCBSP_PCR_FSRM         (1 << 10)
@@ -110,16 +111,59 @@ static void davinci_mcbsp_start(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
+       struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_platform *platform = socdev->card->platform;
        u32 w;
+       int ret;
 
        /* Start the sample generator and enable transmitter/receiver */
        w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
        MOD_REG_BIT(w, DAVINCI_MCBSP_SPCR_GRST, 1);
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               /* Stop the DMA to avoid data loss */
+               /* while the transmitter is out of reset to handle XSYNCERR */
+               if (platform->pcm_ops->trigger) {
+                       ret = platform->pcm_ops->trigger(substream,
+                               SNDRV_PCM_TRIGGER_STOP);
+                       if (ret < 0)
+                               printk(KERN_DEBUG "Playback DMA stop failed\n");
+               }
+
+               /* Enable the transmitter */
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
                MOD_REG_BIT(w, DAVINCI_MCBSP_SPCR_XRST, 1);
-       else
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+
+               /* wait for any unexpected frame sync error to occur */
+               udelay(100);
+
+               /* Disable the transmitter to clear any outstanding XSYNCERR */
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
+               MOD_REG_BIT(w, DAVINCI_MCBSP_SPCR_XRST, 0);
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+
+               /* Restart the DMA */
+               if (platform->pcm_ops->trigger) {
+                       ret = platform->pcm_ops->trigger(substream,
+                               SNDRV_PCM_TRIGGER_START);
+                       if (ret < 0)
+                               printk(KERN_DEBUG "Playback DMA start failed\n");
+               }
+               /* Enable the transmitter */
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
+               MOD_REG_BIT(w, DAVINCI_MCBSP_SPCR_XRST, 1);
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+
+       } else {
+
+               /* Enable the reciever */
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
                MOD_REG_BIT(w, DAVINCI_MCBSP_SPCR_RRST, 1);
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+       }
+
 
        /* Start frame sync */
        w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
@@ -144,7 +188,8 @@ static void davinci_mcbsp_stop(struct snd_pcm_substream *substream)
        davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
 }
 
-static int davinci_i2s_startup(struct snd_pcm_substream *substream)
+static int davinci_i2s_startup(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -155,61 +200,138 @@ static int davinci_i2s_startup(struct snd_pcm_substream *substream)
        return 0;
 }
 
+#define DEFAULT_BITPERSAMPLE   16
+
 static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                                   unsigned int fmt)
 {
        struct davinci_mcbsp_dev *dev = cpu_dai->private_data;
-       u32 w;
+       unsigned int pcr;
+       unsigned int srgr;
+       unsigned int rcr;
+       unsigned int xcr;
+       srgr = DAVINCI_MCBSP_SRGR_FSGM |
+               DAVINCI_MCBSP_SRGR_FPER(DEFAULT_BITPERSAMPLE * 2 - 1) |
+               DAVINCI_MCBSP_SRGR_FWID(DEFAULT_BITPERSAMPLE - 1);
 
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
        case SND_SOC_DAIFMT_CBS_CFS:
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG,
-                                       DAVINCI_MCBSP_PCR_FSXM |
-                                       DAVINCI_MCBSP_PCR_FSRM |
-                                       DAVINCI_MCBSP_PCR_CLKXM |
-                                       DAVINCI_MCBSP_PCR_CLKRM);
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG,
-                                       DAVINCI_MCBSP_SRGR_FSGM);
+               /* cpu is master */
+               pcr = DAVINCI_MCBSP_PCR_FSXM |
+                       DAVINCI_MCBSP_PCR_FSRM |
+                       DAVINCI_MCBSP_PCR_CLKXM |
+                       DAVINCI_MCBSP_PCR_CLKRM;
+               break;
+       case SND_SOC_DAIFMT_CBM_CFS:
+               /* McBSP CLKR pin is the input for the Sample Rate Generator.
+                * McBSP FSR and FSX are driven by the Sample Rate Generator. */
+               pcr = DAVINCI_MCBSP_PCR_SCLKME |
+                       DAVINCI_MCBSP_PCR_FSXM |
+                       DAVINCI_MCBSP_PCR_FSRM;
                break;
        case SND_SOC_DAIFMT_CBM_CFM:
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, 0);
+               /* codec is master */
+               pcr = 0;
                break;
        default:
+               printk(KERN_ERR "%s:bad master\n", __func__);
                return -EINVAL;
        }
 
-       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
-       case SND_SOC_DAIFMT_IB_NF:
-               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_PCR_REG);
-               MOD_REG_BIT(w, DAVINCI_MCBSP_PCR_CLKXP |
-                              DAVINCI_MCBSP_PCR_CLKRP, 1);
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, w);
+       rcr = DAVINCI_MCBSP_RCR_RFRLEN1(1);
+       xcr = DAVINCI_MCBSP_XCR_XFIG | DAVINCI_MCBSP_XCR_XFRLEN1(1);
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_DSP_B:
                break;
-       case SND_SOC_DAIFMT_NB_IF:
-               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_PCR_REG);
-               MOD_REG_BIT(w, DAVINCI_MCBSP_PCR_FSXP |
-                              DAVINCI_MCBSP_PCR_FSRP, 1);
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, w);
+       case SND_SOC_DAIFMT_I2S:
+               /* Davinci doesn't support TRUE I2S, but some codecs will have
+                * the left and right channels contiguous. This allows
+                * dsp_a mode to be used with an inverted normal frame clk.
+                * If your codec is master and does not have contiguous
+                * channels, then you will have sound on only one channel.
+                * Try using a different mode, or codec as slave.
+                *
+                * The TLV320AIC33 is an example of a codec where this works.
+                * It has a variable bit clock frequency allowing it to have
+                * valid data on every bit clock.
+                *
+                * The TLV320AIC23 is an example of a codec where this does not
+                * work. It has a fixed bit clock frequency with progressively
+                * more empty bit clock slots between channels as the sample
+                * rate is lowered.
+                */
+               fmt ^= SND_SOC_DAIFMT_NB_IF;
+       case SND_SOC_DAIFMT_DSP_A:
+               rcr |= DAVINCI_MCBSP_RCR_RDATDLY(1);
+               xcr |= DAVINCI_MCBSP_XCR_XDATDLY(1);
+               break;
+       default:
+               printk(KERN_ERR "%s:bad format\n", __func__);
+               return -EINVAL;
+       }
+
+       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+       case SND_SOC_DAIFMT_NB_NF:
+               /* CLKRP Receive clock polarity,
+                *      1 - sampled on rising edge of CLKR
+                *      valid on rising edge
+                * CLKXP Transmit clock polarity,
+                *      1 - clocked on falling edge of CLKX
+                *      valid on rising edge
+                * FSRP  Receive frame sync pol, 0 - active high
+                * FSXP  Transmit frame sync pol, 0 - active high
+                */
+               pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP);
                break;
        case SND_SOC_DAIFMT_IB_IF:
-               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_PCR_REG);
-               MOD_REG_BIT(w, DAVINCI_MCBSP_PCR_CLKXP |
-                              DAVINCI_MCBSP_PCR_CLKRP |
-                              DAVINCI_MCBSP_PCR_FSXP |
-                              DAVINCI_MCBSP_PCR_FSRP, 1);
-               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, w);
+               /* CLKRP Receive clock polarity,
+                *      0 - sampled on falling edge of CLKR
+                *      valid on falling edge
+                * CLKXP Transmit clock polarity,
+                *      0 - clocked on rising edge of CLKX
+                *      valid on falling edge
+                * FSRP  Receive frame sync pol, 1 - active low
+                * FSXP  Transmit frame sync pol, 1 - active low
+                */
+               pcr |= (DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
                break;
-       case SND_SOC_DAIFMT_NB_NF:
+       case SND_SOC_DAIFMT_NB_IF:
+               /* CLKRP Receive clock polarity,
+                *      1 - sampled on rising edge of CLKR
+                *      valid on rising edge
+                * CLKXP Transmit clock polarity,
+                *      1 - clocked on falling edge of CLKX
+                *      valid on rising edge
+                * FSRP  Receive frame sync pol, 1 - active low
+                * FSXP  Transmit frame sync pol, 1 - active low
+                */
+               pcr |= (DAVINCI_MCBSP_PCR_CLKXP | DAVINCI_MCBSP_PCR_CLKRP |
+                       DAVINCI_MCBSP_PCR_FSXP | DAVINCI_MCBSP_PCR_FSRP);
+               break;
+       case SND_SOC_DAIFMT_IB_NF:
+               /* CLKRP Receive clock polarity,
+                *      0 - sampled on falling edge of CLKR
+                *      valid on falling edge
+                * CLKXP Transmit clock polarity,
+                *      0 - clocked on rising edge of CLKX
+                *      valid on falling edge
+                * FSRP  Receive frame sync pol, 0 - active high
+                * FSXP  Transmit frame sync pol, 0 - active high
+                */
                break;
        default:
                return -EINVAL;
        }
-
+       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, srgr);
+       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, pcr);
+       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr);
+       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, xcr);
        return 0;
 }
 
 static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
-                                struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct davinci_pcm_dma_params *dma_params = rtd->dai->cpu_dai->dma_data;
@@ -219,25 +341,20 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
        u32 w;
 
        /* general line settings */
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG,
-                               DAVINCI_MCBSP_SPCR_RINTM(3) |
-                               DAVINCI_MCBSP_SPCR_XINTM(3) |
-                               DAVINCI_MCBSP_SPCR_FREE);
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG,
-                               DAVINCI_MCBSP_RCR_RFRLEN1(1) |
-                               DAVINCI_MCBSP_RCR_RDATDLY(1));
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG,
-                               DAVINCI_MCBSP_XCR_XFRLEN1(1) |
-                               DAVINCI_MCBSP_XCR_XDATDLY(1) |
-                               DAVINCI_MCBSP_XCR_XFIG);
+       w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
+       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+               w |= DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+       } else {
+               w |= DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE;
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w);
+       }
 
        i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS);
-       w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG);
+       w = DAVINCI_MCBSP_SRGR_FSGM;
        MOD_REG_BIT(w, DAVINCI_MCBSP_SRGR_FWID(snd_interval_value(i) - 1), 1);
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, w);
 
        i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_FRAME_BITS);
-       w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG);
        MOD_REG_BIT(w, DAVINCI_MCBSP_SRGR_FPER(snd_interval_value(i) - 1), 1);
        davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, w);
 
@@ -260,20 +377,24 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG);
-       MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) |
-                      DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1);
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w);
+       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG);
+               MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) |
+                              DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1);
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w);
 
-       w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG);
-       MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) |
-                      DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1);
-       davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w);
+       } else {
+               w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG);
+               MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) |
+                              DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1);
+               davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w);
 
+       }
        return 0;
 }
 
-static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                              struct snd_soc_dai *dai)
 {
        int ret = 0;
 
@@ -299,8 +420,8 @@ static int davinci_i2s_probe(struct platform_device *pdev,
                             struct snd_soc_dai *dai)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_dai *cpu_dai = machine->dai_link[pdev->id].cpu_dai;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai;
        struct davinci_mcbsp_dev *dev;
        struct resource *mem, *ioarea;
        struct evm_snd_platform_data *pdata;
@@ -361,8 +482,8 @@ static void davinci_i2s_remove(struct platform_device *pdev,
                               struct snd_soc_dai *dai)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_dai *cpu_dai = machine->dai_link[pdev->id].cpu_dai;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai;
        struct davinci_mcbsp_dev *dev = cpu_dai->private_data;
        struct resource *mem;
 
@@ -381,7 +502,6 @@ static void davinci_i2s_remove(struct platform_device *pdev,
 struct snd_soc_dai davinci_i2s_dai = {
        .name = "davinci-i2s",
        .id = 0,
-       .type = SND_SOC_DAI_I2S,
        .probe = davinci_i2s_probe,
        .remove = davinci_i2s_remove,
        .playback = {
@@ -397,13 +517,24 @@ struct snd_soc_dai davinci_i2s_dai = {
        .ops = {
                .startup = davinci_i2s_startup,
                .trigger = davinci_i2s_trigger,
-               .hw_params = davinci_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = davinci_i2s_hw_params,
                .set_fmt = davinci_i2s_set_dai_fmt,
        },
 };
 EXPORT_SYMBOL_GPL(davinci_i2s_dai);
 
+static int __init davinci_i2s_init(void)
+{
+       return snd_soc_register_dai(&davinci_i2s_dai);
+}
+module_init(davinci_i2s_init);
+
+static void __exit davinci_i2s_exit(void)
+{
+       snd_soc_unregister_dai(&davinci_i2s_dai);
+}
+module_exit(davinci_i2s_exit);
+
 MODULE_AUTHOR("Vladimir Barinov");
 MODULE_DESCRIPTION("TI DAVINCI I2S (McBSP) SoC Interface");
 MODULE_LICENSE("GPL");
index 76feaa657375e3579cee33db8528a3d6e57f4da6..74abc9b4f1ccd6e9277166873047499bb39c8380 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
+#include <linux/kernel.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
 
 #include "davinci-pcm.h"
 
-#define DAVINCI_PCM_DEBUG 0
-#if DAVINCI_PCM_DEBUG
-#define DPRINTK(x...) printk(KERN_DEBUG x)
-#else
-#define DPRINTK(x...)
-#endif
-
 static struct snd_pcm_hardware davinci_pcm_hardware = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
                 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
@@ -78,8 +72,8 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
        dma_offset = prtd->period * period_size;
        dma_pos = runtime->dma_addr + dma_offset;
 
-       DPRINTK("audio_set_dma_params_play channel = %d dma_ptr = %x "
-               "period_size=%x\n", lch, dma_pos, period_size);
+       pr_debug("davinci_pcm: audio_set_dma_params_play channel = %d "
+               "dma_ptr = %x period_size=%x\n", lch, dma_pos, period_size);
 
        data_type = prtd->params->data_type;
        count = period_size / data_type;
@@ -112,7 +106,7 @@ static void davinci_pcm_dma_irq(int lch, u16 ch_status, void *data)
        struct snd_pcm_substream *substream = data;
        struct davinci_runtime_data *prtd = substream->runtime->private_data;
 
-       DPRINTK("lch=%d, status=0x%x\n", lch, ch_status);
+       pr_debug("davinci_pcm: lch=%d, status=0x%x\n", lch, ch_status);
 
        if (unlikely(ch_status != DMA_COMPLETE))
                return;
@@ -316,8 +310,8 @@ static int davinci_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
        buf->area = dma_alloc_writecombine(pcm->card->dev, size,
                                           &buf->addr, GFP_KERNEL);
 
-       DPRINTK("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
-               (void *) buf->area, (void *) buf->addr, size);
+       pr_debug("davinci_pcm: preallocate_dma_buffer: area=%p, addr=%p, "
+               "size=%d\n", (void *) buf->area, (void *) buf->addr, size);
 
        if (!buf->area)
                return -ENOMEM;
@@ -384,6 +378,18 @@ struct snd_soc_platform davinci_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(davinci_soc_platform);
 
+static int __init davinci_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&davinci_soc_platform);
+}
+module_init(davinci_soc_platform_init);
+
+static void __exit davinci_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&davinci_soc_platform);
+}
+module_exit(davinci_soc_platform_exit);
+
 MODULE_AUTHOR("Vladimir Barinov");
 MODULE_DESCRIPTION("TI DAVINCI PCM DMA module");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
new file mode 100644 (file)
index 0000000..f67579d
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * ASoC driver for Lyrtech SFFSDR board.
+ *
+ * Author:     Hugo Villeneuve
+ * Copyright (C) 2008 Lyrtech inc
+ *
+ * Based on ASoC driver for TI DAVINCI EVM platform, original copyright follow:
+ * Copyright:   (C) 2007 MontaVista Software, Inc., <source@mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/dma.h>
+#include <asm/plat-sffsdr/sffsdr-fpga.h>
+
+#include <mach/mcbsp.h>
+#include <mach/edma.h>
+
+#include "../codecs/pcm3008.h"
+#include "davinci-pcm.h"
+#include "davinci-i2s.h"
+
+static int sffsdr_hw_params(struct snd_pcm_substream *substream,
+                           struct snd_pcm_hw_params *params,
+                           struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int fs;
+       int ret = 0;
+
+       /* Set cpu DAI configuration:
+        * CLKX and CLKR are the inputs for the Sample Rate Generator.
+        * FSX and FSR are outputs, driven by the sample Rate Generator. */
+       ret = snd_soc_dai_set_fmt(cpu_dai,
+                                 SND_SOC_DAIFMT_RIGHT_J |
+                                 SND_SOC_DAIFMT_CBM_CFS |
+                                 SND_SOC_DAIFMT_IB_NF);
+       if (ret < 0)
+               return ret;
+
+       /* Fsref can be 32000, 44100 or 48000. */
+       fs = params_rate(params);
+
+       pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
+
+       return sffsdr_fpga_set_codec_fs(fs);
+}
+
+static struct snd_soc_ops sffsdr_ops = {
+       .hw_params = sffsdr_hw_params,
+};
+
+/* davinci-sffsdr digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link sffsdr_dai = {
+       .name = "PCM3008", /* Codec name */
+       .stream_name = "PCM3008 HiFi",
+       .cpu_dai = &davinci_i2s_dai,
+       .codec_dai = &pcm3008_dai,
+       .ops = &sffsdr_ops,
+};
+
+/* davinci-sffsdr audio machine driver */
+static struct snd_soc_card snd_soc_sffsdr = {
+       .name = "DaVinci SFFSDR",
+       .platform = &davinci_soc_platform,
+       .dai_link = &sffsdr_dai,
+       .num_links = 1,
+};
+
+/* sffsdr audio private data */
+static struct pcm3008_setup_data sffsdr_pcm3008_setup = {
+       .dem0_pin = GPIO(45),
+       .dem1_pin = GPIO(46),
+       .pdad_pin = GPIO(47),
+       .pdda_pin = GPIO(38),
+};
+
+/* sffsdr audio subsystem */
+static struct snd_soc_device sffsdr_snd_devdata = {
+       .card = &snd_soc_sffsdr,
+       .codec_dev = &soc_codec_dev_pcm3008,
+       .codec_data = &sffsdr_pcm3008_setup,
+};
+
+static struct resource sffsdr_snd_resources[] = {
+       {
+               .start = DAVINCI_MCBSP_BASE,
+               .end = DAVINCI_MCBSP_BASE + SZ_8K - 1,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct evm_snd_platform_data sffsdr_snd_data = {
+       .tx_dma_ch      = DAVINCI_DMA_MCBSP_TX,
+       .rx_dma_ch      = DAVINCI_DMA_MCBSP_RX,
+};
+
+static struct platform_device *sffsdr_snd_device;
+
+static int __init sffsdr_init(void)
+{
+       int ret;
+
+       sffsdr_snd_device = platform_device_alloc("soc-audio", 0);
+       if (!sffsdr_snd_device) {
+               printk(KERN_ERR "platform device allocation failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata);
+       sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev;
+       sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data;
+
+       ret = platform_device_add_resources(sffsdr_snd_device,
+                                           sffsdr_snd_resources,
+                                           ARRAY_SIZE(sffsdr_snd_resources));
+       if (ret) {
+               printk(KERN_ERR "platform device add ressources failed\n");
+               goto error;
+       }
+
+       ret = platform_device_add(sffsdr_snd_device);
+       if (ret)
+               goto error;
+
+       return ret;
+
+error:
+       platform_device_put(sffsdr_snd_device);
+       return ret;
+}
+
+static void __exit sffsdr_exit(void)
+{
+       platform_device_unregister(sffsdr_snd_device);
+}
+
+module_init(sffsdr_init);
+module_exit(sffsdr_exit);
+
+MODULE_AUTHOR("Hugo Villeneuve");
+MODULE_DESCRIPTION("Lyrtech SFFSDR ASoC driver");
+MODULE_LICENSE("GPL");
index 8d73edc561026d4464f1c12868d5de9505726656..95c12b26fe37c0a3acfdb1ba070facdf02ca4067 100644 (file)
@@ -20,7 +20,7 @@ config SND_SOC_MPC8610_HPCD
 
 config SND_SOC_MPC5200_I2S
        tristate "Freescale MPC5200 PSC in I2S mode driver"
-       depends on SND_SOC && PPC_MPC52xx && PPC_BESTCOMM
+       depends on PPC_MPC52xx && PPC_BESTCOMM
        select SND_SOC_OF_SIMPLE
        select PPC_BESTCOMM_GEN_BD
        help
index d2d3da9729f25f56d7563fefabe3f7d94b51f2fa..64993eda5679ebce0cd582afe2fc48f74b7f0605 100644 (file)
@@ -284,7 +284,7 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id)
  * fsl_dma_new: initialize this PCM driver.
  *
  * This function is called when the codec driver calls snd_soc_new_pcms(),
- * once for each .dai_link in the machine driver's snd_soc_machine
+ * once for each .dai_link in the machine driver's snd_soc_card
  * structure.
  */
 static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
@@ -853,6 +853,18 @@ int fsl_dma_configure(struct fsl_dma_info *dma_info)
 }
 EXPORT_SYMBOL_GPL(fsl_dma_configure);
 
+static int __init fsl_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&fsl_soc_platform);
+}
+module_init(fsl_soc_platform_init);
+
+static void __exit fsl_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&fsl_soc_platform);
+}
+module_exit(fsl_soc_platform_exit);
+
 MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
 MODULE_DESCRIPTION("Freescale Elo DMA ASoC PCM module");
 MODULE_LICENSE("GPL");
index 157a7895ffa1befbb2427b121f0bb493c0190b3d..c6d6eb71dc1d9635d7c109531f9b0a653c687d6c 100644 (file)
@@ -266,7 +266,8 @@ static irqreturn_t fsl_ssi_isr(int irq, void *dev_id)
  * If this is the first stream open, then grab the IRQ and program most of
  * the SSI registers.
  */
-static int fsl_ssi_startup(struct snd_pcm_substream *substream)
+static int fsl_ssi_startup(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
@@ -411,7 +412,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream)
  * Note: The SxCCR.DC and SxCCR.PM bits are only used if the SSI is the
  * clock master.
  */
-static int fsl_ssi_prepare(struct snd_pcm_substream *substream)
+static int fsl_ssi_prepare(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -441,7 +443,8 @@ static int fsl_ssi_prepare(struct snd_pcm_substream *substream)
  * The DMA channel is in external master start and pause mode, which
  * means the SSI completely controls the flow of data.
  */
-static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd)
+static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
@@ -490,7 +493,8 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd)
  *
  * Shutdown the SSI if there are no other substreams open.
  */
-static void fsl_ssi_shutdown(struct snd_pcm_substream *substream)
+static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
@@ -578,8 +582,6 @@ static struct snd_soc_dai fsl_ssi_dai_template = {
                .prepare = fsl_ssi_prepare,
                .shutdown = fsl_ssi_shutdown,
                .trigger = fsl_ssi_trigger,
-       },
-       .dai_ops = {
                .set_sysclk = fsl_ssi_set_sysclk,
                .set_fmt = fsl_ssi_set_fmt,
        },
@@ -671,6 +673,14 @@ struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
        fsl_ssi_dai->private_data = ssi_private;
        fsl_ssi_dai->name = ssi_private->name;
        fsl_ssi_dai->id = ssi_info->id;
+       fsl_ssi_dai->dev = ssi_info->dev;
+
+       ret = snd_soc_register_dai(fsl_ssi_dai);
+       if (ret != 0) {
+               dev_err(ssi_info->dev, "failed to register DAI: %d\n", ret);
+               kfree(fsl_ssi_dai);
+               return NULL;
+       }
 
        return fsl_ssi_dai;
 }
@@ -688,6 +698,8 @@ void fsl_ssi_destroy_dai(struct snd_soc_dai *fsl_ssi_dai)
 
        device_remove_file(ssi_private->dev, &ssi_private->dev_attr);
 
+       snd_soc_unregister_dai(&ssi_private->cpu_dai);
+
        kfree(ssi_private);
 }
 EXPORT_SYMBOL_GPL(fsl_ssi_destroy_dai);
index 94a02eaa4825a0ef1494c0f8e3798c2daef69504..9eb1ce185bd0cbd11e0e3e8744499ff7085fa624 100644 (file)
@@ -187,7 +187,8 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream)
  * If this is the first stream open, then grab the IRQ and program most of
  * the PSC registers.
  */
-static int psc_i2s_startup(struct snd_pcm_substream *substream)
+static int psc_i2s_startup(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data;
@@ -220,7 +221,8 @@ static int psc_i2s_startup(struct snd_pcm_substream *substream)
 }
 
 static int psc_i2s_hw_params(struct snd_pcm_substream *substream,
-                                struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data;
@@ -256,7 +258,8 @@ static int psc_i2s_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int psc_i2s_hw_free(struct snd_pcm_substream *substream)
+static int psc_i2s_hw_free(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
 {
        snd_pcm_set_runtime_buffer(substream, NULL);
        return 0;
@@ -268,7 +271,8 @@ static int psc_i2s_hw_free(struct snd_pcm_substream *substream)
  * This function is called by ALSA to start, stop, pause, and resume the DMA
  * transfer of data.
  */
-static int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                          struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data;
@@ -383,7 +387,8 @@ static int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
  *
  * Shutdown the PSC if there are no other substreams open.
  */
-static void psc_i2s_shutdown(struct snd_pcm_substream *substream)
+static void psc_i2s_shutdown(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data;
@@ -464,7 +469,6 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
  * psc_i2s_dai_template: template CPU Digital Audio Interface
  */
 static struct snd_soc_dai psc_i2s_dai_template = {
-       .type = SND_SOC_DAI_I2S,
        .playback = {
                .channels_min = 2,
                .channels_max = 2,
@@ -483,8 +487,6 @@ static struct snd_soc_dai psc_i2s_dai_template = {
                .hw_free = psc_i2s_hw_free,
                .shutdown = psc_i2s_shutdown,
                .trigger = psc_i2s_trigger,
-       },
-       .dai_ops = {
                .set_sysclk = psc_i2s_set_sysclk,
                .set_fmt = psc_i2s_set_fmt,
        },
@@ -826,6 +828,8 @@ static int __devinit psc_i2s_of_probe(struct of_device *op,
        if (rc)
                dev_info(psc_i2s->dev, "error creating sysfs files\n");
 
+       snd_soc_register_platform(&psc_i2s_pcm_soc_platform);
+
        /* Tell the ASoC OF helpers about it */
        of_snd_soc_register_platform(&psc_i2s_pcm_soc_platform, op->node,
                                     &psc_i2s->dai);
@@ -839,6 +843,8 @@ static int __devexit psc_i2s_of_remove(struct of_device *op)
 
        dev_dbg(&op->dev, "psc_i2s_remove()\n");
 
+       snd_soc_unregister_platform(&psc_i2s_pcm_soc_platform);
+
        bcom_gen_bd_rx_release(psc_i2s->capture.bcom_task);
        bcom_gen_bd_tx_release(psc_i2s->playback.bcom_task);
 
index 94f89debde1fa463a043741b022040bad7971b3e..bcec3f60bad99d8e5e885ebe9646ed942ebd1ec4 100644 (file)
@@ -29,7 +29,7 @@
 struct mpc8610_hpcd_data {
        struct snd_soc_device sound_devdata;
        struct snd_soc_dai_link dai;
-       struct snd_soc_machine machine;
+       struct snd_soc_card machine;
        unsigned int dai_format;
        unsigned int codec_clk_direction;
        unsigned int cpu_clk_direction;
@@ -185,7 +185,7 @@ static struct snd_soc_ops mpc8610_hpcd_ops = {
 /**
  * mpc8610_hpcd_machine: ASoC machine data
  */
-static struct snd_soc_machine mpc8610_hpcd_machine = {
+static struct snd_soc_card mpc8610_hpcd_machine = {
        .probe = mpc8610_hpcd_machine_probe,
        .remove = mpc8610_hpcd_machine_remove,
        .name = "MPC8610 HPCD",
@@ -465,9 +465,9 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
                goto error;
        }
 
-       machine_data->sound_devdata.machine = &mpc8610_hpcd_machine;
+       machine_data->sound_devdata.card = &mpc8610_hpcd_machine;
        machine_data->sound_devdata.codec_dev = &soc_codec_device_cs4270;
-       machine_data->sound_devdata.platform = &fsl_soc_platform;
+       machine_data->machine.platform = &fsl_soc_platform;
 
        sound_device->dev.platform_data = machine_data;
 
index 0382fdac51cd44d615ea0cae24ecff239eb4bcc7..8bc5cd9e972fc89a2223dc32f01c42cbffd15fea 100644 (file)
@@ -31,7 +31,7 @@ struct of_snd_soc_device {
        int id;
        struct list_head list;
        struct snd_soc_device device;
-       struct snd_soc_machine machine;
+       struct snd_soc_card card;
        struct snd_soc_dai_link dai_link;
        struct platform_device *pdev;
        struct device_node *platform_node;
@@ -58,9 +58,9 @@ of_snd_soc_get_device(struct device_node *codec_node)
        /* Initialize the structure and add it to the global list */
        of_soc->codec_node = codec_node;
        of_soc->id = of_snd_soc_next_index++;
-       of_soc->machine.dai_link = &of_soc->dai_link;
-       of_soc->machine.num_links = 1;
-       of_soc->device.machine = &of_soc->machine;
+       of_soc->card.dai_link = &of_soc->dai_link;
+       of_soc->card.num_links = 1;
+       of_soc->device.card = &of_soc->card;
        of_soc->dai_link.ops = &of_snd_soc_ops;
        list_add(&of_soc->list, &of_snd_soc_device_list);
 
@@ -158,8 +158,8 @@ int of_snd_soc_register_platform(struct snd_soc_platform *platform,
 
        of_soc->platform_node = node;
        of_soc->dai_link.cpu_dai = cpu_dai;
-       of_soc->device.platform = platform;
-       of_soc->machine.name = of_soc->dai_link.cpu_dai->name;
+       of_soc->card.platform = platform;
+       of_soc->card.name = of_soc->dai_link.cpu_dai->name;
 
        /* Now try to register the SoC device */
        of_snd_soc_register_device(of_soc);
index 8b7766b998d7de431bd30d18d32569019a116d28..a7b1d77b2105ec6e722e11301b822fe270c30e60 100644 (file)
@@ -1,6 +1,6 @@
 config SND_OMAP_SOC
        tristate "SoC Audio for the Texas Instruments OMAP chips"
-       depends on ARCH_OMAP && SND_SOC
+       depends on ARCH_OMAP
 
 config SND_OMAP_SOC_MCBSP
        tristate
@@ -21,3 +21,36 @@ config SND_OMAP_SOC_OSK5912
        select SND_SOC_TLV320AIC23
        help
          Say Y if you want to add support for SoC audio on osk5912.
+
+config SND_OMAP_SOC_OVERO
+       tristate "SoC Audio support for Gumstix Overo"
+       depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OVERO
+       select SND_OMAP_SOC_MCBSP
+       select SND_SOC_TWL4030
+       help
+         Say Y if you want to add support for SoC audio on the Gumstix Overo.
+
+config SND_OMAP_SOC_OMAP2EVM
+       tristate "SoC Audio support for OMAP2EVM board"
+       depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP2EVM
+       select SND_OMAP_SOC_MCBSP
+       select SND_SOC_TWL4030
+       help
+         Say Y if you want to add support for SoC audio on the omap2evm board.
+
+config SND_OMAP_SOC_SDP3430
+       tristate "SoC Audio support for Texas Instruments SDP3430"
+       depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_3430SDP
+       select SND_OMAP_SOC_MCBSP
+       select SND_SOC_TWL4030
+       help
+         Say Y if you want to add support for SoC audio on Texas Instruments
+         SDP3430.
+
+config SND_OMAP_SOC_OMAP3_PANDORA
+       tristate "SoC Audio support for OMAP3 Pandora"
+       depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
+       select SND_OMAP_SOC_MCBSP
+       select SND_SOC_TWL4030
+       help
+         Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
index e09d1f297f644c856c16250dc7cdc407bd6f7e6f..76fedd96e3657b8c4e52b9d0695d3fb47f8ae70c 100644 (file)
@@ -8,6 +8,14 @@ obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
 snd-soc-osk5912-objs := osk5912.o
+snd-soc-overo-objs := overo.o
+snd-soc-omap2evm-objs := omap2evm.o
+snd-soc-sdp3430-objs := sdp3430.o
+snd-soc-omap3pandora-objs := omap3pandora.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
+obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
+obj-$(CONFIG_MACH_OMAP2EVM) += snd-soc-omap2evm.o
+obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
index fae3ad36e0bfc3e03606561c48c0c54bb7d192b6..25593fee9121e22df808bd88ac5f2048ea2f2fae 100644 (file)
@@ -70,9 +70,13 @@ static void n810_ext_control(struct snd_soc_codec *codec)
 
 static int n810_startup(struct snd_pcm_substream *substream)
 {
+       struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_codec *codec = rtd->socdev->codec;
 
+       snd_pcm_hw_constraint_minmax(runtime,
+                                    SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
+
        n810_ext_control(codec);
        return clk_enable(sys_clkout2);
 }
@@ -282,8 +286,9 @@ static struct snd_soc_dai_link n810_dai = {
 };
 
 /* Audio machine driver */
-static struct snd_soc_machine snd_soc_machine_n810 = {
+static struct snd_soc_card snd_soc_n810 = {
        .name = "N810",
+       .platform = &omap_soc_platform,
        .dai_link = &n810_dai,
        .num_links = 1,
 };
@@ -298,8 +303,7 @@ static struct aic3x_setup_data n810_aic33_setup = {
 
 /* Audio subsystem */
 static struct snd_soc_device n810_snd_devdata = {
-       .machine = &snd_soc_machine_n810,
-       .platform = &omap_soc_platform,
+       .card = &snd_soc_n810,
        .codec_dev = &soc_codec_dev_aic3x,
        .codec_data = &n810_aic33_setup,
 };
index 8485a8a9d0ff0e89687eb73a62755d064c8177e6..ec5e18a78758346b9340946d30c15bbf9e498b39 100644 (file)
@@ -36,9 +36,7 @@
 #include "omap-mcbsp.h"
 #include "omap-pcm.h"
 
-#define OMAP_MCBSP_RATES       (SNDRV_PCM_RATE_44100 | \
-                                SNDRV_PCM_RATE_48000 | \
-                                SNDRV_PCM_RATE_KNOT)
+#define OMAP_MCBSP_RATES       (SNDRV_PCM_RATE_8000_96000)
 
 struct omap_mcbsp_data {
        unsigned int                    bus_id;
@@ -140,7 +138,8 @@ static const unsigned long omap34xx_mcbsp_port[][2] = {
 static const unsigned long omap34xx_mcbsp_port[][2] = {};
 #endif
 
-static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream)
+static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
+                                 struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -153,7 +152,8 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream)
        return err;
 }
 
-static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream)
+static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
+                                   struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -165,7 +165,8 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream)
        }
 }
 
-static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd)
+static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+                                 struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -194,14 +195,15 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd)
 }
 
 static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
-                                   struct snd_pcm_hw_params *params)
+                                   struct snd_pcm_hw_params *params,
+                                   struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
        struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
        struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
        int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
-       int wlen;
+       int wlen, channels;
        unsigned long port;
 
        if (cpu_class_is_omap1()) {
@@ -230,12 +232,17 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
                return 0;
        }
 
-       switch (params_channels(params)) {
+       channels = params_channels(params);
+       switch (channels) {
        case 2:
-               /* Set 1 word per (McBPSP) frame and use dual-phase frames */
-               regs->rcr2      |= RFRLEN2(1 - 1) | RPHASE;
+               /* Use dual-phase frames */
+               regs->rcr2      |= RPHASE;
+               regs->xcr2      |= XPHASE;
+       case 1:
+               /* Set 1 word per (McBSP) frame */
+               regs->rcr2      |= RFRLEN2(1 - 1);
                regs->rcr1      |= RFRLEN1(1 - 1);
-               regs->xcr2      |= XFRLEN2(1 - 1) | XPHASE;
+               regs->xcr2      |= XFRLEN2(1 - 1);
                regs->xcr1      |= XFRLEN1(1 - 1);
                break;
        default:
@@ -263,9 +270,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
                regs->srgr2     |= FPER(wlen * 2 - 1);
                regs->srgr1     |= FWID(wlen - 1);
                break;
-       case SND_SOC_DAIFMT_DSP_A:
-               regs->srgr2     |= FPER(wlen * 2 - 1);
-               regs->srgr1     |= FWID(wlen * 2 - 2);
+       case SND_SOC_DAIFMT_DSP_B:
+               regs->srgr2     |= FPER(wlen * channels - 1);
+               regs->srgr1     |= FWID(wlen * channels - 2);
                break;
        }
 
@@ -302,7 +309,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                regs->rcr2      |= RDATDLY(1);
                regs->xcr2      |= XDATDLY(1);
                break;
-       case SND_SOC_DAIFMT_DSP_A:
+       case SND_SOC_DAIFMT_DSP_B:
                /* 0-bit data delay */
                regs->rcr2      |= RDATDLY(0);
                regs->xcr2      |= XDATDLY(0);
@@ -452,17 +459,16 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 
 #define OMAP_MCBSP_DAI_BUILDER(link_id)                                \
 {                                                              \
-       .name = "omap-mcbsp-dai-(link_id)",                     \
+       .name = "omap-mcbsp-dai-"#link_id,                      \
        .id = (link_id),                                        \
-       .type = SND_SOC_DAI_I2S,                                \
        .playback = {                                           \
-               .channels_min = 2,                              \
+               .channels_min = 1,                              \
                .channels_max = 2,                              \
                .rates = OMAP_MCBSP_RATES,                      \
                .formats = SNDRV_PCM_FMTBIT_S16_LE,             \
        },                                                      \
        .capture = {                                            \
-               .channels_min = 2,                              \
+               .channels_min = 1,                              \
                .channels_max = 2,                              \
                .rates = OMAP_MCBSP_RATES,                      \
                .formats = SNDRV_PCM_FMTBIT_S16_LE,             \
@@ -472,8 +478,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
                .shutdown = omap_mcbsp_dai_shutdown,            \
                .trigger = omap_mcbsp_dai_trigger,              \
                .hw_params = omap_mcbsp_dai_hw_params,          \
-       },                                                      \
-       .dai_ops = {                                            \
                .set_fmt = omap_mcbsp_dai_set_dai_fmt,          \
                .set_clkdiv = omap_mcbsp_dai_set_clkdiv,        \
                .set_sysclk = omap_mcbsp_dai_set_dai_sysclk,    \
@@ -495,6 +499,19 @@ struct snd_soc_dai omap_mcbsp_dai[] = {
 
 EXPORT_SYMBOL_GPL(omap_mcbsp_dai);
 
+static int __init snd_omap_mcbsp_init(void)
+{
+       return snd_soc_register_dais(omap_mcbsp_dai,
+                                    ARRAY_SIZE(omap_mcbsp_dai));
+}
+module_init(snd_omap_mcbsp_init);
+
+static void __exit snd_omap_mcbsp_exit(void)
+{
+       snd_soc_unregister_dais(omap_mcbsp_dai, ARRAY_SIZE(omap_mcbsp_dai));
+}
+module_exit(snd_omap_mcbsp_exit);
+
 MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>");
 MODULE_DESCRIPTION("OMAP I2S SoC Interface");
 MODULE_LICENSE("GPL");
index e9084fdd2082efcbc14695e801ec6ad89ff66599..b0362dfd5b719a50839503fd39992c9d6ec8df0d 100644 (file)
@@ -97,7 +97,7 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream,
        prtd->dma_data = dma_data;
        err = omap_request_dma(dma_data->dma_req, dma_data->name,
                               omap_pcm_dma_irq, substream, &prtd->dma_ch);
-       if (!err & !cpu_is_omap1510()) {
+       if (!err && !cpu_is_omap1510()) {
                /*
                 * Link channel with itself so DMA doesn't need any
                 * reprogramming while looping the buffer
@@ -233,7 +233,7 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
        if (ret < 0)
                goto out;
 
-       prtd = kzalloc(sizeof(prtd), GFP_KERNEL);
+       prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
        if (prtd == NULL) {
                ret = -ENOMEM;
                goto out;
@@ -354,6 +354,18 @@ struct snd_soc_platform omap_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(omap_soc_platform);
 
+static int __init omap_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&omap_soc_platform);
+}
+module_init(omap_soc_platform_init);
+
+static void __exit omap_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&omap_soc_platform);
+}
+module_exit(omap_soc_platform_exit);
+
 MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@nokia.com>");
 MODULE_DESCRIPTION("OMAP PCM DMA module");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap2evm.c b/sound/soc/omap/omap2evm.c
new file mode 100644 (file)
index 0000000..0c2322d
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * omap2evm.c  --  SoC audio machine driver for omap2evm board
+ *
+ * Author: Arun KS <arunks@mistralsolutions.com>
+ *
+ * Based on sound/soc/omap/overo.c by Steve Sakoman
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+#include <mach/hardware.h>
+#include <mach/gpio.h>
+#include <mach/mcbsp.h>
+
+#include "omap-mcbsp.h"
+#include "omap-pcm.h"
+#include "../codecs/twl4030.h"
+
+static int omap2evm_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params,
+       struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int ret;
+
+       /* Set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec DAI configuration\n");
+               return ret;
+       }
+
+       /* Set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set cpu DAI configuration\n");
+               return ret;
+       }
+
+       /* Set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+                                           SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec system clock\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct snd_soc_ops omap2evm_ops = {
+       .hw_params = omap2evm_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link omap2evm_dai = {
+       .name = "TWL4030",
+       .stream_name = "TWL4030",
+       .cpu_dai = &omap_mcbsp_dai[0],
+       .codec_dai = &twl4030_dai,
+       .ops = &omap2evm_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_omap2evm = {
+       .name = "omap2evm",
+       .platform = &omap_soc_platform,
+       .dai_link = &omap2evm_dai,
+       .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap2evm_snd_devdata = {
+       .card = &snd_soc_omap2evm,
+       .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *omap2evm_snd_device;
+
+static int __init omap2evm_soc_init(void)
+{
+       int ret;
+
+       if (!machine_is_omap2evm()) {
+               pr_debug("Not omap2evm!\n");
+               return -ENODEV;
+       }
+       printk(KERN_INFO "omap2evm SoC init\n");
+
+       omap2evm_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!omap2evm_snd_device) {
+               printk(KERN_ERR "Platform device allocation failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(omap2evm_snd_device, &omap2evm_snd_devdata);
+       omap2evm_snd_devdata.dev = &omap2evm_snd_device->dev;
+       *(unsigned int *)omap2evm_dai.cpu_dai->private_data = 1; /* McBSP2 */
+
+       ret = platform_device_add(omap2evm_snd_device);
+       if (ret)
+               goto err1;
+
+       return 0;
+
+err1:
+       printk(KERN_ERR "Unable to add platform device\n");
+       platform_device_put(omap2evm_snd_device);
+
+       return ret;
+}
+module_init(omap2evm_soc_init);
+
+static void __exit omap2evm_soc_exit(void)
+{
+       platform_device_unregister(omap2evm_snd_device);
+}
+module_exit(omap2evm_soc_exit);
+
+MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
+MODULE_DESCRIPTION("ALSA SoC omap2evm");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
new file mode 100644 (file)
index 0000000..fd24a4a
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * omap3beagle.c  --  SoC audio for OMAP3 Beagle
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+#include <mach/hardware.h>
+#include <mach/gpio.h>
+#include <mach/mcbsp.h>
+
+#include "omap-mcbsp.h"
+#include "omap-pcm.h"
+#include "../codecs/twl4030.h"
+
+static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int ret;
+
+       /* Set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec DAI configuration\n");
+               return ret;
+       }
+
+       /* Set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set cpu DAI configuration\n");
+               return ret;
+       }
+
+       /* Set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+                                    SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec system clock\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct snd_soc_ops omap3beagle_ops = {
+       .hw_params = omap3beagle_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link omap3beagle_dai = {
+       .name = "TWL4030",
+       .stream_name = "TWL4030",
+       .cpu_dai = &omap_mcbsp_dai[0],
+       .codec_dai = &twl4030_dai,
+       .ops = &omap3beagle_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_omap3beagle = {
+       .name = "omap3beagle",
+       .platform = &omap_soc_platform,
+       .dai_link = &omap3beagle_dai,
+       .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap3beagle_snd_devdata = {
+       .card = &snd_soc_omap3beagle,
+       .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *omap3beagle_snd_device;
+
+static int __init omap3beagle_soc_init(void)
+{
+       int ret;
+
+       if (!machine_is_omap3_beagle()) {
+               pr_debug("Not OMAP3 Beagle!\n");
+               return -ENODEV;
+       }
+       pr_info("OMAP3 Beagle SoC init\n");
+
+       omap3beagle_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!omap3beagle_snd_device) {
+               printk(KERN_ERR "Platform device allocation failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(omap3beagle_snd_device, &omap3beagle_snd_devdata);
+       omap3beagle_snd_devdata.dev = &omap3beagle_snd_device->dev;
+       *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */
+
+       ret = platform_device_add(omap3beagle_snd_device);
+       if (ret)
+               goto err1;
+
+       return 0;
+
+err1:
+       printk(KERN_ERR "Unable to add platform device\n");
+       platform_device_put(omap3beagle_snd_device);
+
+       return ret;
+}
+
+static void __exit omap3beagle_soc_exit(void)
+{
+       platform_device_unregister(omap3beagle_snd_device);
+}
+
+module_init(omap3beagle_soc_init);
+module_exit(omap3beagle_soc_exit);
+
+MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>");
+MODULE_DESCRIPTION("ALSA SoC OMAP3 Beagle");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
new file mode 100644 (file)
index 0000000..bd91594
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * omap3pandora.c  --  SoC audio for Pandora Handheld Console
+ *
+ * Author: Gražvydas Ignotas <notasas@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/delay.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+
+#include "omap-mcbsp.h"
+#include "omap-pcm.h"
+#include "../codecs/twl4030.h"
+
+#define OMAP3_PANDORA_DAC_POWER_GPIO   118
+#define OMAP3_PANDORA_AMP_POWER_GPIO   14
+
+#define PREFIX "ASoC omap3pandora: "
+
+static int omap3pandora_cmn_hw_params(struct snd_soc_dai *codec_dai,
+       struct snd_soc_dai *cpu_dai, unsigned int fmt)
+{
+       int ret;
+
+       /* Set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+       if (ret < 0) {
+               pr_err(PREFIX "can't set codec DAI configuration\n");
+               return ret;
+       }
+
+       /* Set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+       if (ret < 0) {
+               pr_err(PREFIX "can't set cpu DAI configuration\n");
+               return ret;
+       }
+
+       /* Set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+                                           SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               pr_err(PREFIX "can't set codec system clock\n");
+               return ret;
+       }
+
+       /* Set McBSP clock to external */
+       ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT, 0,
+                                           SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               pr_err(PREFIX "can't set cpu system clock\n");
+               return ret;
+       }
+
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, 8);
+       if (ret < 0) {
+               pr_err(PREFIX "can't set SRG clock divider\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static int omap3pandora_out_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+
+       return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
+                                         SND_SOC_DAIFMT_I2S |
+                                         SND_SOC_DAIFMT_IB_NF |
+                                         SND_SOC_DAIFMT_CBS_CFS);
+}
+
+static int omap3pandora_in_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+
+       return omap3pandora_cmn_hw_params(codec_dai, cpu_dai,
+                                         SND_SOC_DAIFMT_I2S |
+                                         SND_SOC_DAIFMT_NB_NF |
+                                         SND_SOC_DAIFMT_CBS_CFS);
+}
+
+static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
+       struct snd_kcontrol *k, int event)
+{
+       if (SND_SOC_DAPM_EVENT_ON(event)) {
+               gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 1);
+               gpio_set_value(OMAP3_PANDORA_AMP_POWER_GPIO, 1);
+       } else {
+               gpio_set_value(OMAP3_PANDORA_AMP_POWER_GPIO, 0);
+               mdelay(1);
+               gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 0);
+       }
+
+       return 0;
+}
+
+/*
+ * Audio paths on Pandora board:
+ *
+ *  |O| ---> PCM DAC +-> AMP -> Headphone Jack
+ *  |M|         A    +--------> Line Out
+ *  |A| <~~clk~~+
+ *  |P| <--- TWL4030 <--------- Line In and MICs
+ */
+static const struct snd_soc_dapm_widget omap3pandora_out_dapm_widgets[] = {
+       SND_SOC_DAPM_DAC("PCM DAC", "Playback", SND_SOC_NOPM, 0, 0),
+       SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM,
+                          0, 0, NULL, 0, omap3pandora_hp_event,
+                          SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
+       SND_SOC_DAPM_HP("Headphone Jack", NULL),
+       SND_SOC_DAPM_LINE("Line Out", NULL),
+};
+
+static const struct snd_soc_dapm_widget omap3pandora_in_dapm_widgets[] = {
+       SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
+       SND_SOC_DAPM_MIC("Mic (external)", NULL),
+       SND_SOC_DAPM_LINE("Line In", NULL),
+};
+
+static const struct snd_soc_dapm_route omap3pandora_out_map[] = {
+       {"Headphone Amplifier", NULL, "PCM DAC"},
+       {"Line Out", NULL, "PCM DAC"},
+       {"Headphone Jack", NULL, "Headphone Amplifier"},
+};
+
+static const struct snd_soc_dapm_route omap3pandora_in_map[] = {
+       {"INL", NULL, "Line In"},
+       {"INR", NULL, "Line In"},
+       {"INL", NULL, "Mic (Internal)"},
+       {"INR", NULL, "Mic (external)"},
+};
+
+static int omap3pandora_out_init(struct snd_soc_codec *codec)
+{
+       int ret;
+
+       ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets,
+                               ARRAY_SIZE(omap3pandora_out_dapm_widgets));
+       if (ret < 0)
+               return ret;
+
+       snd_soc_dapm_add_routes(codec, omap3pandora_out_map,
+               ARRAY_SIZE(omap3pandora_out_map));
+
+       return snd_soc_dapm_sync(codec);
+}
+
+static int omap3pandora_in_init(struct snd_soc_codec *codec)
+{
+       int ret;
+
+       ret = snd_soc_dapm_new_controls(codec, omap3pandora_in_dapm_widgets,
+                               ARRAY_SIZE(omap3pandora_in_dapm_widgets));
+       if (ret < 0)
+               return ret;
+
+       snd_soc_dapm_add_routes(codec, omap3pandora_in_map,
+               ARRAY_SIZE(omap3pandora_in_map));
+
+       return snd_soc_dapm_sync(codec);
+}
+
+static struct snd_soc_ops omap3pandora_out_ops = {
+       .hw_params = omap3pandora_out_hw_params,
+};
+
+static struct snd_soc_ops omap3pandora_in_ops = {
+       .hw_params = omap3pandora_in_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link omap3pandora_dai[] = {
+       {
+               .name = "PCM1773",
+               .stream_name = "HiFi Out",
+               .cpu_dai = &omap_mcbsp_dai[0],
+               .codec_dai = &twl4030_dai,
+               .ops = &omap3pandora_out_ops,
+               .init = omap3pandora_out_init,
+       }, {
+               .name = "TWL4030",
+               .stream_name = "Line/Mic In",
+               .cpu_dai = &omap_mcbsp_dai[1],
+               .codec_dai = &twl4030_dai,
+               .ops = &omap3pandora_in_ops,
+               .init = omap3pandora_in_init,
+       }
+};
+
+/* SoC card */
+static struct snd_soc_card snd_soc_card_omap3pandora = {
+       .name = "omap3pandora",
+       .platform = &omap_soc_platform,
+       .dai_link = omap3pandora_dai,
+       .num_links = ARRAY_SIZE(omap3pandora_dai),
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap3pandora_snd_data = {
+       .card = &snd_soc_card_omap3pandora,
+       .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *omap3pandora_snd_device;
+
+static int __init omap3pandora_soc_init(void)
+{
+       int ret;
+
+       if (!machine_is_omap3_pandora()) {
+               pr_debug(PREFIX "Not OMAP3 Pandora\n");
+               return -ENODEV;
+       }
+       pr_info("OMAP3 Pandora SoC init\n");
+
+       ret = gpio_request(OMAP3_PANDORA_DAC_POWER_GPIO, "dac_power");
+       if (ret) {
+               pr_err(PREFIX "Failed to get DAC power GPIO\n");
+               return ret;
+       }
+
+       ret = gpio_direction_output(OMAP3_PANDORA_DAC_POWER_GPIO, 0);
+       if (ret) {
+               pr_err(PREFIX "Failed to set DAC power GPIO direction\n");
+               goto fail0;
+       }
+
+       ret = gpio_request(OMAP3_PANDORA_AMP_POWER_GPIO, "amp_power");
+       if (ret) {
+               pr_err(PREFIX "Failed to get amp power GPIO\n");
+               goto fail0;
+       }
+
+       ret = gpio_direction_output(OMAP3_PANDORA_AMP_POWER_GPIO, 0);
+       if (ret) {
+               pr_err(PREFIX "Failed to set amp power GPIO direction\n");
+               goto fail1;
+       }
+
+       omap3pandora_snd_device = platform_device_alloc("soc-audio", -1);
+       if (omap3pandora_snd_device == NULL) {
+               pr_err(PREFIX "Platform device allocation failed\n");
+               ret = -ENOMEM;
+               goto fail1;
+       }
+
+       platform_set_drvdata(omap3pandora_snd_device, &omap3pandora_snd_data);
+       omap3pandora_snd_data.dev = &omap3pandora_snd_device->dev;
+       *(unsigned int *)omap_mcbsp_dai[0].private_data = 1; /* McBSP2 */
+       *(unsigned int *)omap_mcbsp_dai[1].private_data = 3; /* McBSP4 */
+
+       ret = platform_device_add(omap3pandora_snd_device);
+       if (ret) {
+               pr_err(PREFIX "Unable to add platform device\n");
+               goto fail2;
+       }
+
+       return 0;
+
+fail2:
+       platform_device_put(omap3pandora_snd_device);
+fail1:
+       gpio_free(OMAP3_PANDORA_AMP_POWER_GPIO);
+fail0:
+       gpio_free(OMAP3_PANDORA_DAC_POWER_GPIO);
+       return ret;
+}
+module_init(omap3pandora_soc_init);
+
+static void __exit omap3pandora_soc_exit(void)
+{
+       platform_device_unregister(omap3pandora_snd_device);
+       gpio_free(OMAP3_PANDORA_AMP_POWER_GPIO);
+       gpio_free(OMAP3_PANDORA_DAC_POWER_GPIO);
+}
+module_exit(omap3pandora_soc_exit);
+
+MODULE_AUTHOR("Grazvydas Ignotas <notasas@gmail.com>");
+MODULE_DESCRIPTION("ALSA SoC OMAP3 Pandora");
+MODULE_LICENSE("GPL");
index 0fe733796898149471013ba47db2d6394343921d..cd41a948df7be44abad30a15a11a529b5e0b6ca2 100644 (file)
@@ -61,7 +61,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
 
        /* Set codec DAI configuration */
        err = snd_soc_dai_set_fmt(codec_dai,
-                                 SND_SOC_DAIFMT_DSP_A |
+                                 SND_SOC_DAIFMT_DSP_B |
                                  SND_SOC_DAIFMT_NB_IF |
                                  SND_SOC_DAIFMT_CBM_CFM);
        if (err < 0) {
@@ -71,7 +71,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
 
        /* Set cpu DAI configuration */
        err = snd_soc_dai_set_fmt(cpu_dai,
-                                 SND_SOC_DAIFMT_DSP_A |
+                                 SND_SOC_DAIFMT_DSP_B |
                                  SND_SOC_DAIFMT_NB_IF |
                                  SND_SOC_DAIFMT_CBM_CFM);
        if (err < 0) {
@@ -143,16 +143,16 @@ static struct snd_soc_dai_link osk_dai = {
 };
 
 /* Audio machine driver */
-static struct snd_soc_machine snd_soc_machine_osk = {
+static struct snd_soc_card snd_soc_card_osk = {
        .name = "OSK5912",
+       .platform = &omap_soc_platform,
        .dai_link = &osk_dai,
        .num_links = 1,
 };
 
 /* Audio subsystem */
 static struct snd_soc_device osk_snd_devdata = {
-       .machine = &snd_soc_machine_osk,
-       .platform = &omap_soc_platform,
+       .card = &snd_soc_card_osk,
        .codec_dev = &soc_codec_dev_tlv320aic23,
 };
 
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
new file mode 100644 (file)
index 0000000..a72dc4e
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * overo.c  --  SoC audio for Gumstix Overo
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+#include <mach/hardware.h>
+#include <mach/gpio.h>
+#include <mach/mcbsp.h>
+
+#include "omap-mcbsp.h"
+#include "omap-pcm.h"
+#include "../codecs/twl4030.h"
+
+static int overo_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int ret;
+
+       /* Set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec DAI configuration\n");
+               return ret;
+       }
+
+       /* Set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set cpu DAI configuration\n");
+               return ret;
+       }
+
+       /* Set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+                                           SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec system clock\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct snd_soc_ops overo_ops = {
+       .hw_params = overo_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link overo_dai = {
+       .name = "TWL4030",
+       .stream_name = "TWL4030",
+       .cpu_dai = &omap_mcbsp_dai[0],
+       .codec_dai = &twl4030_dai,
+       .ops = &overo_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_card_overo = {
+       .name = "overo",
+       .platform = &omap_soc_platform,
+       .dai_link = &overo_dai,
+       .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device overo_snd_devdata = {
+       .card = &snd_soc_card_overo,
+       .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *overo_snd_device;
+
+static int __init overo_soc_init(void)
+{
+       int ret;
+
+       if (!machine_is_overo()) {
+               pr_debug("Not Overo!\n");
+               return -ENODEV;
+       }
+       printk(KERN_INFO "overo SoC init\n");
+
+       overo_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!overo_snd_device) {
+               printk(KERN_ERR "Platform device allocation failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(overo_snd_device, &overo_snd_devdata);
+       overo_snd_devdata.dev = &overo_snd_device->dev;
+       *(unsigned int *)overo_dai.cpu_dai->private_data = 1; /* McBSP2 */
+
+       ret = platform_device_add(overo_snd_device);
+       if (ret)
+               goto err1;
+
+       return 0;
+
+err1:
+       printk(KERN_ERR "Unable to add platform device\n");
+       platform_device_put(overo_snd_device);
+
+       return ret;
+}
+module_init(overo_soc_init);
+
+static void __exit overo_soc_exit(void)
+{
+       platform_device_unregister(overo_snd_device);
+}
+module_exit(overo_soc_exit);
+
+MODULE_AUTHOR("Steve Sakoman <steve@sakoman.com>");
+MODULE_DESCRIPTION("ALSA SoC overo");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
new file mode 100644 (file)
index 0000000..ad97836
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * sdp3430.c  --  SoC audio for TI OMAP3430 SDP
+ *
+ * Author: Misael Lopez Cruz <x0052729@ti.com>
+ *
+ * Based on:
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+#include <mach/hardware.h>
+#include <mach/gpio.h>
+#include <mach/mcbsp.h>
+
+#include "omap-mcbsp.h"
+#include "omap-pcm.h"
+#include "../codecs/twl4030.h"
+
+static int sdp3430_hw_params(struct snd_pcm_substream *substream,
+       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int ret;
+
+       /* Set codec DAI configuration */
+       ret = snd_soc_dai_set_fmt(codec_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec DAI configuration\n");
+               return ret;
+       }
+
+       /* Set cpu DAI configuration */
+       ret = snd_soc_dai_set_fmt(cpu_dai,
+                                 SND_SOC_DAIFMT_I2S |
+                                 SND_SOC_DAIFMT_NB_NF |
+                                 SND_SOC_DAIFMT_CBM_CFM);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set cpu DAI configuration\n");
+               return ret;
+       }
+
+       /* Set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+                                           SND_SOC_CLOCK_IN);
+       if (ret < 0) {
+               printk(KERN_ERR "can't set codec system clock\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct snd_soc_ops sdp3430_ops = {
+       .hw_params = sdp3430_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */
+static struct snd_soc_dai_link sdp3430_dai = {
+       .name = "TWL4030",
+       .stream_name = "TWL4030",
+       .cpu_dai = &omap_mcbsp_dai[0],
+       .codec_dai = &twl4030_dai,
+       .ops = &sdp3430_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_machine snd_soc_machine_sdp3430 = {
+       .name = "SDP3430",
+       .platform = &omap_soc_platform,
+       .dai_link = &sdp3430_dai,
+       .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device sdp3430_snd_devdata = {
+       .machine = &snd_soc_machine_sdp3430,
+       .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *sdp3430_snd_device;
+
+static int __init sdp3430_soc_init(void)
+{
+       int ret;
+
+       if (!machine_is_omap_3430sdp()) {
+               pr_debug("Not SDP3430!\n");
+               return -ENODEV;
+       }
+       printk(KERN_INFO "SDP3430 SoC init\n");
+
+       sdp3430_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!sdp3430_snd_device) {
+               printk(KERN_ERR "Platform device allocation failed\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(sdp3430_snd_device, &sdp3430_snd_devdata);
+       sdp3430_snd_devdata.dev = &sdp3430_snd_device->dev;
+       *(unsigned int *)sdp3430_dai.cpu_dai->private_data = 1; /* McBSP2 */
+
+       ret = platform_device_add(sdp3430_snd_device);
+       if (ret)
+               goto err1;
+
+       return 0;
+
+err1:
+       printk(KERN_ERR "Unable to add platform device\n");
+       platform_device_put(sdp3430_snd_device);
+
+       return ret;
+}
+module_init(sdp3430_soc_init);
+
+static void __exit sdp3430_soc_exit(void)
+{
+       platform_device_unregister(sdp3430_snd_device);
+}
+module_exit(sdp3430_soc_exit);
+
+MODULE_AUTHOR("Misael Lopez Cruz <x0052729@ti.com>");
+MODULE_DESCRIPTION("ALSA SoC SDP3430");
+MODULE_LICENSE("GPL");
+
index f8c1cdd940acf54330c05fed9c69a3f4f7c7b0e6..f82e106994717da3c561515e0ba027f1ff32a965 100644 (file)
@@ -21,6 +21,9 @@ config SND_PXA2XX_SOC_AC97
 config SND_PXA2XX_SOC_I2S
        tristate
 
+config SND_PXA_SOC_SSP
+       tristate
+
 config SND_PXA2XX_SOC_CORGI
        tristate "SoC Audio support for Sharp Zaurus SL-C7x0"
        depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx
@@ -75,3 +78,22 @@ config SND_PXA2XX_SOC_EM_X270
        help
          Say Y if you want to add support for SoC audio on
          CompuLab EM-x270.
+
+config SND_PXA2XX_SOC_PALM27X
+       bool "SoC Audio support for Palm T|X, T5 and LifeDrive"
+       depends on SND_PXA2XX_SOC && (MACH_PALMLD || MACH_PALMTX || MACH_PALMT5)
+       select SND_PXA2XX_SOC_AC97
+       select SND_SOC_WM9712
+       help
+         Say Y if you want to add support for SoC audio on
+         Palm T|X, T5 or LifeDrive handheld computer.
+
+config SND_SOC_ZYLONITE
+       tristate "SoC Audio support for Marvell Zylonite"
+       depends on SND_PXA2XX_SOC && MACH_ZYLONITE
+       select SND_PXA2XX_SOC_AC97
+       select SND_PXA_SOC_SSP
+       select SND_SOC_WM9713
+       help
+         Say Y if you want to add support for SoC audio on the
+         Marvell Zylonite reference platform.
index 5bc8edf9dca9ec8532ec6e56e1c7e7ea88f463fc..08a9f279772991f76adbe8f307aee987b8f8351c 100644 (file)
@@ -2,10 +2,12 @@
 snd-soc-pxa2xx-objs := pxa2xx-pcm.o
 snd-soc-pxa2xx-ac97-objs := pxa2xx-ac97.o
 snd-soc-pxa2xx-i2s-objs := pxa2xx-i2s.o
+snd-soc-pxa-ssp-objs := pxa-ssp.o
 
 obj-$(CONFIG_SND_PXA2XX_SOC) += snd-soc-pxa2xx.o
 obj-$(CONFIG_SND_PXA2XX_SOC_AC97) += snd-soc-pxa2xx-ac97.o
 obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o
+obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o
 
 # PXA Machine Support
 snd-soc-corgi-objs := corgi.o
@@ -14,6 +16,8 @@ snd-soc-tosa-objs := tosa.o
 snd-soc-e800-objs := e800_wm9712.o
 snd-soc-spitz-objs := spitz.o
 snd-soc-em-x270-objs := em-x270.o
+snd-soc-palm27x-objs := palm27x.o
+snd-soc-zylonite-objs := zylonite.o
 
 obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
 obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
@@ -21,3 +25,5 @@ obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o
 obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
 obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
 obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o
+obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o
+obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
index 2718eaf7895f39d4db2e5d93e4227400b995b1a7..1ba25a559524296217824f188ac8f4de081a72ec 100644 (file)
@@ -108,15 +108,11 @@ static int corgi_startup(struct snd_pcm_substream *substream)
 }
 
 /* we need to unmute the HP at shutdown as the mute burns power on corgi */
-static int corgi_shutdown(struct snd_pcm_substream *substream)
+static void corgi_shutdown(struct snd_pcm_substream *substream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->socdev->codec;
-
        /* set = unmute headphone */
        gpio_set_value(CORGI_GPIO_MUTE_L, 1);
        gpio_set_value(CORGI_GPIO_MUTE_R, 1);
-       return 0;
 }
 
 static int corgi_hw_params(struct snd_pcm_substream *substream,
@@ -314,8 +310,9 @@ static struct snd_soc_dai_link corgi_dai = {
 };
 
 /* corgi audio machine driver */
-static struct snd_soc_machine snd_soc_machine_corgi = {
+static struct snd_soc_card snd_soc_corgi = {
        .name = "Corgi",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = &corgi_dai,
        .num_links = 1,
 };
@@ -328,8 +325,7 @@ static struct wm8731_setup_data corgi_wm8731_setup = {
 
 /* corgi audio subsystem */
 static struct snd_soc_device corgi_snd_devdata = {
-       .machine = &snd_soc_machine_corgi,
-       .platform = &pxa2xx_soc_platform,
+       .card = &snd_soc_corgi,
        .codec_dev = &soc_codec_dev_wm8731,
        .codec_data = &corgi_wm8731_setup,
 };
index 6781c5be242fb75e3716eaa5bdbc3de3baf4c336..2e3386dfa0f0ed0604568b0b98d4a4b0f19105f8 100644 (file)
@@ -29,7 +29,7 @@
 #include "pxa2xx-pcm.h"
 #include "pxa2xx-ac97.h"
 
-static struct snd_soc_machine e800;
+static struct snd_soc_card e800;
 
 static struct snd_soc_dai_link e800_dai[] = {
 {
@@ -40,15 +40,15 @@ static struct snd_soc_dai_link e800_dai[] = {
 },
 };
 
-static struct snd_soc_machine e800 = {
+static struct snd_soc_card e800 = {
        .name = "Toshiba e800",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = e800_dai,
        .num_links = ARRAY_SIZE(e800_dai),
 };
 
 static struct snd_soc_device e800_snd_devdata = {
-       .machine = &e800,
-       .platform = &pxa2xx_soc_platform,
+       .card = &e800,
        .codec_dev = &soc_codec_dev_wm9712,
 };
 
index e6ff6929ab4b799f7b9875144681469c15e6d8fe..fe4a729ea6487653881c2bda3b4c627ff58b2110 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/moduleparam.h>
 #include <linux/device.h>
 
-#include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
@@ -53,15 +52,15 @@ static struct snd_soc_dai_link em_x270_dai[] = {
        },
 };
 
-static struct snd_soc_machine em_x270 = {
+static struct snd_soc_card em_x270 = {
        .name = "EM-X270",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = em_x270_dai,
        .num_links = ARRAY_SIZE(em_x270_dai),
 };
 
 static struct snd_soc_device em_x270_snd_devdata = {
-       .machine = &em_x270,
-       .platform = &pxa2xx_soc_platform,
+       .card = &em_x270,
        .codec_dev = &soc_codec_dev_wm9712,
 };
 
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
new file mode 100644 (file)
index 0000000..4a9cf30
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * linux/sound/soc/pxa/palm27x.c
+ *
+ * SoC Audio driver for Palm T|X, T5 and LifeDrive
+ *
+ * based on tosa.c
+ *
+ * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/device.h>
+#include <linux/gpio.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include <asm/mach-types.h>
+#include <mach/audio.h>
+#include <mach/palmasoc.h>
+
+#include "../codecs/wm9712.h"
+#include "pxa2xx-pcm.h"
+#include "pxa2xx-ac97.h"
+
+static int palm27x_jack_func = 1;
+static int palm27x_spk_func = 1;
+static int palm27x_ep_gpio = -1;
+
+static void palm27x_ext_control(struct snd_soc_codec *codec)
+{
+       if (!palm27x_spk_func)
+               snd_soc_dapm_enable_pin(codec, "Speaker");
+       else
+               snd_soc_dapm_disable_pin(codec, "Speaker");
+
+       if (!palm27x_jack_func)
+               snd_soc_dapm_enable_pin(codec, "Headphone Jack");
+       else
+               snd_soc_dapm_disable_pin(codec, "Headphone Jack");
+
+       snd_soc_dapm_sync(codec);
+}
+
+static int palm27x_startup(struct snd_pcm_substream *substream)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_codec *codec = rtd->socdev->codec;
+
+       /* check the jack status at stream startup */
+       palm27x_ext_control(codec);
+       return 0;
+}
+
+static struct snd_soc_ops palm27x_ops = {
+       .startup = palm27x_startup,
+};
+
+static irqreturn_t palm27x_interrupt(int irq, void *v)
+{
+       palm27x_spk_func = gpio_get_value(palm27x_ep_gpio);
+       palm27x_jack_func = !palm27x_spk_func;
+       return IRQ_HANDLED;
+}
+
+static int palm27x_get_jack(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       ucontrol->value.integer.value[0] = palm27x_jack_func;
+       return 0;
+}
+
+static int palm27x_set_jack(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+
+       if (palm27x_jack_func == ucontrol->value.integer.value[0])
+               return 0;
+
+       palm27x_jack_func = ucontrol->value.integer.value[0];
+       palm27x_ext_control(codec);
+       return 1;
+}
+
+static int palm27x_get_spk(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       ucontrol->value.integer.value[0] = palm27x_spk_func;
+       return 0;
+}
+
+static int palm27x_set_spk(struct snd_kcontrol *kcontrol,
+       struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+
+       if (palm27x_spk_func == ucontrol->value.integer.value[0])
+               return 0;
+
+       palm27x_spk_func = ucontrol->value.integer.value[0];
+       palm27x_ext_control(codec);
+       return 1;
+}
+
+/* PalmTX machine dapm widgets */
+static const struct snd_soc_dapm_widget palm27x_dapm_widgets[] = {
+       SND_SOC_DAPM_HP("Headphone Jack", NULL),
+       SND_SOC_DAPM_SPK("Speaker", NULL),
+};
+
+/* PalmTX audio map */
+static const struct snd_soc_dapm_route audio_map[] = {
+       /* headphone connected to HPOUTL, HPOUTR */
+       {"Headphone Jack", NULL, "HPOUTL"},
+       {"Headphone Jack", NULL, "HPOUTR"},
+
+       /* ext speaker connected to ROUT2, LOUT2 */
+       {"Speaker", NULL, "LOUT2"},
+       {"Speaker", NULL, "ROUT2"},
+};
+
+static const char *jack_function[] = {"Headphone", "Off"};
+static const char *spk_function[] = {"On", "Off"};
+static const struct soc_enum palm27x_enum[] = {
+       SOC_ENUM_SINGLE_EXT(2, jack_function),
+       SOC_ENUM_SINGLE_EXT(2, spk_function),
+};
+
+static const struct snd_kcontrol_new palm27x_controls[] = {
+       SOC_ENUM_EXT("Jack Function", palm27x_enum[0], palm27x_get_jack,
+               palm27x_set_jack),
+       SOC_ENUM_EXT("Speaker Function", palm27x_enum[1], palm27x_get_spk,
+               palm27x_set_spk),
+};
+
+static int palm27x_ac97_init(struct snd_soc_codec *codec)
+{
+       int i, err;
+
+       snd_soc_dapm_nc_pin(codec, "OUT3");
+       snd_soc_dapm_nc_pin(codec, "MONOOUT");
+
+       /* add palm27x specific controls */
+       for (i = 0; i < ARRAY_SIZE(palm27x_controls); i++) {
+               err = snd_ctl_add(codec->card,
+                               snd_soc_cnew(&palm27x_controls[i],
+                                               codec, NULL));
+               if (err < 0)
+                       return err;
+       }
+
+       /* add palm27x specific widgets */
+       snd_soc_dapm_new_controls(codec, palm27x_dapm_widgets,
+                               ARRAY_SIZE(palm27x_dapm_widgets));
+
+       /* set up palm27x specific audio path audio_map */
+       snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+
+       snd_soc_dapm_sync(codec);
+       return 0;
+}
+
+static struct snd_soc_dai_link palm27x_dai[] = {
+{
+       .name = "AC97 HiFi",
+       .stream_name = "AC97 HiFi",
+       .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
+       .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI],
+       .init = palm27x_ac97_init,
+       .ops = &palm27x_ops,
+},
+{
+       .name = "AC97 Aux",
+       .stream_name = "AC97 Aux",
+       .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
+       .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX],
+       .ops = &palm27x_ops,
+},
+};
+
+static struct snd_soc_card palm27x_asoc = {
+       .name = "Palm/PXA27x",
+       .platform = &pxa2xx_soc_platform,
+       .dai_link = palm27x_dai,
+       .num_links = ARRAY_SIZE(palm27x_dai),
+};
+
+static struct snd_soc_device palm27x_snd_devdata = {
+       .card = &palm27x_asoc,
+       .codec_dev = &soc_codec_dev_wm9712,
+};
+
+static struct platform_device *palm27x_snd_device;
+
+static int __init palm27x_asoc_init(void)
+{
+       int ret;
+
+       if (!(machine_is_palmtx() || machine_is_palmt5() ||
+               machine_is_palmld()))
+               return -ENODEV;
+
+       ret = gpio_request(palm27x_ep_gpio, "Headphone Jack");
+       if (ret)
+               return ret;
+       ret = gpio_direction_input(palm27x_ep_gpio);
+       if (ret)
+               goto err_alloc;
+
+       if (request_irq(gpio_to_irq(palm27x_ep_gpio), palm27x_interrupt,
+                       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                       "Headphone jack", NULL))
+               goto err_alloc;
+
+       palm27x_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!palm27x_snd_device) {
+               ret = -ENOMEM;
+               goto err_dev;
+       }
+
+       platform_set_drvdata(palm27x_snd_device, &palm27x_snd_devdata);
+       palm27x_snd_devdata.dev = &palm27x_snd_device->dev;
+       ret = platform_device_add(palm27x_snd_device);
+
+       if (ret != 0)
+               goto put_device;
+
+       return 0;
+
+put_device:
+       platform_device_put(palm27x_snd_device);
+err_dev:
+       free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
+err_alloc:
+       gpio_free(palm27x_ep_gpio);
+
+       return ret;
+}
+
+static void __exit palm27x_asoc_exit(void)
+{
+       free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
+       gpio_free(palm27x_ep_gpio);
+       platform_device_unregister(palm27x_snd_device);
+}
+
+void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data)
+{
+       palm27x_ep_gpio = data->jack_gpio;
+}
+
+module_init(palm27x_asoc_init);
+module_exit(palm27x_asoc_exit);
+
+/* Module information */
+MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
+MODULE_DESCRIPTION("ALSA SoC Palm T|X, T5 and LifeDrive");
+MODULE_LICENSE("GPL");
index 4d9930c52789989313a8a1189bbc99b26160d8b2..6e9827189fffdca01b79b9c38bb212ee4998ce17 100644 (file)
@@ -276,8 +276,9 @@ static struct snd_soc_dai_link poodle_dai = {
 };
 
 /* poodle audio machine driver */
-static struct snd_soc_machine snd_soc_machine_poodle = {
+static struct snd_soc_card snd_soc_poodle = {
        .name = "Poodle",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = &poodle_dai,
        .num_links = 1,
 };
@@ -290,8 +291,7 @@ static struct wm8731_setup_data poodle_wm8731_setup = {
 
 /* poodle audio subsystem */
 static struct snd_soc_device poodle_snd_devdata = {
-       .machine = &snd_soc_machine_poodle,
-       .platform = &pxa2xx_soc_platform,
+       .card = &snd_soc_poodle,
        .codec_dev = &soc_codec_dev_wm8731,
        .codec_data = &poodle_wm8731_setup,
 };
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
new file mode 100644 (file)
index 0000000..73cb6b4
--- /dev/null
@@ -0,0 +1,931 @@
+#define DEBUG
+/*
+ * pxa-ssp.c  --  ALSA Soc Audio Layer
+ *
+ * Copyright 2005,2008 Wolfson Microelectronics PLC.
+ * Author: Liam Girdwood
+ *         Mark Brown <broonie@opensource.wolfsonmicro.com>
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ * TODO:
+ *  o Test network mode for > 16bit sample size
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/initval.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/pxa2xx-lib.h>
+
+#include <mach/hardware.h>
+#include <mach/pxa-regs.h>
+#include <mach/regs-ssp.h>
+#include <mach/audio.h>
+#include <mach/ssp.h>
+
+#include "pxa2xx-pcm.h"
+#include "pxa-ssp.h"
+
+/*
+ * SSP audio private data
+ */
+struct ssp_priv {
+       struct ssp_dev dev;
+       unsigned int sysclk;
+       int dai_fmt;
+#ifdef CONFIG_PM
+       struct ssp_state state;
+#endif
+};
+
+#define PXA2xx_SSP1_BASE       0x41000000
+#define PXA27x_SSP2_BASE       0x41700000
+#define PXA27x_SSP3_BASE       0x41900000
+#define PXA3xx_SSP4_BASE       0x41a00000
+
+static struct pxa2xx_pcm_dma_params pxa_ssp1_pcm_mono_out = {
+       .name                   = "SSP1 PCM Mono out",
+       .dev_addr               = PXA2xx_SSP1_BASE + SSDR,
+       .drcmr                  = &DRCMR(14),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp1_pcm_mono_in = {
+       .name                   = "SSP1 PCM Mono in",
+       .dev_addr               = PXA2xx_SSP1_BASE + SSDR,
+       .drcmr                  = &DRCMR(13),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp1_pcm_stereo_out = {
+       .name                   = "SSP1 PCM Stereo out",
+       .dev_addr               = PXA2xx_SSP1_BASE + SSDR,
+       .drcmr                  = &DRCMR(14),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp1_pcm_stereo_in = {
+       .name                   = "SSP1 PCM Stereo in",
+       .dev_addr               = PXA2xx_SSP1_BASE + SSDR,
+       .drcmr                  = &DRCMR(13),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp2_pcm_mono_out = {
+       .name                   = "SSP2 PCM Mono out",
+       .dev_addr               = PXA27x_SSP2_BASE + SSDR,
+       .drcmr                  = &DRCMR(16),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp2_pcm_mono_in = {
+       .name                   = "SSP2 PCM Mono in",
+       .dev_addr               = PXA27x_SSP2_BASE + SSDR,
+       .drcmr                  = &DRCMR(15),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp2_pcm_stereo_out = {
+       .name                   = "SSP2 PCM Stereo out",
+       .dev_addr               = PXA27x_SSP2_BASE + SSDR,
+       .drcmr                  = &DRCMR(16),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp2_pcm_stereo_in = {
+       .name                   = "SSP2 PCM Stereo in",
+       .dev_addr               = PXA27x_SSP2_BASE + SSDR,
+       .drcmr                  = &DRCMR(15),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp3_pcm_mono_out = {
+       .name                   = "SSP3 PCM Mono out",
+       .dev_addr               = PXA27x_SSP3_BASE + SSDR,
+       .drcmr                  = &DRCMR(67),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp3_pcm_mono_in = {
+       .name                   = "SSP3 PCM Mono in",
+       .dev_addr               = PXA27x_SSP3_BASE + SSDR,
+       .drcmr                  = &DRCMR(66),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp3_pcm_stereo_out = {
+       .name                   = "SSP3 PCM Stereo out",
+       .dev_addr               = PXA27x_SSP3_BASE + SSDR,
+       .drcmr                  = &DRCMR(67),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp3_pcm_stereo_in = {
+       .name                   = "SSP3 PCM Stereo in",
+       .dev_addr               = PXA27x_SSP3_BASE + SSDR,
+       .drcmr                  = &DRCMR(66),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp4_pcm_mono_out = {
+       .name                   = "SSP4 PCM Mono out",
+       .dev_addr               = PXA3xx_SSP4_BASE + SSDR,
+       .drcmr                  = &DRCMR(67),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp4_pcm_mono_in = {
+       .name                   = "SSP4 PCM Mono in",
+       .dev_addr               = PXA3xx_SSP4_BASE + SSDR,
+       .drcmr                  = &DRCMR(66),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH2,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp4_pcm_stereo_out = {
+       .name                   = "SSP4 PCM Stereo out",
+       .dev_addr               = PXA3xx_SSP4_BASE + SSDR,
+       .drcmr                  = &DRCMR(67),
+       .dcmd                   = DCMD_INCSRCADDR | DCMD_FLOWTRG |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static struct pxa2xx_pcm_dma_params pxa_ssp4_pcm_stereo_in = {
+       .name                   = "SSP4 PCM Stereo in",
+       .dev_addr               = PXA3xx_SSP4_BASE + SSDR,
+       .drcmr                  = &DRCMR(66),
+       .dcmd                   = DCMD_INCTRGADDR | DCMD_FLOWSRC |
+                                 DCMD_BURST16 | DCMD_WIDTH4,
+};
+
+static void dump_registers(struct ssp_device *ssp)
+{
+       dev_dbg(&ssp->pdev->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n",
+                ssp_read_reg(ssp, SSCR0), ssp_read_reg(ssp, SSCR1),
+                ssp_read_reg(ssp, SSTO));
+
+       dev_dbg(&ssp->pdev->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n",
+                ssp_read_reg(ssp, SSPSP), ssp_read_reg(ssp, SSSR),
+                ssp_read_reg(ssp, SSACD));
+}
+
+static struct pxa2xx_pcm_dma_params *ssp_dma_params[4][4] = {
+       {
+               &pxa_ssp1_pcm_mono_out, &pxa_ssp1_pcm_mono_in,
+               &pxa_ssp1_pcm_stereo_out, &pxa_ssp1_pcm_stereo_in,
+       },
+       {
+               &pxa_ssp2_pcm_mono_out, &pxa_ssp2_pcm_mono_in,
+               &pxa_ssp2_pcm_stereo_out, &pxa_ssp2_pcm_stereo_in,
+       },
+       {
+               &pxa_ssp3_pcm_mono_out, &pxa_ssp3_pcm_mono_in,
+               &pxa_ssp3_pcm_stereo_out, &pxa_ssp3_pcm_stereo_in,
+       },
+       {
+               &pxa_ssp4_pcm_mono_out, &pxa_ssp4_pcm_mono_in,
+               &pxa_ssp4_pcm_stereo_out, &pxa_ssp4_pcm_stereo_in,
+       },
+};
+
+static int pxa_ssp_startup(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct ssp_priv *priv = cpu_dai->private_data;
+       int ret = 0;
+
+       if (!cpu_dai->active) {
+               ret = ssp_init(&priv->dev, cpu_dai->id + 1, SSP_NO_IRQ);
+               if (ret < 0)
+                       return ret;
+               ssp_disable(&priv->dev);
+       }
+       return ret;
+}
+
+static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
+                            struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct ssp_priv *priv = cpu_dai->private_data;
+
+       if (!cpu_dai->active) {
+               ssp_disable(&priv->dev);
+               ssp_exit(&priv->dev);
+       }
+}
+
+#ifdef CONFIG_PM
+
+static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+
+       if (!cpu_dai->active)
+               return 0;
+
+       ssp_save_state(&priv->dev, &priv->state);
+       clk_disable(priv->dev.ssp->clk);
+       return 0;
+}
+
+static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+
+       if (!cpu_dai->active)
+               return 0;
+
+       clk_enable(priv->dev.ssp->clk);
+       ssp_restore_state(&priv->dev, &priv->state);
+       ssp_enable(&priv->dev);
+
+       return 0;
+}
+
+#else
+#define pxa_ssp_suspend        NULL
+#define pxa_ssp_resume NULL
+#endif
+
+/**
+ * ssp_set_clkdiv - set SSP clock divider
+ * @div: serial clock rate divider
+ */
+static void ssp_set_scr(struct ssp_dev *dev, u32 div)
+{
+       struct ssp_device *ssp = dev->ssp;
+       u32 sscr0 = ssp_read_reg(dev->ssp, SSCR0) & ~SSCR0_SCR;
+
+       ssp_write_reg(ssp, SSCR0, (sscr0 | SSCR0_SerClkDiv(div)));
+}
+
+/*
+ * Set the SSP ports SYSCLK.
+ */
+static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
+       int clk_id, unsigned int freq, int dir)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       int val;
+
+       u32 sscr0 = ssp_read_reg(ssp, SSCR0) &
+               ~(SSCR0_ECS |  SSCR0_NCS | SSCR0_MOD | SSCR0_ADC);
+
+       dev_dbg(&ssp->pdev->dev,
+               "pxa_ssp_set_dai_sysclk id: %d, clk_id %d, freq %d\n",
+               cpu_dai->id, clk_id, freq);
+
+       switch (clk_id) {
+       case PXA_SSP_CLK_NET_PLL:
+               sscr0 |= SSCR0_MOD;
+               break;
+       case PXA_SSP_CLK_PLL:
+               /* Internal PLL is fixed */
+               if (cpu_is_pxa25x())
+                       priv->sysclk = 1843200;
+               else
+                       priv->sysclk = 13000000;
+               break;
+       case PXA_SSP_CLK_EXT:
+               priv->sysclk = freq;
+               sscr0 |= SSCR0_ECS;
+               break;
+       case PXA_SSP_CLK_NET:
+               priv->sysclk = freq;
+               sscr0 |= SSCR0_NCS | SSCR0_MOD;
+               break;
+       case PXA_SSP_CLK_AUDIO:
+               priv->sysclk = 0;
+               ssp_set_scr(&priv->dev, 1);
+               sscr0 |= SSCR0_ADC;
+               break;
+       default:
+               return -ENODEV;
+       }
+
+       /* The SSP clock must be disabled when changing SSP clock mode
+        * on PXA2xx.  On PXA3xx it must be enabled when doing so. */
+       if (!cpu_is_pxa3xx())
+               clk_disable(priv->dev.ssp->clk);
+       val = ssp_read_reg(ssp, SSCR0) | sscr0;
+       ssp_write_reg(ssp, SSCR0, val);
+       if (!cpu_is_pxa3xx())
+               clk_enable(priv->dev.ssp->clk);
+
+       return 0;
+}
+
+/*
+ * Set the SSP clock dividers.
+ */
+static int pxa_ssp_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
+       int div_id, int div)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       int val;
+
+       switch (div_id) {
+       case PXA_SSP_AUDIO_DIV_ACDS:
+               val = (ssp_read_reg(ssp, SSACD) & ~0x7) | SSACD_ACDS(div);
+               ssp_write_reg(ssp, SSACD, val);
+               break;
+       case PXA_SSP_AUDIO_DIV_SCDB:
+               val = ssp_read_reg(ssp, SSACD);
+               val &= ~SSACD_SCDB;
+#if defined(CONFIG_PXA3xx)
+               if (cpu_is_pxa3xx())
+                       val &= ~SSACD_SCDX8;
+#endif
+               switch (div) {
+               case PXA_SSP_CLK_SCDB_1:
+                       val |= SSACD_SCDB;
+                       break;
+               case PXA_SSP_CLK_SCDB_4:
+                       break;
+#if defined(CONFIG_PXA3xx)
+               case PXA_SSP_CLK_SCDB_8:
+                       if (cpu_is_pxa3xx())
+                               val |= SSACD_SCDX8;
+                       else
+                               return -EINVAL;
+                       break;
+#endif
+               default:
+                       return -EINVAL;
+               }
+               ssp_write_reg(ssp, SSACD, val);
+               break;
+       case PXA_SSP_DIV_SCR:
+               ssp_set_scr(&priv->dev, div);
+               break;
+       default:
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+/*
+ * Configure the PLL frequency pxa27x and (afaik - pxa320 only)
+ */
+static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai,
+       int pll_id, unsigned int freq_in, unsigned int freq_out)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       u32 ssacd = ssp_read_reg(ssp, SSACD) & ~0x70;
+
+#if defined(CONFIG_PXA3xx)
+       if (cpu_is_pxa3xx())
+               ssp_write_reg(ssp, SSACDD, 0);
+#endif
+
+       switch (freq_out) {
+       case 5622000:
+               break;
+       case 11345000:
+               ssacd |= (0x1 << 4);
+               break;
+       case 12235000:
+               ssacd |= (0x2 << 4);
+               break;
+       case 14857000:
+               ssacd |= (0x3 << 4);
+               break;
+       case 32842000:
+               ssacd |= (0x4 << 4);
+               break;
+       case 48000000:
+               ssacd |= (0x5 << 4);
+               break;
+       case 0:
+               /* Disable */
+               break;
+
+       default:
+#ifdef CONFIG_PXA3xx
+               /* PXA3xx has a clock ditherer which can be used to generate
+                * a wider range of frequencies - calculate a value for it.
+                */
+               if (cpu_is_pxa3xx()) {
+                       u32 val;
+                       u64 tmp = 19968;
+                       tmp *= 1000000;
+                       do_div(tmp, freq_out);
+                       val = tmp;
+
+                       val = (val << 16) | 64;;
+                       ssp_write_reg(ssp, SSACDD, val);
+
+                       ssacd |= (0x6 << 4);
+
+                       dev_dbg(&ssp->pdev->dev,
+                               "Using SSACDD %x to supply %dHz\n",
+                               val, freq_out);
+                       break;
+               }
+#endif
+
+               return -EINVAL;
+       }
+
+       ssp_write_reg(ssp, SSACD, ssacd);
+
+       return 0;
+}
+
+/*
+ * Set the active slots in TDM/Network mode
+ */
+static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
+       unsigned int mask, int slots)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       u32 sscr0;
+
+       sscr0 = ssp_read_reg(ssp, SSCR0) & ~SSCR0_SlotsPerFrm(7);
+
+       /* set number of active slots */
+       sscr0 |= SSCR0_SlotsPerFrm(slots);
+       ssp_write_reg(ssp, SSCR0, sscr0);
+
+       /* set active slot mask */
+       ssp_write_reg(ssp, SSTSA, mask);
+       ssp_write_reg(ssp, SSRSA, mask);
+       return 0;
+}
+
+/*
+ * Tristate the SSP DAI lines
+ */
+static int pxa_ssp_set_dai_tristate(struct snd_soc_dai *cpu_dai,
+       int tristate)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       u32 sscr1;
+
+       sscr1 = ssp_read_reg(ssp, SSCR1);
+       if (tristate)
+               sscr1 &= ~SSCR1_TTE;
+       else
+               sscr1 |= SSCR1_TTE;
+       ssp_write_reg(ssp, SSCR1, sscr1);
+
+       return 0;
+}
+
+/*
+ * Set up the SSP DAI format.
+ * The SSP Port must be inactive before calling this function as the
+ * physical interface format is changed.
+ */
+static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
+               unsigned int fmt)
+{
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       u32 sscr0;
+       u32 sscr1;
+       u32 sspsp;
+
+       /* reset port settings */
+       sscr0 = ssp_read_reg(ssp, SSCR0) &
+               (SSCR0_ECS |  SSCR0_NCS | SSCR0_MOD | SSCR0_ADC);
+       sscr1 = SSCR1_RxTresh(8) | SSCR1_TxTresh(7);
+       sspsp = 0;
+
+       switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+       case SND_SOC_DAIFMT_CBM_CFM:
+               sscr1 |= SSCR1_SCLKDIR | SSCR1_SFRMDIR;
+               break;
+       case SND_SOC_DAIFMT_CBM_CFS:
+               sscr1 |= SSCR1_SCLKDIR;
+               break;
+       case SND_SOC_DAIFMT_CBS_CFS:
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       ssp_write_reg(ssp, SSCR0, sscr0);
+       ssp_write_reg(ssp, SSCR1, sscr1);
+       ssp_write_reg(ssp, SSPSP, sspsp);
+
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               sscr0 |= SSCR0_MOD | SSCR0_PSP;
+               sscr1 |= SSCR1_RWOT | SSCR1_TRAIL;
+
+               switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+               case SND_SOC_DAIFMT_NB_NF:
+                       sspsp |= SSPSP_FSRT;
+                       break;
+               case SND_SOC_DAIFMT_NB_IF:
+                       sspsp |= SSPSP_SFRMP | SSPSP_FSRT;
+                       break;
+               case SND_SOC_DAIFMT_IB_IF:
+                       sspsp |= SSPSP_SFRMP;
+                       break;
+               default:
+                       return -EINVAL;
+               }
+               break;
+
+       case SND_SOC_DAIFMT_DSP_A:
+               sspsp |= SSPSP_FSRT;
+       case SND_SOC_DAIFMT_DSP_B:
+               sscr0 |= SSCR0_MOD | SSCR0_PSP;
+               sscr1 |= SSCR1_TRAIL | SSCR1_RWOT;
+
+               switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+               case SND_SOC_DAIFMT_NB_NF:
+                       sspsp |= SSPSP_SFRMP;
+                       break;
+               case SND_SOC_DAIFMT_IB_IF:
+                       break;
+               default:
+                       return -EINVAL;
+               }
+               break;
+
+       default:
+               return -EINVAL;
+       }
+
+       ssp_write_reg(ssp, SSCR0, sscr0);
+       ssp_write_reg(ssp, SSCR1, sscr1);
+       ssp_write_reg(ssp, SSPSP, sspsp);
+
+       dump_registers(ssp);
+
+       /* Since we are configuring the timings for the format by hand
+        * we have to defer some things until hw_params() where we
+        * know parameters like the sample size.
+        */
+       priv->dai_fmt = fmt;
+
+       return 0;
+}
+
+/*
+ * Set the SSP audio DMA parameters and sample size.
+ * Can be called multiple times by oss emulation.
+ */
+static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       int dma = 0, chn = params_channels(params);
+       u32 sscr0;
+       u32 sspsp;
+       int width = snd_pcm_format_physical_width(params_format(params));
+
+       /* select correct DMA params */
+       if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+               dma = 1; /* capture DMA offset is 1,3 */
+       if (chn == 2)
+               dma += 2; /* stereo DMA offset is 2, mono is 0 */
+       cpu_dai->dma_data = ssp_dma_params[cpu_dai->id][dma];
+
+       dev_dbg(&ssp->pdev->dev, "pxa_ssp_hw_params: dma %d\n", dma);
+
+       /* we can only change the settings if the port is not in use */
+       if (ssp_read_reg(ssp, SSCR0) & SSCR0_SSE)
+               return 0;
+
+       /* clear selected SSP bits */
+       sscr0 = ssp_read_reg(ssp, SSCR0) & ~(SSCR0_DSS | SSCR0_EDSS);
+       ssp_write_reg(ssp, SSCR0, sscr0);
+
+       /* bit size */
+       sscr0 = ssp_read_reg(ssp, SSCR0);
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S16_LE:
+#ifdef CONFIG_PXA3xx
+               if (cpu_is_pxa3xx())
+                       sscr0 |= SSCR0_FPCKE;
+#endif
+               sscr0 |= SSCR0_DataSize(16);
+               if (params_channels(params) > 1)
+                       sscr0 |= SSCR0_EDSS;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+               sscr0 |= (SSCR0_EDSS | SSCR0_DataSize(8));
+               /* we must be in network mode (2 slots) for 24 bit stereo */
+               break;
+       case SNDRV_PCM_FORMAT_S32_LE:
+               sscr0 |= (SSCR0_EDSS | SSCR0_DataSize(16));
+               /* we must be in network mode (2 slots) for 32 bit stereo */
+               break;
+       }
+       ssp_write_reg(ssp, SSCR0, sscr0);
+
+       switch (priv->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_I2S:
+               /* Cleared when the DAI format is set */
+               sspsp = ssp_read_reg(ssp, SSPSP) | SSPSP_SFRMWDTH(width);
+               ssp_write_reg(ssp, SSPSP, sspsp);
+               break;
+       default:
+               break;
+       }
+
+       /* We always use a network mode so we always require TDM slots
+        * - complain loudly and fail if they've not been set up yet.
+        */
+       if (!(ssp_read_reg(ssp, SSTSA) & 0xf)) {
+               dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n");
+               return -EINVAL;
+       }
+
+       dump_registers(ssp);
+
+       return 0;
+}
+
+static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
+                          struct snd_soc_dai *dai)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       int ret = 0;
+       struct ssp_priv *priv = cpu_dai->private_data;
+       struct ssp_device *ssp = priv->dev.ssp;
+       int val;
+
+       switch (cmd) {
+       case SNDRV_PCM_TRIGGER_RESUME:
+               ssp_enable(&priv->dev);
+               break;
+       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+               val = ssp_read_reg(ssp, SSCR1);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       val |= SSCR1_TSRE;
+               else
+                       val |= SSCR1_RSRE;
+               ssp_write_reg(ssp, SSCR1, val);
+               val = ssp_read_reg(ssp, SSSR);
+               ssp_write_reg(ssp, SSSR, val);
+               break;
+       case SNDRV_PCM_TRIGGER_START:
+               val = ssp_read_reg(ssp, SSCR1);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       val |= SSCR1_TSRE;
+               else
+                       val |= SSCR1_RSRE;
+               ssp_write_reg(ssp, SSCR1, val);
+               ssp_enable(&priv->dev);
+               break;
+       case SNDRV_PCM_TRIGGER_STOP:
+               val = ssp_read_reg(ssp, SSCR1);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       val &= ~SSCR1_TSRE;
+               else
+                       val &= ~SSCR1_RSRE;
+               ssp_write_reg(ssp, SSCR1, val);
+               break;
+       case SNDRV_PCM_TRIGGER_SUSPEND:
+               ssp_disable(&priv->dev);
+               break;
+       case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+               val = ssp_read_reg(ssp, SSCR1);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       val &= ~SSCR1_TSRE;
+               else
+                       val &= ~SSCR1_RSRE;
+               ssp_write_reg(ssp, SSCR1, val);
+               break;
+
+       default:
+               ret = -EINVAL;
+       }
+
+       dump_registers(ssp);
+
+       return ret;
+}
+
+static int pxa_ssp_probe(struct platform_device *pdev,
+                           struct snd_soc_dai *dai)
+{
+       struct ssp_priv *priv;
+       int ret;
+
+       priv = kzalloc(sizeof(struct ssp_priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->dev.ssp = ssp_request(dai->id, "SoC audio");
+       if (priv->dev.ssp == NULL) {
+               ret = -ENODEV;
+               goto err_priv;
+       }
+
+       dai->private_data = priv;
+
+       return 0;
+
+err_priv:
+       kfree(priv);
+       return ret;
+}
+
+static void pxa_ssp_remove(struct platform_device *pdev,
+                             struct snd_soc_dai *dai)
+{
+       struct ssp_priv *priv = dai->private_data;
+       ssp_free(priv->dev.ssp);
+}
+
+#define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
+                         SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
+                         SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
+                         SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+
+#define PXA_SSP_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
+                           SNDRV_PCM_FMTBIT_S24_LE |   \
+                           SNDRV_PCM_FMTBIT_S32_LE)
+
+struct snd_soc_dai pxa_ssp_dai[] = {
+       {
+               .name = "pxa2xx-ssp1",
+               .id = 0,
+               .probe = pxa_ssp_probe,
+               .remove = pxa_ssp_remove,
+               .suspend = pxa_ssp_suspend,
+               .resume = pxa_ssp_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+               },
+               .capture = {
+                        .channels_min = 1,
+                        .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+                },
+               .ops = {
+                       .startup = pxa_ssp_startup,
+                       .shutdown = pxa_ssp_shutdown,
+                       .trigger = pxa_ssp_trigger,
+                       .hw_params = pxa_ssp_hw_params,
+                       .set_sysclk = pxa_ssp_set_dai_sysclk,
+                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
+                       .set_pll = pxa_ssp_set_dai_pll,
+                       .set_fmt = pxa_ssp_set_dai_fmt,
+                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
+                       .set_tristate = pxa_ssp_set_dai_tristate,
+               },
+       },
+       {       .name = "pxa2xx-ssp2",
+               .id = 1,
+               .probe = pxa_ssp_probe,
+               .remove = pxa_ssp_remove,
+               .suspend = pxa_ssp_suspend,
+               .resume = pxa_ssp_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+               },
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+                },
+               .ops = {
+                       .startup = pxa_ssp_startup,
+                       .shutdown = pxa_ssp_shutdown,
+                       .trigger = pxa_ssp_trigger,
+                       .hw_params = pxa_ssp_hw_params,
+                       .set_sysclk = pxa_ssp_set_dai_sysclk,
+                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
+                       .set_pll = pxa_ssp_set_dai_pll,
+                       .set_fmt = pxa_ssp_set_dai_fmt,
+                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
+                       .set_tristate = pxa_ssp_set_dai_tristate,
+               },
+       },
+       {
+               .name = "pxa2xx-ssp3",
+               .id = 2,
+               .probe = pxa_ssp_probe,
+               .remove = pxa_ssp_remove,
+               .suspend = pxa_ssp_suspend,
+               .resume = pxa_ssp_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+               },
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+                },
+               .ops = {
+                       .startup = pxa_ssp_startup,
+                       .shutdown = pxa_ssp_shutdown,
+                       .trigger = pxa_ssp_trigger,
+                       .hw_params = pxa_ssp_hw_params,
+                       .set_sysclk = pxa_ssp_set_dai_sysclk,
+                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
+                       .set_pll = pxa_ssp_set_dai_pll,
+                       .set_fmt = pxa_ssp_set_dai_fmt,
+                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
+                       .set_tristate = pxa_ssp_set_dai_tristate,
+               },
+       },
+       {
+               .name = "pxa2xx-ssp4",
+               .id = 3,
+               .probe = pxa_ssp_probe,
+               .remove = pxa_ssp_remove,
+               .suspend = pxa_ssp_suspend,
+               .resume = pxa_ssp_resume,
+               .playback = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+               },
+               .capture = {
+                       .channels_min = 1,
+                       .channels_max = 2,
+                       .rates = PXA_SSP_RATES,
+                       .formats = PXA_SSP_FORMATS,
+                },
+               .ops = {
+                       .startup = pxa_ssp_startup,
+                       .shutdown = pxa_ssp_shutdown,
+                       .trigger = pxa_ssp_trigger,
+                       .hw_params = pxa_ssp_hw_params,
+                       .set_sysclk = pxa_ssp_set_dai_sysclk,
+                       .set_clkdiv = pxa_ssp_set_dai_clkdiv,
+                       .set_pll = pxa_ssp_set_dai_pll,
+                       .set_fmt = pxa_ssp_set_dai_fmt,
+                       .set_tdm_slot = pxa_ssp_set_dai_tdm_slot,
+                       .set_tristate = pxa_ssp_set_dai_tristate,
+               },
+       },
+};
+EXPORT_SYMBOL_GPL(pxa_ssp_dai);
+
+static int __init pxa_ssp_init(void)
+{
+       return snd_soc_register_dais(pxa_ssp_dai, ARRAY_SIZE(pxa_ssp_dai));
+}
+module_init(pxa_ssp_init);
+
+static void __exit pxa_ssp_exit(void)
+{
+       snd_soc_unregister_dais(pxa_ssp_dai, ARRAY_SIZE(pxa_ssp_dai));
+}
+module_exit(pxa_ssp_exit);
+
+/* Module information */
+MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+MODULE_DESCRIPTION("PXA SSP/PCM SoC Interface");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/pxa/pxa-ssp.h b/sound/soc/pxa/pxa-ssp.h
new file mode 100644 (file)
index 0000000..91deadd
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * ASoC PXA SSP port support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _PXA_SSP_H
+#define _PXA_SSP_H
+
+/* pxa DAI SSP IDs */
+#define PXA_DAI_SSP1                   0
+#define PXA_DAI_SSP2                   1
+#define PXA_DAI_SSP3                   2
+#define PXA_DAI_SSP4                   3
+
+/* SSP clock sources */
+#define PXA_SSP_CLK_PLL        0
+#define PXA_SSP_CLK_EXT        1
+#define PXA_SSP_CLK_NET        2
+#define PXA_SSP_CLK_AUDIO      3
+#define PXA_SSP_CLK_NET_PLL    4
+
+/* SSP audio dividers */
+#define PXA_SSP_AUDIO_DIV_ACDS         0
+#define PXA_SSP_AUDIO_DIV_SCDB         1
+#define PXA_SSP_DIV_SCR                                2
+
+/* SSP ACDS audio dividers values */
+#define PXA_SSP_CLK_AUDIO_DIV_1                0
+#define PXA_SSP_CLK_AUDIO_DIV_2                1
+#define PXA_SSP_CLK_AUDIO_DIV_4                2
+#define PXA_SSP_CLK_AUDIO_DIV_8                3
+#define PXA_SSP_CLK_AUDIO_DIV_16       4
+#define PXA_SSP_CLK_AUDIO_DIV_32       5
+
+/* SSP divider bypass */
+#define PXA_SSP_CLK_SCDB_4             0
+#define PXA_SSP_CLK_SCDB_1             1
+#define PXA_SSP_CLK_SCDB_8             2
+
+#define PXA_SSP_PLL_OUT  0
+
+extern struct snd_soc_dai pxa_ssp_dai[4];
+
+#endif
index a7a3a9c5c6ff41c6eee5ce690106de63823eb458..780db6757ad2ee4990887a78cc4485493ecab2b6 100644 (file)
@@ -87,14 +87,12 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = {
 };
 
 #ifdef CONFIG_PM
-static int pxa2xx_ac97_suspend(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
+static int pxa2xx_ac97_suspend(struct snd_soc_dai *dai)
 {
        return pxa2xx_ac97_hw_suspend();
 }
 
-static int pxa2xx_ac97_resume(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
+static int pxa2xx_ac97_resume(struct snd_soc_dai *dai)
 {
        return pxa2xx_ac97_hw_resume();
 }
@@ -117,7 +115,8 @@ static void pxa2xx_ac97_remove(struct platform_device *pdev,
 }
 
 static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
-                               struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -131,7 +130,8 @@ static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
 }
 
 static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                                    struct snd_pcm_hw_params *params,
+                                    struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -145,7 +145,8 @@ static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
 }
 
 static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                                    struct snd_pcm_hw_params *params,
+                                    struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -170,7 +171,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
        .name = "pxa2xx-ac97",
        .id = 0,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .probe = pxa2xx_ac97_probe,
        .remove = pxa2xx_ac97_remove,
        .suspend = pxa2xx_ac97_suspend,
@@ -193,7 +194,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
        .name = "pxa2xx-ac97-aux",
        .id = 1,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .playback = {
                .stream_name = "AC97 Aux Playback",
                .channels_min = 1,
@@ -212,7 +213,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
        .name = "pxa2xx-ac97-mic",
        .id = 2,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .capture = {
                .stream_name = "AC97 Mic Capture",
                .channels_min = 1,
@@ -227,6 +228,18 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 EXPORT_SYMBOL_GPL(pxa_ac97_dai);
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
+static int __init pxa_ac97_init(void)
+{
+       return snd_soc_register_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai));
+}
+module_init(pxa_ac97_init);
+
+static void __exit pxa_ac97_exit(void)
+{
+       snd_soc_unregister_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai));
+}
+module_exit(pxa_ac97_exit);
+
 MODULE_AUTHOR("Nicolas Pitre");
 MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip");
 MODULE_LICENSE("GPL");
index e758034db5c3ba38422e07592b2a933dc3e50b81..517991fb10993f16cdbdc758479885da69a840d4 100644 (file)
@@ -121,7 +121,8 @@ static struct pxa2xx_gpio gpio_bus[] = {
        },
 };
 
-static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream)
+static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
+                             struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -187,7 +188,8 @@ static int pxa2xx_i2s_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 }
 
 static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
-                               struct snd_pcm_hw_params *params)
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -248,7 +250,8 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                             struct snd_soc_dai *dai)
 {
        int ret = 0;
 
@@ -269,7 +272,8 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
        return ret;
 }
 
-static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream)
+static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
+                               struct snd_soc_dai *dai)
 {
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                SACR1 |= SACR1_DRPL;
@@ -289,8 +293,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream)
 }
 
 #ifdef CONFIG_PM
-static int pxa2xx_i2s_suspend(struct platform_device *dev,
-       struct snd_soc_dai *dai)
+static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
 {
        if (!dai->active)
                return 0;
@@ -307,8 +310,7 @@ static int pxa2xx_i2s_suspend(struct platform_device *dev,
        return 0;
 }
 
-static int pxa2xx_i2s_resume(struct platform_device *pdev,
-       struct snd_soc_dai *dai)
+static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
 {
        if (!dai->active)
                return 0;
@@ -336,7 +338,6 @@ static int pxa2xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai pxa_i2s_dai = {
        .name = "pxa2xx-i2s",
        .id = 0,
-       .type = SND_SOC_DAI_I2S,
        .suspend = pxa2xx_i2s_suspend,
        .resume = pxa2xx_i2s_resume,
        .playback = {
@@ -353,8 +354,7 @@ struct snd_soc_dai pxa_i2s_dai = {
                .startup = pxa2xx_i2s_startup,
                .shutdown = pxa2xx_i2s_shutdown,
                .trigger = pxa2xx_i2s_trigger,
-               .hw_params = pxa2xx_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = pxa2xx_i2s_hw_params,
                .set_fmt = pxa2xx_i2s_set_dai_fmt,
                .set_sysclk = pxa2xx_i2s_set_dai_sysclk,
        },
@@ -364,12 +364,23 @@ EXPORT_SYMBOL_GPL(pxa_i2s_dai);
 
 static int pxa2xx_i2s_probe(struct platform_device *dev)
 {
+       int ret;
+
        clk_i2s = clk_get(&dev->dev, "I2SCLK");
-       return IS_ERR(clk_i2s) ? PTR_ERR(clk_i2s) : 0;
+       if (IS_ERR(clk_i2s))
+               return PTR_ERR(clk_i2s);
+
+       pxa_i2s_dai.dev = &dev->dev;
+       ret = snd_soc_register_dai(&pxa_i2s_dai);
+       if (ret != 0)
+               clk_put(clk_i2s);
+
+       return ret;
 }
 
 static int __devexit pxa2xx_i2s_remove(struct platform_device *dev)
 {
+       snd_soc_unregister_dai(&pxa_i2s_dai);
        clk_put(clk_i2s);
        clk_i2s = ERR_PTR(-ENOENT);
        return 0;
index afcd892cd2fa42f0526defd607bd58db9f5722ec..c670d08e7c9ede6223b24b4ef78e8c2465859b89 100644 (file)
@@ -69,7 +69,7 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
        return 0;
 }
 
-struct snd_pcm_ops pxa2xx_pcm_ops = {
+static struct snd_pcm_ops pxa2xx_pcm_ops = {
        .open           = __pxa2xx_pcm_open,
        .close          = __pxa2xx_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
@@ -118,6 +118,18 @@ struct snd_soc_platform pxa2xx_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(pxa2xx_soc_platform);
 
+static int __init pxa2xx_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&pxa2xx_soc_platform);
+}
+module_init(pxa2xx_soc_platform_init);
+
+static void __exit pxa2xx_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&pxa2xx_soc_platform);
+}
+module_exit(pxa2xx_soc_platform_exit);
+
 MODULE_AUTHOR("Nicolas Pitre");
 MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module");
 MODULE_LICENSE("GPL");
index d307b6757e9550646b565a4cffaac5abc0a02007..a3b9e6bdf9794cb1350d34448efeddbee1989591 100644 (file)
@@ -319,8 +319,9 @@ static struct snd_soc_dai_link spitz_dai = {
 };
 
 /* spitz audio machine driver */
-static struct snd_soc_machine snd_soc_machine_spitz = {
+static struct snd_soc_card snd_soc_spitz = {
        .name = "Spitz",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = &spitz_dai,
        .num_links = 1,
 };
@@ -333,8 +334,7 @@ static struct wm8750_setup_data spitz_wm8750_setup = {
 
 /* spitz audio subsystem */
 static struct snd_soc_device spitz_snd_devdata = {
-       .machine = &snd_soc_machine_spitz,
-       .platform = &pxa2xx_soc_platform,
+       .card = &snd_soc_spitz,
        .codec_dev = &soc_codec_dev_wm8750,
        .codec_data = &spitz_wm8750_setup,
 };
index afefe41b8c46c9f47ae255b14ec1ebed56e3522e..c77194f74c9b56eea9438db006c0d4b37b7912b5 100644 (file)
@@ -38,7 +38,7 @@
 #include "pxa2xx-pcm.h"
 #include "pxa2xx-ac97.h"
 
-static struct snd_soc_machine tosa;
+static struct snd_soc_card tosa;
 
 #define TOSA_HP        0
 #define TOSA_MIC_INT   1
@@ -230,15 +230,37 @@ static struct snd_soc_dai_link tosa_dai[] = {
 },
 };
 
-static struct snd_soc_machine tosa = {
+static int tosa_probe(struct platform_device *dev)
+{
+       int ret;
+
+       ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
+       if (ret)
+               return ret;
+       ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
+       if (ret)
+               gpio_free(TOSA_GPIO_L_MUTE);
+
+       return ret;
+}
+
+static int tosa_remove(struct platform_device *dev)
+{
+       gpio_free(TOSA_GPIO_L_MUTE);
+       return 0;
+}
+
+static struct snd_soc_card tosa = {
        .name = "Tosa",
+       .platform = &pxa2xx_soc_platform,
        .dai_link = tosa_dai,
        .num_links = ARRAY_SIZE(tosa_dai),
+       .probe = tosa_probe,
+       .remove = tosa_remove,
 };
 
 static struct snd_soc_device tosa_snd_devdata = {
-       .machine = &tosa,
-       .platform = &pxa2xx_soc_platform,
+       .card = &tosa,
        .codec_dev = &soc_codec_dev_wm9712,
 };
 
@@ -251,11 +273,6 @@ static int __init tosa_init(void)
        if (!machine_is_tosa())
                return -ENODEV;
 
-       ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
-       if (ret)
-               return ret;
-       gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
-
        tosa_snd_device = platform_device_alloc("soc-audio", -1);
        if (!tosa_snd_device) {
                ret = -ENOMEM;
@@ -272,15 +289,12 @@ static int __init tosa_init(void)
        platform_device_put(tosa_snd_device);
 
 err_alloc:
-       gpio_free(TOSA_GPIO_L_MUTE);
-
        return ret;
 }
 
 static void __exit tosa_exit(void)
 {
        platform_device_unregister(tosa_snd_device);
-       gpio_free(TOSA_GPIO_L_MUTE);
 }
 
 module_init(tosa_init);
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
new file mode 100644 (file)
index 0000000..f8e9ecd
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * zylonite.c  --  SoC audio for Zylonite
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/device.h>
+#include <linux/i2c.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include "../codecs/wm9713.h"
+#include "pxa2xx-pcm.h"
+#include "pxa2xx-ac97.h"
+#include "pxa-ssp.h"
+
+static struct snd_soc_card zylonite;
+
+static const struct snd_soc_dapm_widget zylonite_dapm_widgets[] = {
+       SND_SOC_DAPM_HP("Headphone", NULL),
+       SND_SOC_DAPM_MIC("Headset Microphone", NULL),
+       SND_SOC_DAPM_MIC("Handset Microphone", NULL),
+       SND_SOC_DAPM_SPK("Multiactor", NULL),
+       SND_SOC_DAPM_SPK("Headset Earpiece", NULL),
+};
+
+/* Currently supported audio map */
+static const struct snd_soc_dapm_route audio_map[] = {
+
+       /* Headphone output connected to HPL/HPR */
+       { "Headphone", NULL,  "HPL" },
+       { "Headphone", NULL,  "HPR" },
+
+       /* On-board earpiece */
+       { "Headset Earpiece", NULL, "OUT3" },
+
+       /* Headphone mic */
+       { "MIC2A", NULL, "Mic Bias" },
+       { "Mic Bias", NULL, "Headset Microphone" },
+
+       /* On-board mic */
+       { "MIC1", NULL, "Mic Bias" },
+       { "Mic Bias", NULL, "Handset Microphone" },
+
+       /* Multiactor differentially connected over SPKL/SPKR */
+       { "Multiactor", NULL, "SPKL" },
+       { "Multiactor", NULL, "SPKR" },
+};
+
+static int zylonite_wm9713_init(struct snd_soc_codec *codec)
+{
+       /* Currently we only support use of the AC97 clock here.  If
+        * CLK_POUT is selected by SW15 then the clock API will need
+        * to be used to request and enable it here.
+        */
+
+       snd_soc_dapm_new_controls(codec, zylonite_dapm_widgets,
+                                 ARRAY_SIZE(zylonite_dapm_widgets));
+
+       snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+
+       /* Static setup for now */
+       snd_soc_dapm_enable_pin(codec, "Headphone");
+       snd_soc_dapm_enable_pin(codec, "Headset Earpiece");
+
+       snd_soc_dapm_sync(codec);
+       return 0;
+}
+
+static int zylonite_voice_hw_params(struct snd_pcm_substream *substream,
+                                   struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       unsigned int pll_out = 0;
+       unsigned int acds = 0;
+       unsigned int wm9713_div = 0;
+       int ret = 0;
+
+       switch (params_rate(params)) {
+       case 8000:
+               wm9713_div = 12;
+               pll_out = 2048000;
+               break;
+       case 16000:
+               wm9713_div = 6;
+               pll_out = 4096000;
+               break;
+       case 48000:
+       default:
+               wm9713_div = 2;
+               pll_out = 12288000;
+               acds = 1;
+               break;
+       }
+
+       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+               SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_tdm_slot(cpu_dai,
+                                      params_channels(params),
+                                      params_channels(params));
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_pll(cpu_dai, 0, 0, pll_out);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, PXA_SSP_AUDIO_DIV_ACDS, acds);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_sysclk(cpu_dai, PXA_SSP_CLK_AUDIO, 0, 1);
+       if (ret < 0)
+               return ret;
+
+       /* Note that if the PLL is in use the WM9713_PCMCLK_PLL_DIV needs
+        * to be set instead.
+        */
+       ret = snd_soc_dai_set_clkdiv(codec_dai, WM9713_PCMCLK_DIV,
+                                    WM9713_PCMDIV(wm9713_div));
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+
+static struct snd_soc_ops zylonite_voice_ops = {
+       .hw_params = zylonite_voice_hw_params,
+};
+
+static struct snd_soc_dai_link zylonite_dai[] = {
+{
+       .name = "AC97",
+       .stream_name = "AC97 HiFi",
+       .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
+       .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI],
+       .init = zylonite_wm9713_init,
+},
+{
+       .name = "AC97 Aux",
+       .stream_name = "AC97 Aux",
+       .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
+       .codec_dai = &wm9713_dai[WM9713_DAI_AC97_AUX],
+},
+{
+       .name = "WM9713 Voice",
+       .stream_name = "WM9713 Voice",
+       .cpu_dai = &pxa_ssp_dai[PXA_DAI_SSP3],
+       .codec_dai = &wm9713_dai[WM9713_DAI_PCM_VOICE],
+       .ops = &zylonite_voice_ops,
+},
+};
+
+static struct snd_soc_card zylonite = {
+       .name = "Zylonite",
+       .platform = &pxa2xx_soc_platform,
+       .dai_link = zylonite_dai,
+       .num_links = ARRAY_SIZE(zylonite_dai),
+};
+
+static struct snd_soc_device zylonite_snd_ac97_devdata = {
+       .card = &zylonite,
+       .codec_dev = &soc_codec_dev_wm9713,
+};
+
+static struct platform_device *zylonite_snd_ac97_device;
+
+static int __init zylonite_init(void)
+{
+       int ret;
+
+       zylonite_snd_ac97_device = platform_device_alloc("soc-audio", -1);
+       if (!zylonite_snd_ac97_device)
+               return -ENOMEM;
+
+       platform_set_drvdata(zylonite_snd_ac97_device,
+                            &zylonite_snd_ac97_devdata);
+       zylonite_snd_ac97_devdata.dev = &zylonite_snd_ac97_device->dev;
+
+       ret = platform_device_add(zylonite_snd_ac97_device);
+       if (ret != 0)
+               platform_device_put(zylonite_snd_ac97_device);
+
+       return ret;
+}
+
+static void __exit zylonite_exit(void)
+{
+       platform_device_unregister(zylonite_snd_ac97_device);
+}
+
+module_init(zylonite_init);
+module_exit(zylonite_exit);
+
+MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+MODULE_DESCRIPTION("ALSA SoC WM9713 Zylonite");
+MODULE_LICENSE("GPL");
index b9f2353effebfba49cf5010c10bcf5b2794781c6..fcd03acf10f6cd4a51d504c12ed4bf4c49d84eb8 100644 (file)
@@ -44,3 +44,8 @@ config SND_S3C24XX_SOC_LN2440SBC_ALC650
          Say Y if you want to add support for SoC audio on ln2440sbc
          with the ALC650.
 
+config SND_S3C24XX_SOC_S3C24XX_UDA134X
+       tristate "SoC I2S Audio support UDA134X wired to a S3C24XX"
+               depends on SND_S3C24XX_SOC
+               select SND_S3C24XX_SOC_I2S
+               select SND_SOC_UDA134X
index 0aa5fb0b9700ae5d4db9ff3704da92aa18c7bfa9..96b3f3f617d4280dddb8fa03c5d0aa95ec9a1e11 100644 (file)
@@ -13,7 +13,9 @@ obj-$(CONFIG_SND_S3C2412_SOC_I2S) += snd-soc-s3c2412-i2s.o
 snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o
 snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o
 snd-soc-ln2440sbc-alc650-objs := ln2440sbc_alc650.o
+snd-soc-s3c24xx-uda134x-objs := s3c24xx_uda134x.o
 
 obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
 obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o
 obj-$(CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650) += snd-soc-ln2440sbc-alc650.o
+obj-$(CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X) += snd-soc-s3c24xx-uda134x.o
index 4eab2c19c454dbda65a62a4e000f05841332c0c5..12c71482d258b35c70d22ecf9e9c18441b57a575 100644 (file)
@@ -27,7 +27,7 @@
 #include "s3c24xx-pcm.h"
 #include "s3c24xx-ac97.h"
 
-static struct snd_soc_machine ln2440sbc;
+static struct snd_soc_card ln2440sbc;
 
 static struct snd_soc_dai_link ln2440sbc_dai[] = {
 {
@@ -38,15 +38,15 @@ static struct snd_soc_dai_link ln2440sbc_dai[] = {
 },
 };
 
-static struct snd_soc_machine ln2440sbc = {
+static struct snd_soc_card ln2440sbc = {
        .name = "LN2440SBC",
+       .platform = &s3c24xx_soc_platform,
        .dai_link = ln2440sbc_dai,
        .num_links = ARRAY_SIZE(ln2440sbc_dai),
 };
 
 static struct snd_soc_device ln2440sbc_snd_ac97_devdata = {
-       .machine = &ln2440sbc,
-       .platform = &s3c24xx_soc_platform,
+       .card = &ln2440sbc,
        .codec_dev = &soc_codec_dev_ac97,
 };
 
index 87ddfefcc2fba18b821f3b154fbe03d86e1bf3e7..45bb12e8ea447df922a5f99c02d9479569bd632d 100644 (file)
@@ -59,7 +59,7 @@
 #define NEO_CAPTURE_HEADSET            7
 #define NEO_CAPTURE_BLUETOOTH          8
 
-static struct snd_soc_machine neo1973;
+static struct snd_soc_card neo1973;
 static struct i2c_client *i2c;
 
 static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
@@ -548,7 +548,6 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
 static struct snd_soc_dai bt_dai = {
        .name = "Bluetooth",
        .id = 0,
-       .type = SND_SOC_DAI_PCM,
        .playback = {
                .channels_min = 1,
                .channels_max = 1,
@@ -579,8 +578,9 @@ static struct snd_soc_dai_link neo1973_dai[] = {
 },
 };
 
-static struct snd_soc_machine neo1973 = {
+static struct snd_soc_card neo1973 = {
        .name = "neo1973",
+       .platform = &s3c24xx_soc_platform,
        .dai_link = neo1973_dai,
        .num_links = ARRAY_SIZE(neo1973_dai),
 };
@@ -591,8 +591,7 @@ static struct wm8753_setup_data neo1973_wm8753_setup = {
 };
 
 static struct snd_soc_device neo1973_snd_devdata = {
-       .machine = &neo1973,
-       .platform = &s3c24xx_soc_platform,
+       .card = &neo1973,
        .codec_dev = &soc_codec_dev_wm8753,
        .codec_data = &neo1973_wm8753_setup,
 };
index ded7d995a9228a5f0d9080cbc4575cfd2216cd32..f3fc0aba0aaf78755d2e0170eeabcc82d575f31b 100644 (file)
@@ -343,7 +343,8 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
 }
 
 static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
-                                struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        u32 iismod;
@@ -373,7 +374,8 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                              struct snd_soc_dai *dai)
 {
        int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
        unsigned long irqs;
@@ -647,8 +649,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
 }
 
 #ifdef CONFIG_PM
-static int s3c2412_i2s_suspend(struct platform_device *dev,
-                             struct snd_soc_dai *dai)
+static int s3c2412_i2s_suspend(struct snd_soc_dai *dai)
 {
        struct s3c2412_i2s_info *i2s = &s3c2412_i2s;
        u32 iismod;
@@ -663,25 +664,24 @@ static int s3c2412_i2s_suspend(struct platform_device *dev,
                iismod = readl(i2s->regs + S3C2412_IISMOD);
 
                if (iismod & S3C2412_IISCON_RXDMA_ACTIVE)
-                       dev_warn(&dev->dev, "%s: RXDMA active?\n", __func__);
+                       pr_warning("%s: RXDMA active?\n", __func__);
 
                if (iismod & S3C2412_IISCON_TXDMA_ACTIVE)
-                       dev_warn(&dev->dev, "%s: TXDMA active?\n", __func__);
+                       pr_warning("%s: TXDMA active?\n", __func__);
 
                if (iismod & S3C2412_IISCON_IIS_ACTIVE)
-                       dev_warn(&dev->dev, "%s: IIS active\n", __func__);
+                       pr_warning("%s: IIS active\n", __func__);
        }
 
        return 0;
 }
 
-static int s3c2412_i2s_resume(struct platform_device *pdev,
-                             struct snd_soc_dai *dai)
+static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
 {
        struct s3c2412_i2s_info *i2s = &s3c2412_i2s;
 
-       dev_info(&pdev->dev, "dai_active %d, IISMOD %08x, IISCON %08x\n",
-                dai->active, i2s->suspend_iismod, i2s->suspend_iiscon);
+       pr_info("dai_active %d, IISMOD %08x, IISCON %08x\n",
+               dai->active, i2s->suspend_iismod, i2s->suspend_iiscon);
 
        if (dai->active) {
                writel(i2s->suspend_iiscon, i2s->regs + S3C2412_IISCON);
@@ -711,7 +711,6 @@ static int s3c2412_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai s3c2412_i2s_dai = {
        .name   = "s3c2412-i2s",
        .id     = 0,
-       .type   = SND_SOC_DAI_I2S,
        .probe  = s3c2412_i2s_probe,
        .suspend = s3c2412_i2s_suspend,
        .resume = s3c2412_i2s_resume,
@@ -730,8 +729,6 @@ struct snd_soc_dai s3c2412_i2s_dai = {
        .ops = {
                .trigger        = s3c2412_i2s_trigger,
                .hw_params      = s3c2412_i2s_hw_params,
-       },
-       .dai_ops = {
                .set_fmt        = s3c2412_i2s_set_fmt,
                .set_clkdiv     = s3c2412_i2s_set_clkdiv,
                .set_sysclk     = s3c2412_i2s_set_sysclk,
@@ -739,6 +736,19 @@ struct snd_soc_dai s3c2412_i2s_dai = {
 };
 EXPORT_SYMBOL_GPL(s3c2412_i2s_dai);
 
+static int __init s3c2412_i2s_init(void)
+{
+       return snd_soc_register_dai(&s3c2412_i2s_dai);
+}
+module_init(s3c2412_i2s_init);
+
+static void __exit s3c2412_i2s_exit(void)
+{
+       snd_soc_unregister_dai(&s3c2412_i2s_dai);
+}
+module_exit(s3c2412_i2s_exit);
+
+
 /* Module information */
 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
 MODULE_DESCRIPTION("S3C2412 I2S SoC Interface");
index 19c5c3cf5d8c64138e31d9b70b489768309159a1..1bfce40bb2e457a56eea42ec6d78a2ad15cffd6a 100644 (file)
@@ -271,7 +271,8 @@ static void s3c2443_ac97_remove(struct platform_device *pdev,
 }
 
 static int s3c2443_ac97_hw_params(struct snd_pcm_substream *substream,
-                               struct snd_pcm_hw_params *params)
+                                 struct snd_pcm_hw_params *params,
+                                 struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -284,7 +285,8 @@ static int s3c2443_ac97_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd)
+static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
+                               struct snd_soc_dai *dai)
 {
        u32 ac_glbctrl;
 
@@ -313,7 +315,8 @@ static int s3c2443_ac97_trigger(struct snd_pcm_substream *substream, int cmd)
 }
 
 static int s3c2443_ac97_hw_mic_params(struct snd_pcm_substream *substream,
-       struct snd_pcm_hw_params *params)
+                                     struct snd_pcm_hw_params *params,
+                                     struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
@@ -327,7 +330,7 @@ static int s3c2443_ac97_hw_mic_params(struct snd_pcm_substream *substream,
 }
 
 static int s3c2443_ac97_mic_trigger(struct snd_pcm_substream *substream,
-       int cmd)
+                                   int cmd, struct snd_soc_dai *dai)
 {
        u32 ac_glbctrl;
 
@@ -356,7 +359,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
 {
        .name = "s3c2443-ac97",
        .id = 0,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .probe = s3c2443_ac97_probe,
        .remove = s3c2443_ac97_remove,
        .playback = {
@@ -378,7 +381,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
 {
        .name = "pxa2xx-ac97-mic",
        .id = 1,
-       .type = SND_SOC_DAI_AC97,
+       .ac97_control = 1,
        .capture = {
                .stream_name = "AC97 Mic Capture",
                .channels_min = 1,
@@ -393,6 +396,21 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
 EXPORT_SYMBOL_GPL(s3c2443_ac97_dai);
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
+static int __init s3c2443_ac97_init(void)
+{
+       return snd_soc_register_dais(s3c2443_ac97_dai,
+                                    ARRAY_SIZE(s3c2443_ac97_dai));
+}
+module_init(s3c2443_ac97_init);
+
+static void __exit s3c2443_ac97_exit(void)
+{
+       snd_soc_unregister_dais(s3c2443_ac97_dai,
+                               ARRAY_SIZE(s3c2443_ac97_dai));
+}
+module_exit(s3c2443_ac97_exit);
+
+
 MODULE_AUTHOR("Graeme Gregory");
 MODULE_DESCRIPTION("AC97 driver for the Samsung s3c2443 chip");
 MODULE_LICENSE("GPL");
index ba4476b55fbcc1f0e67f1311418fd015b1f3bef4..6f4d439b57aaecf4a388d8a2ce80c3caa9301ace 100644 (file)
@@ -243,7 +243,8 @@ static int s3c24xx_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
 }
 
 static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
-                               struct snd_pcm_hw_params *params)
+                                struct snd_pcm_hw_params *params,
+                                struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        u32 iismod;
@@ -261,10 +262,17 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
 
        switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S8:
+               iismod &= ~S3C2410_IISMOD_16BIT;
+               ((struct s3c24xx_pcm_dma_params *)
+                 rtd->dai->cpu_dai->dma_data)->dma_size = 1;
                break;
        case SNDRV_PCM_FORMAT_S16_LE:
                iismod |= S3C2410_IISMOD_16BIT;
+               ((struct s3c24xx_pcm_dma_params *)
+                 rtd->dai->cpu_dai->dma_data)->dma_size = 2;
                break;
+       default:
+               return -EINVAL;
        }
 
        writel(iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);
@@ -272,7 +280,8 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd)
+static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+                              struct snd_soc_dai *dai)
 {
        int ret = 0;
 
@@ -410,8 +419,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
 }
 
 #ifdef CONFIG_PM
-static int s3c24xx_i2s_suspend(struct platform_device *pdev,
-               struct snd_soc_dai *cpu_dai)
+static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
 {
        DBG("Entered %s\n", __func__);
 
@@ -425,8 +433,7 @@ static int s3c24xx_i2s_suspend(struct platform_device *pdev,
        return 0;
 }
 
-static int s3c24xx_i2s_resume(struct platform_device *pdev,
-               struct snd_soc_dai *cpu_dai)
+static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
 {
        DBG("Entered %s\n", __func__);
        clk_enable(s3c24xx_i2s.iis_clk);
@@ -452,7 +459,6 @@ static int s3c24xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai s3c24xx_i2s_dai = {
        .name = "s3c24xx-i2s",
        .id = 0,
-       .type = SND_SOC_DAI_I2S,
        .probe = s3c24xx_i2s_probe,
        .suspend = s3c24xx_i2s_suspend,
        .resume = s3c24xx_i2s_resume,
@@ -468,8 +474,7 @@ struct snd_soc_dai s3c24xx_i2s_dai = {
                .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},
        .ops = {
                .trigger = s3c24xx_i2s_trigger,
-               .hw_params = s3c24xx_i2s_hw_params,},
-       .dai_ops = {
+               .hw_params = s3c24xx_i2s_hw_params,
                .set_fmt = s3c24xx_i2s_set_fmt,
                .set_clkdiv = s3c24xx_i2s_set_clkdiv,
                .set_sysclk = s3c24xx_i2s_set_sysclk,
@@ -477,6 +482,18 @@ struct snd_soc_dai s3c24xx_i2s_dai = {
 };
 EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai);
 
+static int __init s3c24xx_i2s_init(void)
+{
+       return snd_soc_register_dai(&s3c24xx_i2s_dai);
+}
+module_init(s3c24xx_i2s_init);
+
+static void __exit s3c24xx_i2s_exit(void)
+{
+       snd_soc_unregister_dai(&s3c24xx_i2s_dai);
+}
+module_exit(s3c24xx_i2s_exit);
+
 /* Module information */
 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
 MODULE_DESCRIPTION("s3c24xx I2S SoC Interface");
index e13e614bada9aca7beeaecd85b8eb3f14f92a2a8..7c64d31d067e7283714c070001cf4c7f99764f84 100644 (file)
@@ -465,6 +465,18 @@ struct snd_soc_platform s3c24xx_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(s3c24xx_soc_platform);
 
+static int __init s3c24xx_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&s3c24xx_soc_platform);
+}
+module_init(s3c24xx_soc_platform_init);
+
+static void __exit s3c24xx_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&s3c24xx_soc_platform);
+}
+module_exit(s3c24xx_soc_platform_exit);
+
 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
 MODULE_DESCRIPTION("Samsung S3C24XX PCM DMA module");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/s3c24xx/s3c24xx_uda134x.c b/sound/soc/s3c24xx/s3c24xx_uda134x.c
new file mode 100644 (file)
index 0000000..a0a4d18
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+ * Modifications by Christian Pellegrin <chripell@evolware.org>
+ *
+ * s3c24xx_uda134x.c  --  S3C24XX_UDA134X ALSA SoC Audio board driver
+ *
+ * Copyright 2007 Dension Audio Systems Ltd.
+ * Author: Zoltan Devai
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/mutex.h>
+#include <linux/gpio.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/s3c24xx_uda134x.h>
+#include <sound/uda134x.h>
+
+#include <asm/plat-s3c24xx/regs-iis.h>
+
+#include "s3c24xx-pcm.h"
+#include "s3c24xx-i2s.h"
+#include "../codecs/uda134x.h"
+
+
+/* #define ENFORCE_RATES 1 */
+/*
+  Unfortunately the S3C24XX in master mode has a limited capacity of
+  generating the clock for the codec. If you define this only rates
+  that are really available will be enforced. But be careful, most
+  user level application just want the usual sampling frequencies (8,
+  11.025, 22.050, 44.1 kHz) and anyway resampling is a costly
+  operation for embedded systems. So if you aren't very lucky or your
+  hardware engineer wasn't very forward-looking it's better to leave
+  this undefined. If you do so an approximate value for the requested
+  sampling rate in the range -/+ 5% will be chosen. If this in not
+  possible an error will be returned.
+*/
+
+static struct clk *xtal;
+static struct clk *pclk;
+/* this is need because we don't have a place where to keep the
+ * pointers to the clocks in each substream. We get the clocks only
+ * when we are actually using them so we don't block stuff like
+ * frequency change or oscillator power-off */
+static int clk_users;
+static DEFINE_MUTEX(clk_lock);
+
+static unsigned int rates[33 * 2];
+#ifdef ENFORCE_RATES
+static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
+       .count  = ARRAY_SIZE(rates),
+       .list   = rates,
+       .mask   = 0,
+};
+#endif
+
+static struct platform_device *s3c24xx_uda134x_snd_device;
+
+static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
+{
+       int ret = 0;
+#ifdef ENFORCE_RATES
+       struct snd_pcm_runtime *runtime = substream->runtime;;
+#endif
+
+       mutex_lock(&clk_lock);
+       pr_debug("%s %d\n", __func__, clk_users);
+       if (clk_users == 0) {
+               xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
+               if (!xtal) {
+                       printk(KERN_ERR "%s cannot get xtal\n", __func__);
+                       ret = -EBUSY;
+               } else {
+                       pclk = clk_get(&s3c24xx_uda134x_snd_device->dev,
+                                      "pclk");
+                       if (!pclk) {
+                               printk(KERN_ERR "%s cannot get pclk\n",
+                                      __func__);
+                               clk_put(xtal);
+                               ret = -EBUSY;
+                       }
+               }
+               if (!ret) {
+                       int i, j;
+
+                       for (i = 0; i < 2; i++) {
+                               int fs = i ? 256 : 384;
+
+                               rates[i*33] = clk_get_rate(xtal) / fs;
+                               for (j = 1; j < 33; j++)
+                                       rates[i*33 + j] = clk_get_rate(pclk) /
+                                               (j * fs);
+                       }
+               }
+       }
+       clk_users += 1;
+       mutex_unlock(&clk_lock);
+       if (!ret) {
+#ifdef ENFORCE_RATES
+               ret = snd_pcm_hw_constraint_list(runtime, 0,
+                                                SNDRV_PCM_HW_PARAM_RATE,
+                                                &hw_constraints_rates);
+               if (ret < 0)
+                       printk(KERN_ERR "%s cannot set constraints\n",
+                              __func__);
+#endif
+       }
+       return ret;
+}
+
+static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream)
+{
+       mutex_lock(&clk_lock);
+       pr_debug("%s %d\n", __func__, clk_users);
+       clk_users -= 1;
+       if (clk_users == 0) {
+               clk_put(xtal);
+               xtal = NULL;
+               clk_put(pclk);
+               pclk = NULL;
+       }
+       mutex_unlock(&clk_lock);
+}
+
+static int s3c24xx_uda134x_hw_params(struct snd_pcm_substream *substream,
+                                       struct snd_pcm_hw_params *params)
+{
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+       struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+       unsigned int clk = 0;
+       int ret = 0;
+       int clk_source, fs_mode;
+       unsigned long rate = params_rate(params);
+       long err, cerr;
+       unsigned int div;
+       int i, bi;
+
+       err = 999999;
+       bi = 0;
+       for (i = 0; i < 2*33; i++) {
+               cerr = rates[i] - rate;
+               if (cerr < 0)
+                       cerr = -cerr;
+               if (cerr < err) {
+                       err = cerr;
+                       bi = i;
+               }
+       }
+       if (bi / 33 == 1)
+               fs_mode = S3C2410_IISMOD_256FS;
+       else
+               fs_mode = S3C2410_IISMOD_384FS;
+       if (bi % 33 == 0) {
+               clk_source = S3C24XX_CLKSRC_MPLL;
+               div = 1;
+       } else {
+               clk_source = S3C24XX_CLKSRC_PCLK;
+               div = bi % 33;
+       }
+       pr_debug("%s desired rate %lu, %d\n", __func__, rate, bi);
+
+       clk = (fs_mode == S3C2410_IISMOD_384FS ? 384 : 256) * rate;
+       pr_debug("%s will use: %s %s %d sysclk %d err %ld\n", __func__,
+                fs_mode == S3C2410_IISMOD_384FS ? "384FS" : "256FS",
+                clk_source == S3C24XX_CLKSRC_MPLL ? "MPLLin" : "PCLK",
+                div, clk, err);
+
+       if ((err * 100 / rate) > 5) {
+               printk(KERN_ERR "S3C24XX_UDA134X: effective frequency "
+                      "too different from desired (%ld%%)\n",
+                      err * 100 / rate);
+               return -EINVAL;
+       }
+
+       ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
+                       SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
+                       SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_sysclk(cpu_dai, clk_source , clk,
+                       SND_SOC_CLOCK_IN);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, fs_mode);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_BCLK,
+                       S3C2410_IISMOD_32FS);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
+                       S3C24XX_PRESCALE(div, div));
+       if (ret < 0)
+               return ret;
+
+       /* set the codec system clock for DAC and ADC */
+       ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk,
+                       SND_SOC_CLOCK_OUT);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+
+static struct snd_soc_ops s3c24xx_uda134x_ops = {
+       .startup = s3c24xx_uda134x_startup,
+       .shutdown = s3c24xx_uda134x_shutdown,
+       .hw_params = s3c24xx_uda134x_hw_params,
+};
+
+static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
+       .name = "UDA134X",
+       .stream_name = "UDA134X",
+       .codec_dai = &uda134x_dai,
+       .cpu_dai = &s3c24xx_i2s_dai,
+       .ops = &s3c24xx_uda134x_ops,
+};
+
+static struct snd_soc_card snd_soc_s3c24xx_uda134x = {
+       .name = "S3C24XX_UDA134X",
+       .platform = &s3c24xx_soc_platform,
+       .dai_link = &s3c24xx_uda134x_dai_link,
+       .num_links = 1,
+};
+
+static struct s3c24xx_uda134x_platform_data *s3c24xx_uda134x_l3_pins;
+
+static void setdat(int v)
+{
+       gpio_set_value(s3c24xx_uda134x_l3_pins->l3_data, v > 0);
+}
+
+static void setclk(int v)
+{
+       gpio_set_value(s3c24xx_uda134x_l3_pins->l3_clk, v > 0);
+}
+
+static void setmode(int v)
+{
+       gpio_set_value(s3c24xx_uda134x_l3_pins->l3_mode, v > 0);
+}
+
+static struct uda134x_platform_data s3c24xx_uda134x = {
+       .l3 = {
+               .setdat = setdat,
+               .setclk = setclk,
+               .setmode = setmode,
+               .data_hold = 1,
+               .data_setup = 1,
+               .clock_high = 1,
+               .mode_hold = 1,
+               .mode = 1,
+               .mode_setup = 1,
+       },
+};
+
+static struct snd_soc_device s3c24xx_uda134x_snd_devdata = {
+       .card = &snd_soc_s3c24xx_uda134x,
+       .codec_dev = &soc_codec_dev_uda134x,
+       .codec_data = &s3c24xx_uda134x,
+};
+
+static int s3c24xx_uda134x_setup_pin(int pin, char *fun)
+{
+       if (gpio_request(pin, "s3c24xx_uda134x") < 0) {
+               printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
+                      "l3 %s pin already in use", fun);
+               return -EBUSY;
+       }
+       gpio_direction_output(pin, 0);
+       return 0;
+}
+
+static int s3c24xx_uda134x_probe(struct platform_device *pdev)
+{
+       int ret;
+
+       printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n");
+
+       s3c24xx_uda134x_l3_pins = pdev->dev.platform_data;
+       if (s3c24xx_uda134x_l3_pins == NULL) {
+               printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
+                      "unable to find platform data\n");
+               return -ENODEV;
+       }
+       s3c24xx_uda134x.power = s3c24xx_uda134x_l3_pins->power;
+       s3c24xx_uda134x.model = s3c24xx_uda134x_l3_pins->model;
+
+       if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_data,
+                                     "data") < 0)
+               return -EBUSY;
+       if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_clk,
+                                     "clk") < 0) {
+               gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
+               return -EBUSY;
+       }
+       if (s3c24xx_uda134x_setup_pin(s3c24xx_uda134x_l3_pins->l3_mode,
+                                     "mode") < 0) {
+               gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
+               gpio_free(s3c24xx_uda134x_l3_pins->l3_clk);
+               return -EBUSY;
+       }
+
+       s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1);
+       if (!s3c24xx_uda134x_snd_device) {
+               printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
+                      "Unable to register\n");
+               return -ENOMEM;
+       }
+
+       platform_set_drvdata(s3c24xx_uda134x_snd_device,
+                            &s3c24xx_uda134x_snd_devdata);
+       s3c24xx_uda134x_snd_devdata.dev = &s3c24xx_uda134x_snd_device->dev;
+       ret = platform_device_add(s3c24xx_uda134x_snd_device);
+       if (ret) {
+               printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
+               platform_device_put(s3c24xx_uda134x_snd_device);
+       }
+
+       return ret;
+}
+
+static int s3c24xx_uda134x_remove(struct platform_device *pdev)
+{
+       platform_device_unregister(s3c24xx_uda134x_snd_device);
+       gpio_free(s3c24xx_uda134x_l3_pins->l3_data);
+       gpio_free(s3c24xx_uda134x_l3_pins->l3_clk);
+       gpio_free(s3c24xx_uda134x_l3_pins->l3_mode);
+       return 0;
+}
+
+static struct platform_driver s3c24xx_uda134x_driver = {
+       .probe  = s3c24xx_uda134x_probe,
+       .remove = s3c24xx_uda134x_remove,
+       .driver = {
+               .name = "s3c24xx_uda134x",
+               .owner = THIS_MODULE,
+       },
+};
+
+static int __init s3c24xx_uda134x_init(void)
+{
+       return platform_driver_register(&s3c24xx_uda134x_driver);
+}
+
+static void __exit s3c24xx_uda134x_exit(void)
+{
+       platform_driver_unregister(&s3c24xx_uda134x_driver);
+}
+
+
+module_init(s3c24xx_uda134x_init);
+module_exit(s3c24xx_uda134x_exit);
+
+MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>");
+MODULE_DESCRIPTION("S3C24XX_UDA134X ALSA SoC audio driver");
+MODULE_LICENSE("GPL");
index 8515d6ff03f2c50c5220f8a39cf9ec7a0389693d..a2a4f5323c177b83e600a8271640407170556aa3 100644 (file)
@@ -23,7 +23,7 @@
 #include "s3c24xx-pcm.h"
 #include "s3c24xx-ac97.h"
 
-static struct snd_soc_machine smdk2443;
+static struct snd_soc_card smdk2443;
 
 static struct snd_soc_dai_link smdk2443_dai[] = {
 {
@@ -34,15 +34,15 @@ static struct snd_soc_dai_link smdk2443_dai[] = {
 },
 };
 
-static struct snd_soc_machine smdk2443 = {
+static struct snd_soc_card smdk2443 = {
        .name = "SMDK2443",
+       .platform = &s3c24xx_soc_platform,
        .dai_link = smdk2443_dai,
        .num_links = ARRAY_SIZE(smdk2443_dai),
 };
 
 static struct snd_soc_device smdk2443_snd_ac97_devdata = {
-       .machine = &smdk2443,
-       .platform = &s3c24xx_soc_platform,
+       .card = &smdk2443,
        .codec_dev = &soc_codec_dev_ac97,
 };
 
index 9faa12622d09c07895c48cdf5d96ff6cfd47e38e..0dad3a0bb92018751b9101d5020cf32f1f0d2db2 100644 (file)
@@ -348,6 +348,18 @@ struct snd_soc_platform sh7760_soc_platform = {
 };
 EXPORT_SYMBOL_GPL(sh7760_soc_platform);
 
+static int __init sh7760_soc_platform_init(void)
+{
+       return snd_soc_register_platform(&sh7760_soc_platform);
+}
+module_init(sh7760_soc_platform_init);
+
+static void __exit sh7760_soc_platform_exit(void)
+{
+       snd_soc_unregister_platform(&sh7760_soc_platform);
+}
+module_exit(sh7760_soc_platform_exit);
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SH7760 Audio DMA (DMABRG) driver");
 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");
index df7bc345c3205cc0ae069322f6243e1027b71492..eab31838badfed9515a93a97a8eb020d50e4688e 100644 (file)
@@ -236,7 +236,8 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
 static int hac_hw_params(struct snd_pcm_substream *substream,
-                        struct snd_pcm_hw_params *params)
+                        struct snd_pcm_hw_params *params,
+                        struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct hac_priv *hac = &hac_cpu_data[rtd->dai->cpu_dai->id];
@@ -270,7 +271,7 @@ struct snd_soc_dai sh4_hac_dai[] = {
 {
        .name                   = "HAC0",
        .id                     = 0,
-       .type                   = SND_SOC_DAI_AC97,
+       .ac97_control           = 1,
        .playback = {
                .rates          = AC97_RATES,
                .formats        = AC97_FMTS,
@@ -290,8 +291,8 @@ struct snd_soc_dai sh4_hac_dai[] = {
 #ifdef CONFIG_CPU_SUBTYPE_SH7760
 {
        .name                   = "HAC1",
+       .ac97_control           = 1,
        .id                     = 1,
-       .type                   = SND_SOC_DAI_AC97,
        .playback = {
                .rates          = AC97_RATES,
                .formats        = AC97_FMTS,
@@ -313,6 +314,18 @@ struct snd_soc_dai sh4_hac_dai[] = {
 };
 EXPORT_SYMBOL_GPL(sh4_hac_dai);
 
+static int __init sh4_hac_init(void)
+{
+       return snd_soc_register_dais(sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai));
+}
+module_init(sh4_hac_init);
+
+static void __exit sh4_hac_exit(void)
+{
+       snd_soc_unregister_dais(sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai));
+}
+module_exit(sh4_hac_exit);
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver");
 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");
index 92bfaf4774a7d05fec84bf270539c8be09a6b05d..ce7f95b59de32aa3efe58bd46389ecb1d0b98c5e 100644 (file)
@@ -38,15 +38,15 @@ static struct snd_soc_dai_link sh7760_ac97_dai = {
        .ops = NULL,
 };
 
-static struct snd_soc_machine sh7760_ac97_soc_machine  = {
+static struct snd_soc_card sh7760_ac97_soc_machine  = {
        .name = "SH7760 AC97",
+       .platform = &sh7760_soc_platform,
        .dai_link = &sh7760_ac97_dai,
        .num_links = 1,
 };
 
 static struct snd_soc_device sh7760_ac97_snd_devdata = {
-       .machine = &sh7760_ac97_soc_machine,
-       .platform = &sh7760_soc_platform,
+       .card = &sh7760_ac97_soc_machine,
        .codec_dev = &soc_codec_dev_ac97,
 };
 
index 55c3464163ab45b50b7c359ef50b138c994bfcd1..d1e5390fddeb7ff82c999aac717ca281e966864e 100644 (file)
@@ -89,7 +89,8 @@ struct ssi_priv {
  * track usage of the SSI; it is simplex-only so prevent attempts of
  * concurrent playback + capture. FIXME: any locking required?
  */
-static int ssi_startup(struct snd_pcm_substream *substream)
+static int ssi_startup(struct snd_pcm_substream *substream,
+                      struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id];
@@ -101,7 +102,8 @@ static int ssi_startup(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static void ssi_shutdown(struct snd_pcm_substream *substream)
+static void ssi_shutdown(struct snd_pcm_substream *substream,
+                        struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id];
@@ -109,7 +111,8 @@ static void ssi_shutdown(struct snd_pcm_substream *substream)
        ssi->inuse = 0;
 }
 
-static int ssi_trigger(struct snd_pcm_substream *substream, int cmd)
+static int ssi_trigger(struct snd_pcm_substream *substream, int cmd,
+                      struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id];
@@ -129,7 +132,8 @@ static int ssi_trigger(struct snd_pcm_substream *substream, int cmd)
 }
 
 static int ssi_hw_params(struct snd_pcm_substream *substream,
-                        struct snd_pcm_hw_params *params)
+                        struct snd_pcm_hw_params *params,
+                        struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id];
@@ -336,7 +340,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
 {
        .name                   = "SSI0",
        .id                     = 0,
-       .type                   = SND_SOC_DAI_I2S,
        .playback = {
                .rates          = SSI_RATES,
                .formats        = SSI_FMTS,
@@ -354,8 +357,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
                .shutdown       = ssi_shutdown,
                .trigger        = ssi_trigger,
                .hw_params      = ssi_hw_params,
-       },
-       .dai_ops = {
                .set_sysclk     = ssi_set_sysclk,
                .set_clkdiv     = ssi_set_clkdiv,
                .set_fmt        = ssi_set_fmt,
@@ -365,7 +366,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
 {
        .name                   = "SSI1",
        .id                     = 1,
-       .type                   = SND_SOC_DAI_I2S,
        .playback = {
                .rates          = SSI_RATES,
                .formats        = SSI_FMTS,
@@ -383,8 +383,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
                .shutdown       = ssi_shutdown,
                .trigger        = ssi_trigger,
                .hw_params      = ssi_hw_params,
-       },
-       .dai_ops = {
                .set_sysclk     = ssi_set_sysclk,
                .set_clkdiv     = ssi_set_clkdiv,
                .set_fmt        = ssi_set_fmt,
@@ -394,6 +392,18 @@ struct snd_soc_dai sh4_ssi_dai[] = {
 };
 EXPORT_SYMBOL_GPL(sh4_ssi_dai);
 
+static int __init sh4_ssi_init(void)
+{
+       return snd_soc_register_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai));
+}
+module_init(sh4_ssi_init);
+
+static void __exit sh4_ssi_exit(void)
+{
+       snd_soc_unregister_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai));
+}
+module_exit(sh4_ssi_exit);
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver");
 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");
index 16c7453f494691cd3f75b6d6fe4ef5b45c339c84..b098c0b4c584ea8b5a441c3f626ecf02290caeee 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/bitops.h>
+#include <linux/debugfs.h>
 #include <linux/platform_device.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc-dapm.h>
 #include <sound/initval.h>
 
-/* debug */
-#define SOC_DEBUG 0
-#if SOC_DEBUG
-#define dbg(format, arg...) printk(format, ## arg)
-#else
-#define dbg(format, arg...)
-#endif
-
 static DEFINE_MUTEX(pcm_mutex);
 static DEFINE_MUTEX(io_mutex);
 static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq);
 
+#ifdef CONFIG_DEBUG_FS
+static struct dentry *debugfs_root;
+#endif
+
+static DEFINE_MUTEX(client_mutex);
+static LIST_HEAD(card_list);
+static LIST_HEAD(dai_list);
+static LIST_HEAD(platform_list);
+static LIST_HEAD(codec_list);
+
+static int snd_soc_register_card(struct snd_soc_card *card);
+static int snd_soc_unregister_card(struct snd_soc_card *card);
+
 /*
  * This is a timeout to do a DAPM powerdown after a stream is closed().
  * It can be used to eliminate pops between different playback streams, e.g.
@@ -107,20 +113,6 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
 }
 #endif
 
-static inline const char *get_dai_name(int type)
-{
-       switch (type) {
-       case SND_SOC_DAI_AC97_BUS:
-       case SND_SOC_DAI_AC97:
-               return "AC97";
-       case SND_SOC_DAI_I2S:
-               return "I2S";
-       case SND_SOC_DAI_PCM:
-               return "PCM";
-       }
-       return NULL;
-}
-
 /*
  * Called by ALSA when a PCM substream is opened, the runtime->hw record is
  * then initialized and any private data can be allocated. This also calls
@@ -130,9 +122,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_card *card = socdev->card;
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        int ret = 0;
@@ -141,7 +134,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 
        /* startup the audio subsystem */
        if (cpu_dai->ops.startup) {
-               ret = cpu_dai->ops.startup(substream);
+               ret = cpu_dai->ops.startup(substream, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't open interface %s\n",
                                cpu_dai->name);
@@ -158,7 +151,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
        }
 
        if (codec_dai->ops.startup) {
-               ret = codec_dai->ops.startup(substream);
+               ret = codec_dai->ops.startup(substream, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't open codec %s\n",
                                codec_dai->name);
@@ -228,12 +221,12 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
                goto machine_err;
        }
 
-       dbg("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name);
-       dbg("asoc: rate mask 0x%x\n", runtime->hw.rates);
-       dbg("asoc: min ch %d max ch %d\n", runtime->hw.channels_min,
-               runtime->hw.channels_max);
-       dbg("asoc: min rate %d max rate %d\n", runtime->hw.rate_min,
-               runtime->hw.rate_max);
+       pr_debug("asoc: %s <-> %s info:\n", codec_dai->name, cpu_dai->name);
+       pr_debug("asoc: rate mask 0x%x\n", runtime->hw.rates);
+       pr_debug("asoc: min ch %d max ch %d\n", runtime->hw.channels_min,
+                runtime->hw.channels_max);
+       pr_debug("asoc: min rate %d max rate %d\n", runtime->hw.rate_min,
+                runtime->hw.rate_max);
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                cpu_dai->playback.active = codec_dai->playback.active = 1;
@@ -255,7 +248,7 @@ codec_dai_err:
 
 platform_err:
        if (cpu_dai->ops.shutdown)
-               cpu_dai->ops.shutdown(substream);
+               cpu_dai->ops.shutdown(substream, cpu_dai);
 out:
        mutex_unlock(&pcm_mutex);
        return ret;
@@ -268,8 +261,9 @@ out:
  */
 static void close_delayed_work(struct work_struct *work)
 {
-       struct snd_soc_device *socdev =
-               container_of(work, struct snd_soc_device, delayed_work.work);
+       struct snd_soc_card *card = container_of(work, struct snd_soc_card,
+                                                delayed_work.work);
+       struct snd_soc_device *socdev = card->socdev;
        struct snd_soc_codec *codec = socdev->codec;
        struct snd_soc_dai *codec_dai;
        int i;
@@ -278,18 +272,18 @@ static void close_delayed_work(struct work_struct *work)
        for (i = 0; i < codec->num_dai; i++) {
                codec_dai = &codec->dai[i];
 
-               dbg("pop wq checking: %s status: %s waiting: %s\n",
-                       codec_dai->playback.stream_name,
-                       codec_dai->playback.active ? "active" : "inactive",
-                       codec_dai->pop_wait ? "yes" : "no");
+               pr_debug("pop wq checking: %s status: %s waiting: %s\n",
+                        codec_dai->playback.stream_name,
+                        codec_dai->playback.active ? "active" : "inactive",
+                        codec_dai->pop_wait ? "yes" : "no");
 
                /* are we waiting on this codec DAI stream */
                if (codec_dai->pop_wait == 1) {
 
                        /* Reduce power if no longer active */
                        if (codec->active == 0) {
-                               dbg("pop wq D1 %s %s\n", codec->name,
-                                       codec_dai->playback.stream_name);
+                               pr_debug("pop wq D1 %s %s\n", codec->name,
+                                        codec_dai->playback.stream_name);
                                snd_soc_dapm_set_bias_level(socdev,
                                        SND_SOC_BIAS_PREPARE);
                        }
@@ -301,8 +295,8 @@ static void close_delayed_work(struct work_struct *work)
 
                        /* Fall into standby if no longer active */
                        if (codec->active == 0) {
-                               dbg("pop wq D3 %s %s\n", codec->name,
-                                       codec_dai->playback.stream_name);
+                               pr_debug("pop wq D3 %s %s\n", codec->name,
+                                        codec_dai->playback.stream_name);
                                snd_soc_dapm_set_bias_level(socdev,
                                        SND_SOC_BIAS_STANDBY);
                        }
@@ -320,8 +314,9 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_card *card = socdev->card;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        struct snd_soc_codec *codec = socdev->codec;
@@ -346,10 +341,10 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
                snd_soc_dai_digital_mute(codec_dai, 1);
 
        if (cpu_dai->ops.shutdown)
-               cpu_dai->ops.shutdown(substream);
+               cpu_dai->ops.shutdown(substream, cpu_dai);
 
        if (codec_dai->ops.shutdown)
-               codec_dai->ops.shutdown(substream);
+               codec_dai->ops.shutdown(substream, codec_dai);
 
        if (machine->ops && machine->ops->shutdown)
                machine->ops->shutdown(substream);
@@ -361,7 +356,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                /* start delayed pop wq here for playback streams */
                codec_dai->pop_wait = 1;
-               schedule_delayed_work(&socdev->delayed_work,
+               schedule_delayed_work(&card->delayed_work,
                        msecs_to_jiffies(pmdown_time));
        } else {
                /* capture streams can be powered down now */
@@ -387,8 +382,9 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_card *card = socdev->card;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        struct snd_soc_codec *codec = socdev->codec;
@@ -413,7 +409,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
        }
 
        if (codec_dai->ops.prepare) {
-               ret = codec_dai->ops.prepare(substream);
+               ret = codec_dai->ops.prepare(substream, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: codec DAI prepare error\n");
                        goto out;
@@ -421,58 +417,49 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
        }
 
        if (cpu_dai->ops.prepare) {
-               ret = cpu_dai->ops.prepare(substream);
+               ret = cpu_dai->ops.prepare(substream, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: cpu DAI prepare error\n");
                        goto out;
                }
        }
 
-       /* we only want to start a DAPM playback stream if we are not waiting
-        * on an existing one stopping */
-       if (codec_dai->pop_wait) {
-               /* we are waiting for the delayed work to start */
-               if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
-                               snd_soc_dapm_stream_event(socdev->codec,
-                                       codec_dai->capture.stream_name,
-                                       SND_SOC_DAPM_STREAM_START);
-               else {
-                       codec_dai->pop_wait = 0;
-                       cancel_delayed_work(&socdev->delayed_work);
-                       snd_soc_dai_digital_mute(codec_dai, 0);
-               }
-       } else {
-               /* no delayed work - do we need to power up codec */
-               if (codec->bias_level != SND_SOC_BIAS_ON) {
+       /* cancel any delayed stream shutdown that is pending */
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+           codec_dai->pop_wait) {
+               codec_dai->pop_wait = 0;
+               cancel_delayed_work(&card->delayed_work);
+       }
 
-                       snd_soc_dapm_set_bias_level(socdev,
-                                                   SND_SOC_BIAS_PREPARE);
+       /* do we need to power up codec */
+       if (codec->bias_level != SND_SOC_BIAS_ON) {
+               snd_soc_dapm_set_bias_level(socdev,
+                                           SND_SOC_BIAS_PREPARE);
 
-                       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-                               snd_soc_dapm_stream_event(codec,
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       snd_soc_dapm_stream_event(codec,
                                        codec_dai->playback.stream_name,
                                        SND_SOC_DAPM_STREAM_START);
-                       else
-                               snd_soc_dapm_stream_event(codec,
+               else
+                       snd_soc_dapm_stream_event(codec,
                                        codec_dai->capture.stream_name,
                                        SND_SOC_DAPM_STREAM_START);
 
-                       snd_soc_dapm_set_bias_level(socdev, SND_SOC_BIAS_ON);
-                       snd_soc_dai_digital_mute(codec_dai, 0);
+               snd_soc_dapm_set_bias_level(socdev, SND_SOC_BIAS_ON);
+               snd_soc_dai_digital_mute(codec_dai, 0);
 
-               } else {
-                       /* codec already powered - power on widgets */
-                       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-                               snd_soc_dapm_stream_event(codec,
+       } else {
+               /* codec already powered - power on widgets */
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       snd_soc_dapm_stream_event(codec,
                                        codec_dai->playback.stream_name,
                                        SND_SOC_DAPM_STREAM_START);
-                       else
-                               snd_soc_dapm_stream_event(codec,
+               else
+                       snd_soc_dapm_stream_event(codec,
                                        codec_dai->capture.stream_name,
                                        SND_SOC_DAPM_STREAM_START);
 
-                       snd_soc_dai_digital_mute(codec_dai, 0);
-               }
+               snd_soc_dai_digital_mute(codec_dai, 0);
        }
 
 out:
@@ -491,7 +478,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        int ret = 0;
@@ -507,7 +495,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
        }
 
        if (codec_dai->ops.hw_params) {
-               ret = codec_dai->ops.hw_params(substream, params);
+               ret = codec_dai->ops.hw_params(substream, params, codec_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't set codec %s hw params\n",
                                codec_dai->name);
@@ -516,7 +504,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
        }
 
        if (cpu_dai->ops.hw_params) {
-               ret = cpu_dai->ops.hw_params(substream, params);
+               ret = cpu_dai->ops.hw_params(substream, params, cpu_dai);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: interface %s hw params failed\n",
                                cpu_dai->name);
@@ -539,11 +527,11 @@ out:
 
 platform_err:
        if (cpu_dai->ops.hw_free)
-               cpu_dai->ops.hw_free(substream);
+               cpu_dai->ops.hw_free(substream, cpu_dai);
 
 interface_err:
        if (codec_dai->ops.hw_free)
-               codec_dai->ops.hw_free(substream);
+               codec_dai->ops.hw_free(substream, codec_dai);
 
 codec_err:
        if (machine->ops && machine->ops->hw_free)
@@ -561,7 +549,8 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        struct snd_soc_codec *codec = socdev->codec;
@@ -582,10 +571,10 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
 
        /* now free hw params for the DAI's  */
        if (codec_dai->ops.hw_free)
-               codec_dai->ops.hw_free(substream);
+               codec_dai->ops.hw_free(substream, codec_dai);
 
        if (cpu_dai->ops.hw_free)
-               cpu_dai->ops.hw_free(substream);
+               cpu_dai->ops.hw_free(substream, cpu_dai);
 
        mutex_unlock(&pcm_mutex);
        return 0;
@@ -595,14 +584,15 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_device *socdev = rtd->socdev;
+       struct snd_soc_card *card= socdev->card;
        struct snd_soc_dai_link *machine = rtd->dai;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *cpu_dai = machine->cpu_dai;
        struct snd_soc_dai *codec_dai = machine->codec_dai;
        int ret;
 
        if (codec_dai->ops.trigger) {
-               ret = codec_dai->ops.trigger(substream, cmd);
+               ret = codec_dai->ops.trigger(substream, cmd, codec_dai);
                if (ret < 0)
                        return ret;
        }
@@ -614,7 +604,7 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
        }
 
        if (cpu_dai->ops.trigger) {
-               ret = cpu_dai->ops.trigger(substream, cmd);
+               ret = cpu_dai->ops.trigger(substream, cmd, cpu_dai);
                if (ret < 0)
                        return ret;
        }
@@ -636,8 +626,8 @@ static struct snd_pcm_ops soc_pcm_ops = {
 static int soc_suspend(struct platform_device *pdev, pm_message_t state)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
        struct snd_soc_codec *codec = socdev->codec;
        int i;
@@ -653,29 +643,29 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
        snd_power_change_state(codec->card, SNDRV_CTL_POWER_D3hot);
 
        /* mute any active DAC's */
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *dai = machine->dai_link[i].codec_dai;
-               if (dai->dai_ops.digital_mute && dai->playback.active)
-                       dai->dai_ops.digital_mute(dai, 1);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *dai = card->dai_link[i].codec_dai;
+               if (dai->ops.digital_mute && dai->playback.active)
+                       dai->ops.digital_mute(dai, 1);
        }
 
        /* suspend all pcms */
-       for (i = 0; i < machine->num_links; i++)
-               snd_pcm_suspend_all(machine->dai_link[i].pcm);
+       for (i = 0; i < card->num_links; i++)
+               snd_pcm_suspend_all(card->dai_link[i].pcm);
 
-       if (machine->suspend_pre)
-               machine->suspend_pre(pdev, state);
+       if (card->suspend_pre)
+               card->suspend_pre(pdev, state);
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai  *cpu_dai = machine->dai_link[i].cpu_dai;
-               if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97)
-                       cpu_dai->suspend(pdev, cpu_dai);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai  *cpu_dai = card->dai_link[i].cpu_dai;
+               if (cpu_dai->suspend && !cpu_dai->ac97_control)
+                       cpu_dai->suspend(cpu_dai);
                if (platform->suspend)
-                       platform->suspend(pdev, cpu_dai);
+                       platform->suspend(cpu_dai);
        }
 
        /* close any waiting streams and save state */
-       run_delayed_work(&socdev->delayed_work);
+       run_delayed_work(&card->delayed_work);
        codec->suspend_bias_level = codec->bias_level;
 
        for (i = 0; i < codec->num_dai; i++) {
@@ -692,14 +682,14 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
        if (codec_dev->suspend)
                codec_dev->suspend(pdev, state);
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
-               if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97)
-                       cpu_dai->suspend(pdev, cpu_dai);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
+               if (cpu_dai->suspend && cpu_dai->ac97_control)
+                       cpu_dai->suspend(cpu_dai);
        }
 
-       if (machine->suspend_post)
-               machine->suspend_post(pdev, state);
+       if (card->suspend_post)
+               card->suspend_post(pdev, state);
 
        return 0;
 }
@@ -709,11 +699,11 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
  */
 static void soc_resume_deferred(struct work_struct *work)
 {
-       struct snd_soc_device *socdev = container_of(work,
-                                                    struct snd_soc_device,
-                                                    deferred_resume_work);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_card *card = container_of(work,
+                                                struct snd_soc_card,
+                                                deferred_resume_work);
+       struct snd_soc_device *socdev = card->socdev;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
        struct snd_soc_codec *codec = socdev->codec;
        struct platform_device *pdev = to_platform_device(socdev->dev);
@@ -723,15 +713,15 @@ static void soc_resume_deferred(struct work_struct *work)
         * so userspace apps are blocked from touching us
         */
 
-       dev_info(socdev->dev, "starting resume work\n");
+       dev_dbg(socdev->dev, "starting resume work\n");
 
-       if (machine->resume_pre)
-               machine->resume_pre(pdev);
+       if (card->resume_pre)
+               card->resume_pre(pdev);
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
-               if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97)
-                       cpu_dai->resume(pdev, cpu_dai);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
+               if (cpu_dai->resume && cpu_dai->ac97_control)
+                       cpu_dai->resume(cpu_dai);
        }
 
        if (codec_dev->resume)
@@ -749,24 +739,24 @@ static void soc_resume_deferred(struct work_struct *work)
        }
 
        /* unmute any active DACs */
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *dai = machine->dai_link[i].codec_dai;
-               if (dai->dai_ops.digital_mute && dai->playback.active)
-                       dai->dai_ops.digital_mute(dai, 0);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *dai = card->dai_link[i].codec_dai;
+               if (dai->ops.digital_mute && dai->playback.active)
+                       dai->ops.digital_mute(dai, 0);
        }
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
-               if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97)
-                       cpu_dai->resume(pdev, cpu_dai);
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
+               if (cpu_dai->resume && !cpu_dai->ac97_control)
+                       cpu_dai->resume(cpu_dai);
                if (platform->resume)
-                       platform->resume(pdev, cpu_dai);
+                       platform->resume(cpu_dai);
        }
 
-       if (machine->resume_post)
-               machine->resume_post(pdev);
+       if (card->resume_post)
+               card->resume_post(pdev);
 
-       dev_info(socdev->dev, "resume work completed\n");
+       dev_dbg(socdev->dev, "resume work completed\n");
 
        /* userspace can access us now we are back as we were before */
        snd_power_change_state(codec->card, SNDRV_CTL_POWER_D0);
@@ -776,11 +766,12 @@ static void soc_resume_deferred(struct work_struct *work)
 static int soc_resume(struct platform_device *pdev)
 {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_card *card = socdev->card;
 
-       dev_info(socdev->dev, "scheduling resume work\n");
+       dev_dbg(socdev->dev, "scheduling resume work\n");
 
-       if (!schedule_work(&socdev->deferred_resume_work))
-               dev_err(socdev->dev, "work item may be lost\n");
+       if (!schedule_work(&card->deferred_resume_work))
+               dev_err(socdev->dev, "resume work item may be lost\n");
 
        return 0;
 }
@@ -790,23 +781,83 @@ static int soc_resume(struct platform_device *pdev)
 #define soc_resume     NULL
 #endif
 
-/* probes a new socdev */
-static int soc_probe(struct platform_device *pdev)
+static void snd_soc_instantiate_card(struct snd_soc_card *card)
 {
-       int ret = 0, i;
-       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_platform *platform = socdev->platform;
-       struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
+       struct platform_device *pdev = container_of(card->dev,
+                                                   struct platform_device,
+                                                   dev);
+       struct snd_soc_codec_device *codec_dev = card->socdev->codec_dev;
+       struct snd_soc_platform *platform;
+       struct snd_soc_dai *dai;
+       int i, found, ret, ac97;
+
+       if (card->instantiated)
+               return;
+
+       found = 0;
+       list_for_each_entry(platform, &platform_list, list)
+               if (card->platform == platform) {
+                       found = 1;
+                       break;
+               }
+       if (!found) {
+               dev_dbg(card->dev, "Platform %s not registered\n",
+                       card->platform->name);
+               return;
+       }
+
+       ac97 = 0;
+       for (i = 0; i < card->num_links; i++) {
+               found = 0;
+               list_for_each_entry(dai, &dai_list, list)
+                       if (card->dai_link[i].cpu_dai == dai) {
+                               found = 1;
+                               break;
+                       }
+               if (!found) {
+                       dev_dbg(card->dev, "DAI %s not registered\n",
+                               card->dai_link[i].cpu_dai->name);
+                       return;
+               }
 
-       if (machine->probe) {
-               ret = machine->probe(pdev);
+               if (card->dai_link[i].cpu_dai->ac97_control)
+                       ac97 = 1;
+       }
+
+       /* If we have AC97 in the system then don't wait for the
+        * codec.  This will need revisiting if we have to handle
+        * systems with mixed AC97 and non-AC97 parts.  Only check for
+        * DAIs currently; we can't do this per link since some AC97
+        * codecs have non-AC97 DAIs.
+        */
+       if (!ac97)
+               for (i = 0; i < card->num_links; i++) {
+                       found = 0;
+                       list_for_each_entry(dai, &dai_list, list)
+                               if (card->dai_link[i].codec_dai == dai) {
+                                       found = 1;
+                                       break;
+                               }
+                       if (!found) {
+                               dev_dbg(card->dev, "DAI %s not registered\n",
+                                       card->dai_link[i].codec_dai->name);
+                               return;
+                       }
+               }
+
+       /* Note that we do not current check for codec components */
+
+       dev_dbg(card->dev, "All components present, instantiating\n");
+
+       /* Found everything, bring it up */
+       if (card->probe) {
+               ret = card->probe(pdev);
                if (ret < 0)
-                       return ret;
+                       return;
        }
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
                if (cpu_dai->probe) {
                        ret = cpu_dai->probe(pdev, cpu_dai);
                        if (ret < 0)
@@ -827,13 +878,15 @@ static int soc_probe(struct platform_device *pdev)
        }
 
        /* DAPM stream work */
-       INIT_DELAYED_WORK(&socdev->delayed_work, close_delayed_work);
+       INIT_DELAYED_WORK(&card->delayed_work, close_delayed_work);
 #ifdef CONFIG_PM
        /* deferred resume work */
-       INIT_WORK(&socdev->deferred_resume_work, soc_resume_deferred);
+       INIT_WORK(&card->deferred_resume_work, soc_resume_deferred);
 #endif
 
-       return 0;
+       card->instantiated = 1;
+
+       return;
 
 platform_err:
        if (codec_dev->remove)
@@ -841,15 +894,45 @@ platform_err:
 
 cpu_dai_err:
        for (i--; i >= 0; i--) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
                if (cpu_dai->remove)
                        cpu_dai->remove(pdev, cpu_dai);
        }
 
-       if (machine->remove)
-               machine->remove(pdev);
+       if (card->remove)
+               card->remove(pdev);
+}
 
-       return ret;
+/*
+ * Attempt to initialise any uninitalised cards.  Must be called with
+ * client_mutex.
+ */
+static void snd_soc_instantiate_cards(void)
+{
+       struct snd_soc_card *card;
+       list_for_each_entry(card, &card_list, list)
+               snd_soc_instantiate_card(card);
+}
+
+/* probes a new socdev */
+static int soc_probe(struct platform_device *pdev)
+{
+       int ret = 0;
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+       struct snd_soc_card *card = socdev->card;
+
+       /* Bodge while we push things out of socdev */
+       card->socdev = socdev;
+
+       /* Bodge while we unpick instantiation */
+       card->dev = &pdev->dev;
+       ret = snd_soc_register_card(card);
+       if (ret != 0) {
+               dev_err(&pdev->dev, "Failed to register card\n");
+               return ret;
+       }
+
+       return 0;
 }
 
 /* removes a socdev */
@@ -857,11 +940,11 @@ static int soc_remove(struct platform_device *pdev)
 {
        int i;
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
-       struct snd_soc_machine *machine = socdev->machine;
-       struct snd_soc_platform *platform = socdev->platform;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
 
-       run_delayed_work(&socdev->delayed_work);
+       run_delayed_work(&card->delayed_work);
 
        if (platform->remove)
                platform->remove(pdev);
@@ -869,14 +952,16 @@ static int soc_remove(struct platform_device *pdev)
        if (codec_dev->remove)
                codec_dev->remove(pdev);
 
-       for (i = 0; i < machine->num_links; i++) {
-               struct snd_soc_dai *cpu_dai = machine->dai_link[i].cpu_dai;
+       for (i = 0; i < card->num_links; i++) {
+               struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
                if (cpu_dai->remove)
                        cpu_dai->remove(pdev, cpu_dai);
        }
 
-       if (machine->remove)
-               machine->remove(pdev);
+       if (card->remove)
+               card->remove(pdev);
+
+       snd_soc_unregister_card(card);
 
        return 0;
 }
@@ -898,6 +983,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
        struct snd_soc_dai_link *dai_link, int num)
 {
        struct snd_soc_codec *codec = socdev->codec;
+       struct snd_soc_card *card = socdev->card;
+       struct snd_soc_platform *platform = card->platform;
        struct snd_soc_dai *codec_dai = dai_link->codec_dai;
        struct snd_soc_dai *cpu_dai = dai_link->cpu_dai;
        struct snd_soc_pcm_runtime *rtd;
@@ -914,8 +1001,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
        codec_dai->codec = socdev->codec;
 
        /* check client and interface hw capabilities */
-       sprintf(new_name, "%s %s-%s-%d", dai_link->stream_name, codec_dai->name,
-               get_dai_name(cpu_dai->type), num);
+       sprintf(new_name, "%s %s-%d", dai_link->stream_name, codec_dai->name,
+               num);
 
        if (codec_dai->playback.channels_min)
                playback = 1;
@@ -933,13 +1020,13 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
 
        dai_link->pcm = pcm;
        pcm->private_data = rtd;
-       soc_pcm_ops.mmap = socdev->platform->pcm_ops->mmap;
-       soc_pcm_ops.pointer = socdev->platform->pcm_ops->pointer;
-       soc_pcm_ops.ioctl = socdev->platform->pcm_ops->ioctl;
-       soc_pcm_ops.copy = socdev->platform->pcm_ops->copy;
-       soc_pcm_ops.silence = socdev->platform->pcm_ops->silence;
-       soc_pcm_ops.ack = socdev->platform->pcm_ops->ack;
-       soc_pcm_ops.page = socdev->platform->pcm_ops->page;
+       soc_pcm_ops.mmap = platform->pcm_ops->mmap;
+       soc_pcm_ops.pointer = platform->pcm_ops->pointer;
+       soc_pcm_ops.ioctl = platform->pcm_ops->ioctl;
+       soc_pcm_ops.copy = platform->pcm_ops->copy;
+       soc_pcm_ops.silence = platform->pcm_ops->silence;
+       soc_pcm_ops.ack = platform->pcm_ops->ack;
+       soc_pcm_ops.page = platform->pcm_ops->page;
 
        if (playback)
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &soc_pcm_ops);
@@ -947,24 +1034,22 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
        if (capture)
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &soc_pcm_ops);
 
-       ret = socdev->platform->pcm_new(codec->card, codec_dai, pcm);
+       ret = platform->pcm_new(codec->card, codec_dai, pcm);
        if (ret < 0) {
                printk(KERN_ERR "asoc: platform pcm constructor failed\n");
                kfree(rtd);
                return ret;
        }
 
-       pcm->private_free = socdev->platform->pcm_free;
+       pcm->private_free = platform->pcm_free;
        printk(KERN_INFO "asoc: %s <-> %s mapping ok\n", codec_dai->name,
                cpu_dai->name);
        return ret;
 }
 
 /* codec register dump */
-static ssize_t codec_reg_show(struct device *dev,
-       struct device_attribute *attr, char *buf)
+static ssize_t soc_codec_reg_show(struct snd_soc_device *devdata, char *buf)
 {
-       struct snd_soc_device *devdata = dev_get_drvdata(dev);
        struct snd_soc_codec *codec = devdata->codec;
        int i, step = 1, count = 0;
 
@@ -1001,8 +1086,110 @@ static ssize_t codec_reg_show(struct device *dev,
 
        return count;
 }
+static ssize_t codec_reg_show(struct device *dev,
+       struct device_attribute *attr, char *buf)
+{
+       struct snd_soc_device *devdata = dev_get_drvdata(dev);
+       return soc_codec_reg_show(devdata, buf);
+}
+
 static DEVICE_ATTR(codec_reg, 0444, codec_reg_show, NULL);
 
+#ifdef CONFIG_DEBUG_FS
+static int codec_reg_open_file(struct inode *inode, struct file *file)
+{
+       file->private_data = inode->i_private;
+       return 0;
+}
+
+static ssize_t codec_reg_read_file(struct file *file, char __user *user_buf,
+                              size_t count, loff_t *ppos)
+{
+       ssize_t ret;
+       struct snd_soc_codec *codec = file->private_data;
+       struct device *card_dev = codec->card->dev;
+       struct snd_soc_device *devdata = card_dev->driver_data;
+       char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+       if (!buf)
+               return -ENOMEM;
+       ret = soc_codec_reg_show(devdata, buf);
+       if (ret >= 0)
+               ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
+       kfree(buf);
+       return ret;
+}
+
+static ssize_t codec_reg_write_file(struct file *file,
+               const char __user *user_buf, size_t count, loff_t *ppos)
+{
+       char buf[32];
+       int buf_size;
+       char *start = buf;
+       unsigned long reg, value;
+       int step = 1;
+       struct snd_soc_codec *codec = file->private_data;
+
+       buf_size = min(count, (sizeof(buf)-1));
+       if (copy_from_user(buf, user_buf, buf_size))
+               return -EFAULT;
+       buf[buf_size] = 0;
+
+       if (codec->reg_cache_step)
+               step = codec->reg_cache_step;
+
+       while (*start == ' ')
+               start++;
+       reg = simple_strtoul(start, &start, 16);
+       if ((reg >= codec->reg_cache_size) || (reg % step))
+               return -EINVAL;
+       while (*start == ' ')
+               start++;
+       if (strict_strtoul(start, 16, &value))
+               return -EINVAL;
+       codec->write(codec, reg, value);
+       return buf_size;
+}
+
+static const struct file_operations codec_reg_fops = {
+       .open = codec_reg_open_file,
+       .read = codec_reg_read_file,
+       .write = codec_reg_write_file,
+};
+
+static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
+{
+       codec->debugfs_reg = debugfs_create_file("codec_reg", 0644,
+                                                debugfs_root, codec,
+                                                &codec_reg_fops);
+       if (!codec->debugfs_reg)
+               printk(KERN_WARNING
+                      "ASoC: Failed to create codec register debugfs file\n");
+
+       codec->debugfs_pop_time = debugfs_create_u32("dapm_pop_time", 0744,
+                                                    debugfs_root,
+                                                    &codec->pop_time);
+       if (!codec->debugfs_pop_time)
+               printk(KERN_WARNING
+                      "Failed to create pop time debugfs file\n");
+}
+
+static void soc_cleanup_codec_debugfs(struct snd_soc_codec *codec)
+{
+       debugfs_remove(codec->debugfs_pop_time);
+       debugfs_remove(codec->debugfs_reg);
+}
+
+#else
+
+static inline void soc_init_codec_debugfs(struct snd_soc_codec *codec)
+{
+}
+
+static inline void soc_cleanup_codec_debugfs(struct snd_soc_codec *codec)
+{
+}
+#endif
+
 /**
  * snd_soc_new_ac97_codec - initailise AC97 device
  * @codec: audio codec
@@ -1121,7 +1308,7 @@ EXPORT_SYMBOL_GPL(snd_soc_test_bits);
 int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
 {
        struct snd_soc_codec *codec = socdev->codec;
-       struct snd_soc_machine *machine = socdev->machine;
+       struct snd_soc_card *card = socdev->card;
        int ret = 0, i;
 
        mutex_lock(&codec->mutex);
@@ -1140,11 +1327,11 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
        strncpy(codec->card->driver, codec->name, sizeof(codec->card->driver));
 
        /* create the pcms */
-       for (i = 0; i < machine->num_links; i++) {
-               ret = soc_new_pcm(socdev, &machine->dai_link[i], i);
+       for (i = 0; i < card->num_links; i++) {
+               ret = soc_new_pcm(socdev, &card->dai_link[i], i);
                if (ret < 0) {
                        printk(KERN_ERR "asoc: can't create pcm %s\n",
-                               machine->dai_link[i].stream_name);
+                               card->dai_link[i].stream_name);
                        mutex_unlock(&codec->mutex);
                        return ret;
                }
@@ -1156,7 +1343,7 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
 EXPORT_SYMBOL_GPL(snd_soc_new_pcms);
 
 /**
- * snd_soc_register_card - register sound card
+ * snd_soc_init_card - register sound card
  * @socdev: the SoC audio device
  *
  * Register a SoC sound card. Also registers an AC97 device if the
@@ -1164,29 +1351,28 @@ EXPORT_SYMBOL_GPL(snd_soc_new_pcms);
  *
  * Returns 0 for success, else error.
  */
-int snd_soc_register_card(struct snd_soc_device *socdev)
+int snd_soc_init_card(struct snd_soc_device *socdev)
 {
        struct snd_soc_codec *codec = socdev->codec;
-       struct snd_soc_machine *machine = socdev->machine;
+       struct snd_soc_card *card = socdev->card;
        int ret = 0, i, ac97 = 0, err = 0;
 
-       for (i = 0; i < machine->num_links; i++) {
-               if (socdev->machine->dai_link[i].init) {
-                       err = socdev->machine->dai_link[i].init(codec);
+       for (i = 0; i < card->num_links; i++) {
+               if (card->dai_link[i].init) {
+                       err = card->dai_link[i].init(codec);
                        if (err < 0) {
                                printk(KERN_ERR "asoc: failed to init %s\n",
-                                       socdev->machine->dai_link[i].stream_name);
+                                       card->dai_link[i].stream_name);
                                continue;
                        }
                }
-               if (socdev->machine->dai_link[i].codec_dai->type ==
-                       SND_SOC_DAI_AC97_BUS)
+               if (card->dai_link[i].codec_dai->ac97_control)
                        ac97 = 1;
        }
        snprintf(codec->card->shortname, sizeof(codec->card->shortname),
-                "%s", machine->name);
+                "%s",  card->name);
        snprintf(codec->card->longname, sizeof(codec->card->longname),
-                "%s (%s)", machine->name, codec->name);
+                "%s (%s)", card->name, codec->name);
 
        ret = snd_card_register(codec->card);
        if (ret < 0) {
@@ -1216,12 +1402,13 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
        if (err < 0)
                printk(KERN_WARNING "asoc: failed to add codec sysfs files\n");
 
+       soc_init_codec_debugfs(socdev->codec);
        mutex_unlock(&codec->mutex);
 
 out:
        return ret;
 }
-EXPORT_SYMBOL_GPL(snd_soc_register_card);
+EXPORT_SYMBOL_GPL(snd_soc_init_card);
 
 /**
  * snd_soc_free_pcms - free sound card and pcms
@@ -1239,10 +1426,11 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
 #endif
 
        mutex_lock(&codec->mutex);
+       soc_cleanup_codec_debugfs(socdev->codec);
 #ifdef CONFIG_SND_SOC_AC97_BUS
        for (i = 0; i < codec->num_dai; i++) {
                codec_dai = &codec->dai[i];
-               if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) {
+               if (codec_dai->ac97_control && codec->ac97) {
                        soc_ac97_dev_unregister(codec);
                        goto free_card;
                }
@@ -1756,8 +1944,8 @@ EXPORT_SYMBOL_GPL(snd_soc_put_volsw_s8);
 int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
        unsigned int freq, int dir)
 {
-       if (dai->dai_ops.set_sysclk)
-               return dai->dai_ops.set_sysclk(dai, clk_id, freq, dir);
+       if (dai->ops.set_sysclk)
+               return dai->ops.set_sysclk(dai, clk_id, freq, dir);
        else
                return -EINVAL;
 }
@@ -1776,8 +1964,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk);
 int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
        int div_id, int div)
 {
-       if (dai->dai_ops.set_clkdiv)
-               return dai->dai_ops.set_clkdiv(dai, div_id, div);
+       if (dai->ops.set_clkdiv)
+               return dai->ops.set_clkdiv(dai, div_id, div);
        else
                return -EINVAL;
 }
@@ -1795,8 +1983,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_clkdiv);
 int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
        int pll_id, unsigned int freq_in, unsigned int freq_out)
 {
-       if (dai->dai_ops.set_pll)
-               return dai->dai_ops.set_pll(dai, pll_id, freq_in, freq_out);
+       if (dai->ops.set_pll)
+               return dai->ops.set_pll(dai, pll_id, freq_in, freq_out);
        else
                return -EINVAL;
 }
@@ -1805,15 +1993,14 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll);
 /**
  * snd_soc_dai_set_fmt - configure DAI hardware audio format.
  * @dai: DAI
- * @clk_id: DAI specific clock ID
  * @fmt: SND_SOC_DAIFMT_ format value.
  *
  * Configures the DAI hardware format and clocking.
  */
 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 {
-       if (dai->dai_ops.set_fmt)
-               return dai->dai_ops.set_fmt(dai, fmt);
+       if (dai->ops.set_fmt)
+               return dai->ops.set_fmt(dai, fmt);
        else
                return -EINVAL;
 }
@@ -1831,8 +2018,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
        unsigned int mask, int slots)
 {
-       if (dai->dai_ops.set_sysclk)
-               return dai->dai_ops.set_tdm_slot(dai, mask, slots);
+       if (dai->ops.set_sysclk)
+               return dai->ops.set_tdm_slot(dai, mask, slots);
        else
                return -EINVAL;
 }
@@ -1847,8 +2034,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot);
  */
 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate)
 {
-       if (dai->dai_ops.set_sysclk)
-               return dai->dai_ops.set_tristate(dai, tristate);
+       if (dai->ops.set_sysclk)
+               return dai->ops.set_tristate(dai, tristate);
        else
                return -EINVAL;
 }
@@ -1863,21 +2050,242 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_tristate);
  */
 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute)
 {
-       if (dai->dai_ops.digital_mute)
-               return dai->dai_ops.digital_mute(dai, mute);
+       if (dai->ops.digital_mute)
+               return dai->ops.digital_mute(dai, mute);
        else
                return -EINVAL;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dai_digital_mute);
 
-static int __devinit snd_soc_init(void)
+/**
+ * snd_soc_register_card - Register a card with the ASoC core
+ *
+ * @param card Card to register
+ *
+ * Note that currently this is an internal only function: it will be
+ * exposed to machine drivers after further backporting of ASoC v2
+ * registration APIs.
+ */
+static int snd_soc_register_card(struct snd_soc_card *card)
+{
+       if (!card->name || !card->dev)
+               return -EINVAL;
+
+       INIT_LIST_HEAD(&card->list);
+       card->instantiated = 0;
+
+       mutex_lock(&client_mutex);
+       list_add(&card->list, &card_list);
+       snd_soc_instantiate_cards();
+       mutex_unlock(&client_mutex);
+
+       dev_dbg(card->dev, "Registered card '%s'\n", card->name);
+
+       return 0;
+}
+
+/**
+ * snd_soc_unregister_card - Unregister a card with the ASoC core
+ *
+ * @param card Card to unregister
+ *
+ * Note that currently this is an internal only function: it will be
+ * exposed to machine drivers after further backporting of ASoC v2
+ * registration APIs.
+ */
+static int snd_soc_unregister_card(struct snd_soc_card *card)
+{
+       mutex_lock(&client_mutex);
+       list_del(&card->list);
+       mutex_unlock(&client_mutex);
+
+       dev_dbg(card->dev, "Unregistered card '%s'\n", card->name);
+
+       return 0;
+}
+
+/**
+ * snd_soc_register_dai - Register a DAI with the ASoC core
+ *
+ * @param dai DAI to register
+ */
+int snd_soc_register_dai(struct snd_soc_dai *dai)
+{
+       if (!dai->name)
+               return -EINVAL;
+
+       /* The device should become mandatory over time */
+       if (!dai->dev)
+               printk(KERN_WARNING "No device for DAI %s\n", dai->name);
+
+       INIT_LIST_HEAD(&dai->list);
+
+       mutex_lock(&client_mutex);
+       list_add(&dai->list, &dai_list);
+       snd_soc_instantiate_cards();
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Registered DAI '%s'\n", dai->name);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(snd_soc_register_dai);
+
+/**
+ * snd_soc_unregister_dai - Unregister a DAI from the ASoC core
+ *
+ * @param dai DAI to unregister
+ */
+void snd_soc_unregister_dai(struct snd_soc_dai *dai)
+{
+       mutex_lock(&client_mutex);
+       list_del(&dai->list);
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Unregistered DAI '%s'\n", dai->name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_unregister_dai);
+
+/**
+ * snd_soc_register_dais - Register multiple DAIs with the ASoC core
+ *
+ * @param dai Array of DAIs to register
+ * @param count Number of DAIs
+ */
+int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count)
+{
+       int i, ret;
+
+       for (i = 0; i < count; i++) {
+               ret = snd_soc_register_dai(&dai[i]);
+               if (ret != 0)
+                       goto err;
+       }
+
+       return 0;
+
+err:
+       for (i--; i >= 0; i--)
+               snd_soc_unregister_dai(&dai[i]);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(snd_soc_register_dais);
+
+/**
+ * snd_soc_unregister_dais - Unregister multiple DAIs from the ASoC core
+ *
+ * @param dai Array of DAIs to unregister
+ * @param count Number of DAIs
+ */
+void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count)
+{
+       int i;
+
+       for (i = 0; i < count; i++)
+               snd_soc_unregister_dai(&dai[i]);
+}
+EXPORT_SYMBOL_GPL(snd_soc_unregister_dais);
+
+/**
+ * snd_soc_register_platform - Register a platform with the ASoC core
+ *
+ * @param platform platform to register
+ */
+int snd_soc_register_platform(struct snd_soc_platform *platform)
+{
+       if (!platform->name)
+               return -EINVAL;
+
+       INIT_LIST_HEAD(&platform->list);
+
+       mutex_lock(&client_mutex);
+       list_add(&platform->list, &platform_list);
+       snd_soc_instantiate_cards();
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Registered platform '%s'\n", platform->name);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(snd_soc_register_platform);
+
+/**
+ * snd_soc_unregister_platform - Unregister a platform from the ASoC core
+ *
+ * @param platform platform to unregister
+ */
+void snd_soc_unregister_platform(struct snd_soc_platform *platform)
 {
-       printk(KERN_INFO "ASoC version %s\n", SND_SOC_VERSION);
+       mutex_lock(&client_mutex);
+       list_del(&platform->list);
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Unregistered platform '%s'\n", platform->name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_unregister_platform);
+
+/**
+ * snd_soc_register_codec - Register a codec with the ASoC core
+ *
+ * @param codec codec to register
+ */
+int snd_soc_register_codec(struct snd_soc_codec *codec)
+{
+       if (!codec->name)
+               return -EINVAL;
+
+       /* The device should become mandatory over time */
+       if (!codec->dev)
+               printk(KERN_WARNING "No device for codec %s\n", codec->name);
+
+       INIT_LIST_HEAD(&codec->list);
+
+       mutex_lock(&client_mutex);
+       list_add(&codec->list, &codec_list);
+       snd_soc_instantiate_cards();
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Registered codec '%s'\n", codec->name);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(snd_soc_register_codec);
+
+/**
+ * snd_soc_unregister_codec - Unregister a codec from the ASoC core
+ *
+ * @param codec codec to unregister
+ */
+void snd_soc_unregister_codec(struct snd_soc_codec *codec)
+{
+       mutex_lock(&client_mutex);
+       list_del(&codec->list);
+       mutex_unlock(&client_mutex);
+
+       pr_debug("Unregistered codec '%s'\n", codec->name);
+}
+EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
+
+static int __init snd_soc_init(void)
+{
+#ifdef CONFIG_DEBUG_FS
+       debugfs_root = debugfs_create_dir("asoc", NULL);
+       if (IS_ERR(debugfs_root) || !debugfs_root) {
+               printk(KERN_WARNING
+                      "ASoC: Failed to create debugfs directory\n");
+               debugfs_root = NULL;
+       }
+#endif
+
        return platform_driver_register(&soc_driver);
 }
 
-static void snd_soc_exit(void)
+static void __exit snd_soc_exit(void)
 {
+#ifdef CONFIG_DEBUG_FS
+       debugfs_remove_recursive(debugfs_root);
+#endif
        platform_driver_unregister(&soc_driver);
 }
 
index 7351db9606e48f3d11870671a4b9e71c37081e50..8863eddbac029975f9f7b4fefeac73b73bbcb6cf 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/bitops.h>
 #include <linux/platform_device.h>
 #include <linux/jiffies.h>
-#include <linux/debugfs.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -67,17 +66,13 @@ static int dapm_status = 1;
 module_param(dapm_status, int, 0);
 MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");
 
-static struct dentry *asoc_debugfs;
-
-static u32 pop_time;
-
-static void pop_wait(void)
+static void pop_wait(u32 pop_time)
 {
        if (pop_time)
                schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
 }
 
-static void pop_dbg(const char *fmt, ...)
+static void pop_dbg(u32 pop_time, const char *fmt, ...)
 {
        va_list args;
 
@@ -85,7 +80,7 @@ static void pop_dbg(const char *fmt, ...)
 
        if (pop_time) {
                vprintk(fmt, args);
-               pop_wait();
+               pop_wait(pop_time);
        }
 
        va_end(args);
@@ -230,10 +225,11 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
 
        change = old != new;
        if (change) {
-               pop_dbg("pop test %s : %s in %d ms\n", widget->name,
-                       widget->power ? "on" : "off", pop_time);
+               pop_dbg(codec->pop_time, "pop test %s : %s in %d ms\n",
+                       widget->name, widget->power ? "on" : "off",
+                       codec->pop_time);
                snd_soc_write(codec, widget->reg, new);
-               pop_wait();
+               pop_wait(codec->pop_time);
        }
        pr_debug("reg %x old %x new %x change %d\n", widget->reg,
                 old, new, change);
@@ -293,7 +289,7 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
        struct snd_soc_dapm_widget *w)
 {
        int i, ret = 0;
-       char name[32];
+       size_t name_len;
        struct snd_soc_dapm_path *path;
 
        /* add kcontrol */
@@ -307,11 +303,16 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
                                continue;
 
                        /* add dapm control with long name */
-                       snprintf(name, 32, "%s %s", w->name, w->kcontrols[i].name);
-                       path->long_name = kstrdup (name, GFP_KERNEL);
+                       name_len = 2 + strlen(w->name)
+                               + strlen(w->kcontrols[i].name);
+                       path->long_name = kmalloc(name_len, GFP_KERNEL);
                        if (path->long_name == NULL)
                                return -ENOMEM;
 
+                       snprintf(path->long_name, name_len, "%s %s",
+                                w->name, w->kcontrols[i].name);
+                       path->long_name[name_len - 1] = '\0';
+
                        path->kcontrol = snd_soc_cnew(&w->kcontrols[i], w,
                                path->long_name);
                        ret = snd_ctl_add(codec->card, path->kcontrol);
@@ -821,23 +822,9 @@ static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);
 
 int snd_soc_dapm_sys_add(struct device *dev)
 {
-       int ret = 0;
-
        if (!dapm_status)
                return 0;
-
-       ret = device_create_file(dev, &dev_attr_dapm_widget);
-       if (ret != 0)
-               return ret;
-
-       asoc_debugfs = debugfs_create_dir("asoc", NULL);
-       if (!IS_ERR(asoc_debugfs) && asoc_debugfs)
-               debugfs_create_u32("dapm_pop_time", 0744, asoc_debugfs,
-                                  &pop_time);
-       else
-               asoc_debugfs = NULL;
-
-       return 0;
+       return device_create_file(dev, &dev_attr_dapm_widget);
 }
 
 static void snd_soc_dapm_sys_remove(struct device *dev)
@@ -845,9 +832,6 @@ static void snd_soc_dapm_sys_remove(struct device *dev)
        if (dapm_status) {
                device_remove_file(dev, &dev_attr_dapm_widget);
        }
-
-       if (asoc_debugfs)
-               debugfs_remove_recursive(asoc_debugfs);
 }
 
 /* free all dapm widgets and resources */
@@ -1006,28 +990,6 @@ err:
        return ret;
 }
 
-/**
- * snd_soc_dapm_connect_input - connect dapm widgets
- * @codec: audio codec
- * @sink: name of target widget
- * @control: mixer control name
- * @source: name of source name
- *
- * Connects 2 dapm widgets together via a named audio path. The sink is
- * the widget receiving the audio signal, whilst the source is the sender
- * of the audio signal.
- *
- * This function has been deprecated in favour of snd_soc_dapm_add_routes().
- *
- * Returns 0 for success else error.
- */
-int snd_soc_dapm_connect_input(struct snd_soc_codec *codec, const char *sink,
-       const char *control, const char *source)
-{
-       return snd_soc_dapm_add_route(codec, sink, control, source);
-}
-EXPORT_SYMBOL_GPL(snd_soc_dapm_connect_input);
-
 /**
  * snd_soc_dapm_add_routes - Add routes between DAPM widgets
  * @codec: codec
@@ -1358,8 +1320,12 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
 
        for (i = 0; i < num; i++) {
                ret = snd_soc_dapm_new_control(codec, widget);
-               if (ret < 0)
+               if (ret < 0) {
+                       printk(KERN_ERR
+                              "ASoC: Failed to create DAPM control %s: %d\n",
+                              widget->name, ret);
                        return ret;
+               }
                widget++;
        }
        return 0;
@@ -1440,11 +1406,11 @@ int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
                                enum snd_soc_bias_level level)
 {
        struct snd_soc_codec *codec = socdev->codec;
-       struct snd_soc_machine *machine = socdev->machine;
+       struct snd_soc_card *card = socdev->card;
        int ret = 0;
 
-       if (machine->set_bias_level)
-               ret = machine->set_bias_level(machine, level);
+       if (card->set_bias_level)
+               ret = card->set_bias_level(card, level);
        if (ret == 0 && codec->set_bias_level)
                ret = codec->set_bias_level(codec, level);
 
index 798ca124da58756e0aedfb3ab15ce2f2750abd6c..ccd763dd7167e2ce37b469098807634a1500aab9 100644 (file)
@@ -247,69 +247,56 @@ static struct caiaq_controller a8dj_controller[] = {
        { "Software lock",                      40              }
 };
 
-int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev)
+static int __devinit add_controls(struct caiaq_controller *c, int num,
+                                 struct snd_usb_caiaqdev *dev)
 {
-       int i;
+       int i, ret;
        struct snd_kcontrol *kc;
 
+       for (i = 0; i < num; i++, c++) {
+               kcontrol_template.name = c->name;
+               kcontrol_template.private_value = c->index;
+               kc = snd_ctl_new1(&kcontrol_template, dev);
+               ret = snd_ctl_add(dev->chip.card, kc);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev)
+{
+       int ret = 0;
+
        switch (dev->chip.usb_id) {
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
-               for (i = 0; i < ARRAY_SIZE(ak1_controller); i++) {
-                       struct caiaq_controller *c = ak1_controller + i;
-                       kcontrol_template.name = c->name;
-                       kcontrol_template.private_value = c->index;
-                       kc = snd_ctl_new1(&kcontrol_template, dev);
-                       snd_ctl_add(dev->chip.card, kc);
-               }
-
+               ret = add_controls(ak1_controller,
+                       ARRAY_SIZE(ak1_controller), dev);
                break;
 
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2):
-               for (i = 0; i < ARRAY_SIZE(rk2_controller); i++) {
-                       struct caiaq_controller *c = rk2_controller + i;
-                       kcontrol_template.name = c->name;
-                       kcontrol_template.private_value = c->index;
-                       kc = snd_ctl_new1(&kcontrol_template, dev);
-                       snd_ctl_add(dev->chip.card, kc);
-               }
-
+               ret = add_controls(rk2_controller,
+                       ARRAY_SIZE(rk2_controller), dev);
                break;
 
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
-               for (i = 0; i < ARRAY_SIZE(rk3_controller); i++) {
-                       struct caiaq_controller *c = rk3_controller + i;
-                       kcontrol_template.name = c->name;
-                       kcontrol_template.private_value = c->index;
-                       kc = snd_ctl_new1(&kcontrol_template, dev);
-                       snd_ctl_add(dev->chip.card, kc);
-               }
-
+               ret = add_controls(rk3_controller,
+                       ARRAY_SIZE(rk3_controller), dev);
                break;
 
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
-               for (i = 0; i < ARRAY_SIZE(kore_controller); i++) {
-                       struct caiaq_controller *c = kore_controller + i;
-                       kcontrol_template.name = c->name;
-                       kcontrol_template.private_value = c->index;
-                       kc = snd_ctl_new1(&kcontrol_template, dev);
-                       snd_ctl_add(dev->chip.card, kc);
-               }
-
+               ret = add_controls(kore_controller,
+                       ARRAY_SIZE(kore_controller), dev);
                break;
 
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
-               for (i = 0; i < ARRAY_SIZE(a8dj_controller); i++) {
-                       struct caiaq_controller *c = a8dj_controller + i;
-                       kcontrol_template.name = c->name;
-                       kcontrol_template.private_value = c->index;
-                       kc = snd_ctl_new1(&kcontrol_template, dev);
-                       snd_ctl_add(dev->chip.card, kc);
-               }
-
+               ret = add_controls(a8dj_controller,
+                       ARRAY_SIZE(a8dj_controller), dev);
                break;
        }
 
-       return 0;
+       return ret;
 }
 
index 83175083e50f8c60852cc0250fd26ace2038afba..b143ef7152f7b7b734ff08c58ffdb014b518b6e0 100644 (file)
@@ -42,7 +42,7 @@
 #endif
 
 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
-MODULE_DESCRIPTION("caiaq USB audio, version 1.3.8");
+MODULE_DESCRIPTION("caiaq USB audio, version 1.3.9");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
                         "{Native Instruments, RigKontrol3},"
index 5962e4b8442394fbe4812c2bfd21a013cf04f29c..6d9f9b135c62258bf0727166f32cfccbab31e744 100644 (file)
@@ -880,7 +880,7 @@ static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream,
                                snd_rawmidi_transmit_ack(substream, 1);
                        return;
                }
-               tasklet_hi_schedule(&port->ep->tasklet);
+               tasklet_schedule(&port->ep->tasklet);
        }
 }
 
index ff23cc1ce3b9f92e9f7e3739c48f8e509c6fea37..70b96355ca4cfba36b726c0fd11d0c62bbeaa359 100644 (file)
@@ -276,7 +276,8 @@ static void subs_set_complete(struct urb **urbs, void (*complete)(struct urb *))
        }
 }
 
-int usb_stream_prepare_playback(struct usb_stream_kernel *sk, struct urb *inurb)
+static int usb_stream_prepare_playback(struct usb_stream_kernel *sk,
+               struct urb *inurb)
 {
        struct usb_stream *s = sk->s;
        struct urb *io;