summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2002-12-20 09:47:54 +1100
committerPaul Mackerras <paulus@samba.org>2002-12-20 09:47:54 +1100
commitbba32258181346cb476419033bb0243aa20360d2 (patch)
tree45dbe6adaa7b9af62681504daa658f6969fed33b
parent8ca34b9e54cb7a20a4d2f3bbd7e160f071f30230 (diff)
parent75fb58eebfbaca27864b925e49370ccbf1bc33ba (diff)
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt1188
-rw-r--r--Documentation/sound/alsa/ControlNames.txt82
-rw-r--r--arch/alpha/kernel/traps.c2
-rw-r--r--arch/alpha/lib/clear_user.S3
-rw-r--r--arch/alpha/lib/copy_user.S17
-rw-r--r--arch/alpha/lib/ev6-clear_user.S5
-rw-r--r--arch/alpha/lib/ev6-copy_user.S9
-rw-r--r--arch/alpha/lib/ev6-strncpy_from_user.S5
-rw-r--r--arch/alpha/lib/ev67-strlen_user.S6
-rw-r--r--arch/alpha/lib/strlen_user.S5
-rw-r--r--arch/alpha/lib/strncpy_from_user.S6
-rw-r--r--arch/alpha/mm/extable.c70
-rw-r--r--arch/alpha/mm/fault.c2
-rw-r--r--arch/i386/Kconfig1
-rw-r--r--arch/i386/kernel/entry.S15
-rw-r--r--arch/i386/kernel/process.c3
-rw-r--r--arch/i386/kernel/sysenter.c61
-rw-r--r--arch/i386/kernel/vm86.c30
-rw-r--r--drivers/acpi/ac.c4
-rw-r--r--drivers/acpi/battery.c4
-rw-r--r--drivers/acpi/button.c4
-rw-r--r--drivers/acpi/dispatcher/dsfield.c87
-rw-r--r--drivers/acpi/dispatcher/dsinit.c23
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c49
-rw-r--r--drivers/acpi/dispatcher/dsmthdat.c97
-rw-r--r--drivers/acpi/dispatcher/dsobject.c57
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c147
-rw-r--r--drivers/acpi/dispatcher/dsutils.c51
-rw-r--r--drivers/acpi/dispatcher/dswexec.c39
-rw-r--r--drivers/acpi/dispatcher/dswload.c49
-rw-r--r--drivers/acpi/dispatcher/dswscope.c17
-rw-r--r--drivers/acpi/dispatcher/dswstate.c153
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/events/evevent.c30
-rw-r--r--drivers/acpi/events/evgpe.c97
-rw-r--r--drivers/acpi/events/evmisc.c53
-rw-r--r--drivers/acpi/events/evregion.c53
-rw-r--r--drivers/acpi/events/evrgnini.c85
-rw-r--r--drivers/acpi/events/evsci.c17
-rw-r--r--drivers/acpi/events/evxface.c51
-rw-r--r--drivers/acpi/events/evxfevnt.c25
-rw-r--r--drivers/acpi/events/evxfregn.c23
-rw-r--r--drivers/acpi/executer/exconfig.c61
-rw-r--r--drivers/acpi/executer/exconvrt.c82
-rw-r--r--drivers/acpi/executer/excreate.c75
-rw-r--r--drivers/acpi/executer/exdump.c127
-rw-r--r--drivers/acpi/executer/exfield.c31
-rw-r--r--drivers/acpi/executer/exfldio.c109
-rw-r--r--drivers/acpi/executer/exmisc.c55
-rw-r--r--drivers/acpi/executer/exmutex.c45
-rw-r--r--drivers/acpi/executer/exnames.c49
-rw-r--r--drivers/acpi/executer/exoparg1.c93
-rw-r--r--drivers/acpi/executer/exoparg2.c59
-rw-r--r--drivers/acpi/executer/exoparg3.c37
-rw-r--r--drivers/acpi/executer/exoparg6.c23
-rw-r--r--drivers/acpi/executer/exprep.c77
-rw-r--r--drivers/acpi/executer/exregion.c109
-rw-r--r--drivers/acpi/executer/exresnte.c15
-rw-r--r--drivers/acpi/executer/exresolv.c51
-rw-r--r--drivers/acpi/executer/exresop.c33
-rw-r--r--drivers/acpi/executer/exstore.c47
-rw-r--r--drivers/acpi/executer/exstoren.c37
-rw-r--r--drivers/acpi/executer/exstorob.c25
-rw-r--r--drivers/acpi/executer/exsystem.c47
-rw-r--r--drivers/acpi/executer/exutils.c45
-rw-r--r--drivers/acpi/fan.c4
-rw-r--r--drivers/acpi/hardware/hwacpi.c13
-rw-r--r--drivers/acpi/hardware/hwgpe.c41
-rw-r--r--drivers/acpi/hardware/hwregs.c153
-rw-r--r--drivers/acpi/hardware/hwsleep.c49
-rw-r--r--drivers/acpi/hardware/hwtimer.c25
-rw-r--r--drivers/acpi/include/acconfig.h5
-rw-r--r--drivers/acpi/include/acdebug.h1
-rw-r--r--drivers/acpi/include/acdispat.h13
-rw-r--r--drivers/acpi/include/acevents.h3
-rw-r--r--drivers/acpi/include/acexcep.h1
-rw-r--r--drivers/acpi/include/acglobal.h31
-rw-r--r--drivers/acpi/include/achware.h3
-rw-r--r--drivers/acpi/include/acinterp.h27
-rw-r--r--drivers/acpi/include/aclocal.h67
-rw-r--r--drivers/acpi/include/acmacros.h69
-rw-r--r--drivers/acpi/include/acnamesp.h17
-rw-r--r--drivers/acpi/include/acobject.h153
-rw-r--r--drivers/acpi/include/acoutput.h13
-rw-r--r--drivers/acpi/include/acparser.h1
-rw-r--r--drivers/acpi/include/acpi.h1
-rw-r--r--drivers/acpi/include/acpiosxf.h26
-rw-r--r--drivers/acpi/include/acpixf.h18
-rw-r--r--drivers/acpi/include/acresrc.h101
-rw-r--r--drivers/acpi/include/acstruct.h27
-rw-r--r--drivers/acpi/include/actables.h21
-rw-r--r--drivers/acpi/include/actbl.h3
-rw-r--r--drivers/acpi/include/actbl1.h13
-rw-r--r--drivers/acpi/include/actbl2.h35
-rw-r--r--drivers/acpi/include/actbl71.h15
-rw-r--r--drivers/acpi/include/actypes.h202
-rw-r--r--drivers/acpi/include/acutils.h79
-rw-r--r--drivers/acpi/include/amlcode.h31
-rw-r--r--drivers/acpi/include/amlresrc.h95
-rw-r--r--drivers/acpi/include/platform/acenv.h33
-rw-r--r--drivers/acpi/include/platform/acgcc.h1
-rw-r--r--drivers/acpi/include/platform/aclinux.h1
-rw-r--r--drivers/acpi/namespace/nsaccess.c39
-rw-r--r--drivers/acpi/namespace/nsalloc.c43
-rw-r--r--drivers/acpi/namespace/nsdump.c41
-rw-r--r--drivers/acpi/namespace/nsdumpdv.c13
-rw-r--r--drivers/acpi/namespace/nseval.c49
-rw-r--r--drivers/acpi/namespace/nsinit.c27
-rw-r--r--drivers/acpi/namespace/nsload.c28
-rw-r--r--drivers/acpi/namespace/nsnames.c37
-rw-r--r--drivers/acpi/namespace/nsobject.c37
-rw-r--r--drivers/acpi/namespace/nsparse.c17
-rw-r--r--drivers/acpi/namespace/nssearch.c37
-rw-r--r--drivers/acpi/namespace/nsutils.c127
-rw-r--r--drivers/acpi/namespace/nswalk.c31
-rw-r--r--drivers/acpi/namespace/nsxfeval.c93
-rw-r--r--drivers/acpi/namespace/nsxfname.c15
-rw-r--r--drivers/acpi/namespace/nsxfobj.c15
-rw-r--r--drivers/acpi/osl.c26
-rw-r--r--drivers/acpi/parser/psargs.c79
-rw-r--r--drivers/acpi/parser/psopcode.c11
-rw-r--r--drivers/acpi/parser/psparse.c73
-rw-r--r--drivers/acpi/parser/psscope.c41
-rw-r--r--drivers/acpi/parser/pstree.c11
-rw-r--r--drivers/acpi/parser/psutils.c27
-rw-r--r--drivers/acpi/parser/pswalk.c23
-rw-r--r--drivers/acpi/parser/psxface.c13
-rw-r--r--drivers/acpi/power.c4
-rw-r--r--drivers/acpi/processor.c16
-rw-r--r--drivers/acpi/resources/rsaddr.c165
-rw-r--r--drivers/acpi/resources/rscalc.c65
-rw-r--r--drivers/acpi/resources/rscreate.c83
-rw-r--r--drivers/acpi/resources/rsdump.c41
-rw-r--r--drivers/acpi/resources/rsio.c119
-rw-r--r--drivers/acpi/resources/rsirq.c91
-rw-r--r--drivers/acpi/resources/rslist.c43
-rw-r--r--drivers/acpi/resources/rsmemory.c133
-rw-r--r--drivers/acpi/resources/rsmisc.c155
-rw-r--r--drivers/acpi/resources/rsutils.c35
-rw-r--r--drivers/acpi/resources/rsxface.c51
-rw-r--r--drivers/acpi/sleep.c4
-rw-r--r--drivers/acpi/tables/tbconvrt.c101
-rw-r--r--drivers/acpi/tables/tbget.c61
-rw-r--r--drivers/acpi/tables/tbgetall.c27
-rw-r--r--drivers/acpi/tables/tbinstal.c55
-rw-r--r--drivers/acpi/tables/tbrsdt.c35
-rw-r--r--drivers/acpi/tables/tbutils.c27
-rw-r--r--drivers/acpi/tables/tbxface.c71
-rw-r--r--drivers/acpi/tables/tbxfroot.c57
-rw-r--r--drivers/acpi/thermal.c4
-rw-r--r--drivers/acpi/utilities/utalloc.c155
-rw-r--r--drivers/acpi/utilities/utcopy.c109
-rw-r--r--drivers/acpi/utilities/utdebug.c155
-rw-r--r--drivers/acpi/utilities/utdelete.c29
-rw-r--r--drivers/acpi/utilities/uteval.c43
-rw-r--r--drivers/acpi/utilities/utglobal.c91
-rw-r--r--drivers/acpi/utilities/utinit.c41
-rw-r--r--drivers/acpi/utilities/utmath.c39
-rw-r--r--drivers/acpi/utilities/utmisc.c151
-rw-r--r--drivers/acpi/utilities/utobject.c85
-rw-r--r--drivers/acpi/utilities/utxface.c47
-rw-r--r--drivers/char/drm/drm.h21
-rw-r--r--drivers/char/drm/drmP.h15
-rw-r--r--drivers/char/drm/drm_agpsupport.h71
-rw-r--r--drivers/char/drm/drm_dma.h76
-rw-r--r--drivers/char/drm/drm_vm.h4
-rw-r--r--drivers/char/drm/mga_irq.c3
-rw-r--r--drivers/char/drm/r128.h2
-rw-r--r--drivers/char/drm/r128_irq.c3
-rw-r--r--drivers/char/drm/radeon_cp.c2
-rw-r--r--drivers/char/drm/radeon_irq.c7
-rw-r--r--drivers/char/drm/radeon_state.c201
-rw-r--r--drivers/net/hp100.c99
-rw-r--r--drivers/net/hp100.h5
-rw-r--r--drivers/scsi/eata_pio_proc.c2
-rw-r--r--drivers/scsi/hosts.c7
-rw-r--r--drivers/scsi/osst.c185
-rw-r--r--drivers/scsi/scsi.c7
-rw-r--r--drivers/scsi/scsi.h8
-rw-r--r--drivers/scsi/sd.c104
-rw-r--r--drivers/usb/core/hcd.c5
-rw-r--r--drivers/usb/core/hub.c61
-rw-r--r--drivers/usb/core/inode.c5
-rw-r--r--drivers/usb/host/ehci-dbg.c37
-rw-r--r--drivers/usb/host/ehci-hcd.c159
-rw-r--r--drivers/usb/host/ehci-hub.c2
-rw-r--r--drivers/usb/host/ehci-mem.c5
-rw-r--r--drivers/usb/host/ehci-q.c189
-rw-r--r--drivers/usb/host/ehci-sched.c26
-rw-r--r--drivers/usb/host/ehci.h3
-rw-r--r--drivers/usb/media/ibmcam.c14
-rw-r--r--drivers/usb/media/konicawc.c2
-rw-r--r--drivers/usb/media/pwc-ctrl.c12
-rw-r--r--drivers/usb/media/pwc-if.c9
-rw-r--r--drivers/usb/media/pwc-ioctl.h13
-rw-r--r--drivers/usb/media/pwc-uncompress.h4
-rw-r--r--drivers/usb/media/pwc.h4
-rw-r--r--drivers/usb/media/ultracam.c2
-rw-r--r--drivers/usb/media/usbvideo.c32
-rw-r--r--drivers/usb/media/usbvideo.h36
-rw-r--r--drivers/usb/misc/speedtouch.c45
-rw-r--r--drivers/usb/misc/usblcd.c2
-rw-r--r--drivers/usb/net/usbnet.c168
-rw-r--r--drivers/usb/serial/belkin_sa.c1
-rw-r--r--drivers/usb/serial/bus.c5
-rw-r--r--drivers/usb/serial/cyberjack.c1
-rw-r--r--drivers/usb/serial/generic.c1
-rw-r--r--drivers/usb/serial/io_tables.h4
-rw-r--r--drivers/usb/serial/io_ti.c2
-rw-r--r--drivers/usb/serial/keyspan.h4
-rw-r--r--drivers/usb/serial/keyspan_pda.c3
-rw-r--r--drivers/usb/serial/kl5kusb105.c1
-rw-r--r--drivers/usb/serial/mct_u232.c1
-rw-r--r--drivers/usb/serial/omninet.c1
-rw-r--r--drivers/usb/serial/usb-serial.h4
-rw-r--r--drivers/usb/serial/visor.c2
-rw-r--r--drivers/usb/serial/whiteheat.c4
-rw-r--r--drivers/usb/storage/transport.c46
-rw-r--r--drivers/usb/storage/usb.c20
-rw-r--r--fs/intermezzo/Makefile2
-rw-r--r--include/asm-alpha/dma.h4
-rw-r--r--include/asm-alpha/uaccess.h48
-rw-r--r--include/asm-i386/elf.h11
-rw-r--r--include/asm-i386/fixmap.h2
-rw-r--r--include/asm-i386/irq.h1
-rw-r--r--include/asm-i386/segment.h4
-rw-r--r--include/scsi/scsi.h4
-rw-r--r--include/sound/ac97_codec.h4
-rw-r--r--include/sound/control.h2
-rw-r--r--include/sound/core.h39
-rw-r--r--include/sound/cs46xx.h2
-rw-r--r--include/sound/cs46xx_dsp_spos.h6
-rw-r--r--include/sound/initval.h13
-rw-r--r--include/sound/mixer_oss.h1
-rw-r--r--include/sound/mpu401.h6
-rw-r--r--include/sound/opl3.h1
-rw-r--r--include/sound/pcm.h5
-rw-r--r--include/sound/pcm_oss.h1
-rw-r--r--include/sound/sb.h9
-rw-r--r--include/sound/trident.h18
-rw-r--r--include/sound/version.h4
-rw-r--r--kernel/params.c2
-rw-r--r--sound/arm/sa11xx-uda1341.c2
-rw-r--r--sound/core/control.c170
-rw-r--r--sound/core/device.c40
-rw-r--r--sound/core/info.c8
-rw-r--r--sound/core/init.c305
-rw-r--r--sound/core/ioctl32/ioctl32.c1
-rw-r--r--sound/core/ioctl32/rawmidi32.c1
-rw-r--r--sound/core/ioctl32/seq32.c1
-rw-r--r--sound/core/ioctl32/timer32.c1
-rw-r--r--sound/core/oss/mixer_oss.c74
-rw-r--r--sound/core/oss/pcm_oss.c57
-rw-r--r--sound/core/pcm.c50
-rw-r--r--sound/core/pcm_lib.c12
-rw-r--r--sound/core/pcm_native.c8
-rw-r--r--sound/core/pcm_sgbuf.c52
-rw-r--r--sound/core/rawmidi.c46
-rw-r--r--sound/core/seq/Makefile93
-rw-r--r--sound/core/seq/instr/Makefile1
-rw-r--r--sound/core/seq/seq.c2
-rw-r--r--sound/core/seq/seq_device.c20
-rw-r--r--sound/core/seq/seq_lock.c2
-rw-r--r--sound/core/seq/seq_lock.h2
-rw-r--r--sound/core/sound.c10
-rw-r--r--sound/drivers/mpu401/mpu401.c14
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c7
-rw-r--r--sound/drivers/mtpav.c78
-rw-r--r--sound/drivers/opl3/Makefile77
-rw-r--r--sound/drivers/opl3/opl3_lib.c21
-rw-r--r--sound/drivers/opl3/opl3_seq.c1
-rw-r--r--sound/drivers/virmidi.c3
-rw-r--r--sound/isa/cs423x/cs4231_lib.c70
-rw-r--r--sound/isa/cs423x/cs4236.c8
-rw-r--r--sound/isa/es18xx.c146
-rw-r--r--sound/isa/sb/sb16.c10
-rw-r--r--sound/isa/sb/sb16_main.c6
-rw-r--r--sound/isa/sb/sb_mixer.c328
-rw-r--r--sound/oss/Kconfig4
-rw-r--r--sound/pci/Kconfig4
-rw-r--r--sound/pci/ac97/ac97_codec.c236
-rw-r--r--sound/pci/ac97/ac97_id.h3
-rw-r--r--sound/pci/ac97/ac97_patch.c14
-rw-r--r--sound/pci/ac97/ac97_patch.h1
-rw-r--r--sound/pci/ali5451/ali5451.c141
-rw-r--r--sound/pci/als4000.c55
-rw-r--r--sound/pci/cmipci.c453
-rw-r--r--sound/pci/cs4281.c6
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c288
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.h7
-rw-r--r--sound/pci/cs46xx/dsp_spos.c88
-rw-r--r--sound/pci/cs46xx/dsp_spos.h24
-rw-r--r--sound/pci/cs46xx/dsp_spos_scb_lib.c254
-rw-r--r--sound/pci/emu10k1/emu10k1.c2
-rw-r--r--sound/pci/ens1370.c94
-rw-r--r--sound/pci/es1938.c6
-rw-r--r--sound/pci/es1968.c67
-rw-r--r--sound/pci/fm801.c62
-rw-r--r--sound/pci/ice1712/Makefile2
-rw-r--r--sound/pci/ice1712/ak4524.c52
-rw-r--r--sound/pci/ice1712/amp.c55
-rw-r--r--sound/pci/ice1712/amp.h34
-rw-r--r--sound/pci/ice1712/delta.c32
-rw-r--r--sound/pci/ice1712/envy24ht.h203
-rw-r--r--sound/pci/ice1712/ews.c17
-rw-r--r--sound/pci/ice1712/hoontech.c5
-rw-r--r--sound/pci/ice1712/hoontech.h8
-rw-r--r--sound/pci/ice1712/ice1712.c982
-rw-r--r--sound/pci/ice1712/ice1712.h6
-rw-r--r--sound/pci/intel8x0.c6
-rw-r--r--sound/pci/korg1212/korg1212.c4
-rw-r--r--sound/pci/rme32.c180
-rw-r--r--sound/pci/rme96.c6
-rw-r--r--sound/pci/rme9652/hammerfall_mem.c2
-rw-r--r--sound/pci/rme9652/hdsp.c62
-rw-r--r--sound/pci/rme9652/rme9652.c8
-rw-r--r--sound/pci/trident/trident.c10
-rw-r--r--sound/pci/trident/trident_main.c676
-rw-r--r--sound/pci/via82xx.c3
-rw-r--r--sound/synth/Makefile3
-rw-r--r--sound/usb/Kconfig2
-rw-r--r--sound/usb/usbaudio.c54
-rw-r--r--sound/usb/usbaudio.h8
-rw-r--r--sound/usb/usbmidi.c115
-rw-r--r--sound/usb/usbmixer.c113
-rw-r--r--sound/usb/usbmixer_maps.c8
-rw-r--r--sound/usb/usbquirks.h116
327 files changed, 10647 insertions, 6398 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
new file mode 100644
index 000000000000..9acb5a3ef5d5
--- /dev/null
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -0,0 +1,1188 @@
+
+ Advanced Linux Sound Architecture - Driver
+ ==========================================
+ Configuration guide
+
+
+Kernel Configuration
+====================
+
+To enable the ALSA support, at least you need to build the kernel with
+the primary sound card support (CONFIG_SOUND). Since ALSA can emulate
+the OSS, you don't have to choose any of the OSS/Free modules. Please
+enable "OSS API emulation" (CONFIG_SND_OSSEMUL) and both OSS mixer and
+PCM supports if you want to run the OSS application with the ALSA.
+
+When you want to support the WaveTable functionality on some cards
+such like SB Live!, you need to enable "Sequencer support"
+(CONFIG_SND_SEQUENCER).
+
+For getting more verbose debug messages, turn on "Verbose printk" and
+"Debug" options. For checking the memory leaks, you can turn on
+"Debug memory" option, too. "Debug detection" will put more
+additional checks for the detection of cards.
+
+Please note that all the ALSA ISA drivers support Linux isapnp API (if
+the card supports). You don't need to configure the PnP via
+isapnptools.
+
+
+Module parameters
+=================
+
+ A user can modify or set parameters at the load time of the module. If
+ the module supports more cards and you have got more than one card
+ of the same type, you may simply specify more values for the parameter,
+ delimited by commas.
+
+ Note that module option names were changed in 0.9.0rc4. The 'snd_'
+ prefix was removed.
+
+ Module snd
+ ----------
+
+ The module snd is the ALSA core module, which is used by all ALSA
+ card drivers. This takes the global options for creating devices,
+ etc.
+
+ major - major # for sound driver
+ - default is 116
+ cards_limit
+ - specifies card limit # (1-8)
+ - good for kmod support if you do not want to search
+ for soundcards which are not installed in your system
+ device_mode
+ - specifies permission mask for dynamic sound device filesystem
+ - default value = 0666
+ - for example 'device_mode=0660'
+ device_gid
+ - specifies GID number for dynamic sound device filesystem
+ - default value = 0 (root)
+ device_uid
+ - specifies UID number for dynamic sound device filesystem
+ - default value = 0 (root)
+
+
+ Module snd-pcm-oss
+ ------------------
+
+ The PCM OSS emulation module.
+ This module takes the options to change the mapping of devices.
+
+ dsp_map - PCM device number maps assigned to the 1st OSS device.
+ (default: 0)
+ adsp_map - PCM device number maps assigned to the 2st OSS device.
+ (default: 1)
+ nonblock_open - Don't block opening busy PCM devices.
+
+ For example, when dsp_map=2, /dev/dsp will be mapped to PCM #2 of
+ the card #0. Similarly, when adsp_map=0, /dev/adsp will be mapped
+ to PCM #0 of the card #0.
+ For changing the second or later card, specify the option with
+ commas, such like "dsp_map=0,1".
+
+ nonblock_open option is used to change the behavior of the PCM
+ regarding opening the device. When this option is non-zero,
+ opening a busy OSS PCM device won't be blocked but return
+ immediately with EAGAIN (just like O_NONBLOCK flag).
+
+ Module snd-rawmidi
+ ------------------
+
+ This module takes the options to change the mapping of OSS
+ devices like snd-pcm-oss module.
+
+ midi_map - MIDI device number maps assigned to the 1st OSS device.
+ (default: 0)
+ amidi_map - MIDI device number maps assigned to the 2st OSS device.
+ (default: 1)
+
+ Global parameters for top soundcard modules
+ -------------------------------------------
+
+ Each of top-level soundcard module takes some general options,
+
+ index - 0-7 - index (slot #) for soundcard
+ - if not set or -1, first free index (slot #) is assigned
+ id - user identification for card (up to 15 chars)
+ - default expression is 'card<index>' (for example card1)
+ - value is used for /proc/asound filesystem
+ - this value can be used by applications for identification
+ of card if user does not want identify card with index number
+ enable - enable card (only first card is enabled by default)
+
+ Module snd-ad1816a
+ ------------------
+
+ Module for soundcards based on Analog Devices AD1816A/AD1815 ISA chips.
+
+ port - port # for AD1816A chip (PnP setup)
+ mpu_port - port # for MPU-401 UART (PnP setup)
+ fm_port - port # for OPL3 (PnP setup)
+ irq - IRQ # for AD1816A chip (PnP setup)
+ mpu_irq - IRQ # for MPU-401 UART (PnP setup)
+ dma1 - first DMA # for AD1816A chip (PnP setup)
+ dma2 - second DMA # for AD1816A chip (PnP setup)
+
+ Module supports up to 8 cards, autoprobe and PnP.
+
+ Module snd-ad1848
+ -----------------
+
+ Module for soundcards based on AD1848/AD1847/CS4248 ISA chips.
+
+ port - port # for AD1848 chip
+ irq - IRQ # for AD1848 chip
+ dma1 - DMA # for AD1848 chip (0,1,3)
+
+ Module supports up to 8 cards. This module does not support autoprobe
+ thus main port must be specified!!! Other ports are optional.
+
+ Module snd-ali5451
+ ------------------
+
+ Module for ALi M5451 PCI chip.
+
+ pcm_channels - Number of hardware channels assigned for PCM
+
+ Module supports autoprobe and multiple chips (max 8).
+
+ The power-management is supported.
+
+ Module snd-als100
+ -----------------
+
+ Module for soundcards based on Avance Logic ALS100/ALS120 ISA chips.
+
+ port - port # for ALS100 (SB16) chip (PnP setup)
+ irq - IRQ # for ALS100 (SB16) chip (PnP setup)
+ dma8 - 8-bit DMA # for ALS100 (SB16) chip (PnP setup)
+ dma16 - 16-bit DMA # for ALS100 (SB16) chip (PnP setup)
+ mpu_port - port # for MPU-401 UART (PnP setup)
+ mpu_irq - IRQ # for MPU-401 (PnP setup)
+ fm_port - port # for OPL3 FM (PnP setup)
+
+ Module supports up to 8 cards, autoprobe and PnP.
+
+ Module snd-als4000
+ ------------------
+
+ Module for soundcards based on Avance Logic ALS4000 PCI chip.
+
+ joystick_port - port # for legacy joystick support.
+ default: 0x200 for the 1st card.
+ 0 = disabled
+
+ Module supports up to 8 cards, autoprobe and PnP.
+
+ Module snd-azt2320
+ ------------------
+
+ Module for soundcards based on Aztech System AZT2320 ISA chip (PnP only).
+
+ port - port # for AZT2320 chip (PnP setup)
+ wss_port - port # for WSS (PnP setup)
+ mpu_port - port # for MPU-401 UART (PnP setup)
+ fm_port - FM port # for AZT2320 chip (PnP setup)
+ irq - IRQ # for AZT2320 (WSS) chip (PnP setup)
+ mpu_irq - IRQ # for MPU-401 UART (PnP setup)
+ dma1 - 1st DMA # for AZT2320 (WSS) chip (PnP setup)
+ dma2 - 2nd DMA # for AZT2320 (WSS) chip (PnP setup)
+
+ Module supports up to 8 cards, PnP and autoprobe.
+
+ Module snd-cmi8330
+ ------------------
+
+ Module for soundcards based on C-Media CMI8330 ISA chips.
+
+ wssport - port # for CMI8330 chip (WSS)
+ wssirq - IRQ # for CMI8330 chip (WSS)
+ wssdma - first DMA # for CMI8330 chip (WSS)
+ sbport - port # for CMI8330 chip (SB16)
+ sbirq - IRQ # for CMI8330 chip (SB16)
+ sbdma8 - 8bit DMA # for CMI8330 chip (SB16)
+ sbdma16 - 16bit DMA # for CMI8330 chip (SB16)
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-cmipci
+ -----------------
+
+ Module for C-Media CMI8338 and 8738 PCI soundcards.
+
+ mpu_port - 0x300 (default),0x310,0x320,0x330, -1 (diable)
+ fm_port - 0x388 (default), -1 (disable)
+
+ Module supports autoprobe and multiple chips (max 8).
+
+ Module snd-cs4231
+ -----------------
+
+ Module for soundcards based on CS4231 ISA chips.
+
+ port - port # for CS4231 chip
+ mpu_port - port # for MPU-401 UART (optional), -1 = disable
+ irq - IRQ # for CS4231 chip
+ mpu_irq - IRQ # for MPU-401 UART
+ dma1 - first DMA # for CS4231 chip
+ dma2 - second DMA # for CS4231 chip
+
+ Module supports up to 8 cards. This module does not support autoprobe
+ thus main port must be specified!!! Other ports are optional.
+
+ The power-management is supported.
+
+ Module snd-cs4232
+ -----------------
+
+ Module for soundcards based on CS4232/CS4232A ISA chips.
+
+ port - port # for CS4232 chip (PnP setup - 0x534)
+ cport - control port # for CS4232 chip (PnP setup - 0x120,0x210,0xf00)
+ mpu_port - port # for MPU-401 UART (PnP setup - 0x300), -1 = disable
+ fm_port - FM port # for CS4232 chip (PnP setup - 0x388), -1 = disable
+ irq - IRQ # for CS4232 chip (5,7,9,11,12,15)
+ mpu_irq - IRQ # for MPU-401 UART (9,11,12,15)
+ dma1 - first DMA # for CS4232 chip (0,1,3)
+ dma2 - second DMA # for Yamaha CS4232 chip (0,1,3), -1 = disable
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards. This module does not support autoprobe
+ thus main port must be specified!!! Other ports are optional.
+
+ The power-management is supported.
+
+ Module snd-cs4236
+ -----------------
+
+ Module for soundcards based on CS4235/CS4236/CS4236B/CS4237B/
+ CS4238B/CS4239 ISA chips.
+
+ port - port # for CS4236 chip (PnP setup - 0x534)
+ cport - control port # for CS4236 chip (PnP setup - 0x120,0x210,0xf00)
+ mpu_port - port # for MPU-401 UART (PnP setup - 0x300), -1 = disable
+ fm_port - FM port # for CS4236 chip (PnP setup - 0x388), -1 = disable
+ irq - IRQ # for CS4236 chip (5,7,9,11,12,15)
+ mpu_irq - IRQ # for MPU-401 UART (9,11,12,15)
+ dma1 - first DMA # for CS4236 chip (0,1,3)
+ dma2 - second DMA # for CS4236 chip (0,1,3), -1 = disable
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards. This module does not support autoprobe
+ (if ISA PnP is not used) thus main port and control port must be
+ specified!!! Other ports are optional.
+
+ The power-management is supported.
+
+ Module snd-cs4281
+ -----------------
+
+ Module for Cirrus Logic CS4281 soundchip.
+
+ dual_codec - Secondary codec ID (0 = disable, default)
+
+ Module supports up to 8 cards.
+
+ The power-management is supported.
+
+ Module snd-cs46xx
+ -----------------
+
+ Module for PCI soundcards based on CS4610/CS4612/CS4614/CS4615/CS4622/
+ CS4624/CS4630/CS4280 PCI chips.
+
+ external_amp - Force to enable external amplifer.
+ thinkpad - Force to enable Thinkpad's CLKRUN control.
+ mmap_valid - Support OSS mmap mode (default = 0).
+
+ Module supports up to 8 cards and autoprobe.
+ Usually external amp and CLKRUN controls are detected automatically
+ from PCI sub vendor/device ids. If they don't work, give the options
+ above explicitly.
+
+ The power-management is supported.
+
+ Module snd-dt019x
+ -----------------
+
+ Module for Diamond Technologies DT-019X / Avance Logic ALS-007 (PnP
+ only)
+
+ port - Port # (PnP setup)
+ mpu_port - Port # for MPU-401 (PnP setup)
+ fm_port - Port # for FM OPL-3 (PnP setup)
+ irq - IRQ # (PnP setup)
+ mpu_irq - IRQ # for MPU-401 (PnP setup)
+ dma8 - DMA # (PnP setup)
+
+ Module supports up to 8 cards. This module is enabled only with
+ ISA PnP support.
+
+ Module snd-dummy
+ ----------------
+
+ Module for the dummy soundcard. This soundcard doesn't do any output
+ or input, but you may use this module for any application which
+ requires a soundcard (like RealPlayer).
+
+ Module snd-emu10k1
+ ------------------
+
+ Module for EMU10K1/EMU10k2 based PCI soundcards.
+ * Sound Blaster Live!
+ * Sound Blaster PCI 512
+ * Emu APS (partially supported)
+ * Sound Blaster Audigy
+
+ extin - bitmap of available external inputs for FX8010 (see bellow)
+ extout - bitmap of available external outputs for FX8010 (see bellow)
+ seq_ports - allocated sequencer ports (4 by default)
+ max_synth_voices - limit of voices used for wavetable (64 by default)
+ max_buffer_size - specifies the maximum size of wavetable/pcm buffers
+ given in MB unit. Default value is 128.
+ enable_ir - enable IR
+
+ Module supports up to 8 cards and autoprobe.
+
+ Input & Output configurations [extin/extout]
+ * Creative Card wo/Digital out [0x0003/0x1f03]
+ * Creative Card w/Digital out [0x0003/0x1f0f]
+ * Creative Card w/Digital CD in [0x000f/0x1f0f]
+ * Creative Card wo/Digital out + LiveDrive [0x3fc3/0x1fc3]
+ * Creative Card w/Digital out + LiveDrive [0x3fc3/0x1fcf]
+ * Creative Card w/Digital CD in + LiveDrive [0x3fcf/0x1fcf]
+ * Creative Card wo/Digital out + Digital I/O 2 [0x0fc3/0x1f0f]
+ * Creative Card w/Digital out + Digital I/O 2 [0x0fc3/0x1f0f]
+ * Creative Card w/Digital CD in + Digital I/O 2 [0x0fcf/0x1f0f]
+ * Creative Card 5.1/w Digital out + LiveDrive [0x3fc3/0x1fff]
+ * Creative Card all ins and outs [0x3fff/0x1fff]
+
+ Module snd-ens1370
+ ------------------
+
+ Module for Ensoniq AudioPCI ES1370 PCI soundcards.
+ * SoundBlaster PCI 64
+ * SoundBlaster PCI 128
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-ens1371
+ ------------------
+
+ Module for Ensoniq AudioPCI ES1371 PCI soundcards.
+ * SoundBlaster PCI 64
+ * SoundBlaster PCI 128
+ * SoundBlaster Vibra PCI
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-es968
+ ----------------
+
+ Module for soundcards based on ESS ES968 chip (PnP only).
+
+ port - port # for ES968 (SB8) chip (PnP setup)
+ irq - IRQ # for ES968 (SB8) chip (PnP setup)
+ dma1 - DMA # for ES968 (SB8) chip (PnP setup)
+
+ Module supports up to 8 cards, PnP and autoprobe.
+
+ Module snd-es1688
+ -----------------
+
+ Module for ESS AudioDrive ES-1688 and ES-688 soundcards.
+
+ port - port # for ES-1688 chip (0x220,0x240,0x260)
+ mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
+ irq - IRQ # for ES-1688 chip (5,7,9,10)
+ mpu_irq - IRQ # for MPU-401 port (5,7,9,10)
+ dma8 - DMA # for ES-1688 chip (0,1,3)
+
+ Module supports up to 8 cards and autoprobe (without MPU-401 port).
+
+ Module snd-es18xx
+ -----------------
+
+ Module for ESS AudioDrive ES-18xx soundcards.
+
+ port - port # for ES-18xx chip (0x220,0x240,0x260)
+ mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
+ fm_port - port # for FM (optional, not used)
+ irq - IRQ # for ES-18xx chip (5,7,9,10)
+ dma1 - first DMA # for ES-18xx chip (0,1,3)
+ dma2 - first DMA # for ES-18xx chip (0,1,3)
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards ISA PnP and autoprobe (without MPU-401 port
+ if native ISA PnP routines are not used).
+ When dma2 is equal with dma1, the driver works as half-duplex.
+
+ The power-management is supported.
+
+ Module snd-es1938
+ -----------------
+
+ Module for soundcards based on ESS Solo-1 (ES1938,ES1946) chips.
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-es1968
+ -----------------
+
+ Module for soundcards based on ESS Maestro-1/2/2E (ES1968/ES1978) chips.
+
+ total_bufsize - total buffer size in kB (1-4096kB)
+ pcm_substreams_p - playback channels (1-8, default=2)
+ pcm_substreams_c - capture channels (1-8, default=0)
+ clock - clock (0 = auto-detection)
+ use_pm - support the power-management (0 = off, 1 = on,
+ 2 = auto)
+
+ Module supports up to 8 cards and autoprobe.
+
+ The power-management is supported.
+
+ Module snd-fm801
+ ----------------
+
+ Module for ForteMedia FM801 based PCI soundcards.
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-gusclassic
+ ---------------------
+
+ Module for Gravis UltraSound Classic soundcard.
+
+ port - port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
+ irq - IRQ # for GF1 chip (3,5,9,11,12,15)
+ dma1 - DMA # for GF1 chip (1,3,5,6,7)
+ dma2 - DMA # for GF1 chip (1,3,5,6,7,-1=disable)
+ joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
+ voices - GF1 voices limit (14-32)
+ pcm_voices - reserved PCM voices
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-gusextreme
+ ---------------------
+
+ Module for Gravis UltraSound Extreme (Synergy ViperMax) soundcard.
+
+ port - port # for ES-1688 chip (0x220,0x230,0x240,0x250,0x260)
+ gf1_port - port # for GF1 chip (0x210,0x220,0x230,0x240,0x250,0x260,0x270)
+ mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable
+ irq - IRQ # for ES-1688 chip (5,7,9,10)
+ gf1_irq - IRQ # for GF1 chip (3,5,9,11,12,15)
+ mpu_irq - IRQ # for MPU-401 port (5,7,9,10)
+ dma8 - DMA # for ES-1688 chip (0,1,3)
+ dma1 - DMA # for GF1 chip (1,3,5,6,7)
+ joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
+ voices - GF1 voices limit (14-32)
+ pcm_voices - reserved PCM voices
+
+ Module supports up to 8 cards and autoprobe (without MPU-401 port).
+
+ Module snd-gusmax
+ -----------------
+
+ Module for Gravis UltraSound MAX soundcard.
+
+ port - port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
+ irq - IRQ # for GF1 chip (3,5,9,11,12,15)
+ dma1 - DMA # for GF1 chip (1,3,5,6,7)
+ dma2 - DMA # for GF1 chip (1,3,5,6,7,-1=disable)
+ joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
+ voices - GF1 voices limit (14-32)
+ pcm_voices - reserved PCM voices
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-hdsp
+ ---------------
+
+ Module for RME Hammerfall DSP audio interface(s)
+
+ precise_ptr - Enable precise pointer (doesn't work reliably).
+ (default = 0)
+ line_outs_monitor - Send all input and playback streams to line outs
+ by default. (default = 0)
+ force_firmware - Force a reload of the I/O box firmware
+ (default = 0)
+
+ Module supports up to 8 cards.
+
+ Module snd-ice1712
+ ------------------
+
+ Module for Envy24 (ICE1712) based PCI soundcards.
+ * MidiMan M Audio Delta 1010
+ * MidiMan M Audio Delta DiO 2496
+ * MidiMan M Audio Delta 66
+ * MidiMan M Audio Delta 44
+ * MidiMan M Audio Audiophile 2496
+ * TerraTec EWS 88MT
+ * TerraTec EWS 88D
+ * TerraTec EWX 24/96
+
+ omni - Omni I/O support for MidiMan M-Audio Delta44/66
+
+ Module supports up to 8 cards and autoprobe. Note: The consumer part
+ is not used with all Envy24 based cards (for example in the MidiMan Delta
+ serie).
+
+ Module snd-intel8x0
+ -------------------
+
+ Module for AC'97 motherboards from Intel and compatibles.
+ * Intel i810/810E, i815, i820, i830, i84x, MX440
+ * SiS 7012 (SiS 735)
+ * NVidia NForce, NForce2
+ * AMD AMD768, AMD8111
+ * ALi m5455
+
+ ac97_clock - AC'97 codec clock base (0 = auto-detect)
+ joystick_port - Joystick port # (0 = disabled, 0x200)
+ mpu_port - MPU401 port # (0 = disabled, 0x330,0x300)
+
+ Module supports autoprobe and multiple bus-master chips (max 8).
+ Note: the latest driver supports auto-detection of chip clock.
+ if you still encounter too fast playback, specify the clock
+ explicitly via the module option "ac97_clock=41194".
+
+ The joystick and MPU-401 are supported only certain hardwares.
+ MPU401 is experimental, It doesn't work perfectly.
+
+ The power-management is supported.
+
+ Module snd-interwave
+ --------------------
+
+ Module for Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32
+ and other soundcards based on AMD InterWave (tm) chip.
+
+ port - port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
+ irq - IRQ # for InterWave chip (3,5,9,11,12,15)
+ dma1 - DMA # for InterWave chip (0,1,3,5,6,7)
+ dma2 - DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
+ joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
+ midi - 1 = MIDI UART enable, 0 = MIDI UART disable (default)
+ pcm_voices - reserved PCM voices for the synthesizer (default 2)
+ effect - 1 = InterWave effects enable (default 0);
+ requires 8 voices
+
+ Module supports up to 8 cards, autoprobe and ISA PnP.
+
+ Module snd-interwave-stb
+ ------------------------
+
+ Module for UltraSound 32-Pro (soundcard from STB used by Compaq)
+ and other soundcards based on AMD InterWave (tm) chip with TEA6330T
+ circuit for extended control of bass, treble and master volume.
+
+ port - port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
+ port_tc - tone control (i2c bus) port # for TEA6330T chip (0x350,0x360,0x370,0x380)
+ irq - IRQ # for InterWave chip (3,5,9,11,12,15)
+ dma1 - DMA # for InterWave chip (0,1,3,5,6,7)
+ dma2 - DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
+ joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
+ midi - 1 = MIDI UART enable, 0 = MIDI UART disable (default)
+ pcm_voices - reserved PCM voices for the synthesizer (default 2)
+ effect - 1 = InterWave effects enable (default 0);
+ requires 8 voices
+
+ Module supports up to 8 cards, autoprobe and ISA PnP.
+
+ Module snd-korg1212
+ -------------------
+
+ Module for Korg 1212 IO PCI card
+
+ Module supports up to 8 cards.
+
+ Module snd-maestro3
+ -------------------
+
+ Module for Allegro/Maestro3 chips
+
+ external_amp - enable external amp (enabled by default)
+ amp_gpio - GPIO pin number for external amp (0-15) or
+ -1 for default pin (8 for allegro, 1 for
+ others)
+
+ Module supports autoprobe and multiple chips (max 8).
+ Note: the binding of amplifier is dependent on hardware.
+ If there is no sound even though all channels are unmuted, try to
+ specify other gpio connection via amp_gpio option.
+ For example, a Panasonic notebook might need "amp_gpio=0x0d"
+ option.
+
+ The power-management is supported.
+
+ Module snd-mpu401
+ -----------------
+
+ Module for MPU-401 UART devices.
+
+ port - port number or -1 (disable)
+ irq - IRQ number or -1 (disable)
+
+ Module supports multiple devices (max 8).
+
+ Module snd-mtpav
+ ----------------
+
+ Module for MOTU MidiTimePiece AV multiport MIDI (on the parallel
+ port).
+
+ port - I/O port # for MTPAV (0x378,0x278, default=0x378)
+ irq - IRQ # for MTPAV (7,5, default=7)
+ hwports - number of supported hardware ports, default=8.
+
+ Module supports only 1 card. This module has no enable option.
+
+ Module snd-nm256
+ ----------------
+
+ Module for NeoMagic NM256AV/ZX chips
+
+ playback_bufsize - max playback frame size in kB (4-128kB)
+ capture_bufsize - max capture frame size in kB (4-128kB)
+ force_ac97 - 0 or 1 (disabled by default)
+ buffer_top - specify buffer top address
+ use_cache - 0 or 1 (disabled by default)
+ vaio_hack - alias buffer_top=0x25a800
+
+ Module supports autoprobe and multiple chips (max 8).
+ Note: on some notebooks the buffer address cannot be detected
+ automatically, or causes hang-up during initialization.
+ In such a case, specify the buffer top address explicity via
+ buffer_top option.
+ For example,
+ Sony F250: buffer_top=0x25a800
+ Sony F270: buffer_top=0x272800
+ The driver supports only ac97 codec. It's possible to force
+ to initialize/use ac97 although it's not detected. In such a
+ case, use force_ac97=1 option.
+
+ The power-management is supported.
+
+ Module snd-opl3sa2
+ ------------------
+
+ Module for Yamaha OPL3-SA2/SA3 soundcards.
+
+ port - control port # for OPL3-SA chip (0x370)
+ sb_port - SB port # for OPL3-SA chip (0x220,0x240)
+ wss_port - WSS port # for OPL3-SA chip (0x530,0xe80,0xf40,0x604)
+ midi_port - port # for MPU-401 UART (0x300,0x330), -1 = disable
+ fm_port - FM port # for OPL3-SA chip (0x388), -1 = disable
+ irq - IRQ # for OPL3-SA chip (5,7,9,10)
+ dma1 - first DMA # for Yamaha OPL3-SA chip (0,1,3)
+ dma2 - second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards and ISA PnP. This module does not support
+ autoprobe (if ISA PnP is not used) thus all ports must be specified!!!
+
+ The power-management is supported.
+
+ Module snd-opti92x-ad1848
+ -------------------------
+
+ Module for soundcards based on OPTi 82c92x and Analog Devices AD1848 chips.
+ Module works with OAK Mozart cards as well.
+
+ port - port # for WSS chip (0x530,0xe80,0xf40,0x604)
+ mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330)
+ fm_port - port # for OPL3 device (0x388)
+ irq - IRQ # for WSS chip (5,7,9,10,11)
+ mpu_irq - IRQ # for MPU-401 UART (5,7,9,10)
+ dma1 - first DMA # for WSS chip (0,1,3)
+
+ This module supports only one card, autoprobe and PnP.
+
+ Module snd-opti92x-cs4231
+ -------------------------
+
+ Module for soundcards based on OPTi 82c92x and Crystal CS4231 chips.
+
+ port - port # for WSS chip (0x530,0xe80,0xf40,0x604)
+ mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330)
+ fm_port - port # for OPL3 device (0x388)
+ irq - IRQ # for WSS chip (5,7,9,10,11)
+ mpu_irq - IRQ # for MPU-401 UART (5,7,9,10)
+ dma1 - first DMA # for WSS chip (0,1,3)
+ dma2 - second DMA # for WSS chip (0,1,3)
+
+ This module supports only one card, autoprobe and PnP.
+
+ Module snd-opti93x
+ ------------------
+
+ Module for soundcards based on OPTi 82c93x chips.
+
+ port - port # for WSS chip (0x530,0xe80,0xf40,0x604)
+ mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330)
+ fm_port - port # for OPL3 device (0x388)
+ irq - IRQ # for WSS chip (5,7,9,10,11)
+ mpu_irq - IRQ # for MPU-401 UART (5,7,9,10)
+ dma1 - first DMA # for WSS chip (0,1,3)
+ dma2 - second DMA # for WSS chip (0,1,3)
+
+ This module supports only one card, autoprobe and PnP.
+
+ Module snd-powermac (on ppc only)
+ ---------------------------------
+
+ Module for PowerMac, iMac and iBook on-board soundchips
+
+ enable_beep - enable beep using PCM (enabled as default)
+
+ Module supports autoprobe a chip.
+ Note: the driver may have problems regarding endianess.
+
+ The power-management is supported.
+
+ Module snd-rme32
+ ----------------
+
+ Module for RME Digi32, Digi32/8 and Digi32 PRO soundcards.
+
+ Module supports up to 8 cards.
+
+ Module snd-rme96
+ ----------------
+
+ Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST soundcards.
+
+ Module supports up to 8 cards.
+
+ Module snd-rme9652
+ ------------------
+
+ Module for RME Digi9652 (Hammerfall, Hammerfall-Light) soundcards.
+
+ precise_ptr - Enable precise pointer (doesn't work reliably).
+ (default = 0)
+
+ Module supports up to 8 cards.
+
+ Module snd-sa11xx-uda1341 (on arm only)
+ ---------------------------------------
+
+ Module for Philips UDA1341TS on Compaq iPAQ H3600 soundcard.
+
+ Module supports only one card.
+ Module has no enable and index options.
+
+ Module snd-sb8
+ --------------
+
+ Module for 8-bit SoundBlaster cards: SoundBlaster 1.0,
+ SoundBlaster 2.0,
+ SoundBlaster Pro
+
+ port - port # for SB DSP chip (0x220,0x240,0x260)
+ irq - IRQ # for SB DSP chip (5,7,9,10)
+ dma8 - DMA # for SB DSP chip (1,3)
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-sb16 and snd-sbawe
+ -----------------------------
+
+ Module for 16-bit SoundBlaster cards: SoundBlaster 16 (PnP),
+ SoundBlaster AWE 32 (PnP),
+ SoundBlaster AWE 64 PnP
+
+ port - port # for SB DSP 4.x chip (0x220,0x240,0x260)
+ mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disable
+ awe_port - base port # for EMU8000 synthesizer (0x620,0x640,0x660)
+ (snd-sbawe module only)
+ irq - IRQ # for SB DSP 4.x chip (5,7,9,10)
+ dma8 - 8-bit DMA # for SB DSP 4.x chip (0,1,3)
+ dma16 - 16-bit DMA # for SB DSP 4.x chip (5,6,7)
+ mic_agc - Mic Auto-Gain-Control - 0 = disable, 1 = enable (default)
+ csp - ASP/CSP chip support - 0 = disable (default), 1 = enable
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards, autoprobe and ISA PnP.
+
+ Note: To use Vibra16X cards in 16-bit half duplex mode, you must
+ disable 16bit DMA with dma16 = -1 module parameter.
+ Also, all Sound Blaster 16 type cards can operate in 16-bit
+ half duplex mode through 8-bit DMA channel by disabling their
+ 16-bit DMA channel.
+
+ Module snd-sgalaxy
+ ------------------
+
+ Module for Aztech Sound Galaxy soundcard.
+
+ sbport - Port # for SB16 interface (0x220,0x240)
+ wssport - Port # for WSS interface (0x530,0xe80,0xf40,0x604)
+ irq - IRQ # (7,9,10,11)
+ dma1 - DMA #
+
+ Module supports up to 8 cards.
+
+ Module snd-sun-amd7930 (on sparc only)
+ --------------------------------------
+
+ Module for AMD7930 sound chips found on Sparcs.
+
+ Module supports up to 8 cards.
+
+ Module snd-sun-cs4231 (on sparc only)
+ -------------------------------------
+
+ Module for CS4231 sound chips found on Sparcs.
+
+ Module supports up to 8 cards.
+
+ Module snd-wavefront
+ --------------------
+
+ Module for Turtle Beach Maui, Tropez and Tropez+ soundcards.
+
+ cs4232_pcm_port - Port # for CS4232 PCM interface.
+ cs4232_pcm_irq - IRQ # for CS4232 PCM interface (5,7,9,11,12,15).
+ cs4232_mpu_port - Port # for CS4232 MPU-401 interface.
+ cs4232_mpu_irq - IRQ # for CS4232 MPU-401 interface (9,11,12,15).
+ use_cs4232_midi - Use CS4232 MPU-401 interface
+ (inaccessibly located inside your computer)
+ ics2115_port - Port # for ICS2115
+ ics2115_irq - IRQ # for ICS2115
+ fm_port - FM OPL-3 Port #
+ dma1 - DMA1 # for CS4232 PCM interface.
+ dma2 - DMA2 # for CS4232 PCM interface.
+ isapnp - ISA PnP detection - 0 = disable, 1 = enable (default)
+
+ Module supports up to 8 cards and ISA PnP.
+
+ Module snd-sonicvibes
+ ---------------------
+
+ Module for S3 SonicVibes PCI soundcards.
+ * PINE Schubert 32 PCI
+
+ reverb - Reverb Enable - 1 = enable, 0 = disable (default)
+ - SoundCard must have onboard SRAM for this.
+ mge - Mic Gain Enable - 1 = enable, 0 = disable (default)
+
+ Module supports up to 8 cards and autoprobe.
+
+ Module snd-serial-u16550
+ ------------------------
+
+ Module for UART16550A serial MIDI ports.
+
+ port - port # for UART16550A chip
+ irq - IRQ # for UART16550A chip, -1 = poll mode
+ speed - speed in bauds (9600,19200,38400,57600,115200)
+ 38400 = default
+ base - base for divisor in bauds (57600,115200,230400,460800)
+ 115200 = default
+ outs - number of MIDI ports in a serial port (1-4)
+ 1 = default
+ adaptor - Type of adaptor.
+ 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A,
+ 3 = MS-124W M/B, 4 = Generic
+
+ Module supports up to 8 cards. This module does not support autoprobe
+ thus the main port must be specified!!! Other options are optional.
+
+ Module snd-trident
+ ------------------
+
+ Module for Trident 4DWave DX/NX soundcards.
+ * Best Union Miss Melody 4DWave PCI
+ * HIS 4DWave PCI
+ * Warpspeed ONSpeed 4DWave PCI
+ * AzTech PCI 64-Q3D
+ * Addonics SV 750
+ * CHIC True Sound 4Dwave
+ * Shark Predator4D-PCI
+ * Jaton SonicWave 4D
+
+ pcm_channels - max channels (voices) reserved for PCM
+ wavetable_size - max wavetable size in kB (4-?kb)
+
+ Module supports up to 8 cards and autoprobe.
+
+ The power-management is supported.
+
+ Module snd-usb-audio
+ --------------------
+
+ Module for USB audio and USB MIDI devices.
+
+ vid - Vendor ID for the device (optional)
+ pid - Product ID for the device (optional)
+
+ This module supports up to 8 cards, autoprobe and hotplugging.
+
+ Module snd-via82xx
+ ------------------
+
+ Module for AC'97 motherboards based on VIA 82C686A/686B, 8233
+ (south) bridge.
+
+ mpu_port - 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup
+ ac97_clock - AC'97 codec clock base (default 48000Hz)
+
+ Module supports autoprobe and multiple bus-master chips (max 8).
+ Note: on some SMP motherboards like MSI 694D the interrupts might
+ not be generated properly. In such a case, please try to
+ set the SMP (or MPS) version on BIOS to 1.1 instead of
+ default value 1.4. Then the interrupt number will be
+ assigned under 15. You might also upgrade your BIOS.
+
+ Module snd-virmidi
+ ------------------
+
+ Module for virtual rawmidi devices.
+ This module creates virtual rawmidi devices which communicate
+ to the corresponding ALSA sequencer ports.
+
+ midi_devs - MIDI devices # (1-8, default=4)
+
+ Module supports up to 8 cards.
+
+ Module snd-ymfpci
+ -----------------
+
+ Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x).
+
+ mpu_port - 0x300,0x330,0x332,0x334, -1 (disable) by default
+ fm_port - 0x388,0x398,0x3a0,0x3a8, -1 (disable) by default
+ rear_switch - enable shared rear/line-in switch (bool)
+
+ Module supports autoprobe and multiple chips (max 8).
+
+ The power-management is supported.
+
+
+modprobe/kmod support
+=====================
+
+The modprobe program must know which modules are used for the
+device major numbers.
+Native ALSA devices have got default number 116. Thus a line like
+'alias char-major-116 snd' must be added to /etc/modules.conf. If you have
+compiled the ALSA driver with the OSS/Free emulation code, then you
+will need to add lines as explained below:
+
+The ALSA driver uses soundcore multiplexer for 2.2+ kernels and OSS compatible
+devices. You should add line like 'alias char-major-14 soundcore'.
+
+Example with OSS/Free emulation turned on:
+
+----- /etc/modules.conf
+
+# ALSA portion
+alias char-major-116 snd
+# OSS/Free portion
+alias char-major-14 soundcore
+
+----- /etc/modules.conf
+
+After the main multiplexer is loaded, its code requests top-level soundcard
+module. String 'snd-card-%i' is requested for native devices where %i is
+soundcard number from zero to seven. String 'sound-slot-%i' is requested
+for native devices where %i is slot number (for ALSA owner this means soundcard
+number).
+
+----- /etc/modules.conf
+
+# ALSA portion
+alias snd-card-0 snd-interwave
+alias snd-card-1 snd-ens1371
+# OSS/Free portion
+alias sound-slot-0 snd-card-0
+alias sound-slot-1 snd-card-1
+
+----- /etc/modules.conf
+
+We are finished at this point with the configuration for ALSA native devices,
+but you may also need autoloading for ALSA's add-on OSS/Free emulation
+modules. At this time only one module does not depend on any others, thus
+must be loaded separately - snd-pcm-oss. String 'sound-service-%i-%i'
+is requested for OSS/Free service where first %i means slot number
+(e.g. card number) and second %i means service number.
+
+----- /etc/modules.conf
+
+# OSS/Free portion - card #1
+alias sound-service-0-0 snd-mixer-oss
+alias sound-service-0-1 snd-seq-oss
+alias sound-service-0-3 snd-pcm-oss
+alias sound-service-0-8 snd-seq-oss
+alias sound-service-0-12 snd-pcm-oss
+# OSS/Free portion - card #2
+alias sound-service-1-0 snd-mixer-oss
+alias sound-service-1-3 snd-pcm-oss
+alias sound-service-1-12 snd-pcm-oss
+
+----- /etc/modules.conf
+
+A complete example for Gravis UltraSound PnP soundcard:
+
+----- /etc/modules.conf
+
+# ISA PnP support (don't use IRQs 9,10,11,12,13)
+options isapnp isapnp_reserve_irq=9,10,11,12,13
+
+# ALSA native device support
+alias char-major-116 snd
+options snd major=116 cards_limit=1
+alias snd-card-0 snd-interwave
+options snd-interwave index=0 id="GusPnP"
+
+# OSS/Free setup
+alias char-major-14 soundcore
+alias sound-slot-0 snd-card-0
+alias sound-service-0-0 snd-mixer-oss
+alias sound-service-0-1 snd-seq-oss
+alias sound-service-0-3 snd-pcm-oss
+alias sound-service-0-8 snd-seq-oss
+alias sound-service-0-12 snd-pcm-oss
+
+-----
+
+A complete example if you want to use more soundcards in one machine
+(the configuration below is for Sound Blaster 16 and Gravis UltraSound Classic):
+
+----- /etc/modules.conf
+
+# ISA PnP support (don't use IRQs 9,10,11,12,13)
+# it's only an example to reserve some IRQs for another hardware
+options isapnp isapnp_reserve_irq=9,10,11,12,13
+
+# ALSA native device support
+alias char-major-116 snd
+options snd major=116 cards_limit=2
+alias snd-card-0 snd-gusclassic
+alias snd-card-1 snd-sb16
+options snd-gusclassic index=0 id="Gus" \
+ port=0x220 irq=5 dma1=6 dma2=7
+options snd-sb16 index=1 id="SB16"
+
+# OSS/Free setup
+alias char-major-14 soundcore
+alias sound-slot-0 snd-card-0
+alias sound-service-0-0 snd-mixer-oss
+alias sound-service-0-1 snd-seq-oss
+alias sound-service-0-3 snd-pcm-oss
+alias sound-service-0-8 snd-seq-oss
+alias sound-service-0-12 snd-pcm-oss
+alias sound-slot-1 snd-card-1
+alias sound-service-1-0 snd-mixer-oss
+alias sound-service-1-3 snd-pcm-oss
+alias sound-service-1-12 snd-pcm-oss
+
+-----
+
+A complete example, two Gravis UltraSound Classic soundcards are installed
+in the system:
+
+----- /etc/modules.conf
+
+# ALSA native device support
+alias char-major-116 snd
+options snd major=116 cards_limit=2
+alias snd-card-0 snd-gusclassic
+alias snd-card-1 snd-gusclassic
+options snd-gusclassic index=0,1 id="Gus1","Gus2" \
+ port=0x220,0x240 irq=5,7 dma1=1,5 dma2=3,6
+
+# OSS/Free setup
+alias char-major-14 soundcore
+alias sound-slot-0 snd-card-0
+alias sound-service-0-0 snd-mixer-oss
+alias sound-service-0-1 snd-seq-oss
+alias sound-service-0-3 snd-pcm-oss
+alias sound-service-0-8 snd-seq-oss
+alias sound-service-0-12 snd-pcm-oss
+alias sound-slot-1 snd-card-1
+alias sound-service-1-0 snd-mixer-oss
+alias sound-service-1-3 snd-pcm-oss
+alias sound-service-1-12 snd-pcm-oss
+
+-----
+
+If you want to autoclean your modules, you should put below line to your
+/etc/crontab:
+
+*/10 * * * * root /sbin/modprobe -rs snd-card-0 snd-card-1; /sbin/rmmod -as
+
+You may also want to extend the soundcard list to follow your requirements.
+
+
+ALSA PCM devices to OSS devices mapping
+=======================================
+
+/dev/snd/pcmC0D0 -> /dev/audio0 (/dev/audio) -> minor 4
+/dev/snd/pcmC0D0 -> /dev/dsp0 (/dev/dsp) -> minor 3
+/dev/snd/pcmC0D1 -> /dev/adsp0 (/dev/adsp) -> minor 12
+/dev/snd/pcmC1D0 -> /dev/audio1 -> minor 4+16 = 20
+/dev/snd/pcmC1D0 -> /dev/dsp1 -> minor 3+16 = 19
+/dev/snd/pcmC1D1 -> /dev/adsp1 -> minor 12+16 = 28
+/dev/snd/pcmC2D0 -> /dev/audio2 -> minor 4+32 = 36
+/dev/snd/pcmC2D0 -> /dev/dsp2 -> minor 3+32 = 39
+/dev/snd/pcmC2D1 -> /dev/adsp2 -> minor 12+32 = 44
+
+The first number from /dev/snd/pcmC{X}D{Y} expression means soundcard number
+and second means device number.
+Please note that the device mapping above may be varied via the module
+options of snd-pcm-oss module.
+
+
+DEVFS support
+=============
+
+The ALSA driver fully supports the devfs extension.
+You should add lines below to your devfsd.conf file:
+
+LOOKUP snd MODLOAD ACTION snd
+REGISTER ^sound/.* PERMISSIONS root.audio 660
+REGISTER ^snd/.* PERMISSIONS root.audio 660
+
+Warning: These lines assume that you have the audio group in your system.
+ Otherwise replace audio word with another group name (root for
+ example).
+
+
+Proc interfaces (/proc/asound)
+==============================
+
+/proc/asound/card#/pcm#[cp]/oss
+-------------------------------
+ String "erase" - erase all additional informations about OSS applications
+ String "<app_name> <fragments> <fragment_size> [<options>]"
+
+ <app_name> - name of application with (higher priority) or without path
+ <fragments> - number of fragments or zero if auto
+ <fragment_size> - size of fragment in bytes or zero if auto
+ <options> - optional parameters
+ - disable the application tries to open a pcm device for
+ this channel but does not want to use it.
+ (Cause a bug or mmap needs)
+ It's good for Quake etc...
+ - direct don't use plugins
+ - block force block mode (rvplayer)
+ - non-block force non-block mode
+
+ Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss
+ echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss
+ echo "rvplayer 0 0 block" > /proc/asound/card0/pcm0p/oss
+
+
+Links
+=====
+
+ ALSA project homepage
+ http://www.alsa-project.org
+
diff --git a/Documentation/sound/alsa/ControlNames.txt b/Documentation/sound/alsa/ControlNames.txt
new file mode 100644
index 000000000000..a3e109d02fc1
--- /dev/null
+++ b/Documentation/sound/alsa/ControlNames.txt
@@ -0,0 +1,82 @@
+This document describes standard names of mixer controls.
+
+Syntax: SOURCE [DIRECTION] FUNCTION
+
+DIRECTION:
+ <nothing> (both directions)
+ Playback
+ Capture
+ Bypass Playback
+ Bypass Capture
+
+FUNCTION:
+ Switch (on/off switch)
+ Volume
+ Route (route control, hardware specific)
+
+SOURCE:
+ Master
+ Master Mono
+ Hardware Master
+ Headphone
+ PC Speaker
+ Phone
+ Phone Input
+ Phone Output
+ Synth
+ FM
+ Mic
+ Line
+ CD
+ Video
+ Zoom Video
+ Aux
+ PCM
+ PCM Front
+ PCM Rear
+ PCM Pan
+ Loopback
+ Analog Loopback (D/A -> A/D loopback)
+ Digital Loopback (playback -> capture loopback - without analog path)
+ Mono
+ Mono Output
+ Multi
+ ADC
+ Wave
+ Music
+ I2S
+ IEC958
+
+Exceptions:
+ [Digital] Capture Source
+ [Digital] Capture Switch (aka input gain switch)
+ [Digital] Capture Volume (aka input gain volume)
+ [Digital] Playback Switch (aka output gain switch)
+ [Digital] Playback Volume (aka output gain volume)
+ Tone Control - Switch
+ Tone Control - Bass
+ Tone Control - Treble
+ 3D Control - Switch
+ 3D Control - Center
+ 3D Control - Depth
+ 3D Control - Wide
+ 3D Control - Space
+ 3D Control - Level
+ Mic Boost [(?dB)]
+
+PCM interface:
+
+ Sample Clock Source { "Word", "Internal", "AutoSync" }
+ Clock Sync Status { "Lock", "Sync", "No Lock" }
+ External Rate /* external capture rate */
+ Capture Rate /* capture rate taken from external source */
+
+IEC958 (S/PDIF) interface:
+
+ IEC958 [...] [Playback|Capture] Switch /* turn on/off the IEC958 interface */
+ IEC958 [...] [Playback|Capture] Volume /* digital volume control */
+ IEC958 [...] [Playback|Capture] Default /* default or global value - read/write */
+ IEC958 [...] [Playback|Capture] Mask /* consumer and professional mask */
+ IEC958 [...] [Playback|Capture] Con Mask /* consumer mask */
+ IEC958 [...] [Playback|Capture] Pro Mask /* professional mask */
+ IEC958 [...] [Playback|Capture] PCM Stream /* the settings assigned to a PCM stream */
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index a43901ade489..7f30895ca719 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -638,7 +638,7 @@ do_entUna(void * va, unsigned long opcode, unsigned long reg,
got_exception:
/* Ok, we caught the exception, but we don't want it. Is there
someone to pass it along to? */
- if ((fixup = search_exception_table(pc, regs.gp)) != 0) {
+ if ((fixup = search_exception_table(pc)) != 0) {
unsigned long newpc;
newpc = fixup_exception(una_reg, fixup, pc);
diff --git a/arch/alpha/lib/clear_user.S b/arch/alpha/lib/clear_user.S
index 21d86eb78a11..8860316c1957 100644
--- a/arch/alpha/lib/clear_user.S
+++ b/arch/alpha/lib/clear_user.S
@@ -29,7 +29,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exception-99b($31); \
.previous
@@ -80,7 +80,6 @@ $tail:
ret $31, ($28), 1 # .. e1 :
__do_clear_user:
- ldgp $29,0($27) # we do exceptions -- we need the gp.
and $6, 7, $4 # e0 : find dest misalignment
beq $0, $zerolength # .. e1 :
addq $0, $4, $1 # e0 : bias counter
diff --git a/arch/alpha/lib/copy_user.S b/arch/alpha/lib/copy_user.S
index d8f1a24cfedd..6f3fab9eb434 100644
--- a/arch/alpha/lib/copy_user.S
+++ b/arch/alpha/lib/copy_user.S
@@ -30,29 +30,28 @@
#define EXI(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exitin-99b($31); \
.previous
#define EXO(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exitout-99b($31); \
.previous
.set noat
- .align 3
+ .align 4
.globl __copy_user
.ent __copy_user
__copy_user:
- ldgp $29,0($27) # we do exceptions -- we need the gp.
- .prologue 1
+ .prologue 0
and $6,7,$3
beq $0,$35
beq $3,$36
subq $3,8,$3
- .align 5
+ .align 4
$37:
EXI( ldq_u $1,0($7) )
EXO( ldq_u $2,0($6) )
@@ -73,7 +72,7 @@ $36:
beq $1,$43
beq $4,$48
EXI( ldq_u $3,0($7) )
- .align 5
+ .align 4
$50:
EXI( ldq_u $2,8($7) )
subq $4,8,$4
@@ -88,7 +87,7 @@ $50:
bne $4,$50
$48:
beq $0,$41
- .align 5
+ .align 4
$57:
EXI( ldq_u $1,0($7) )
EXO( ldq_u $2,0($6) )
@@ -105,7 +104,7 @@ $57:
.align 4
$43:
beq $4,$65
- .align 5
+ .align 4
$66:
EXI( ldq $1,0($7) )
subq $4,8,$4
diff --git a/arch/alpha/lib/ev6-clear_user.S b/arch/alpha/lib/ev6-clear_user.S
index 090f060637ef..4f42a16b7f53 100644
--- a/arch/alpha/lib/ev6-clear_user.S
+++ b/arch/alpha/lib/ev6-clear_user.S
@@ -47,7 +47,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exception-99b($31); \
.previous
@@ -62,9 +62,6 @@
# Pipeline info : Slotting & Comments
__do_clear_user:
- ldgp $29,0($27) # we do exceptions -- we need the gp.
- # Macro instruction becomes ldah/lda
- # .. .. E E :
and $6, 7, $4 # .. E .. .. : find dest head misalignment
beq $0, $zerolength # U .. .. .. : U L U L
diff --git a/arch/alpha/lib/ev6-copy_user.S b/arch/alpha/lib/ev6-copy_user.S
index a30f7324c845..db42ffe9c350 100644
--- a/arch/alpha/lib/ev6-copy_user.S
+++ b/arch/alpha/lib/ev6-copy_user.S
@@ -41,14 +41,14 @@
#define EXI(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exitin-99b($31); \
.previous
#define EXO(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exitout-99b($31); \
.previous
@@ -58,10 +58,7 @@
.ent __copy_user
# Pipeline info: Slotting & Comments
__copy_user:
- ldgp $29,0($27) # we do exceptions -- we need the gp.
- # Macro instruction becomes ldah/lda
- # .. .. E E
- .prologue 1
+ .prologue 0
subq $0, 32, $1 # .. E .. .. : Is this going to be a small copy?
beq $0, $zerolength # U .. .. .. : U L U L
diff --git a/arch/alpha/lib/ev6-strncpy_from_user.S b/arch/alpha/lib/ev6-strncpy_from_user.S
index d9ab9ef74a70..d2e28178cacc 100644
--- a/arch/alpha/lib/ev6-strncpy_from_user.S
+++ b/arch/alpha/lib/ev6-strncpy_from_user.S
@@ -34,7 +34,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exception-99b($0); \
.previous
@@ -46,11 +46,10 @@
.globl __strncpy_from_user
.ent __strncpy_from_user
.frame $30, 0, $26
- .prologue 1
+ .prologue 0
.align 4
__strncpy_from_user:
- ldgp $29, 0($27) # E E : becomes 2 instructions (for exceptions)
and a0, 7, t3 # E : find dest misalignment
beq a2, $zerolength # U :
diff --git a/arch/alpha/lib/ev67-strlen_user.S b/arch/alpha/lib/ev67-strlen_user.S
index 7a20f5270d2d..57e0d77b81a6 100644
--- a/arch/alpha/lib/ev67-strlen_user.S
+++ b/arch/alpha/lib/ev67-strlen_user.S
@@ -30,7 +30,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda v0, $exception-99b(zero); \
.previous
@@ -56,9 +56,7 @@ __strlen_user:
.align 4
__strnlen_user:
- ldgp $29,0($27) # E E : we do exceptions -- we need the gp.
- /* Decomposes into lda/ldah */
- .prologue 1
+ .prologue 0
EX( ldq_u t0, 0(a0) ) # L : load first quadword (a0 may be misaligned)
lda t1, -1(zero) # E :
diff --git a/arch/alpha/lib/strlen_user.S b/arch/alpha/lib/strlen_user.S
index af99c54d58fc..508a18e96479 100644
--- a/arch/alpha/lib/strlen_user.S
+++ b/arch/alpha/lib/strlen_user.S
@@ -19,7 +19,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda v0, $exception-99b(zero); \
.previous
@@ -42,8 +42,7 @@ __strlen_user:
.align 3
__strnlen_user:
- ldgp $29,0($27) # we do exceptions -- we need the gp.
- .prologue 1
+ .prologue 0
EX( ldq_u t0, 0(a0) ) # load first quadword (a0 may be misaligned)
lda t1, -1(zero)
diff --git a/arch/alpha/lib/strncpy_from_user.S b/arch/alpha/lib/strncpy_from_user.S
index bc934256f686..73ee21160ff7 100644
--- a/arch/alpha/lib/strncpy_from_user.S
+++ b/arch/alpha/lib/strncpy_from_user.S
@@ -19,7 +19,7 @@
#define EX(x,y...) \
99: x,##y; \
.section __ex_table,"a"; \
- .gprel32 99b; \
+ .long 99b - .; \
lda $31, $exception-99b($0); \
.previous
@@ -31,7 +31,7 @@
.globl __strncpy_from_user
.ent __strncpy_from_user
.frame $30, 0, $26
- .prologue 1
+ .prologue 0
.align 3
$aligned:
@@ -100,8 +100,6 @@ $a_eoc:
/*** The Function Entry Point ***/
.align 3
__strncpy_from_user:
- ldgp $29, 0($27) # we do exceptions -- we need the gp.
-
mov a0, v0 # save the string start
beq a2, $zerolength
diff --git a/arch/alpha/mm/extable.c b/arch/alpha/mm/extable.c
index 98435ea3ef09..c856eea015f3 100644
--- a/arch/alpha/mm/extable.c
+++ b/arch/alpha/mm/extable.c
@@ -12,21 +12,17 @@ extern const struct exception_table_entry __stop___ex_table[];
static inline unsigned
search_one_table(const struct exception_table_entry *first,
const struct exception_table_entry *last,
- signed long value)
+ unsigned long value)
{
- /* Abort early if the search value is out of range. */
- if (value != (signed int)value)
- return 0;
-
while (first <= last) {
const struct exception_table_entry *mid;
- long diff;
+ unsigned long mid_value;
mid = (last - first) / 2 + first;
- diff = mid->insn - value;
- if (diff == 0)
+ mid_value = (unsigned long)&mid->insn + mid->insn;
+ if (mid_value == value)
return mid->fixup.unit;
- else if (diff < 0)
+ else if (mid_value < value)
first = mid+1;
else
last = mid-1;
@@ -34,48 +30,13 @@ search_one_table(const struct exception_table_entry *first,
return 0;
}
-register unsigned long gp __asm__("$29");
-
-static unsigned
-search_exception_table_without_gp(unsigned long addr)
-{
- unsigned ret;
-
-#ifndef CONFIG_MODULES
- /* There is only the kernel to search. */
- ret = search_one_table(__start___ex_table, __stop___ex_table - 1,
- addr - gp);
-#else
- extern spinlock_t modlist_lock;
- unsigned long flags;
- /* The kernel is the last "module" -- no need to treat it special. */
- struct module *mp;
-
- ret = 0;
- spin_lock_irqsave(&modlist_lock, flags);
- for (mp = module_list; mp ; mp = mp->next) {
- if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
- continue;
- ret = search_one_table(mp->ex_table_start,
- mp->ex_table_end - 1, addr - mp->gp);
- if (ret)
- break;
- }
- spin_unlock_irqrestore(&modlist_lock, flags);
-#endif
-
- return ret;
-}
-
unsigned
-search_exception_table(unsigned long addr, unsigned long exc_gp)
+search_exception_table(unsigned long addr)
{
unsigned ret;
#ifndef CONFIG_MODULES
- ret = search_one_table(__start___ex_table, __stop___ex_table - 1,
- addr - exc_gp);
- if (ret) return ret;
+ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
#else
extern spinlock_t modlist_lock;
unsigned long flags;
@@ -88,25 +49,12 @@ search_exception_table(unsigned long addr, unsigned long exc_gp)
if (!mp->ex_table_start || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
continue;
ret = search_one_table(mp->ex_table_start,
- mp->ex_table_end - 1, addr - exc_gp);
+ mp->ex_table_end - 1, addr);
if (ret)
break;
}
spin_unlock_irqrestore(&modlist_lock, flags);
- if (ret) return ret;
#endif
- /*
- * The search failed with the exception gp. To be safe, try the
- * old method before giving up.
- */
- ret = search_exception_table_without_gp(addr);
- if (ret) {
- printk(KERN_ALERT "%s: [%lx] EX_TABLE search fail with"
- "exc frame GP, success with raw GP\n",
- current->comm, addr);
- return ret;
- }
-
- return 0;
+ return ret;
}
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index 2348ff945aec..8285db87a801 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -176,7 +176,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
no_context:
/* Are we prepared to handle this fault as an exception? */
- if ((fixup = search_exception_table(regs->pc, regs->gp)) != 0) {
+ if ((fixup = search_exception_table(regs->pc)) != 0) {
unsigned long newpc;
newpc = fixup_exception(dpf_reg, fixup, regs->pc);
regs->pc = newpc;
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index b72e6ba66ef8..e55289e7ea33 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -1553,7 +1553,6 @@ config DEBUG_HIGHMEM
config KALLSYMS
bool "Load all symbols for debugging/kksymoops"
- depends on DEBUG_KERNEL
help
Say Y here to let the kernel print out symbolic crash information and
symbolic stack backtraces. This increases the size of the kernel
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 6ff4b2350e1e..8da98697215f 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -47,6 +47,7 @@
#include <asm/errno.h>
#include <asm/segment.h>
#include <asm/smp.h>
+#include <asm/page.h>
#include "irq_vectors.h"
EBX = 0x00
@@ -232,7 +233,7 @@ need_resched:
#endif
/* Points to after the "sysenter" instruction in the vsyscall page */
-#define SYSENTER_RETURN 0xfffff007
+#define SYSENTER_RETURN 0xffffe00a
# sysenter call handler stub
ALIGN
@@ -244,6 +245,18 @@ ENTRY(sysenter_entry)
pushl $(__USER_CS)
pushl $SYSENTER_RETURN
+/*
+ * Load the potential sixth argument from user stack.
+ * Careful about security.
+ */
+ cmpl $__PAGE_OFFSET-3,%ebp
+ jae syscall_badsys
+1: movl (%ebp),%ebp
+.section __ex_table,"a"
+ .align 4
+ .long 1b,syscall_badsys
+.previous
+
pushl %eax
SAVE_ALL
GET_THREAD_INFO(%ebx)
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 253f08d92da3..e31d79b11a5b 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -44,6 +44,7 @@
#include <asm/ldt.h>
#include <asm/processor.h>
#include <asm/i387.h>
+#include <asm/irq.h>
#include <asm/desc.h>
#ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h>
@@ -269,6 +270,8 @@ void release_thread(struct task_struct *dead_task)
BUG();
}
}
+
+ release_x86_irqs(dead_task);
}
/*
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index c47740010b5d..685bf5154e7d 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/thread_info.h>
+#include <linux/sched.h>
#include <linux/gfp.h>
#include <linux/string.h>
@@ -18,24 +19,55 @@
extern asmlinkage void sysenter_entry(void);
+/*
+ * Create a per-cpu fake "SEP thread" stack, so that we can
+ * enter the kernel without having to worry about things like
+ * "current" etc not working (debug traps and NMI's can happen
+ * before we can switch over to the "real" thread).
+ *
+ * Return the resulting fake stack pointer.
+ */
+struct fake_sep_struct {
+ struct thread_info thread;
+ struct task_struct task;
+ unsigned char trampoline[32] __attribute__((aligned(1024)));
+ unsigned char stack[0];
+} __attribute__((aligned(8192)));
+
+static struct fake_sep_struct *alloc_sep_thread(int cpu)
+{
+ struct fake_sep_struct *entry;
+
+ entry = (struct fake_sep_struct *) __get_free_pages(GFP_ATOMIC, 1);
+ if (!entry)
+ return NULL;
+
+ memset(entry, 0, PAGE_SIZE<<1);
+ entry->thread.task = &entry->task;
+ entry->task.thread_info = &entry->thread;
+ entry->thread.preempt_count = 1;
+ entry->thread.cpu = cpu;
+
+ return entry;
+}
+
static void __init enable_sep_cpu(void *info)
{
- unsigned long page = __get_free_page(GFP_ATOMIC);
int cpu = get_cpu();
+ struct fake_sep_struct *sep = alloc_sep_thread(cpu);
unsigned long *esp0_ptr = &(init_tss + cpu)->esp0;
unsigned long rel32;
- rel32 = (unsigned long) sysenter_entry - (page+11);
-
+ rel32 = (unsigned long) sysenter_entry - (unsigned long) (sep->trampoline+11);
- *(short *) (page+0) = 0x258b; /* movl xxxxx,%esp */
- *(long **) (page+2) = esp0_ptr;
- *(char *) (page+6) = 0xe9; /* jmp rl32 */
- *(long *) (page+7) = rel32;
+ *(short *) (sep->trampoline+0) = 0x258b; /* movl xxxxx,%esp */
+ *(long **) (sep->trampoline+2) = esp0_ptr;
+ *(char *) (sep->trampoline+6) = 0xe9; /* jmp rl32 */
+ *(long *) (sep->trampoline+7) = rel32;
- wrmsr(0x174, __KERNEL_CS, 0); /* SYSENTER_CS_MSR */
- wrmsr(0x175, page+PAGE_SIZE, 0); /* SYSENTER_ESP_MSR */
- wrmsr(0x176, page, 0); /* SYSENTER_EIP_MSR */
+ wrmsr(0x174, __KERNEL_CS, 0); /* SYSENTER_CS_MSR */
+ wrmsr(0x175, PAGE_SIZE*2 + (unsigned long) sep, 0); /* SYSENTER_ESP_MSR */
+ wrmsr(0x176, (unsigned long) &sep->trampoline, 0); /* SYSENTER_EIP_MSR */
printk("Enabling SEP on CPU %d\n", cpu);
put_cpu();
@@ -48,14 +80,19 @@ static int __init sysenter_setup(void)
0xc3 /* ret */
};
static const char sysent[] = {
- 0x55, /* push %ebp */
+ 0x9c, /* pushf */
0x51, /* push %ecx */
0x52, /* push %edx */
+ 0x55, /* push %ebp */
0x89, 0xe5, /* movl %esp,%ebp */
0x0f, 0x34, /* sysenter */
+ /* System call restart point is here! (SYSENTER_RETURN - 2) */
+ 0xeb, 0xfa, /* jmp to "movl %esp,%ebp" */
+ /* System call normal return point is here! (SYSENTER_RETURN in entry.S) */
+ 0x5d, /* pop %ebp */
0x5a, /* pop %edx */
0x59, /* pop %ecx */
- 0x5d, /* pop %ebp */
+ 0x9d, /* popf - restore TF */
0xc3 /* ret */
};
unsigned long page = get_zeroed_page(GFP_ATOMIC);
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index 482f49fd17c5..8917425babd7 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -708,23 +708,6 @@ static inline void free_vm86_irq(int irqnumber)
spin_unlock_irqrestore(&irqbits_lock, flags);
}
-static inline int task_valid(struct task_struct *tsk)
-{
- struct task_struct *g, *p;
- int ret = 0;
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p)
- if ((p == tsk) && (p->sig)) {
- ret = 1;
- goto out;
- }
- while_each_thread(g, p);
-out:
- read_unlock(&tasklist_lock);
- return ret;
-}
-
void release_x86_irqs(struct task_struct *task)
{
int i;
@@ -733,17 +716,6 @@ void release_x86_irqs(struct task_struct *task)
free_vm86_irq(i);
}
-static inline void handle_irq_zombies(void)
-{
- int i;
- for (i=3; i<16; i++) {
- if (vm86_irqs[i].tsk) {
- if (task_valid(vm86_irqs[i].tsk)) continue;
- free_vm86_irq(i);
- }
- }
-}
-
static inline int get_and_reset_irq(int irqnumber)
{
int bit;
@@ -772,7 +744,6 @@ static int do_vm86_irq_handling(int subfunction, int irqnumber)
case VM86_REQUEST_IRQ: {
int sig = irqnumber >> 8;
int irq = irqnumber & 255;
- handle_irq_zombies();
if (!capable(CAP_SYS_ADMIN)) return -EPERM;
if (!((1 << sig) & ALLOWED_SIGS)) return -EPERM;
if ( (irq<3) || (irq>15) ) return -EPERM;
@@ -784,7 +755,6 @@ static int do_vm86_irq_handling(int subfunction, int irqnumber)
return irq;
}
case VM86_FREE_IRQ: {
- handle_irq_zombies();
if ( (irqnumber<3) || (irqnumber>15) ) return -EPERM;
if (!vm86_irqs[irqnumber].tsk) return 0;
if (vm86_irqs[irqnumber].tsk != current) return -EPERM;
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 4c6fb4761848..a322828c72fb 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -183,8 +183,10 @@ acpi_ac_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index d9f2b3c8137e..c821ef4c35ac 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -669,8 +669,10 @@ acpi_battery_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_battery_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index ef1861bb2df2..ef82cf991c91 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -179,8 +179,10 @@ acpi_button_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_button_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index 470b227deb2f..1aea76688958 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dsfield - Dispatcher field routines
- * $Revision: 70 $
*
*****************************************************************************/
@@ -38,21 +37,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_buffer_field
+ * FUNCTION: acpi_ds_create_buffer_field
*
* PARAMETERS: Opcode - The opcode to be executed
* Operands - List of operands for the opcode
- * Walk_state - Current state
+ * walk_state - Current state
*
* RETURN: Status
*
- * DESCRIPTION: Execute the Create_field operators:
- * Create_bit_field_op,
- * Create_byte_field_op,
- * Create_word_field_op,
- * Create_dWord_field_op,
- * Create_qWord_field_op,
- * Create_field_op (all of which define fields in buffers)
+ * DESCRIPTION: Execute the create_field operators:
+ * create_bit_field_op,
+ * create_byte_field_op,
+ * create_word_field_op,
+ * create_dword_field_op,
+ * create_qword_field_op,
+ * create_field_op (all of which define fields in buffers)
*
******************************************************************************/
@@ -69,10 +68,10 @@ acpi_ds_create_buffer_field (
u32 flags;
- ACPI_FUNCTION_TRACE ("Ds_create_buffer_field");
+ ACPI_FUNCTION_TRACE ("ds_create_buffer_field");
- /* Get the Name_string argument */
+ /* Get the name_string argument */
if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
arg = acpi_ps_get_arg (op, 3);
@@ -100,7 +99,7 @@ acpi_ds_create_buffer_field (
}
/*
- * Enter the Name_string into the namespace
+ * Enter the name_string into the namespace
*/
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
@@ -168,10 +167,10 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_get_field_names
+ * FUNCTION: acpi_ds_get_field_names
*
- * PARAMETERS: Info - Create_field info structure
- * ` Walk_state - Current method state
+ * PARAMETERS: Info - create_field info structure
+ * ` walk_state - Current method state
* Arg - First parser arg for the field name list
*
* RETURN: Status
@@ -183,7 +182,7 @@ cleanup:
acpi_status
acpi_ds_get_field_names (
- ACPI_CREATE_FIELD_INFO *info,
+ acpi_create_field_info *info,
acpi_walk_state *walk_state,
acpi_parse_object *arg)
{
@@ -191,7 +190,7 @@ acpi_ds_get_field_names (
acpi_integer position;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_field_names", info);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_field_names", info);
/* First field starts at bit zero */
@@ -204,7 +203,7 @@ acpi_ds_get_field_names (
/*
* Three types of field elements are handled:
* 1) Offset - specifies a bit offset
- * 2) Access_as - changes the access mode
+ * 2) access_as - changes the access mode
* 3) Name - Enters a new named field into the namespace
*/
switch (arg->common.aml_opcode) {
@@ -225,10 +224,10 @@ acpi_ds_get_field_names (
case AML_INT_ACCESSFIELD_OP:
/*
- * Get a new Access_type and Access_attribute -- to be used for all
- * field units that follow, until field end or another Access_as keyword.
+ * Get a new access_type and access_attribute -- to be used for all
+ * field units that follow, until field end or another access_as keyword.
*
- * In Field_flags, preserve the flag bits other than the ACCESS_TYPE bits
+ * In field_flags, preserve the flag bits other than the ACCESS_TYPE bits
*/
info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
((u8) (arg->common.value.integer32 >> 8)));
@@ -296,11 +295,11 @@ acpi_ds_get_field_names (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_field
+ * FUNCTION: acpi_ds_create_field
*
* PARAMETERS: Op - Op containing the Field definition and args
- * Region_node - Object for the containing Operation Region
- * ` Walk_state - Current method state
+ * region_node - Object for the containing Operation Region
+ * ` walk_state - Current method state
*
* RETURN: Status
*
@@ -316,13 +315,13 @@ acpi_ds_create_field (
{
acpi_status status;
acpi_parse_object *arg;
- ACPI_CREATE_FIELD_INFO info;
+ acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_field", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_field", op);
- /* First arg is the name of the parent Op_region (must already exist) */
+ /* First arg is the name of the parent op_region (must already exist) */
arg = op->common.value.arg;
if (!region_node) {
@@ -354,10 +353,10 @@ acpi_ds_create_field (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_init_field_objects
+ * FUNCTION: acpi_ds_init_field_objects
*
* PARAMETERS: Op - Op containing the Field definition and args
- * ` Walk_state - Current method state
+ * ` walk_state - Current method state
*
* RETURN: Status
*
@@ -378,7 +377,7 @@ acpi_ds_init_field_objects (
u8 type = 0;
- ACPI_FUNCTION_TRACE_PTR ("Ds_init_field_objects", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_init_field_objects", op);
switch (walk_state->opcode) {
@@ -402,7 +401,7 @@ acpi_ds_init_field_objects (
}
/*
- * Walk the list of entries in the Field_list
+ * Walk the list of entries in the field_list
*/
while (arg) {
/* Ignore OFFSET and ACCESSAS terms here */
@@ -438,11 +437,11 @@ acpi_ds_init_field_objects (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_bank_field
+ * FUNCTION: acpi_ds_create_bank_field
*
* PARAMETERS: Op - Op containing the Field definition and args
- * Region_node - Object for the containing Operation Region
- * ` Walk_state - Current method state
+ * region_node - Object for the containing Operation Region
+ * ` walk_state - Current method state
*
* RETURN: Status
*
@@ -458,13 +457,13 @@ acpi_ds_create_bank_field (
{
acpi_status status;
acpi_parse_object *arg;
- ACPI_CREATE_FIELD_INFO info;
+ acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_bank_field", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_bank_field", op);
- /* First arg is the name of the parent Op_region (must already exist) */
+ /* First arg is the name of the parent op_region (must already exist) */
arg = op->common.value.arg;
if (!region_node) {
@@ -488,7 +487,7 @@ acpi_ds_create_bank_field (
return_ACPI_STATUS (status);
}
- /* Third arg is the Bank_value */
+ /* Third arg is the bank_value */
arg = arg->common.next;
info.bank_value = arg->common.value.integer32;
@@ -511,11 +510,11 @@ acpi_ds_create_bank_field (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_index_field
+ * FUNCTION: acpi_ds_create_index_field
*
* PARAMETERS: Op - Op containing the Field definition and args
- * Region_node - Object for the containing Operation Region
- * ` Walk_state - Current method state
+ * region_node - Object for the containing Operation Region
+ * ` walk_state - Current method state
*
* RETURN: Status
*
@@ -531,10 +530,10 @@ acpi_ds_create_index_field (
{
acpi_status status;
acpi_parse_object *arg;
- ACPI_CREATE_FIELD_INFO info;
+ acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_index_field", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_index_field", op);
/* First arg is the name of the Index register (must already exist) */
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index aa193a11cbee..a4f58db346c2 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dsinit - Object initialization namespace walk
- * $Revision: 4 $
*
*****************************************************************************/
@@ -37,16 +36,16 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_init_one_object
+ * FUNCTION: acpi_ds_init_one_object
*
- * PARAMETERS: Obj_handle - Node
+ * PARAMETERS: obj_handle - Node
* Level - Current nesting level
* Context - Points to a init info struct
- * Return_value - Not used
+ * return_value - Not used
*
* RETURN: Status
*
- * DESCRIPTION: Callback from Acpi_walk_namespace. Invoked for every object
+ * DESCRIPTION: Callback from acpi_walk_namespace. Invoked for every object
* within the namespace.
*
* Currently, the only objects that require initialization are:
@@ -67,7 +66,7 @@ acpi_ds_init_one_object (
acpi_init_walk_info *info = (acpi_init_walk_info *) context;
- ACPI_FUNCTION_NAME ("Ds_init_one_object");
+ ACPI_FUNCTION_NAME ("ds_init_one_object");
/*
@@ -163,14 +162,14 @@ acpi_ds_init_one_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_initialize_objects
+ * FUNCTION: acpi_ds_initialize_objects
*
- * PARAMETERS: Table_desc - Descriptor for parent ACPI table
- * Start_node - Root of subtree to be initialized.
+ * PARAMETERS: table_desc - Descriptor for parent ACPI table
+ * start_node - Root of subtree to be initialized.
*
* RETURN: Status
*
- * DESCRIPTION: Walk the namespace starting at "Start_node" and perform any
+ * DESCRIPTION: Walk the namespace starting at "start_node" and perform any
* necessary initialization on the objects found therein
*
******************************************************************************/
@@ -184,7 +183,7 @@ acpi_ds_initialize_objects (
acpi_init_walk_info info;
- ACPI_FUNCTION_TRACE ("Ds_initialize_objects");
+ ACPI_FUNCTION_TRACE ("ds_initialize_objects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@@ -202,7 +201,7 @@ acpi_ds_initialize_objects (
status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
acpi_ds_init_one_object, &info, NULL);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed, %s\n",
acpi_format_exception (status)));
}
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 846e53630ef1..a4ae2fcd6b11 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
- * $Revision: 89 $
*
*****************************************************************************/
@@ -38,12 +37,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_parse_method
+ * FUNCTION: acpi_ds_parse_method
*
- * PARAMETERS: Obj_handle - Node of the method
+ * PARAMETERS: obj_handle - Node of the method
* Level - Current nesting level
* Context - Points to a method counter
- * Return_value - Not used
+ * return_value - Not used
*
* RETURN: Status
*
@@ -66,7 +65,7 @@ acpi_ds_parse_method (
acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle);
+ ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
/* Parameter Validation */
@@ -75,7 +74,7 @@ acpi_ds_parse_method (
return_ACPI_STATUS (AE_NULL_ENTRY);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** Named_obj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
((acpi_namespace_node *) obj_handle)->name.ascii, obj_handle));
/* Extract the method object from the method Node */
@@ -113,7 +112,7 @@ acpi_ds_parse_method (
op->common.node = node;
/*
- * Get a new Owner_id for objects created by this method. Namespace
+ * Get a new owner_id for objects created by this method. Namespace
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
@@ -150,7 +149,7 @@ acpi_ds_parse_method (
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
+ "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
((acpi_namespace_node *) obj_handle)->name.ascii, obj_handle, op));
acpi_ps_delete_parse_tree (op);
@@ -160,11 +159,11 @@ acpi_ds_parse_method (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_begin_method_execution
+ * FUNCTION: acpi_ds_begin_method_execution
*
- * PARAMETERS: Method_node - Node of the method
- * Obj_desc - The method object
- * Calling_method_node - Caller of this method (if non-null)
+ * PARAMETERS: method_node - Node of the method
+ * obj_desc - The method object
+ * calling_method_node - Caller of this method (if non-null)
*
* RETURN: Status
*
@@ -185,7 +184,7 @@ acpi_ds_begin_method_execution (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ds_begin_method_execution", method_node);
+ ACPI_FUNCTION_TRACE_PTR ("ds_begin_method_execution", method_node);
if (!method_node) {
@@ -199,7 +198,7 @@ acpi_ds_begin_method_execution (
if (obj_desc->method.semaphore) {
/*
* Allow recursive method calls, up to the reentrancy/concurrency
- * limit imposed by the SERIALIZED rule and the Sync_level method
+ * limit imposed by the SERIALIZED rule and the sync_level method
* parameter.
*
* The point of this code is to avoid permanently blocking a
@@ -230,9 +229,9 @@ acpi_ds_begin_method_execution (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_call_control_method
+ * FUNCTION: acpi_ds_call_control_method
*
- * PARAMETERS: Walk_state - Current state of the walk
+ * PARAMETERS: walk_state - Current state of the walk
* Op - Current Op to be walked
*
* RETURN: Status
@@ -243,7 +242,7 @@ acpi_ds_begin_method_execution (
acpi_status
acpi_ds_call_control_method (
- ACPI_THREAD_STATE *thread,
+ acpi_thread_state *thread,
acpi_walk_state *this_walk_state,
acpi_parse_object *op)
{
@@ -254,7 +253,7 @@ acpi_ds_call_control_method (
u32 i;
- ACPI_FUNCTION_TRACE_PTR ("Ds_call_control_method", this_walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_call_control_method", this_walk_state);
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Execute method %p, currentstate=%p\n",
this_walk_state->prev_op, this_walk_state));
@@ -364,9 +363,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_restart_control_method
+ * FUNCTION: acpi_ds_restart_control_method
*
- * PARAMETERS: Walk_state - State of the method when it was preempted
+ * PARAMETERS: walk_state - State of the method when it was preempted
* Op - Pointer to new current op
*
* RETURN: Status
@@ -383,7 +382,7 @@ acpi_ds_restart_control_method (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_restart_control_method", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_restart_control_method", walk_state);
if (return_desc) {
@@ -408,7 +407,7 @@ acpi_ds_restart_control_method (
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Method=%p Return=%p Return_used?=%X Res_stack=%p State=%p\n",
+ "Method=%p Return=%p return_used?=%X res_stack=%p State=%p\n",
walk_state->method_call_op, return_desc, walk_state->return_used,
walk_state->results, walk_state));
@@ -418,9 +417,9 @@ acpi_ds_restart_control_method (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_terminate_control_method
+ * FUNCTION: acpi_ds_terminate_control_method
*
- * PARAMETERS: Walk_state - State of the method
+ * PARAMETERS: walk_state - State of the method
*
* RETURN: Status
*
@@ -439,7 +438,7 @@ acpi_ds_terminate_control_method (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_terminate_control_method", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_terminate_control_method", walk_state);
if (!walk_state) {
diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
index 5e0f268903f3..ce568caea3b0 100644
--- a/drivers/acpi/dispatcher/dsmthdat.c
+++ b/drivers/acpi/dispatcher/dsmthdat.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
- * $Revision: 68 $
*
******************************************************************************/
@@ -37,22 +36,22 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_init
+ * FUNCTION: acpi_ds_method_data_init
*
- * PARAMETERS: Walk_state - Current walk state object
+ * PARAMETERS: walk_state - Current walk state object
*
* RETURN: Status
*
* DESCRIPTION: Initialize the data structures that hold the method's arguments
* and locals. The data struct is an array of NTEs for each.
- * This allows Ref_of and De_ref_of to work properly for these
+ * This allows ref_of and de_ref_of to work properly for these
* special data types.
*
- * NOTES: Walk_state fields are initialized to zero by the
+ * NOTES: walk_state fields are initialized to zero by the
* ACPI_MEM_CALLOCATE().
*
* A pseudo-Namespace Node is assigned to each argument and local
- * so that Ref_of() can return a pointer to the Node.
+ * so that ref_of() can return a pointer to the Node.
*
******************************************************************************/
@@ -63,7 +62,7 @@ acpi_ds_method_data_init (
u32 i;
- ACPI_FUNCTION_TRACE ("Ds_method_data_init");
+ ACPI_FUNCTION_TRACE ("ds_method_data_init");
/* Init the method arguments */
@@ -95,9 +94,9 @@ acpi_ds_method_data_init (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_delete_all
+ * FUNCTION: acpi_ds_method_data_delete_all
*
- * PARAMETERS: Walk_state - Current walk state object
+ * PARAMETERS: walk_state - Current walk state object
*
* RETURN: None
*
@@ -113,7 +112,7 @@ acpi_ds_method_data_delete_all (
u32 index;
- ACPI_FUNCTION_TRACE ("Ds_method_data_delete_all");
+ ACPI_FUNCTION_TRACE ("ds_method_data_delete_all");
/* Detach the locals */
@@ -148,17 +147,17 @@ acpi_ds_method_data_delete_all (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_init_args
+ * FUNCTION: acpi_ds_method_data_init_args
*
* PARAMETERS: *Params - Pointer to a parameter list for the method
- * Max_param_count - The arg count for this method
- * Walk_state - Current walk state object
+ * max_param_count - The arg count for this method
+ * walk_state - Current walk state object
*
* RETURN: Status
*
* DESCRIPTION: Initialize arguments for a method. The parameter list is a list
* of ACPI operand objects, either null terminated or whose length
- * is defined by Max_param_count.
+ * is defined by max_param_count.
*
******************************************************************************/
@@ -172,7 +171,7 @@ acpi_ds_method_data_init_args (
u32 index = 0;
- ACPI_FUNCTION_TRACE_PTR ("Ds_method_data_init_args", params);
+ ACPI_FUNCTION_TRACE_PTR ("ds_method_data_init_args", params);
if (!params) {
@@ -203,12 +202,12 @@ acpi_ds_method_data_init_args (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_get_node
+ * FUNCTION: acpi_ds_method_data_get_node
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument whose type
+ * Index - which local_var or argument whose type
* to get
- * Walk_state - Current walk state object
+ * walk_state - Current walk state object
*
* RETURN: Get the Node associated with a local or arg.
*
@@ -221,7 +220,7 @@ acpi_ds_method_data_get_node (
acpi_walk_state *walk_state,
acpi_namespace_node **node)
{
- ACPI_FUNCTION_TRACE ("Ds_method_data_get_node");
+ ACPI_FUNCTION_TRACE ("ds_method_data_get_node");
/*
@@ -265,12 +264,12 @@ acpi_ds_method_data_get_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_set_value
+ * FUNCTION: acpi_ds_method_data_set_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument to get
+ * Index - which local_var or argument to get
* Object - Object to be inserted into the stack entry
- * Walk_state - Current walk state object
+ * walk_state - Current walk state object
*
* RETURN: Status
*
@@ -291,7 +290,7 @@ acpi_ds_method_data_set_value (
acpi_operand_object *new_desc = object;
- ACPI_FUNCTION_TRACE ("Ds_method_data_set_value");
+ ACPI_FUNCTION_TRACE ("ds_method_data_set_value");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
@@ -335,12 +334,12 @@ acpi_ds_method_data_set_value (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_get_type
+ * FUNCTION: acpi_ds_method_data_get_type
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument whose type
+ * Index - which local_var or argument whose type
* to get
- * Walk_state - Current walk state object
+ * walk_state - Current walk state object
*
* RETURN: Data type of current value of the selected Arg or Local
*
@@ -357,7 +356,7 @@ acpi_ds_method_data_get_type (
acpi_operand_object *object;
- ACPI_FUNCTION_TRACE ("Ds_method_data_get_type");
+ ACPI_FUNCTION_TRACE ("ds_method_data_get_type");
/* Get the namespace node for the arg/local */
@@ -384,19 +383,19 @@ acpi_ds_method_data_get_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_get_value
+ * FUNCTION: acpi_ds_method_data_get_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument to get
- * Walk_state - Current walk state object
- * *Dest_desc - Ptr to Descriptor into which selected Arg
+ * Index - which local_var or argument to get
+ * walk_state - Current walk state object
+ * *dest_desc - Ptr to Descriptor into which selected Arg
* or Local value should be copied
*
* RETURN: Status
*
* DESCRIPTION: Retrieve value of selected Arg or Local from the method frame
* at the current top of the method stack.
- * Used only in Acpi_ex_resolve_to_value().
+ * Used only in acpi_ex_resolve_to_value().
*
******************************************************************************/
@@ -412,7 +411,7 @@ acpi_ds_method_data_get_value (
acpi_operand_object *object;
- ACPI_FUNCTION_TRACE ("Ds_method_data_get_value");
+ ACPI_FUNCTION_TRACE ("ds_method_data_get_value");
/* Validate the object descriptor */
@@ -476,11 +475,11 @@ acpi_ds_method_data_get_value (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_method_data_delete_value
+ * FUNCTION: acpi_ds_method_data_delete_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument to delete
- * Walk_state - Current walk state object
+ * Index - which local_var or argument to delete
+ * walk_state - Current walk state object
*
* RETURN: None
*
@@ -500,7 +499,7 @@ acpi_ds_method_data_delete_value (
acpi_operand_object *object;
- ACPI_FUNCTION_TRACE ("Ds_method_data_delete_value");
+ ACPI_FUNCTION_TRACE ("ds_method_data_delete_value");
/* Get the namespace node for the arg/local */
@@ -537,18 +536,18 @@ acpi_ds_method_data_delete_value (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_store_object_to_local
+ * FUNCTION: acpi_ds_store_object_to_local
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
- * Index - Which local_var or argument to set
- * Obj_desc - Value to be stored
- * Walk_state - Current walk state
+ * Index - which local_var or argument to set
+ * obj_desc - Value to be stored
+ * walk_state - Current walk state
*
* RETURN: Status
*
- * DESCRIPTION: Store a value in an Arg or Local. The Obj_desc is installed
+ * DESCRIPTION: Store a value in an Arg or Local. The obj_desc is installed
* as the new value for the Arg or Local and the reference count
- * for Obj_desc is incremented.
+ * for obj_desc is incremented.
*
******************************************************************************/
@@ -564,7 +563,7 @@ acpi_ds_store_object_to_local (
acpi_operand_object *current_obj_desc;
- ACPI_FUNCTION_TRACE ("Ds_store_object_to_local");
+ ACPI_FUNCTION_TRACE ("ds_store_object_to_local");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
opcode, index, obj_desc));
@@ -603,12 +602,12 @@ acpi_ds_store_object_to_local (
* locals, since a store to a local should overwrite
* anything there, including an object reference.
*
- * If both Arg0 and Local0 contain Ref_of (Local4):
+ * If both Arg0 and Local0 contain ref_of (Local4):
*
* Store (1, Arg0) - Causes indirect store to local4
* Store (1, Local0) - Stores 1 in local0, overwriting
* the reference to local4
- * Store (1, De_refof (Local0)) - Causes indirect store to local4
+ * Store (1, de_refof (Local0)) - Causes indirect store to local4
*
* Weird, but true.
*/
@@ -625,13 +624,13 @@ acpi_ds_store_object_to_local (
}
/*
- * If we have a valid reference object that came from Ref_of(), do the
+ * If we have a valid reference object that came from ref_of(), do the
* indirect store
*/
if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
(current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Arg (%p) is an Obj_ref(Node), storing in node %p\n",
+ "Arg (%p) is an obj_ref(Node), storing in node %p\n",
obj_desc, current_obj_desc));
/*
@@ -652,7 +651,7 @@ acpi_ds_store_object_to_local (
}
/*
- * Install the Obj_stack descriptor (*Obj_desc) into
+ * Install the obj_stack descriptor (*obj_desc) into
* the descriptor for the Arg or Local.
* Install the new object in the stack entry
* (increments the object reference count by one)
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 4472ad97c979..a7f20374dd1e 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dsobject - Dispatcher object management routines
- * $Revision: 112 $
*
*****************************************************************************/
@@ -38,11 +37,11 @@
#ifndef ACPI_NO_METHOD_EXECUTION
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_build_internal_object
+ * FUNCTION: acpi_ds_build_internal_object
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
* Op - Parser object to be translated
- * Obj_desc_ptr - Where the ACPI internal object is returned
+ * obj_desc_ptr - Where the ACPI internal object is returned
*
* RETURN: Status
*
@@ -61,7 +60,7 @@ acpi_ds_build_internal_object (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ds_build_internal_object");
+ ACPI_FUNCTION_TRACE ("ds_build_internal_object");
*obj_desc_ptr = NULL;
@@ -104,12 +103,12 @@ acpi_ds_build_internal_object (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_build_internal_buffer_obj
+ * FUNCTION: acpi_ds_build_internal_buffer_obj
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
* Op - Parser object to be translated
- * Buffer_length - Length of the buffer
- * Obj_desc_ptr - Where the ACPI internal object is returned
+ * buffer_length - Length of the buffer
+ * obj_desc_ptr - Where the ACPI internal object is returned
*
* RETURN: Status
*
@@ -131,7 +130,7 @@ acpi_ds_build_internal_buffer_obj (
u32 byte_list_length = 0;
- ACPI_FUNCTION_TRACE ("Ds_build_internal_buffer_obj");
+ ACPI_FUNCTION_TRACE ("ds_build_internal_buffer_obj");
obj_desc = *obj_desc_ptr;
@@ -152,9 +151,9 @@ acpi_ds_build_internal_buffer_obj (
}
/*
- * Second arg is the buffer data (optional) Byte_list can be either
+ * Second arg is the buffer data (optional) byte_list can be either
* individual bytes or a string initializer. In either case, a
- * Byte_list appears in the AML.
+ * byte_list appears in the AML.
*/
arg = op->common.value.arg; /* skip first arg */
@@ -196,7 +195,7 @@ acpi_ds_build_internal_buffer_obj (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- /* Initialize buffer from the Byte_list (if present) */
+ /* Initialize buffer from the byte_list (if present) */
if (byte_list) {
ACPI_MEMCPY (obj_desc->buffer.pointer, byte_list->named.data,
@@ -212,12 +211,12 @@ acpi_ds_build_internal_buffer_obj (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_build_internal_package_obj
+ * FUNCTION: acpi_ds_build_internal_package_obj
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
* Op - Parser object to be translated
- * Package_length - Number of elements in the package
- * Obj_desc_ptr - Where the ACPI internal object is returned
+ * package_length - Number of elements in the package
+ * obj_desc_ptr - Where the ACPI internal object is returned
*
* RETURN: Status
*
@@ -241,7 +240,7 @@ acpi_ds_build_internal_package_obj (
u32 i;
- ACPI_FUNCTION_TRACE ("Ds_build_internal_package_obj");
+ ACPI_FUNCTION_TRACE ("ds_build_internal_package_obj");
/* Find the parent of a possibly nested package */
@@ -295,7 +294,7 @@ acpi_ds_build_internal_package_obj (
* that the list is always null terminated.
*/
obj_desc->package.elements = ACPI_MEM_CALLOCATE (
- ((ACPI_SIZE) obj_desc->package.count + 1) * sizeof (void *));
+ ((acpi_size) obj_desc->package.count + 1) * sizeof (void *));
if (!obj_desc->package.elements) {
acpi_ut_delete_object_desc (obj_desc);
@@ -331,9 +330,9 @@ acpi_ds_build_internal_package_obj (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_create_node
+ * FUNCTION: acpi_ds_create_node
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
* Node - NS Node to be initialized
* Op - Parser object to be translated
*
@@ -353,7 +352,7 @@ acpi_ds_create_node (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_node", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_node", op);
/*
@@ -397,12 +396,12 @@ acpi_ds_create_node (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_init_object_from_op
+ * FUNCTION: acpi_ds_init_object_from_op
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
* Op - Parser op used to init the internal object
* Opcode - AML opcode associated with the object
- * Ret_obj_desc - Namespace object to be initialized
+ * ret_obj_desc - Namespace object to be initialized
*
* RETURN: Status
*
@@ -424,7 +423,7 @@ acpi_ds_init_object_from_op (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ds_init_object_from_op");
+ ACPI_FUNCTION_TRACE ("ds_init_object_from_op");
obj_desc = *ret_obj_desc;
@@ -441,7 +440,7 @@ acpi_ds_init_object_from_op (
case ACPI_TYPE_BUFFER:
/*
- * Defer evaluation of Buffer Term_arg operand
+ * Defer evaluation of Buffer term_arg operand
*/
obj_desc->buffer.node = (acpi_namespace_node *) walk_state->operands[0];
obj_desc->buffer.aml_start = op->named.data;
@@ -452,7 +451,7 @@ acpi_ds_init_object_from_op (
case ACPI_TYPE_PACKAGE:
/*
- * Defer evaluation of Package Term_arg operand
+ * Defer evaluation of Package term_arg operand
*/
obj_desc->package.node = (acpi_namespace_node *) walk_state->operands[0];
obj_desc->package.aml_start = op->named.data;
@@ -469,7 +468,7 @@ acpi_ds_init_object_from_op (
* All constants are integers.
* We mark the integer with a flag that indicates that it started life
* as a constant -- so that stores to constants will perform as expected (noop).
- * (Zero_op is used as a placeholder for optional target operands.)
+ * (zero_op is used as a placeholder for optional target operands.)
*/
obj_desc->common.flags = AOPOBJ_AML_CONSTANT;
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index c0d37989f361..fc173321e907 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -2,7 +2,6 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
- * $Revision: 84 $
*
*****************************************************************************/
@@ -39,11 +38,11 @@
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_execute_arguments
+ * FUNCTION: acpi_ds_execute_arguments
*
* PARAMETERS: Node - Parent NS node
- * Aml_length - Length of executable AML
- * Aml_start - Pointer to the AML
+ * aml_length - Length of executable AML
+ * aml_start - Pointer to the AML
*
* RETURN: Status.
*
@@ -64,7 +63,7 @@ acpi_ds_execute_arguments (
acpi_parse_object *arg;
- ACPI_FUNCTION_TRACE ("Acpi_ds_execute_arguments");
+ ACPI_FUNCTION_TRACE ("acpi_ds_execute_arguments");
/*
@@ -75,7 +74,7 @@ acpi_ds_execute_arguments (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- /* Save the Node for use in Acpi_ps_parse_aml */
+ /* Save the Node for use in acpi_ps_parse_aml */
op->common.node = scope_node;
@@ -141,13 +140,13 @@ acpi_ds_execute_arguments (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_get_buffer_field_arguments
+ * FUNCTION: acpi_ds_get_buffer_field_arguments
*
- * PARAMETERS: Obj_desc - A valid Buffer_field object
+ * PARAMETERS: obj_desc - A valid buffer_field object
*
* RETURN: Status.
*
- * DESCRIPTION: Get Buffer_field Buffer and Index. This implements the late
+ * DESCRIPTION: Get buffer_field Buffer and Index. This implements the late
* evaluation of these field attributes.
*
****************************************************************************/
@@ -161,23 +160,23 @@ acpi_ds_get_buffer_field_arguments (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_buffer_field_arguments", obj_desc);
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
return_ACPI_STATUS (AE_OK);
}
- /* Get the AML pointer (method object) and Buffer_field node */
+ /* Get the AML pointer (method object) and buffer_field node */
extra_desc = acpi_ns_get_secondary_object (obj_desc);
node = obj_desc->buffer_field.node;
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL));
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field JIT Init\n",
node->name.ascii));
- /* Execute the AML code for the Term_arg arguments */
+ /* Execute the AML code for the term_arg arguments */
status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node),
extra_desc->extra.aml_length, extra_desc->extra.aml_start);
@@ -187,9 +186,9 @@ acpi_ds_get_buffer_field_arguments (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_get_buffer_arguments
+ * FUNCTION: acpi_ds_get_buffer_arguments
*
- * PARAMETERS: Obj_desc - A valid Bufferobject
+ * PARAMETERS: obj_desc - A valid Bufferobject
*
* RETURN: Status.
*
@@ -206,7 +205,7 @@ acpi_ds_get_buffer_arguments (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_buffer_arguments", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_buffer_arguments", obj_desc);
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
@@ -224,7 +223,7 @@ acpi_ds_get_buffer_arguments (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n"));
- /* Execute the AML code for the Term_arg arguments */
+ /* Execute the AML code for the term_arg arguments */
status = acpi_ds_execute_arguments (node, node,
obj_desc->buffer.aml_length, obj_desc->buffer.aml_start);
@@ -234,9 +233,9 @@ acpi_ds_get_buffer_arguments (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_get_package_arguments
+ * FUNCTION: acpi_ds_get_package_arguments
*
- * PARAMETERS: Obj_desc - A valid Packageobject
+ * PARAMETERS: obj_desc - A valid Packageobject
*
* RETURN: Status.
*
@@ -253,7 +252,7 @@ acpi_ds_get_package_arguments (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_package_arguments", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_package_arguments", obj_desc);
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
@@ -271,7 +270,7 @@ acpi_ds_get_package_arguments (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n"));
- /* Execute the AML code for the Term_arg arguments */
+ /* Execute the AML code for the term_arg arguments */
status = acpi_ds_execute_arguments (node, node,
obj_desc->package.aml_length, obj_desc->package.aml_start);
@@ -281,9 +280,9 @@ acpi_ds_get_package_arguments (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_get_region_arguments
+ * FUNCTION: acpi_ds_get_region_arguments
*
- * PARAMETERS: Obj_desc - A valid region object
+ * PARAMETERS: obj_desc - A valid region object
*
* RETURN: Status.
*
@@ -301,7 +300,7 @@ acpi_ds_get_region_arguments (
acpi_operand_object *extra_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_region_arguments", obj_desc);
if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
@@ -319,7 +318,7 @@ acpi_ds_get_region_arguments (
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL));
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Init at AML %p\n",
node->name.ascii, extra_desc->extra.aml_start));
@@ -331,13 +330,13 @@ acpi_ds_get_region_arguments (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_initialize_region
+ * FUNCTION: acpi_ds_initialize_region
*
* PARAMETERS: Op - A valid region Op object
*
* RETURN: Status
*
- * DESCRIPTION: Front end to Ev_initialize_region
+ * DESCRIPTION: Front end to ev_initialize_region
*
****************************************************************************/
@@ -360,12 +359,12 @@ acpi_ds_initialize_region (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_init_buffer_field
+ * FUNCTION: acpi_ds_init_buffer_field
*
- * PARAMETERS: Aml_opcode - Create_xxx_field
- * Obj_desc - Buffer_field object
- * Buffer_desc - Host Buffer
- * Offset_desc - Offset into buffer
+ * PARAMETERS: aml_opcode - create_xxx_field
+ * obj_desc - buffer_field object
+ * buffer_desc - Host Buffer
+ * offset_desc - Offset into buffer
* Length - Length of field (CREATE_FIELD_OP only)
* Result - Where to store the result
*
@@ -391,7 +390,7 @@ acpi_ds_init_buffer_field (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_init_buffer_field", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ds_init_buffer_field", obj_desc);
/* Host object must be a Buffer */
@@ -406,9 +405,9 @@ acpi_ds_init_buffer_field (
}
/*
- * The last parameter to all of these opcodes (Result_desc) started
- * out as a Name_string, and should therefore now be a NS node
- * after resolution in Acpi_ex_resolve_operands().
+ * The last parameter to all of these opcodes (result_desc) started
+ * out as a name_string, and should therefore now be a NS node
+ * after resolution in acpi_ex_resolve_operands().
*/
if (ACPI_GET_DESCRIPTOR_TYPE (result_desc) != ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n",
@@ -501,7 +500,7 @@ acpi_ds_init_buffer_field (
/*
* Initialize areas of the field object that are common to all fields
- * For Field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
+ * For field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/
status = acpi_ex_prep_common_field_object (obj_desc, field_flags, 0,
bit_offset, bit_count);
@@ -511,7 +510,7 @@ acpi_ds_init_buffer_field (
obj_desc->buffer_field.buffer_obj = buffer_desc;
- /* Reference count for Buffer_desc inherits Obj_desc count */
+ /* Reference count for buffer_desc inherits obj_desc count */
buffer_desc->common.reference_count = (u16) (buffer_desc->common.reference_count +
obj_desc->common.reference_count);
@@ -534,7 +533,7 @@ cleanup:
acpi_ut_remove_reference (result_desc); /* Result descriptor */
}
else {
- /* Now the address and length are valid for this Buffer_field */
+ /* Now the address and length are valid for this buffer_field */
obj_desc->buffer_field.flags |= AOPOBJ_DATA_VALID;
}
@@ -545,15 +544,15 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_eval_buffer_field_operands
+ * FUNCTION: acpi_ds_eval_buffer_field_operands
*
- * PARAMETERS: Walk_state - Current walk
- * Op - A valid Buffer_field Op object
+ * PARAMETERS: walk_state - Current walk
+ * Op - A valid buffer_field Op object
*
* RETURN: Status
*
- * DESCRIPTION: Get Buffer_field Buffer and Index
- * Called from Acpi_ds_exec_end_op during Buffer_field parse tree walk
+ * DESCRIPTION: Get buffer_field Buffer and Index
+ * Called from acpi_ds_exec_end_op during buffer_field parse tree walk
*
****************************************************************************/
@@ -568,16 +567,16 @@ acpi_ds_eval_buffer_field_operands (
acpi_parse_object *next_op;
- ACPI_FUNCTION_TRACE_PTR ("Ds_eval_buffer_field_operands", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_eval_buffer_field_operands", op);
/*
* This is where we evaluate the address and length fields of the
- * Create_xxx_field declaration
+ * create_xxx_field declaration
*/
node = op->common.node;
- /* Next_op points to the op that holds the Buffer */
+ /* next_op points to the op that holds the Buffer */
next_op = op->common.value.arg;
@@ -600,7 +599,7 @@ acpi_ds_eval_buffer_field_operands (
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
acpi_ps_get_opcode_name (op->common.aml_opcode),
- walk_state->num_operands, "after Acpi_ex_resolve_operands");
+ walk_state->num_operands, "after acpi_ex_resolve_operands");
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n",
@@ -619,7 +618,7 @@ acpi_ds_eval_buffer_field_operands (
walk_state->operands[2], walk_state->operands[3]);
}
else {
- /* All other, Create_xxx_field opcodes */
+ /* All other, create_xxx_field opcodes */
status = acpi_ds_init_buffer_field (op->common.aml_opcode, obj_desc,
walk_state->operands[0], walk_state->operands[1],
@@ -632,15 +631,15 @@ acpi_ds_eval_buffer_field_operands (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_eval_region_operands
+ * FUNCTION: acpi_ds_eval_region_operands
*
- * PARAMETERS: Walk_state - Current walk
+ * PARAMETERS: walk_state - Current walk
* Op - A valid region Op object
*
* RETURN: Status
*
* DESCRIPTION: Get region address and length
- * Called from Acpi_ds_exec_end_op during Op_region parse tree walk
+ * Called from acpi_ds_exec_end_op during op_region parse tree walk
*
****************************************************************************/
@@ -656,19 +655,19 @@ acpi_ds_eval_region_operands (
acpi_parse_object *next_op;
- ACPI_FUNCTION_TRACE_PTR ("Ds_eval_region_operands", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_eval_region_operands", op);
/*
- * This is where we evaluate the address and length fields of the Op_region declaration
+ * This is where we evaluate the address and length fields of the op_region declaration
*/
node = op->common.node;
- /* Next_op points to the op that holds the Space_iD */
+ /* next_op points to the op that holds the space_iD */
next_op = op->common.value.arg;
- /* Next_op points to address op */
+ /* next_op points to address op */
next_op = next_op->common.next;
@@ -688,7 +687,7 @@ acpi_ds_eval_region_operands (
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
acpi_ps_get_opcode_name (op->common.aml_opcode),
- 1, "after Acpi_ex_resolve_operands");
+ 1, "after acpi_ex_resolve_operands");
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
@@ -710,10 +709,10 @@ acpi_ds_eval_region_operands (
*/
operand_desc = walk_state->operands[walk_state->num_operands - 2];
- obj_desc->region.address = (ACPI_PHYSICAL_ADDRESS) operand_desc->integer.value;
+ obj_desc->region.address = (acpi_physical_address) operand_desc->integer.value;
acpi_ut_remove_reference (operand_desc);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8X%8.8X Len %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "rgn_obj %p Addr %8.8X%8.8X Len %X\n",
obj_desc,
ACPI_HIDWORD (obj_desc->region.address), ACPI_LODWORD (obj_desc->region.address),
obj_desc->region.length));
@@ -728,11 +727,11 @@ acpi_ds_eval_region_operands (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_eval_data_object_operands
+ * FUNCTION: acpi_ds_eval_data_object_operands
*
- * PARAMETERS: Walk_state - Current walk
- * Op - A valid Data_object Op object
- * Obj_desc - Data_object
+ * PARAMETERS: walk_state - Current walk
+ * Op - A valid data_object Op object
+ * obj_desc - data_object
*
* RETURN: Status
*
@@ -753,7 +752,7 @@ acpi_ds_eval_data_object_operands (
u32 length;
- ACPI_FUNCTION_TRACE ("Ds_eval_data_object_operands");
+ ACPI_FUNCTION_TRACE ("ds_eval_data_object_operands");
/* The first operand (for all of these data objects) is the length */
@@ -805,7 +804,7 @@ acpi_ds_eval_data_object_operands (
if (ACPI_SUCCESS (status)) {
/*
- * Return the object in the Walk_state, unless the parent is a package --
+ * Return the object in the walk_state, unless the parent is a package --
* in this case, the return object will be stored in the parse tree
* for the package.
*/
@@ -823,9 +822,9 @@ acpi_ds_eval_data_object_operands (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_exec_begin_control_op
+ * FUNCTION: acpi_ds_exec_begin_control_op
*
- * PARAMETERS: Walk_list - The list that owns the walk stack
+ * PARAMETERS: walk_list - The list that owns the walk stack
* Op - The control Op
*
* RETURN: Status
@@ -844,7 +843,7 @@ acpi_ds_exec_begin_control_op (
acpi_generic_state *control_state;
- ACPI_FUNCTION_NAME ("Ds_exec_begin_control_op");
+ ACPI_FUNCTION_NAME ("ds_exec_begin_control_op");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", op,
@@ -903,9 +902,9 @@ acpi_ds_exec_begin_control_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_exec_end_control_op
+ * FUNCTION: acpi_ds_exec_end_control_op
*
- * PARAMETERS: Walk_list - The list that owns the walk stack
+ * PARAMETERS: walk_list - The list that owns the walk stack
* Op - The control Op
*
* RETURN: Status
@@ -924,7 +923,7 @@ acpi_ds_exec_end_control_op (
acpi_generic_state *control_state;
- ACPI_FUNCTION_NAME ("Ds_exec_end_control_op");
+ ACPI_FUNCTION_NAME ("ds_exec_end_control_op");
switch (op->common.aml_opcode) {
@@ -1004,7 +1003,7 @@ acpi_ds_exec_end_control_op (
/*
* Get the return value and save as the last result
- * value. This is the only place where Walk_state->Return_desc
+ * value. This is the only place where walk_state->return_desc
* is set to anything other than zero!
*/
walk_state->return_desc = walk_state->operands[0];
@@ -1045,7 +1044,7 @@ acpi_ds_exec_end_control_op (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Completed RETURN_OP State=%p, Ret_val=%p\n",
+ "Completed RETURN_OP State=%p, ret_val=%p\n",
walk_state, walk_state->return_desc));
/* End the control method execution right now */
@@ -1089,7 +1088,7 @@ acpi_ds_exec_end_control_op (
return (AE_AML_NO_WHILE);
}
- /* Was: Walk_state->Aml_last_while = Walk_state->Control_state->Control.Aml_predicate_start; */
+ /* Was: walk_state->aml_last_while = walk_state->control_state->Control.aml_predicate_start; */
walk_state->aml_last_while = walk_state->control_state->control.package_end;
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index c09c2267d40b..60887030c633 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
- * $Revision: 98 $
*
******************************************************************************/
@@ -39,11 +38,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_is_result_used
+ * FUNCTION: acpi_ds_is_result_used
*
* PARAMETERS: Op
- * Result_obj
- * Walk_state
+ * result_obj
+ * walk_state
*
* RETURN: Status
*
@@ -59,7 +58,7 @@ acpi_ds_is_result_used (
const acpi_opcode_info *parent_info;
- ACPI_FUNCTION_TRACE_PTR ("Ds_is_result_used", op);
+ ACPI_FUNCTION_TRACE_PTR ("ds_is_result_used", op);
/* Must have both an Op and a Result Object */
@@ -130,7 +129,7 @@ acpi_ds_is_result_used (
case AML_CLASS_CREATE:
/*
- * These opcodes allow Term_arg(s) as operands and therefore
+ * These opcodes allow term_arg(s) as operands and therefore
* the operands can be method calls. The result is used.
*/
goto result_used;
@@ -145,7 +144,7 @@ acpi_ds_is_result_used (
(op->common.parent->common.aml_opcode == AML_BUFFER_OP) ||
(op->common.parent->common.aml_opcode == AML_INT_EVAL_SUBTREE_OP)) {
/*
- * These opcodes allow Term_arg(s) as operands and therefore
+ * These opcodes allow term_arg(s) as operands and therefore
* the operands can be method calls. The result is used.
*/
goto result_used;
@@ -184,11 +183,11 @@ result_not_used:
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_delete_result_if_not_used
+ * FUNCTION: acpi_ds_delete_result_if_not_used
*
* PARAMETERS: Op
- * Result_obj
- * Walk_state
+ * result_obj
+ * walk_state
*
* RETURN: Status
*
@@ -209,7 +208,7 @@ acpi_ds_delete_result_if_not_used (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ds_delete_result_if_not_used", result_obj);
+ ACPI_FUNCTION_TRACE_PTR ("ds_delete_result_if_not_used", result_obj);
if (!op) {
@@ -224,7 +223,7 @@ acpi_ds_delete_result_if_not_used (
if (!acpi_ds_is_result_used (op, walk_state)) {
/*
- * Must pop the result stack (Obj_desc should be equal to Result_obj)
+ * Must pop the result stack (obj_desc should be equal to result_obj)
*/
status = acpi_ds_result_pop (&obj_desc, walk_state);
if (ACPI_SUCCESS (status)) {
@@ -238,9 +237,9 @@ acpi_ds_delete_result_if_not_used (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_resolve_operands
+ * FUNCTION: acpi_ds_resolve_operands
*
- * PARAMETERS: Walk_state - Current walk state with operands on stack
+ * PARAMETERS: walk_state - Current walk state with operands on stack
*
* RETURN: Status
*
@@ -258,7 +257,7 @@ acpi_ds_resolve_operands (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_resolve_operands", walk_state);
/*
@@ -278,9 +277,9 @@ acpi_ds_resolve_operands (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_clear_operands
+ * FUNCTION: acpi_ds_clear_operands
*
- * PARAMETERS: Walk_state - Current walk state with operands on stack
+ * PARAMETERS: walk_state - Current walk state with operands on stack
*
* RETURN: None
*
@@ -295,7 +294,7 @@ acpi_ds_clear_operands (
u32 i;
- ACPI_FUNCTION_TRACE_PTR ("Acpi_ds_clear_operands", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("acpi_ds_clear_operands", walk_state);
/*
@@ -318,9 +317,9 @@ acpi_ds_clear_operands (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_operand
+ * FUNCTION: acpi_ds_create_operand
*
- * PARAMETERS: Walk_state
+ * PARAMETERS: walk_state
* Arg
*
* RETURN: Status
@@ -348,7 +347,7 @@ acpi_ds_create_operand (
const acpi_opcode_info *op_info;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_operand", arg);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_operand", arg);
/* A valid name must be looked up in the namespace */
@@ -368,7 +367,7 @@ acpi_ds_create_operand (
/*
* All prefixes have been handled, and the name is
- * in Name_string
+ * in name_string
*/
/*
@@ -401,7 +400,7 @@ acpi_ds_create_operand (
ACPI_CAST_INDIRECT_PTR (acpi_namespace_node, &obj_desc));
/*
* The only case where we pass through (ignore) a NOT_FOUND
- * error is for the Cond_ref_of opcode.
+ * error is for the cond_ref_of opcode.
*/
if (status == AE_NOT_FOUND) {
if (parent_op->common.aml_opcode == AML_COND_REF_OF_OP) {
@@ -530,9 +529,9 @@ acpi_ds_create_operand (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_operands
+ * FUNCTION: acpi_ds_create_operands
*
- * PARAMETERS: First_arg - First argument of a parser argument tree
+ * PARAMETERS: first_arg - First argument of a parser argument tree
*
* RETURN: Status
*
@@ -552,7 +551,7 @@ acpi_ds_create_operands (
u32 arg_count = 0;
- ACPI_FUNCTION_TRACE_PTR ("Ds_create_operands", first_arg);
+ ACPI_FUNCTION_TRACE_PTR ("ds_create_operands", first_arg);
/* For all arguments in the list... */
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 93256aadac69..88f8dd7872d9 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -2,7 +2,6 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
- * $Revision: 97 $
*
*****************************************************************************/
@@ -55,9 +54,9 @@ static ACPI_EXECUTE_OP acpi_gbl_op_type_dispatch [] = {
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_get_predicate_value
+ * FUNCTION: acpi_ds_get_predicate_value
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
*
* RETURN: Status
*
@@ -73,7 +72,7 @@ acpi_ds_get_predicate_value (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ds_get_predicate_value", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_get_predicate_value", walk_state);
walk_state->control_state->common.state = 0;
@@ -103,7 +102,7 @@ acpi_ds_get_predicate_value (
}
if (!obj_desc) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate Obj_desc=%p State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate obj_desc=%p State=%p\n",
obj_desc, walk_state));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
@@ -115,7 +114,7 @@ acpi_ds_get_predicate_value (
*/
if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_INTEGER) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Bad predicate (not a number) Obj_desc=%p State=%p Type=%X\n",
+ "Bad predicate (not a number) obj_desc=%p State=%p Type=%X\n",
obj_desc, walk_state, ACPI_GET_OBJECT_TYPE (obj_desc)));
status = AE_AML_OPERAND_TYPE;
@@ -165,10 +164,10 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_exec_begin_op
+ * FUNCTION: acpi_ds_exec_begin_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
- * Out_op - Return op if a new one is created
+ * PARAMETERS: walk_state - Current state of the parse tree walk
+ * out_op - Return op if a new one is created
*
* RETURN: Status
*
@@ -188,7 +187,7 @@ acpi_ds_exec_begin_op (
u32 opcode_class;
- ACPI_FUNCTION_TRACE_PTR ("Ds_exec_begin_op", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_exec_begin_op", walk_state);
op = walk_state->op;
@@ -305,9 +304,9 @@ acpi_ds_exec_begin_op (
/*****************************************************************************
*
- * FUNCTION: Acpi_ds_exec_end_op
+ * FUNCTION: acpi_ds_exec_end_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
* Op - Op that has been just been completed in the
* walk; Arguments have now been evaluated.
*
@@ -331,7 +330,7 @@ acpi_ds_exec_end_op (
acpi_parse_object *first_arg;
- ACPI_FUNCTION_TRACE_PTR ("Ds_exec_end_op", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_exec_end_op", walk_state);
op = walk_state->op;
@@ -387,7 +386,7 @@ acpi_ds_exec_end_op (
if (ACPI_SUCCESS (status)) {
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
acpi_ps_get_opcode_name (walk_state->opcode),
- walk_state->num_operands, "after Ex_resolve_operands");
+ walk_state->num_operands, "after ex_resolve_operands");
/*
* Dispatch the request to the appropriate interpreter handler
@@ -424,7 +423,7 @@ acpi_ds_exec_end_op (
switch (op_type) {
case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
- /* 1 Operand, 0 External_result, 0 Internal_result */
+ /* 1 Operand, 0 external_result, 0 internal_result */
status = acpi_ds_exec_end_control_op (walk_state, op);
if (ACPI_FAILURE (status)) {
@@ -443,11 +442,11 @@ acpi_ds_exec_end_op (
* (AML_METHODCALL) Op->Value->Arg->Node contains
* the method Node pointer
*/
- /* Next_op points to the op that holds the method name */
+ /* next_op points to the op that holds the method name */
next_op = first_arg;
- /* Next_op points to first argument op */
+ /* next_op points to first argument op */
next_op = next_op->common.next;
@@ -488,7 +487,7 @@ acpi_ds_exec_end_op (
case AML_TYPE_CREATE_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing Create_field Buffer/Index Op=%p\n", op));
+ "Executing create_field Buffer/Index Op=%p\n", op));
status = acpi_ds_load2_end_op (walk_state);
if (ACPI_FAILURE (status)) {
@@ -502,7 +501,7 @@ acpi_ds_exec_end_op (
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing Create_object (Buffer/Package) Op=%p\n", op));
+ "Executing create_object (Buffer/Package) Op=%p\n", op));
switch (op->common.parent->common.aml_opcode) {
case AML_NAME_OP:
@@ -557,7 +556,7 @@ acpi_ds_exec_end_op (
if (op->common.aml_opcode == AML_REGION_OP) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing Op_region Address/Length Op=%p\n", op));
+ "Executing op_region Address/Length Op=%p\n", op));
status = acpi_ds_eval_region_operands (walk_state, op);
if (ACPI_FAILURE (status)) {
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index 6aa9351ca68d..4a02205cafa9 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
- * $Revision: 82 $
*
*****************************************************************************/
@@ -39,10 +38,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_init_callbacks
+ * FUNCTION: acpi_ds_init_callbacks
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
- * Pass_number - 1, 2, or 3
+ * PARAMETERS: walk_state - Current state of the parse tree walk
+ * pass_number - 1, 2, or 3
*
* RETURN: Status
*
@@ -87,9 +86,9 @@ acpi_ds_init_callbacks (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_load1_begin_op
+ * FUNCTION: acpi_ds_load1_begin_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
* Op - Op that has been just been reached in the
* walk; Arguments have not been evaluated yet.
*
@@ -112,7 +111,7 @@ acpi_ds_load1_begin_op (
u32 flags;
- ACPI_FUNCTION_NAME ("Ds_load1_begin_op");
+ ACPI_FUNCTION_NAME ("ds_load1_begin_op");
op = walk_state->op;
@@ -226,8 +225,8 @@ acpi_ds_load1_begin_op (
* already exists:
* 1) the Scope() operator can reopen a scoping object that was
* previously defined (Scope, Method, Device, etc.)
- * 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
- * Buffer_field, or Package), the name of the object is already
+ * 2) Whenever we are parsing a deferred opcode (op_region, Buffer,
+ * buffer_field, or Package), the name of the object is already
* in the namespace.
*/
flags = ACPI_NS_NO_UPSEARCH;
@@ -289,9 +288,9 @@ acpi_ds_load1_begin_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_load1_end_op
+ * FUNCTION: acpi_ds_load1_end_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
* Op - Op that has been just been completed in the
* walk; Arguments have now been evaluated.
*
@@ -311,7 +310,7 @@ acpi_ds_load1_end_op (
acpi_status status = AE_OK;
- ACPI_FUNCTION_NAME ("Ds_load1_end_op");
+ ACPI_FUNCTION_NAME ("ds_load1_end_op");
op = walk_state->op;
@@ -340,7 +339,7 @@ acpi_ds_load1_end_op (
if (op->common.aml_opcode == AML_REGION_OP) {
status = acpi_ex_create_region (op->named.data, op->named.length,
- (ACPI_ADR_SPACE_TYPE) ((op->common.value.arg)->common.value.integer), walk_state);
+ (acpi_adr_space_type) ((op->common.value.arg)->common.value.integer), walk_state);
if (ACPI_FAILURE (status)) {
return (status);
}
@@ -358,7 +357,7 @@ acpi_ds_load1_end_op (
if (op->common.aml_opcode == AML_METHOD_OP) {
/*
- * Method_op Pkg_length Name_string Method_flags Term_list
+ * method_op pkg_length name_string method_flags term_list
*
* Note: We must create the method node/object pair as soon as we
* see the method declaration. This allows later pass1 parsing
@@ -366,7 +365,7 @@ acpi_ds_load1_end_op (
* arguments.)
*/
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "LOADING-Method: State=%p Op=%p Named_obj=%p\n",
+ "LOADING-Method: State=%p Op=%p named_obj=%p\n",
walk_state, op, op->named.node));
if (!acpi_ns_get_attached_object (op->named.node)) {
@@ -402,9 +401,9 @@ acpi_ds_load1_end_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_load2_begin_op
+ * FUNCTION: acpi_ds_load2_begin_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
* Op - Op that has been just been reached in the
* walk; Arguments have not been evaluated yet.
*
@@ -426,7 +425,7 @@ acpi_ds_load2_begin_op (
char *buffer_ptr;
- ACPI_FUNCTION_TRACE ("Ds_load2_begin_op");
+ ACPI_FUNCTION_TRACE ("ds_load2_begin_op");
op = walk_state->op;
@@ -485,7 +484,7 @@ acpi_ds_load2_begin_op (
case AML_INT_NAMEPATH_OP:
/*
- * The Name_path is an object reference to an existing object. Don't enter the
+ * The name_path is an object reference to an existing object. Don't enter the
* name into the namespace, but look it up for use later
*/
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
@@ -613,9 +612,9 @@ acpi_ds_load2_begin_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_load2_end_op
+ * FUNCTION: acpi_ds_load2_end_op
*
- * PARAMETERS: Walk_state - Current state of the parse tree walk
+ * PARAMETERS: walk_state - Current state of the parse tree walk
* Op - Op that has been just been completed in the
* walk; Arguments have now been evaluated.
*
@@ -641,7 +640,7 @@ acpi_ds_load2_end_op (
#endif
- ACPI_FUNCTION_TRACE ("Ds_load2_end_op");
+ ACPI_FUNCTION_TRACE ("ds_load2_end_op");
op = walk_state->op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
@@ -715,7 +714,7 @@ acpi_ds_load2_end_op (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Create-Load [%s] State=%p Op=%p Named_obj=%p\n",
+ "Create-Load [%s] State=%p Op=%p named_obj=%p\n",
acpi_ps_get_opcode_name (op->common.aml_opcode), walk_state, op, node));
/* Decode the opcode */
@@ -822,7 +821,7 @@ acpi_ds_load2_end_op (
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP:
/*
- * The Op_region is not fully parsed at this time. Only valid argument is the Space_id.
+ * The op_region is not fully parsed at this time. Only valid argument is the space_id.
* (We must save the address of the AML of the address and length operands)
*/
/*
@@ -867,7 +866,7 @@ acpi_ds_load2_end_op (
case AML_CLASS_METHOD_CALL:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "RESOLVING-Method_call: State=%p Op=%p Named_obj=%p\n",
+ "RESOLVING-method_call: State=%p Op=%p named_obj=%p\n",
walk_state, op, node));
/*
diff --git a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c
index ca139652cb55..4173171fdfa9 100644
--- a/drivers/acpi/dispatcher/dswscope.c
+++ b/drivers/acpi/dispatcher/dswscope.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dswscope - Scope stack manipulation
- * $Revision: 56 $
*
*****************************************************************************/
@@ -37,7 +36,7 @@
/****************************************************************************
*
- * FUNCTION: Acpi_ds_scope_stack_clear
+ * FUNCTION: acpi_ds_scope_stack_clear
*
* PARAMETERS: None
*
@@ -52,7 +51,7 @@ acpi_ds_scope_stack_clear (
{
acpi_generic_state *scope_info;
- ACPI_FUNCTION_NAME ("Ds_scope_stack_clear");
+ ACPI_FUNCTION_NAME ("ds_scope_stack_clear");
while (walk_state->scope_info) {
@@ -70,7 +69,7 @@ acpi_ds_scope_stack_clear (
/****************************************************************************
*
- * FUNCTION: Acpi_ds_scope_stack_push
+ * FUNCTION: acpi_ds_scope_stack_push
*
* PARAMETERS: *Node, - Name to be made current
* Type, - Type of frame being pushed
@@ -90,20 +89,20 @@ acpi_ds_scope_stack_push (
acpi_generic_state *old_scope_info;
- ACPI_FUNCTION_TRACE ("Ds_scope_stack_push");
+ ACPI_FUNCTION_TRACE ("ds_scope_stack_push");
if (!node) {
/* Invalid scope */
- ACPI_REPORT_ERROR (("Ds_scope_stack_push: null scope passed\n"));
+ ACPI_REPORT_ERROR (("ds_scope_stack_push: null scope passed\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Make sure object type is valid */
if (!acpi_ut_valid_object_type (type)) {
- ACPI_REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n"));
+ ACPI_REPORT_WARNING (("ds_scope_stack_push: type code out of range\n"));
}
@@ -152,7 +151,7 @@ acpi_ds_scope_stack_push (
/****************************************************************************
*
- * FUNCTION: Acpi_ds_scope_stack_pop
+ * FUNCTION: acpi_ds_scope_stack_pop
*
* PARAMETERS: Type - The type of frame to be found
*
@@ -175,7 +174,7 @@ acpi_ds_scope_stack_pop (
acpi_generic_state *new_scope_info;
- ACPI_FUNCTION_TRACE ("Ds_scope_stack_pop");
+ ACPI_FUNCTION_TRACE ("ds_scope_stack_pop");
/*
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index e394161a9633..805b1b45c5b3 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
- * $Revision: 73 $
*
*****************************************************************************/
@@ -35,10 +34,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_insert
+ * FUNCTION: acpi_ds_result_insert
*
* PARAMETERS: Object - Object to push
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -55,7 +54,7 @@ acpi_ds_result_insert (
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_insert");
+ ACPI_FUNCTION_NAME ("ds_result_insert");
state = walk_state->results;
@@ -93,10 +92,10 @@ acpi_ds_result_insert (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_remove
+ * FUNCTION: acpi_ds_result_remove
*
* PARAMETERS: Object - Where to return the popped object
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -114,7 +113,7 @@ acpi_ds_result_remove (
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_remove");
+ ACPI_FUNCTION_NAME ("ds_result_remove");
state = walk_state->results;
@@ -157,10 +156,10 @@ acpi_ds_result_remove (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_pop
+ * FUNCTION: acpi_ds_result_pop
*
* PARAMETERS: Object - Where to return the popped object
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -174,11 +173,11 @@ acpi_ds_result_pop (
acpi_operand_object **object,
acpi_walk_state *walk_state)
{
- NATIVE_UINT index;
+ acpi_native_uint index;
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_pop");
+ ACPI_FUNCTION_NAME ("ds_result_pop");
state = walk_state->results;
@@ -217,10 +216,10 @@ acpi_ds_result_pop (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_pop_from_bottom
+ * FUNCTION: acpi_ds_result_pop_from_bottom
*
* PARAMETERS: Object - Where to return the popped object
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -234,11 +233,11 @@ acpi_ds_result_pop_from_bottom (
acpi_operand_object **object,
acpi_walk_state *walk_state)
{
- NATIVE_UINT index;
+ acpi_native_uint index;
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_pop_from_bottom");
+ ACPI_FUNCTION_NAME ("ds_result_pop_from_bottom");
state = walk_state->results;
@@ -284,10 +283,10 @@ acpi_ds_result_pop_from_bottom (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_push
+ * FUNCTION: acpi_ds_result_push
*
* PARAMETERS: Object - Where to return the popped object
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -303,7 +302,7 @@ acpi_ds_result_push (
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_push");
+ ACPI_FUNCTION_NAME ("ds_result_push");
state = walk_state->results;
@@ -338,14 +337,14 @@ acpi_ds_result_push (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_stack_push
+ * FUNCTION: acpi_ds_result_stack_push
*
* PARAMETERS: Object - Object to push
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
- * DESCRIPTION: Push an object onto the Walk_state result stack.
+ * DESCRIPTION: Push an object onto the walk_state result stack.
*
******************************************************************************/
@@ -355,7 +354,7 @@ acpi_ds_result_stack_push (
{
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_stack_push");
+ ACPI_FUNCTION_NAME ("ds_result_stack_push");
state = acpi_ut_create_generic_state ();
@@ -375,13 +374,13 @@ acpi_ds_result_stack_push (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_result_stack_pop
+ * FUNCTION: acpi_ds_result_stack_pop
*
- * PARAMETERS: Walk_state - Current Walk state
+ * PARAMETERS: walk_state - Current Walk state
*
* RETURN: Status
*
- * DESCRIPTION: Pop an object off of the Walk_state result stack.
+ * DESCRIPTION: Pop an object off of the walk_state result stack.
*
******************************************************************************/
@@ -391,7 +390,7 @@ acpi_ds_result_stack_pop (
{
acpi_generic_state *state;
- ACPI_FUNCTION_NAME ("Ds_result_stack_pop");
+ ACPI_FUNCTION_NAME ("ds_result_stack_pop");
/* Check for stack underflow */
@@ -406,7 +405,7 @@ acpi_ds_result_stack_pop (
state = acpi_ut_pop_generic_state (&walk_state->results);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Result=%p Remaining_results=%X State=%p\n",
+ "Result=%p remaining_results=%X State=%p\n",
state, state->results.num_results, walk_state));
acpi_ut_delete_generic_state (state);
@@ -417,9 +416,9 @@ acpi_ds_result_stack_pop (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_delete_all
+ * FUNCTION: acpi_ds_obj_stack_delete_all
*
- * PARAMETERS: Walk_state - Current Walk state
+ * PARAMETERS: walk_state - Current Walk state
*
* RETURN: Status
*
@@ -435,7 +434,7 @@ acpi_ds_obj_stack_delete_all (
u32 i;
- ACPI_FUNCTION_TRACE_PTR ("Ds_obj_stack_delete_all", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_obj_stack_delete_all", walk_state);
/* The stack size is configurable, but fixed */
@@ -453,10 +452,10 @@ acpi_ds_obj_stack_delete_all (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_push
+ * FUNCTION: acpi_ds_obj_stack_push
*
* PARAMETERS: Object - Object to push
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -469,7 +468,7 @@ acpi_ds_obj_stack_push (
void *object,
acpi_walk_state *walk_state)
{
- ACPI_FUNCTION_NAME ("Ds_obj_stack_push");
+ ACPI_FUNCTION_NAME ("ds_obj_stack_push");
/* Check for stack overflow */
@@ -497,10 +496,10 @@ acpi_ds_obj_stack_push (
#if 0
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_pop_object
+ * FUNCTION: acpi_ds_obj_stack_pop_object
*
- * PARAMETERS: Pop_count - Number of objects/entries to pop
- * Walk_state - Current Walk state
+ * PARAMETERS: pop_count - Number of objects/entries to pop
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -514,7 +513,7 @@ acpi_ds_obj_stack_pop_object (
acpi_operand_object **object,
acpi_walk_state *walk_state)
{
- ACPI_FUNCTION_NAME ("Ds_obj_stack_pop_object");
+ ACPI_FUNCTION_NAME ("ds_obj_stack_pop_object");
/* Check for stack underflow */
@@ -556,10 +555,10 @@ acpi_ds_obj_stack_pop_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_pop
+ * FUNCTION: acpi_ds_obj_stack_pop
*
- * PARAMETERS: Pop_count - Number of objects/entries to pop
- * Walk_state - Current Walk state
+ * PARAMETERS: pop_count - Number of objects/entries to pop
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -575,7 +574,7 @@ acpi_ds_obj_stack_pop (
{
u32 i;
- ACPI_FUNCTION_NAME ("Ds_obj_stack_pop");
+ ACPI_FUNCTION_NAME ("ds_obj_stack_pop");
for (i = 0; i < pop_count; i++) {
@@ -603,10 +602,10 @@ acpi_ds_obj_stack_pop (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_pop_and_delete
+ * FUNCTION: acpi_ds_obj_stack_pop_and_delete
*
- * PARAMETERS: Pop_count - Number of objects/entries to pop
- * Walk_state - Current Walk state
+ * PARAMETERS: pop_count - Number of objects/entries to pop
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -623,7 +622,7 @@ acpi_ds_obj_stack_pop_and_delete (
u32 i;
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_NAME ("Ds_obj_stack_pop_and_delete");
+ ACPI_FUNCTION_NAME ("ds_obj_stack_pop_and_delete");
for (i = 0; i < pop_count; i++) {
@@ -655,11 +654,11 @@ acpi_ds_obj_stack_pop_and_delete (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_obj_stack_get_value
+ * FUNCTION: acpi_ds_obj_stack_get_value
*
* PARAMETERS: Index - Stack index whose value is desired. Based
* on the top of the stack (index=0 == top)
- * Walk_state - Current Walk state
+ * walk_state - Current Walk state
*
* RETURN: Status
*
@@ -674,7 +673,7 @@ acpi_ds_obj_stack_get_value (
acpi_walk_state *walk_state)
{
- ACPI_FUNCTION_TRACE_PTR ("Ds_obj_stack_get_value", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_obj_stack_get_value", walk_state);
/* Can't do it if the stack is empty */
@@ -689,14 +688,14 @@ acpi_ds_obj_stack_get_value (
return_PTR (NULL);
}
- return_PTR (walk_state->operands[(NATIVE_UINT)(walk_state->num_operands - 1) -
+ return_PTR (walk_state->operands[(acpi_native_uint)(walk_state->num_operands - 1) -
index]);
}
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_get_current_walk_state
+ * FUNCTION: acpi_ds_get_current_walk_state
*
* PARAMETERS: Thread - Get current active state for this Thread
*
@@ -709,17 +708,17 @@ acpi_ds_obj_stack_get_value (
acpi_walk_state *
acpi_ds_get_current_walk_state (
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
- ACPI_FUNCTION_NAME ("Ds_get_current_walk_state");
+ ACPI_FUNCTION_NAME ("ds_get_current_walk_state");
if (!thread) {
return (NULL);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Current Walk_state %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Current walk_state %p\n",
thread->walk_state_list));
return (thread->walk_state_list);
@@ -728,23 +727,23 @@ acpi_ds_get_current_walk_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_push_walk_state
+ * FUNCTION: acpi_ds_push_walk_state
*
- * PARAMETERS: Walk_state - State to push
- * Walk_list - The list that owns the walk stack
+ * PARAMETERS: walk_state - State to push
+ * walk_list - The list that owns the walk stack
*
* RETURN: None
*
- * DESCRIPTION: Place the Walk_state at the head of the state list.
+ * DESCRIPTION: Place the walk_state at the head of the state list.
*
******************************************************************************/
void
acpi_ds_push_walk_state (
acpi_walk_state *walk_state,
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
- ACPI_FUNCTION_TRACE ("Ds_push_walk_state");
+ ACPI_FUNCTION_TRACE ("ds_push_walk_state");
walk_state->next = thread->walk_state_list;
@@ -756,11 +755,11 @@ acpi_ds_push_walk_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_pop_walk_state
+ * FUNCTION: acpi_ds_pop_walk_state
*
- * PARAMETERS: Walk_list - The list that owns the walk stack
+ * PARAMETERS: walk_list - The list that owns the walk stack
*
- * RETURN: A Walk_state object popped from the stack
+ * RETURN: A walk_state object popped from the stack
*
* DESCRIPTION: Remove and return the walkstate object that is at the head of
* the walk stack for the given walk list. NULL indicates that
@@ -770,12 +769,12 @@ acpi_ds_push_walk_state (
acpi_walk_state *
acpi_ds_pop_walk_state (
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE ("Ds_pop_walk_state");
+ ACPI_FUNCTION_TRACE ("ds_pop_walk_state");
walk_state = thread->walk_state_list;
@@ -788,7 +787,7 @@ acpi_ds_pop_walk_state (
/*
* Don't clear the NEXT field, this serves as an indicator
* that there is a parent WALK STATE
- * NO: Walk_state->Next = NULL;
+ * NO: walk_state->Next = NULL;
*/
}
@@ -798,7 +797,7 @@ acpi_ds_pop_walk_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_create_walk_state
+ * FUNCTION: acpi_ds_create_walk_state
*
* PARAMETERS: Origin - Starting point for this walk
* Thread - Current thread state
@@ -815,13 +814,13 @@ acpi_ds_create_walk_state (
acpi_owner_id owner_id,
acpi_parse_object *origin,
acpi_operand_object *mth_desc,
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
acpi_walk_state *walk_state;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ds_create_walk_state");
+ ACPI_FUNCTION_TRACE ("ds_create_walk_state");
walk_state = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_WALK);
@@ -862,9 +861,9 @@ acpi_ds_create_walk_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_init_aml_walk
+ * FUNCTION: acpi_ds_init_aml_walk
*
- * PARAMETERS: Walk_state - New state to be initialized
+ * PARAMETERS: walk_state - New state to be initialized
*
* RETURN: None
*
@@ -888,7 +887,7 @@ acpi_ds_init_aml_walk (
acpi_parse_object *extra_op;
- ACPI_FUNCTION_TRACE ("Ds_init_aml_walk");
+ ACPI_FUNCTION_TRACE ("ds_init_aml_walk");
walk_state->parser_state.aml =
@@ -896,7 +895,7 @@ acpi_ds_init_aml_walk (
walk_state->parser_state.aml_end =
walk_state->parser_state.pkg_end = aml_start + aml_length;
- /* The Next_op of the Next_walk will be the beginning of the method */
+ /* The next_op of the next_walk will be the beginning of the method */
walk_state->next_op = NULL;
walk_state->params = params;
@@ -963,9 +962,9 @@ acpi_ds_init_aml_walk (
/*******************************************************************************
*
- * FUNCTION: Acpi_ds_delete_walk_state
+ * FUNCTION: acpi_ds_delete_walk_state
*
- * PARAMETERS: Walk_state - State to delete
+ * PARAMETERS: walk_state - State to delete
*
* RETURN: Status
*
@@ -980,7 +979,7 @@ acpi_ds_delete_walk_state (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE_PTR ("Ds_delete_walk_state", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ds_delete_walk_state", walk_state);
if (!walk_state) {
@@ -1030,7 +1029,7 @@ acpi_ds_delete_walk_state (
/******************************************************************************
*
- * FUNCTION: Acpi_ds_delete_walk_state_cache
+ * FUNCTION: acpi_ds_delete_walk_state_cache
*
* PARAMETERS: None
*
@@ -1045,7 +1044,7 @@ void
acpi_ds_delete_walk_state_cache (
void)
{
- ACPI_FUNCTION_TRACE ("Ds_delete_walk_state_cache");
+ ACPI_FUNCTION_TRACE ("ds_delete_walk_state_cache");
acpi_ut_delete_generic_cache (ACPI_MEM_LIST_WALK);
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 6d4ad3a954c1..9210841ad533 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -422,7 +422,7 @@ acpi_ec_space_setup (
static acpi_status
acpi_ec_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index 7bea78f28176..b62b3ef61f9b 100644
--- a/drivers/acpi/events/evevent.c
+++ b/drivers/acpi/events/evevent.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: evevent - Fixed Event handling and dispatch
- * $Revision: 104 $
*
*****************************************************************************/
@@ -25,7 +24,6 @@
#include "acpi.h"
#include "acevents.h"
-#include "acnamesp.h"
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evevent")
@@ -33,7 +31,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_initialize
+ * FUNCTION: acpi_ev_initialize
*
* PARAMETERS: None
*
@@ -50,7 +48,7 @@ acpi_ev_initialize (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_initialize");
+ ACPI_FUNCTION_TRACE ("ev_initialize");
/* Make sure we have ACPI tables */
@@ -61,7 +59,7 @@ acpi_ev_initialize (
}
/*
- * Initialize the Fixed and General Purpose Acpi_events prior. This is
+ * Initialize the Fixed and General Purpose acpi_events prior. This is
* done prior to enabling SCIs to prevent interrupts from occuring
* before handers are installed.
*/
@@ -87,7 +85,7 @@ acpi_ev_initialize (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_handler_initialize
+ * FUNCTION: acpi_ev_handler_initialize
*
* PARAMETERS: None
*
@@ -104,7 +102,7 @@ acpi_ev_handler_initialize (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_handler_initialize");
+ ACPI_FUNCTION_TRACE ("ev_handler_initialize");
/* Install the SCI handler */
@@ -144,7 +142,7 @@ acpi_ev_handler_initialize (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_fixed_event_initialize
+ * FUNCTION: acpi_ev_fixed_event_initialize
*
* PARAMETERS: None
*
@@ -158,7 +156,7 @@ acpi_status
acpi_ev_fixed_event_initialize (
void)
{
- NATIVE_UINT i;
+ acpi_native_uint i;
acpi_status status;
@@ -187,7 +185,7 @@ acpi_ev_fixed_event_initialize (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_fixed_event_detect
+ * FUNCTION: acpi_ev_fixed_event_detect
*
* PARAMETERS: None
*
@@ -204,10 +202,10 @@ acpi_ev_fixed_event_detect (
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
u32 fixed_status;
u32 fixed_enable;
- NATIVE_UINT_MAX32 i;
+ acpi_native_uint i;
- ACPI_FUNCTION_NAME ("Ev_fixed_event_detect");
+ ACPI_FUNCTION_NAME ("ev_fixed_event_detect");
/*
@@ -218,7 +216,7 @@ acpi_ev_fixed_event_detect (
(void) acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Fixed Acpi_event Block: Enable %08X Status %08X\n",
+ "Fixed acpi_event Block: Enable %08X Status %08X\n",
fixed_enable, fixed_status));
/*
@@ -231,7 +229,7 @@ acpi_ev_fixed_event_detect (
(fixed_enable & acpi_gbl_fixed_event_info[i].enable_bit_mask)) {
/* Found an active (signalled) event */
- int_status |= acpi_ev_fixed_event_dispatch (i);
+ int_status |= acpi_ev_fixed_event_dispatch ((u32) i);
}
}
@@ -241,7 +239,7 @@ acpi_ev_fixed_event_detect (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_fixed_event_dispatch
+ * FUNCTION: acpi_ev_fixed_event_dispatch
*
* PARAMETERS: Event - Event type
*
@@ -275,7 +273,7 @@ acpi_ev_fixed_event_dispatch (
0, ACPI_MTX_DO_NOT_LOCK);
ACPI_REPORT_ERROR (
- ("Ev_gpe_dispatch: No installed handler for fixed event [%08X]\n",
+ ("ev_gpe_dispatch: No installed handler for fixed event [%08X]\n",
event));
return (ACPI_INTERRUPT_NOT_HANDLED);
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index fb22b669e3cc..70cec76ef7c3 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: evgpe - General Purpose Event handling and dispatch
- * $Revision: 3 $
*
*****************************************************************************/
@@ -33,7 +32,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_gpe_initialize
+ * FUNCTION: acpi_ev_gpe_initialize
*
* PARAMETERS: None
*
@@ -46,17 +45,17 @@
acpi_status
acpi_ev_gpe_initialize (void)
{
- NATIVE_UINT_MAX32 i;
- NATIVE_UINT_MAX32 j;
+ acpi_native_uint i;
+ acpi_native_uint j;
u32 gpe_block;
u32 gpe_register;
u32 gpe_number_index;
u32 gpe_number;
- ACPI_GPE_REGISTER_INFO *gpe_register_info;
+ acpi_gpe_register_info *gpe_register_info;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_gpe_initialize");
+ ACPI_FUNCTION_TRACE ("ev_gpe_initialize");
/*
@@ -77,8 +76,8 @@ acpi_ev_gpe_initialize (void)
acpi_gbl_gpe_block_info[0].register_count = 0;
acpi_gbl_gpe_block_info[1].register_count = 0;
- acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->Xgpe0_blk;
- acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->Xgpe1_blk;
+ acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->xgpe0_blk;
+ acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->xgpe1_blk;
acpi_gbl_gpe_block_info[0].block_base_number = 0;
acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base;
@@ -92,17 +91,17 @@ acpi_ev_gpe_initialize (void)
* If EITHER the register length OR the block address are zero, then that
* particular block is not supported.
*/
- if (acpi_gbl_FADT->Xgpe0_blk.register_bit_width && acpi_gbl_FADT->Xgpe0_blk.address) {
+ if (acpi_gbl_FADT->xgpe0_blk.register_bit_width && acpi_gbl_FADT->xgpe0_blk.address) {
/* GPE block 0 exists (has both length and address > 0) */
- acpi_gbl_gpe_block_info[0].register_count = (u16) (acpi_gbl_FADT->Xgpe0_blk.register_bit_width / (ACPI_GPE_REGISTER_WIDTH * 2));
+ acpi_gbl_gpe_block_info[0].register_count = (u16) (acpi_gbl_FADT->xgpe0_blk.register_bit_width / (ACPI_GPE_REGISTER_WIDTH * 2));
acpi_gbl_gpe_number_max = (acpi_gbl_gpe_block_info[0].register_count * ACPI_GPE_REGISTER_WIDTH) - 1;
}
- if (acpi_gbl_FADT->Xgpe1_blk.register_bit_width && acpi_gbl_FADT->Xgpe1_blk.address) {
+ if (acpi_gbl_FADT->xgpe1_blk.register_bit_width && acpi_gbl_FADT->xgpe1_blk.address) {
/* GPE block 1 exists (has both length and address > 0) */
- acpi_gbl_gpe_block_info[1].register_count = (u16) (acpi_gbl_FADT->Xgpe1_blk.register_bit_width / (ACPI_GPE_REGISTER_WIDTH * 2));
+ acpi_gbl_gpe_block_info[1].register_count = (u16) (acpi_gbl_FADT->xgpe1_blk.register_bit_width / (ACPI_GPE_REGISTER_WIDTH * 2));
/* Check for GPE0/GPE1 overlap (if both banks exist) */
@@ -149,27 +148,27 @@ acpi_ev_gpe_initialize (void)
/* Allocate the GPE number-to-index translation table */
acpi_gbl_gpe_number_to_index = ACPI_MEM_CALLOCATE (
- sizeof (ACPI_GPE_INDEX_INFO) *
- ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
+ sizeof (acpi_gpe_index_info) *
+ ((acpi_size) acpi_gbl_gpe_number_max + 1));
if (!acpi_gbl_gpe_number_to_index) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Could not allocate the Gpe_number_to_index table\n"));
+ "Could not allocate the gpe_number_to_index table\n"));
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Set the Gpe index table to GPE_INVALID */
ACPI_MEMSET (acpi_gbl_gpe_number_to_index, (int) ACPI_GPE_INVALID,
- sizeof (ACPI_GPE_INDEX_INFO) * ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
+ sizeof (acpi_gpe_index_info) * ((acpi_size) acpi_gbl_gpe_number_max + 1));
/* Allocate the GPE register information block */
acpi_gbl_gpe_register_info = ACPI_MEM_CALLOCATE (
- (ACPI_SIZE) acpi_gbl_gpe_register_count *
- sizeof (ACPI_GPE_REGISTER_INFO));
+ (acpi_size) acpi_gbl_gpe_register_count *
+ sizeof (acpi_gpe_register_info));
if (!acpi_gbl_gpe_register_info) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Could not allocate the Gpe_register_info table\n"));
+ "Could not allocate the gpe_register_info table\n"));
goto error_exit1;
}
@@ -178,10 +177,10 @@ acpi_ev_gpe_initialize (void)
* per register. Initialization to zeros is sufficient.
*/
acpi_gbl_gpe_number_info = ACPI_MEM_CALLOCATE (
- (ACPI_SIZE) (acpi_gbl_gpe_register_count * ACPI_GPE_REGISTER_WIDTH) *
- sizeof (ACPI_GPE_NUMBER_INFO));
+ ((acpi_size) acpi_gbl_gpe_register_count * ACPI_GPE_REGISTER_WIDTH) *
+ sizeof (acpi_gpe_number_info));
if (!acpi_gbl_gpe_number_info) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the Gpe_number_info table\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the gpe_number_info table\n"));
goto error_exit2;
}
@@ -223,7 +222,7 @@ acpi_ev_gpe_initialize (void)
/* Init the Index mapping info for each GPE number within this register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
- gpe_number = gpe_register_info->base_gpe_number + j;
+ gpe_number = gpe_register_info->base_gpe_number + (u32) j;
acpi_gbl_gpe_number_to_index[gpe_number].number_index = (u8) gpe_number_index;
acpi_gbl_gpe_number_info[gpe_number_index].bit_mask = acpi_gbl_decode_to8bit[j];
@@ -280,13 +279,13 @@ error_exit1:
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_save_method_info
+ * FUNCTION: acpi_ev_save_method_info
*
* PARAMETERS: None
*
* RETURN: None
*
- * DESCRIPTION: Called from Acpi_walk_namespace. Expects each object to be a
+ * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
* control method under the _GPE portion of the namespace.
* Extract the name and GPE type from the object, saving this
* information for quick lookup during GPE dispatch
@@ -314,7 +313,7 @@ acpi_ev_save_method_info (
acpi_status status;
- ACPI_FUNCTION_NAME ("Ev_save_method_info");
+ ACPI_FUNCTION_NAME ("ev_save_method_info");
/* Extract the name from the object and convert to a string */
@@ -366,7 +365,7 @@ acpi_ev_save_method_info (
}
/*
- * Now we can add this information to the Gpe_info block
+ * Now we can add this information to the gpe_info block
* for use during dispatch of this GPE.
*/
acpi_gbl_gpe_number_info [gpe_number_index].type = type;
@@ -388,7 +387,7 @@ acpi_ev_save_method_info (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_init_gpe_control_methods
+ * FUNCTION: acpi_ev_init_gpe_control_methods
*
* PARAMETERS: None
*
@@ -405,7 +404,7 @@ acpi_ev_init_gpe_control_methods (void)
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_init_gpe_control_methods");
+ ACPI_FUNCTION_TRACE ("ev_init_gpe_control_methods");
/* Get a permanent handle to the _GPE object */
@@ -427,7 +426,7 @@ acpi_ev_init_gpe_control_methods (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_gpe_detect
+ * FUNCTION: acpi_ev_gpe_detect
*
* PARAMETERS: None
*
@@ -446,12 +445,12 @@ acpi_ev_gpe_detect (void)
u32 j;
u8 enabled_status_byte;
u8 bit_mask;
- ACPI_GPE_REGISTER_INFO *gpe_register_info;
+ acpi_gpe_register_info *gpe_register_info;
u32 in_value;
acpi_status status;
- ACPI_FUNCTION_NAME ("Ev_gpe_detect");
+ ACPI_FUNCTION_NAME ("ev_gpe_detect");
/*
@@ -513,14 +512,14 @@ acpi_ev_gpe_detect (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_asynch_execute_gpe_method
+ * FUNCTION: acpi_ev_asynch_execute_gpe_method
*
- * PARAMETERS: Gpe_number - The 0-based GPE number
+ * PARAMETERS: gpe_number - The 0-based GPE number
*
* RETURN: None
*
* DESCRIPTION: Perform the actual execution of a GPE control method. This
- * function is called from an invocation of Acpi_os_queue_for_execution
+ * function is called from an invocation of acpi_os_queue_for_execution
* (and therefore does NOT execute at interrupt level) so that
* the control method itself is not executed in the context of
* the SCI interrupt handler.
@@ -533,11 +532,11 @@ acpi_ev_asynch_execute_gpe_method (
{
u32 gpe_number = (u32) ACPI_TO_INTEGER (context);
u32 gpe_number_index;
- ACPI_GPE_NUMBER_INFO gpe_info;
+ acpi_gpe_number_info gpe_info;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_asynch_execute_gpe_method");
+ ACPI_FUNCTION_TRACE ("ev_asynch_execute_gpe_method");
gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number);
@@ -547,7 +546,7 @@ acpi_ev_asynch_execute_gpe_method (
/*
* Take a snapshot of the GPE info for this level - we copy the
- * info to prevent a race condition with Remove_handler.
+ * info to prevent a race condition with remove_handler.
*/
status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (status)) {
@@ -594,9 +593,9 @@ acpi_ev_asynch_execute_gpe_method (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_gpe_dispatch
+ * FUNCTION: acpi_ev_gpe_dispatch
*
- * PARAMETERS: Gpe_number - The 0-based GPE number
+ * PARAMETERS: gpe_number - The 0-based GPE number
*
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
*
@@ -611,11 +610,11 @@ acpi_ev_gpe_dispatch (
u32 gpe_number)
{
u32 gpe_number_index;
- ACPI_GPE_NUMBER_INFO *gpe_info;
+ acpi_gpe_number_info *gpe_info;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_gpe_dispatch");
+ ACPI_FUNCTION_TRACE ("ev_gpe_dispatch");
gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number);
@@ -625,7 +624,7 @@ acpi_ev_gpe_dispatch (
}
/*
- * We don't have to worry about mutex on Gpe_info because we are
+ * We don't have to worry about mutex on gpe_info because we are
* executing at interrupt level.
*/
gpe_info = &acpi_gbl_gpe_number_info [gpe_number_index];
@@ -637,7 +636,7 @@ acpi_ev_gpe_dispatch (
if (gpe_info->type & ACPI_EVENT_EDGE_TRIGGERED) {
status = acpi_hw_clear_gpe (gpe_number);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -661,7 +660,7 @@ acpi_ev_gpe_dispatch (
*/
status = acpi_hw_disable_gpe (gpe_number);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
}
@@ -671,13 +670,13 @@ acpi_ev_gpe_dispatch (
if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
acpi_ev_asynch_execute_gpe_method,
ACPI_TO_POINTER (gpe_number)))) {
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%2.2X], event is disabled\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%2.2X], event is disabled\n", gpe_number));
}
}
else {
/* No handler or method to run! */
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: No handler or method for GPE[%2.2X], disabling event\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: No handler or method for GPE[%2.2X], disabling event\n", gpe_number));
/*
* Disable the GPE. The GPE will remain disabled until the ACPI
@@ -685,7 +684,7 @@ acpi_ev_gpe_dispatch (
*/
status = acpi_hw_disable_gpe (gpe_number);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -696,7 +695,7 @@ acpi_ev_gpe_dispatch (
if (gpe_info->type & ACPI_EVENT_LEVEL_TRIGGERED) {
status = acpi_hw_clear_gpe (gpe_number);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
+ ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
}
}
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 79c5bf33300d..bd7d2a729c04 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: evmisc - Miscellaneous event manager support functions
- * $Revision: 60 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_is_notify_object
+ * FUNCTION: acpi_ev_is_notify_object
*
* PARAMETERS: Node - Node to check
*
@@ -68,9 +67,9 @@ acpi_ev_is_notify_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_get_gpe_register_index
+ * FUNCTION: acpi_ev_get_gpe_register_index
*
- * PARAMETERS: Gpe_number - Raw GPE number
+ * PARAMETERS: gpe_number - Raw GPE number
*
* RETURN: None.
*
@@ -94,9 +93,9 @@ acpi_ev_get_gpe_register_index (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_get_gpe_number_index
+ * FUNCTION: acpi_ev_get_gpe_number_index
*
- * PARAMETERS: Gpe_number - Raw GPE number
+ * PARAMETERS: gpe_number - Raw GPE number
*
* RETURN: None.
*
@@ -120,7 +119,7 @@ acpi_ev_get_gpe_number_index (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_queue_notify_request
+ * FUNCTION: acpi_ev_queue_notify_request
*
* PARAMETERS:
*
@@ -142,7 +141,7 @@ acpi_ev_queue_notify_request (
acpi_status status = AE_OK;
- ACPI_FUNCTION_NAME ("Ev_queue_notify_request");
+ ACPI_FUNCTION_NAME ("ev_queue_notify_request");
/*
@@ -238,7 +237,7 @@ acpi_ev_queue_notify_request (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_notify_dispatch
+ * FUNCTION: acpi_ev_notify_dispatch
*
* PARAMETERS:
*
@@ -305,7 +304,7 @@ acpi_ev_notify_dispatch (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_global_lock_thread
+ * FUNCTION: acpi_ev_global_lock_thread
*
* RETURN: None
*
@@ -338,7 +337,7 @@ acpi_ev_global_lock_thread (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_global_lock_handler
+ * FUNCTION: acpi_ev_global_lock_handler
*
* RETURN: Status
*
@@ -385,7 +384,7 @@ acpi_ev_global_lock_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_init_global_lock_handler
+ * FUNCTION: acpi_ev_init_global_lock_handler
*
* RETURN: Status
*
@@ -399,7 +398,7 @@ acpi_ev_init_global_lock_handler (void)
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_init_global_lock_handler");
+ ACPI_FUNCTION_TRACE ("ev_init_global_lock_handler");
acpi_gbl_global_lock_present = TRUE;
@@ -424,7 +423,7 @@ acpi_ev_init_global_lock_handler (void)
/******************************************************************************
*
- * FUNCTION: Acpi_ev_acquire_global_lock
+ * FUNCTION: acpi_ev_acquire_global_lock
*
* RETURN: Status
*
@@ -440,7 +439,7 @@ acpi_ev_acquire_global_lock (
u8 acquired = FALSE;
- ACPI_FUNCTION_TRACE ("Ev_acquire_global_lock");
+ ACPI_FUNCTION_TRACE ("ev_acquire_global_lock");
#ifndef ACPI_APPLICATION
@@ -491,7 +490,7 @@ acpi_ev_acquire_global_lock (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_release_global_lock
+ * FUNCTION: acpi_ev_release_global_lock
*
* DESCRIPTION: Releases ownership of the Global Lock.
*
@@ -504,7 +503,7 @@ acpi_ev_release_global_lock (void)
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ev_release_global_lock");
+ ACPI_FUNCTION_TRACE ("ev_release_global_lock");
if (!acpi_gbl_global_lock_thread_count) {
@@ -542,7 +541,7 @@ acpi_ev_release_global_lock (void)
/******************************************************************************
*
- * FUNCTION: Acpi_ev_terminate
+ * FUNCTION: acpi_ev_terminate
*
* PARAMETERS: none
*
@@ -555,11 +554,11 @@ acpi_ev_release_global_lock (void)
void
acpi_ev_terminate (void)
{
- NATIVE_UINT_MAX32 i;
+ acpi_native_uint i;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_terminate");
+ ACPI_FUNCTION_TRACE ("ev_terminate");
if (acpi_gbl_events_initialized) {
@@ -572,9 +571,9 @@ acpi_ev_terminate (void)
* Disable all fixed events
*/
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
- status = acpi_disable_event(i, ACPI_EVENT_FIXED, 0);
+ status = acpi_disable_event ((u32) i, ACPI_EVENT_FIXED, 0);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", i));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", (u32) i));
}
}
@@ -582,10 +581,10 @@ acpi_ev_terminate (void)
* Disable all GPEs
*/
for (i = 0; i < acpi_gbl_gpe_number_max; i++) {
- if (acpi_ev_get_gpe_number_index(i) != ACPI_GPE_INVALID) {
- status = acpi_hw_disable_gpe(i);
+ if (acpi_ev_get_gpe_number_index ((u32)i) != ACPI_GPE_INVALID) {
+ status = acpi_hw_disable_gpe((u32) i);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", i));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", (u32) i));
}
}
}
@@ -593,7 +592,7 @@ acpi_ev_terminate (void)
/*
* Remove SCI handler
*/
- status = acpi_ev_remove_sci_handler();
+ status = acpi_ev_remove_sci_handler ();
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n"));
}
@@ -605,7 +604,7 @@ acpi_ev_terminate (void)
if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
status = acpi_disable ();
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_disable failed\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "acpi_disable failed\n"));
}
}
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index b4db0582a984..b83bc487c5d5 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
- * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
- * $Revision: 136 $
+ * Module Name: evregion - ACPI address_space (op_region) handler dispatch
*
*****************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_init_address_spaces
+ * FUNCTION: acpi_ev_init_address_spaces
*
* PARAMETERS:
*
@@ -52,7 +51,7 @@ acpi_ev_init_address_spaces (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_init_address_spaces");
+ ACPI_FUNCTION_TRACE ("ev_init_address_spaces");
/*
@@ -68,7 +67,7 @@ acpi_ev_init_address_spaces (
* near ready to find the PCI root buses at this point.
*
* NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
- * has already been installed (via Acpi_install_address_space_handler)
+ * has already been installed (via acpi_install_address_space_handler)
*/
status = acpi_install_address_space_handler ((acpi_handle) acpi_gbl_root_node,
@@ -109,9 +108,9 @@ acpi_ev_init_address_spaces (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_execute_reg_method
+ * FUNCTION: acpi_ev_execute_reg_method
*
- * PARAMETERS: Region_obj - Object structure
+ * PARAMETERS: region_obj - Object structure
* Function - On (1) or Off (0)
*
* RETURN: Status
@@ -130,7 +129,7 @@ acpi_ev_execute_reg_method (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_execute_reg_method");
+ ACPI_FUNCTION_TRACE ("ev_execute_reg_method");
region_obj2 = acpi_ns_get_secondary_object (region_obj);
@@ -145,7 +144,7 @@ acpi_ev_execute_reg_method (
/*
* _REG method has two arguments
* Arg0: Integer: Operation region space ID
- * Same value as Region_obj->Region.Space_id
+ * Same value as region_obj->Region.space_id
* Arg1: Integer: connection status
* 1 for connecting the handler,
* 0 for disconnecting the handler
@@ -186,13 +185,13 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_address_space_dispatch
+ * FUNCTION: acpi_ev_address_space_dispatch
*
- * PARAMETERS: Region_obj - internal region object
- * Space_id - ID of the address space (0-255)
+ * PARAMETERS: region_obj - internal region object
+ * space_id - ID of the address space (0-255)
* Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, 32, or 64)
+ * bit_width - Field width in bits (8, 16, 32, or 64)
* Value - Pointer to in or out value
*
* RETURN: Status
@@ -206,7 +205,7 @@ acpi_status
acpi_ev_address_space_dispatch (
acpi_operand_object *region_obj,
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
void *value)
{
@@ -219,7 +218,7 @@ acpi_ev_address_space_dispatch (
void *region_context = NULL;
- ACPI_FUNCTION_TRACE ("Ev_address_space_dispatch");
+ ACPI_FUNCTION_TRACE ("ev_address_space_dispatch");
region_obj2 = acpi_ns_get_secondary_object (region_obj);
@@ -339,10 +338,10 @@ acpi_ev_address_space_dispatch (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_detach_region
+ * FUNCTION: acpi_ev_detach_region
*
- * PARAMETERS: Region_obj - Region Object
- * Acpi_ns_is_locked - Namespace Region Already Locked?
+ * PARAMETERS: region_obj - Region Object
+ * acpi_ns_is_locked - Namespace Region Already Locked?
*
* RETURN: None
*
@@ -365,7 +364,7 @@ acpi_ev_detach_region(
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_detach_region");
+ ACPI_FUNCTION_TRACE ("ev_detach_region");
region_obj2 = acpi_ns_get_secondary_object (region_obj);
@@ -484,11 +483,11 @@ acpi_ev_detach_region(
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_attach_region
+ * FUNCTION: acpi_ev_attach_region
*
- * PARAMETERS: Handler_obj - Handler Object
- * Region_obj - Region Object
- * Acpi_ns_is_locked - Namespace Region Already Locked?
+ * PARAMETERS: handler_obj - Handler Object
+ * region_obj - Region Object
+ * acpi_ns_is_locked - Namespace Region Already Locked?
*
* RETURN: None
*
@@ -507,7 +506,7 @@ acpi_ev_attach_region (
acpi_status status2;
- ACPI_FUNCTION_TRACE ("Ev_attach_region");
+ ACPI_FUNCTION_TRACE ("ev_attach_region");
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
@@ -552,11 +551,11 @@ acpi_ev_attach_region (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_addr_handler_helper
+ * FUNCTION: acpi_ev_addr_handler_helper
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
- * Context - Passed into Acpi_ns_walk_namespace
+ * Context - Passed into acpi_ns_walk_namespace
*
* DESCRIPTION: This routine installs an address handler into objects that are
* of type Region.
@@ -583,7 +582,7 @@ acpi_ev_addr_handler_helper (
acpi_status status;
- ACPI_FUNCTION_NAME ("Ev_addr_handler_helper");
+ ACPI_FUNCTION_NAME ("ev_addr_handler_helper");
handler_obj = (acpi_operand_object *) context;
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 511efb149786..03c5decf5a77 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
- * Module Name: evrgnini- ACPI Address_space (Op_region) init
- * $Revision: 64 $
+ * Module Name: evrgnini- ACPI address_space (op_region) init
*
*****************************************************************************/
@@ -34,12 +33,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_system_memory_region_setup
+ * FUNCTION: acpi_ev_system_memory_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -58,7 +57,7 @@ acpi_ev_system_memory_region_setup (
acpi_mem_space_context *local_region_context;
- ACPI_FUNCTION_TRACE ("Ev_system_memory_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_system_memory_region_setup");
if (function == ACPI_REGION_DEACTIVATE) {
@@ -88,12 +87,12 @@ acpi_ev_system_memory_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_io_space_region_setup
+ * FUNCTION: acpi_ev_io_space_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -108,7 +107,7 @@ acpi_ev_io_space_region_setup (
void *handler_context,
void **region_context)
{
- ACPI_FUNCTION_TRACE ("Ev_io_space_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_io_space_region_setup");
if (function == ACPI_REGION_DEACTIVATE) {
@@ -124,12 +123,12 @@ acpi_ev_io_space_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_pci_config_region_setup
+ * FUNCTION: acpi_ev_pci_config_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -155,7 +154,7 @@ acpi_ev_pci_config_region_setup (
acpi_device_id object_hID;
- ACPI_FUNCTION_TRACE ("Ev_pci_config_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_pci_config_region_setup");
handler_obj = region_obj->region.addr_handler;
@@ -218,8 +217,8 @@ acpi_ev_pci_config_region_setup (
*/
/*
- * If the Addr_handler.Node is still pointing to the root, we need
- * to scan upward for a PCI Root bridge and re-associate the Op_region
+ * If the addr_handler.Node is still pointing to the root, we need
+ * to scan upward for a PCI Root bridge and re-associate the op_region
* handlers with that device.
*/
if (handler_obj->addr_handler.node == acpi_gbl_root_node) {
@@ -239,7 +238,7 @@ acpi_ev_pci_config_region_setup (
ACPI_ADR_SPACE_PCI_CONFIG,
ACPI_DEFAULT_HANDLER, NULL, NULL);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Could not install Pci_config handler for %4.4s, %s\n",
+ ACPI_REPORT_ERROR (("Could not install pci_config handler for %4.4s, %s\n",
node->name.ascii, acpi_format_exception (status)));
}
break;
@@ -270,7 +269,7 @@ acpi_ev_pci_config_region_setup (
}
/*
- * Complete this device's Pci_id
+ * Complete this device's pci_id
*/
acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id);
@@ -281,12 +280,12 @@ acpi_ev_pci_config_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_pci_bar_region_setup
+ * FUNCTION: acpi_ev_pci_bar_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -303,7 +302,7 @@ acpi_ev_pci_bar_region_setup (
void *handler_context,
void **region_context)
{
- ACPI_FUNCTION_TRACE ("Ev_pci_bar_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_pci_bar_region_setup");
return_ACPI_STATUS (AE_OK);
@@ -312,12 +311,12 @@ acpi_ev_pci_bar_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_cmos_region_setup
+ * FUNCTION: acpi_ev_cmos_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -334,7 +333,7 @@ acpi_ev_cmos_region_setup (
void *handler_context,
void **region_context)
{
- ACPI_FUNCTION_TRACE ("Ev_cmos_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_cmos_region_setup");
return_ACPI_STATUS (AE_OK);
@@ -343,12 +342,12 @@ acpi_ev_cmos_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_default_region_setup
+ * FUNCTION: acpi_ev_default_region_setup
*
- * PARAMETERS: Region_obj - Region we are interested in
+ * PARAMETERS: region_obj - Region we are interested in
* Function - Start or stop
- * Handler_context - Address space handler context
- * Region_context - Region specific context
+ * handler_context - Address space handler context
+ * region_context - Region specific context
*
* RETURN: Status
*
@@ -363,7 +362,7 @@ acpi_ev_default_region_setup (
void *handler_context,
void **region_context)
{
- ACPI_FUNCTION_TRACE ("Ev_default_region_setup");
+ ACPI_FUNCTION_TRACE ("ev_default_region_setup");
if (function == ACPI_REGION_DEACTIVATE) {
@@ -379,10 +378,10 @@ acpi_ev_default_region_setup (
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_initialize_region
+ * FUNCTION: acpi_ev_initialize_region
*
- * PARAMETERS: Region_obj - Region we are initializing
- * Acpi_ns_locked - Is namespace locked?
+ * PARAMETERS: region_obj - Region we are initializing
+ * acpi_ns_locked - Is namespace locked?
*
* RETURN: Status
*
@@ -406,7 +405,7 @@ acpi_ev_initialize_region (
{
acpi_operand_object *handler_obj;
acpi_operand_object *obj_desc;
- ACPI_ADR_SPACE_TYPE space_id;
+ acpi_adr_space_type space_id;
acpi_namespace_node *node;
acpi_status status;
acpi_namespace_node *method_node;
@@ -414,7 +413,7 @@ acpi_ev_initialize_region (
acpi_operand_object *region_obj2;
- ACPI_FUNCTION_TRACE_U32 ("Ev_initialize_region", acpi_ns_locked);
+ ACPI_FUNCTION_TRACE_U32 ("ev_initialize_region", acpi_ns_locked);
if (!region_obj) {
@@ -454,7 +453,7 @@ acpi_ev_initialize_region (
/*
* The following loop depends upon the root Node having no parent
- * ie: Acpi_gbl_Root_node->Parent_entry being set to NULL
+ * ie: acpi_gbl_root_node->parent_entry being set to NULL
*/
while (node) {
/*
@@ -520,7 +519,7 @@ acpi_ev_initialize_region (
* If we get here, there is no handler for this region
*/
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "No handler for Region_type %s(%X) (Region_obj %p)\n",
+ "No handler for region_type %s(%X) (region_obj %p)\n",
acpi_ut_get_region_name (space_id), space_id, region_obj));
return_ACPI_STATUS (AE_NOT_EXIST);
diff --git a/drivers/acpi/events/evsci.c b/drivers/acpi/events/evsci.c
index fd347f315d96..9e47863dc7ce 100644
--- a/drivers/acpi/events/evsci.c
+++ b/drivers/acpi/events/evsci.c
@@ -2,7 +2,6 @@
*
* Module Name: evsci - System Control Interrupt configuration and
* legacy to ACPI mode state transition functions
- * $Revision: 86 $
*
******************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ev_sci_handler
+ * FUNCTION: acpi_ev_sci_handler
*
* PARAMETERS: Context - Calling Context
*
@@ -55,7 +54,7 @@ acpi_ev_sci_handler (
acpi_status status;
- ACPI_FUNCTION_TRACE("Ev_sci_handler");
+ ACPI_FUNCTION_TRACE("ev_sci_handler");
/*
@@ -74,9 +73,9 @@ acpi_ev_sci_handler (
}
/*
- * Fixed Acpi_events:
+ * Fixed acpi_events:
* -------------
- * Check for and dispatch any Fixed Acpi_events that have occurred
+ * Check for and dispatch any Fixed acpi_events that have occurred
*/
interrupt_handled |= acpi_ev_fixed_event_detect ();
@@ -93,7 +92,7 @@ acpi_ev_sci_handler (
/******************************************************************************
*
- * FUNCTION: Acpi_ev_install_sci_handler
+ * FUNCTION: acpi_ev_install_sci_handler
*
* PARAMETERS: none
*
@@ -109,7 +108,7 @@ acpi_ev_install_sci_handler (void)
u32 status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ev_install_sci_handler");
+ ACPI_FUNCTION_TRACE ("ev_install_sci_handler");
status = acpi_os_install_interrupt_handler ((u32) acpi_gbl_FADT->sci_int,
@@ -120,7 +119,7 @@ acpi_ev_install_sci_handler (void)
/******************************************************************************
*
- * FUNCTION: Acpi_ev_remove_sci_handler
+ * FUNCTION: acpi_ev_remove_sci_handler
*
* PARAMETERS: none
*
@@ -143,7 +142,7 @@ acpi_ev_remove_sci_handler (void)
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ev_remove_sci_handler");
+ ACPI_FUNCTION_TRACE ("ev_remove_sci_handler");
/* Just let the OS remove the handler and disable the level */
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index c55df3e9ed86..8914fc9c8fd7 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: evxface - External interfaces for ACPI events
- * $Revision: 132 $
*
*****************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_install_fixed_event_handler
+ * FUNCTION: acpi_install_fixed_event_handler
*
* PARAMETERS: Event - Event type to enable.
* Handler - Pointer to the handler function for the
@@ -58,7 +57,7 @@ acpi_install_fixed_event_handler (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_install_fixed_event_handler");
+ ACPI_FUNCTION_TRACE ("acpi_install_fixed_event_handler");
/* Parameter validation */
@@ -107,7 +106,7 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_remove_fixed_event_handler
+ * FUNCTION: acpi_remove_fixed_event_handler
*
* PARAMETERS: Event - Event type to disable.
* Handler - Address of the handler
@@ -126,7 +125,7 @@ acpi_remove_fixed_event_handler (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_remove_fixed_event_handler");
+ ACPI_FUNCTION_TRACE ("acpi_remove_fixed_event_handler");
/* Parameter validation */
@@ -164,12 +163,12 @@ acpi_remove_fixed_event_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_install_notify_handler
+ * FUNCTION: acpi_install_notify_handler
*
* PARAMETERS: Device - The device for which notifies will be handled
- * Handler_type - The type of handler:
- * ACPI_SYSTEM_NOTIFY: System_handler (00-7f)
- * ACPI_DEVICE_NOTIFY: Driver_handler (80-ff)
+ * handler_type - The type of handler:
+ * ACPI_SYSTEM_NOTIFY: system_handler (00-7f)
+ * ACPI_DEVICE_NOTIFY: driver_handler (80-ff)
* Handler - Address of the handler
* Context - Value passed to the handler on each GPE
*
@@ -192,7 +191,7 @@ acpi_install_notify_handler (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_install_notify_handler");
+ ACPI_FUNCTION_TRACE ("acpi_install_notify_handler");
/* Parameter validation */
@@ -321,12 +320,12 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_remove_notify_handler
+ * FUNCTION: acpi_remove_notify_handler
*
* PARAMETERS: Device - The device for which notifies will be handled
- * Handler_type - The type of handler:
- * ACPI_SYSTEM_NOTIFY: System_handler (00-7f)
- * ACPI_DEVICE_NOTIFY: Driver_handler (80-ff)
+ * handler_type - The type of handler:
+ * ACPI_SYSTEM_NOTIFY: system_handler (00-7f)
+ * ACPI_DEVICE_NOTIFY: driver_handler (80-ff)
* Handler - Address of the handler
* RETURN: Status
*
@@ -346,7 +345,7 @@ acpi_remove_notify_handler (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_remove_notify_handler");
+ ACPI_FUNCTION_TRACE ("acpi_remove_notify_handler");
/* Parameter validation */
@@ -451,9 +450,9 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_install_gpe_handler
+ * FUNCTION: acpi_install_gpe_handler
*
- * PARAMETERS: Gpe_number - The GPE number. The numbering scheme is
+ * PARAMETERS: gpe_number - The GPE number. The numbering scheme is
* bank 0 first, then bank 1.
* Type - Whether this GPE should be treated as an
* edge- or level-triggered interrupt.
@@ -477,7 +476,7 @@ acpi_install_gpe_handler (
u32 gpe_number_index;
- ACPI_FUNCTION_TRACE ("Acpi_install_gpe_handler");
+ ACPI_FUNCTION_TRACE ("acpi_install_gpe_handler");
/* Parameter validation */
@@ -529,14 +528,14 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_remove_gpe_handler
+ * FUNCTION: acpi_remove_gpe_handler
*
- * PARAMETERS: Gpe_number - The event to remove a handler
+ * PARAMETERS: gpe_number - The event to remove a handler
* Handler - Address of the handler
*
* RETURN: Status
*
- * DESCRIPTION: Remove a handler for a General Purpose Acpi_event.
+ * DESCRIPTION: Remove a handler for a General Purpose acpi_event.
*
******************************************************************************/
@@ -549,7 +548,7 @@ acpi_remove_gpe_handler (
u32 gpe_number_index;
- ACPI_FUNCTION_TRACE ("Acpi_remove_gpe_handler");
+ ACPI_FUNCTION_TRACE ("acpi_remove_gpe_handler");
/* Parameter validation */
@@ -599,10 +598,10 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_acquire_global_lock
+ * FUNCTION: acpi_acquire_global_lock
*
* PARAMETERS: Timeout - How long the caller is willing to wait
- * Out_handle - A handle to the lock if acquired
+ * out_handle - A handle to the lock if acquired
*
* RETURN: Status
*
@@ -641,9 +640,9 @@ acpi_acquire_global_lock (
/*******************************************************************************
*
- * FUNCTION: Acpi_release_global_lock
+ * FUNCTION: acpi_release_global_lock
*
- * PARAMETERS: Handle - Returned from Acpi_acquire_global_lock
+ * PARAMETERS: Handle - Returned from acpi_acquire_global_lock
*
* RETURN: Status
*
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index e1d1bd0e2d05..b1375dab658c 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
- * $Revision: 59 $
*
*****************************************************************************/
@@ -33,7 +32,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_enable
+ * FUNCTION: acpi_enable
*
* PARAMETERS: None
*
@@ -49,7 +48,7 @@ acpi_enable (void)
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_enable");
+ ACPI_FUNCTION_TRACE ("acpi_enable");
/* Make sure we have the FADT*/
@@ -80,7 +79,7 @@ acpi_enable (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_disable
+ * FUNCTION: acpi_disable
*
* PARAMETERS: None
*
@@ -96,7 +95,7 @@ acpi_disable (void)
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_disable");
+ ACPI_FUNCTION_TRACE ("acpi_disable");
if (!acpi_gbl_FADT) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No FADT information present!\n"));
@@ -125,7 +124,7 @@ acpi_disable (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_enable_event
+ * FUNCTION: acpi_enable_event
*
* PARAMETERS: Event - The fixed event or GPE to be enabled
* Type - The type of event
@@ -147,7 +146,7 @@ acpi_enable_event (
u32 value;
- ACPI_FUNCTION_TRACE ("Acpi_enable_event");
+ ACPI_FUNCTION_TRACE ("acpi_enable_event");
/* The Type must be either Fixed Event or GPE */
@@ -219,7 +218,7 @@ acpi_enable_event (
/*******************************************************************************
*
- * FUNCTION: Acpi_disable_event
+ * FUNCTION: acpi_disable_event
*
* PARAMETERS: Event - The fixed event or GPE to be enabled
* Type - The type of event, fixed or general purpose
@@ -241,7 +240,7 @@ acpi_disable_event (
u32 value;
- ACPI_FUNCTION_TRACE ("Acpi_disable_event");
+ ACPI_FUNCTION_TRACE ("acpi_disable_event");
/* The Type must be either Fixed Event or GPE */
@@ -311,7 +310,7 @@ acpi_disable_event (
/*******************************************************************************
*
- * FUNCTION: Acpi_clear_event
+ * FUNCTION: acpi_clear_event
*
* PARAMETERS: Event - The fixed event or GPE to be cleared
* Type - The type of event
@@ -330,7 +329,7 @@ acpi_clear_event (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_clear_event");
+ ACPI_FUNCTION_TRACE ("acpi_clear_event");
/* The Type must be either Fixed Event or GPE */
@@ -376,7 +375,7 @@ acpi_clear_event (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_event_status
+ * FUNCTION: acpi_get_event_status
*
* PARAMETERS: Event - The fixed event or GPE
* Type - The type of event
@@ -399,7 +398,7 @@ acpi_get_event_status (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_get_event_status");
+ ACPI_FUNCTION_TRACE ("acpi_get_event_status");
if (!event_status) {
diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
index fe9bdaa567b4..a2e6049e8c61 100644
--- a/drivers/acpi/events/evxfregn.c
+++ b/drivers/acpi/events/evxfregn.c
@@ -2,7 +2,6 @@
*
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces.
- * $Revision: 52 $
*
*****************************************************************************/
@@ -36,24 +35,24 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_install_address_space_handler
+ * FUNCTION: acpi_install_address_space_handler
*
* PARAMETERS: Device - Handle for the device
- * Space_id - The address space ID
+ * space_id - The address space ID
* Handler - Address of the handler
* Setup - Address of the setup function
* Context - Value passed to the handler on each access
*
* RETURN: Status
*
- * DESCRIPTION: Install a handler for all Op_regions of a given Space_id.
+ * DESCRIPTION: Install a handler for all op_regions of a given space_id.
*
******************************************************************************/
acpi_status
acpi_install_address_space_handler (
acpi_handle device,
- ACPI_ADR_SPACE_TYPE space_id,
+ acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup,
void *context)
@@ -66,7 +65,7 @@ acpi_install_address_space_handler (
u16 flags = 0;
- ACPI_FUNCTION_TRACE ("Acpi_install_address_space_handler");
+ ACPI_FUNCTION_TRACE ("acpi_install_address_space_handler");
/* Parameter validation */
@@ -181,7 +180,7 @@ acpi_install_address_space_handler (
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Creating object on Device %p while installing handler\n", node));
- /* Obj_desc does not exist, create one */
+ /* obj_desc does not exist, create one */
if (node->type == ACPI_TYPE_ANY) {
type = ACPI_TYPE_DEVICE;
@@ -269,9 +268,9 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_remove_address_space_handler
+ * FUNCTION: acpi_remove_address_space_handler
*
- * PARAMETERS: Space_id - The address space ID
+ * PARAMETERS: space_id - The address space ID
* Handler - Address of the handler
*
* RETURN: Status
@@ -283,7 +282,7 @@ unlock_and_exit:
acpi_status
acpi_remove_address_space_handler (
acpi_handle device,
- ACPI_ADR_SPACE_TYPE space_id,
+ acpi_adr_space_type space_id,
acpi_adr_space_handler handler)
{
acpi_operand_object *obj_desc;
@@ -294,7 +293,7 @@ acpi_remove_address_space_handler (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_remove_address_space_handler");
+ ACPI_FUNCTION_TRACE ("acpi_remove_address_space_handler");
/* Parameter validation */
@@ -391,7 +390,7 @@ acpi_remove_address_space_handler (
* The handler does not exist
*/
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Unable to remove address handler %p for %s(%X), Dev_node %p, obj %p\n",
+ "Unable to remove address handler %p for %s(%X), dev_node %p, obj %p\n",
handler, acpi_ut_get_region_name (space_id), space_id, node, obj_desc));
status = AE_NOT_EXIST;
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 85e8533450f7..945647d48431 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
- * $Revision: 69 $
*
*****************************************************************************/
@@ -38,11 +37,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_add_table
+ * FUNCTION: acpi_ex_add_table
*
* PARAMETERS: Table - Pointer to raw table
- * Parent_node - Where to load the table (scope)
- * Ddb_handle - Where to return the table handle.
+ * parent_node - Where to load the table (scope)
+ * ddb_handle - Where to return the table handle.
*
* RETURN: Status
*
@@ -62,7 +61,7 @@ acpi_ex_add_table (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Ex_add_table");
+ ACPI_FUNCTION_TRACE ("ex_add_table");
/* Create an object to be the table handle */
@@ -75,7 +74,7 @@ acpi_ex_add_table (
/* Install the new table into the local data structures */
table_info.pointer = table;
- table_info.length = (ACPI_SIZE) table->length;
+ table_info.length = (acpi_size) table->length;
table_info.allocation = ACPI_MEM_ALLOCATED;
status = acpi_tb_install_table (&table_info);
@@ -109,10 +108,10 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_load_table_op
+ * FUNCTION: acpi_ex_load_table_op
*
- * PARAMETERS: Walk_state - Current state with operands
- * Return_desc - Where to store the return object
+ * PARAMETERS: walk_state - Current state with operands
+ * return_desc - Where to store the return object
*
* RETURN: Status
*
@@ -134,7 +133,7 @@ acpi_ex_load_table_op (
acpi_operand_object *ddb_handle;
- ACPI_FUNCTION_TRACE ("Ex_load_table_op");
+ ACPI_FUNCTION_TRACE ("ex_load_table_op");
#if 0
@@ -178,11 +177,11 @@ acpi_ex_load_table_op (
start_node = walk_state->scope_info->scope.node;
parent_node = acpi_gbl_root_node;
- /* Root_path (optional parameter) */
+ /* root_path (optional parameter) */
if (operand[3]->string.length > 0) {
/*
- * Find the node referenced by the Root_path_string. This is the
+ * Find the node referenced by the root_path_string. This is the
* location within the namespace where the table will be loaded.
*/
status = acpi_ns_get_node_by_path (operand[3]->string.pointer, start_node,
@@ -192,20 +191,20 @@ acpi_ex_load_table_op (
}
}
- /* Parameter_path (optional parameter) */
+ /* parameter_path (optional parameter) */
if (operand[4]->string.length > 0) {
if ((operand[4]->string.pointer[0] != '\\') &&
(operand[4]->string.pointer[0] != '^')) {
/*
* Path is not absolute, so it will be relative to the node
- * referenced by the Root_path_string (or the NS root if omitted)
+ * referenced by the root_path_string (or the NS root if omitted)
*/
start_node = parent_node;
}
/*
- * Find the node referenced by the Parameter_path_string
+ * Find the node referenced by the parameter_path_string
*/
status = acpi_ns_get_node_by_path (operand[4]->string.pointer, start_node,
ACPI_NS_SEARCH_PARENT, &parameter_node);
@@ -239,12 +238,12 @@ acpi_ex_load_table_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_load_op
+ * FUNCTION: acpi_ex_load_op
*
- * PARAMETERS: Obj_desc - Region or Field where the table will be
+ * PARAMETERS: obj_desc - Region or Field where the table will be
* obtained
* Target - Where a handle to the table will be stored
- * Walk_state - Current state
+ * walk_state - Current state
*
* RETURN: Status
*
@@ -266,10 +265,10 @@ acpi_ex_load_op (
acpi_table_header table_header;
u32 i;
- ACPI_FUNCTION_TRACE ("Ex_load_op");
+ ACPI_FUNCTION_TRACE ("ex_load_op");
- /* Object can be either an Op_region or a Field */
+ /* Object can be either an op_region or a Field */
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_REGION:
@@ -282,7 +281,7 @@ acpi_ex_load_op (
table_header.length = 0;
for (i = 0; i < sizeof (acpi_table_header); i++) {
status = acpi_ev_address_space_dispatch (obj_desc, ACPI_READ,
- (ACPI_PHYSICAL_ADDRESS) i, 8,
+ (acpi_physical_address) i, 8,
((u8 *) &table_header) + i);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
@@ -305,7 +304,7 @@ acpi_ex_load_op (
for (i = 0; i < table_header.length; i++) {
status = acpi_ev_address_space_dispatch (obj_desc, ACPI_READ,
- (ACPI_PHYSICAL_ADDRESS) i, 8,
+ (acpi_physical_address) i, 8,
((u8 *) table_data_ptr + i));
if (ACPI_FAILURE (status)) {
goto cleanup;
@@ -362,7 +361,7 @@ acpi_ex_load_op (
goto cleanup;
}
- /* Store the Ddb_handle into the Target operand */
+ /* Store the ddb_handle into the Target operand */
status = acpi_ex_store (ddb_handle, target, walk_state);
if (ACPI_FAILURE (status)) {
@@ -386,9 +385,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_unload_table
+ * FUNCTION: acpi_ex_unload_table
*
- * PARAMETERS: Ddb_handle - Handle to a previously loaded table
+ * PARAMETERS: ddb_handle - Handle to a previously loaded table
*
* RETURN: Status
*
@@ -405,13 +404,13 @@ acpi_ex_unload_table (
acpi_table_desc *table_info;
- ACPI_FUNCTION_TRACE ("Ex_unload_table");
+ ACPI_FUNCTION_TRACE ("ex_unload_table");
/*
* Validate the handle
- * Although the handle is partially validated in Acpi_ex_reconfiguration(),
- * when it calls Acpi_ex_resolve_operands(), the handle is more completely
+ * Although the handle is partially validated in acpi_ex_reconfiguration(),
+ * when it calls acpi_ex_resolve_operands(), the handle is more completely
* validated here.
*/
if ((!ddb_handle) ||
@@ -420,13 +419,13 @@ acpi_ex_unload_table (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the actual table descriptor from the Ddb_handle */
+ /* Get the actual table descriptor from the ddb_handle */
table_info = (acpi_table_desc *) table_desc->reference.object;
/*
* Delete the entire namespace under this table Node
- * (Offset contains the Table_id)
+ * (Offset contains the table_id)
*/
acpi_ns_delete_namespace_by_owner (table_info->table_id);
@@ -434,7 +433,7 @@ acpi_ex_unload_table (
(void) acpi_tb_uninstall_table (table_info->installed_desc);
- /* Delete the table descriptor (Ddb_handle) */
+ /* Delete the table descriptor (ddb_handle) */
acpi_ut_remove_reference (table_desc);
return_ACPI_STATUS (status);
diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
index 87453f7d98d6..b27833530ef6 100644
--- a/drivers/acpi/executer/exconvrt.c
+++ b/drivers/acpi/executer/exconvrt.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
- * $Revision: 47 $
*
*****************************************************************************/
@@ -35,11 +34,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_convert_to_integer
+ * FUNCTION: acpi_ex_convert_to_integer
*
- * PARAMETERS: *Obj_desc - Object to be converted. Must be an
+ * PARAMETERS: *obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
- * Walk_state - Current method state
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -61,7 +60,7 @@ acpi_ex_convert_to_integer (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_integer", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_convert_to_integer", obj_desc);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
@@ -169,11 +168,11 @@ acpi_ex_convert_to_integer (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_convert_to_buffer
+ * FUNCTION: acpi_ex_convert_to_buffer
*
- * PARAMETERS: *Obj_desc - Object to be converted. Must be an
+ * PARAMETERS: *obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
- * Walk_state - Current method state
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -192,7 +191,7 @@ acpi_ex_convert_to_buffer (
u8 *new_buf;
- ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_buffer", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_convert_to_buffer", obj_desc);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
@@ -230,7 +229,7 @@ acpi_ex_convert_to_buffer (
* Create a new Buffer object
* Size will be the string length
*/
- ret_desc = acpi_ut_create_buffer_object ((ACPI_SIZE) obj_desc->string.length);
+ ret_desc = acpi_ut_create_buffer_object ((acpi_size) obj_desc->string.length);
if (!ret_desc) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -269,12 +268,12 @@ acpi_ex_convert_to_buffer (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_convert_ascii
+ * FUNCTION: acpi_ex_convert_ascii
*
* PARAMETERS: Integer - Value to be converted
* Base - 10 or 16
* String - Where the string is returned
- * Data_width - Size of data item to be converted
+ * data_width - Size of data item to be converted
*
* RETURN: Actual string length
*
@@ -376,11 +375,11 @@ acpi_ex_convert_to_ascii (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_convert_to_string
+ * FUNCTION: acpi_ex_convert_to_string
*
- * PARAMETERS: *Obj_desc - Object to be converted. Must be an
+ * PARAMETERS: *obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
- * Walk_state - Current method state
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -398,13 +397,12 @@ acpi_ex_convert_to_string (
{
acpi_operand_object *ret_desc;
u32 i;
- u32 index;
u32 string_length;
u8 *new_buf;
u8 *pointer;
- ACPI_FUNCTION_TRACE_PTR ("Ex_convert_to_string", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_convert_to_string", obj_desc);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
@@ -438,10 +436,10 @@ acpi_ex_convert_to_string (
/* Need enough space for one ASCII integer plus null terminator */
- new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) string_length + 1);
+ new_buf = ACPI_MEM_CALLOCATE ((acpi_size) string_length + 1);
if (!new_buf) {
ACPI_REPORT_ERROR
- (("Ex_convert_to_string: Buffer allocation failure\n"));
+ (("ex_convert_to_string: Buffer allocation failure\n"));
acpi_ut_remove_reference (ret_desc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -467,9 +465,15 @@ acpi_ex_convert_to_string (
case ACPI_TYPE_BUFFER:
- string_length = obj_desc->buffer.length * 3;
- if (base == 10) {
- string_length = obj_desc->buffer.length * 4;
+ /* Find the string length */
+
+ pointer = obj_desc->buffer.pointer;
+ for (string_length = 0; string_length < obj_desc->buffer.length; string_length++) {
+ /* Exit on null terminator */
+
+ if (!pointer[string_length]) {
+ break;
+ }
}
if (max_length > ACPI_MAX_STRING_CONVERSION) {
@@ -492,31 +496,23 @@ acpi_ex_convert_to_string (
string_length = max_length;
}
- new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) string_length + 1);
+ new_buf = ACPI_MEM_CALLOCATE ((acpi_size) string_length + 1);
if (!new_buf) {
ACPI_REPORT_ERROR
- (("Ex_convert_to_string: Buffer allocation failure\n"));
+ (("ex_convert_to_string: Buffer allocation failure\n"));
acpi_ut_remove_reference (ret_desc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
- /*
- * Convert each byte of the buffer to two ASCII characters plus a space.
- */
- pointer = obj_desc->buffer.pointer;
- index = 0;
- for (i = 0, index = 0; i < obj_desc->buffer.length; i++) {
- index += acpi_ex_convert_to_ascii ((acpi_integer) pointer[i], base, &new_buf[index], 1);
+ /* Copy the appropriate number of buffer characters */
- new_buf[index] = ' ';
- index++;
- }
+ ACPI_MEMCPY (new_buf, pointer, string_length);
/* Null terminate */
- new_buf [index-1] = 0;
+ new_buf [string_length] = 0;
ret_desc->buffer.pointer = new_buf;
- ret_desc->string.length = (u32) ACPI_STRLEN ((char *) new_buf);
+ ret_desc->string.length = string_length;
break;
@@ -543,11 +539,11 @@ acpi_ex_convert_to_string (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_convert_to_target_type
+ * FUNCTION: acpi_ex_convert_to_target_type
*
- * PARAMETERS: Destination_type - Current type of the destination
- * Source_desc - Source object to be converted.
- * Walk_state - Current method state
+ * PARAMETERS: destination_type - Current type of the destination
+ * source_desc - Source object to be converted.
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -565,7 +561,7 @@ acpi_ex_convert_to_target_type (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_convert_to_target_type");
+ ACPI_FUNCTION_TRACE ("ex_convert_to_target_type");
/* Default behavior */
@@ -646,14 +642,14 @@ acpi_ex_convert_to_target_type (
case ARGI_REFERENCE:
/*
- * Create_xxxx_field cases - we are storing the field object into the name
+ * create_xxxx_field cases - we are storing the field object into the name
*/
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Unknown Target type ID 0x%X Op %s Dest_type %s\n",
+ "Unknown Target type ID 0x%X Op %s dest_type %s\n",
GET_CURRENT_ARG_TYPE (walk_state->op_info->runtime_args),
walk_state->op_info->name, acpi_ut_get_type_name (destination_type)));
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index e1117feba461..e2d9dcac4f3d 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: excreate - Named object creation
- * $Revision: 98 $
*
*****************************************************************************/
@@ -39,9 +38,9 @@
#ifndef ACPI_NO_METHOD_EXECUTION
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_alias
+ * FUNCTION: acpi_ex_create_alias
*
- * PARAMETERS: Walk_state - Current state, contains operands
+ * PARAMETERS: walk_state - Current state, contains operands
*
* RETURN: Status
*
@@ -58,7 +57,7 @@ acpi_ex_create_alias (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_create_alias");
+ ACPI_FUNCTION_TRACE ("ex_create_alias");
/* Get the source/alias operands (both namespace nodes) */
@@ -123,9 +122,9 @@ acpi_ex_create_alias (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_event
+ * FUNCTION: acpi_ex_create_event
*
- * PARAMETERS: Walk_state - Current state
+ * PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
@@ -141,7 +140,7 @@ acpi_ex_create_event (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Ex_create_event");
+ ACPI_FUNCTION_TRACE ("ex_create_event");
obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_EVENT);
@@ -177,15 +176,15 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_mutex
+ * FUNCTION: acpi_ex_create_mutex
*
- * PARAMETERS: Walk_state - Current state
+ * PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
* DESCRIPTION: Create a new mutex object
*
- * Mutex (Name[0], Sync_level[1])
+ * Mutex (Name[0], sync_level[1])
*
****************************************************************************/
@@ -197,7 +196,7 @@ acpi_ex_create_mutex (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ex_create_mutex", ACPI_WALK_OPERANDS);
+ ACPI_FUNCTION_TRACE_PTR ("ex_create_mutex", ACPI_WALK_OPERANDS);
/* Create the new mutex object */
@@ -239,12 +238,12 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_region
+ * FUNCTION: acpi_ex_create_region
*
- * PARAMETERS: Aml_start - Pointer to the region declaration AML
- * Aml_length - Max length of the declaration AML
+ * PARAMETERS: aml_start - Pointer to the region declaration AML
+ * aml_length - Max length of the declaration AML
* Operands - List of operands for the opcode
- * Walk_state - Current state
+ * walk_state - Current state
*
* RETURN: Status
*
@@ -265,7 +264,7 @@ acpi_ex_create_region (
acpi_operand_object *region_obj2;
- ACPI_FUNCTION_TRACE ("Ex_create_region");
+ ACPI_FUNCTION_TRACE ("ex_create_region");
/* Get the Node from the object stack */
@@ -286,7 +285,7 @@ acpi_ex_create_region (
*/
if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) &&
(region_space < ACPI_USER_REGION_BEGIN)) {
- ACPI_REPORT_ERROR (("Invalid Address_space type %X\n", region_space));
+ ACPI_REPORT_ERROR (("Invalid address_space type %X\n", region_space));
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
@@ -333,13 +332,13 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_table_region
+ * FUNCTION: acpi_ex_create_table_region
*
- * PARAMETERS: Walk_state - Current state
+ * PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
- * DESCRIPTION: Create a new Data_table_region object
+ * DESCRIPTION: Create a new data_table_region object
*
****************************************************************************/
@@ -355,7 +354,7 @@ acpi_ex_create_table_region (
acpi_operand_object *region_obj2;
- ACPI_FUNCTION_TRACE ("Ex_create_table_region");
+ ACPI_FUNCTION_TRACE ("ex_create_table_region");
/* Get the Node from the object stack */
@@ -392,7 +391,7 @@ acpi_ex_create_table_region (
/* Init the region from the operands */
obj_desc->region.space_id = REGION_DATA_TABLE;
- obj_desc->region.address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (table);
+ obj_desc->region.address = (acpi_physical_address) ACPI_TO_INTEGER (table);
obj_desc->region.length = table->length;
obj_desc->region.node = node;
obj_desc->region.flags = AOPOBJ_DATA_VALID;
@@ -428,15 +427,15 @@ cleanup:
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_processor
+ * FUNCTION: acpi_ex_create_processor
*
- * PARAMETERS: Walk_state - Current state
+ * PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
* DESCRIPTION: Create a new processor object and populate the fields
*
- * Processor (Name[0], Cpu_iD[1], Pblock_addr[2], Pblock_length[3])
+ * Processor (Name[0], cpu_iD[1], pblock_addr[2], pblock_length[3])
*
****************************************************************************/
@@ -449,7 +448,7 @@ acpi_ex_create_processor (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ex_create_processor", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ex_create_processor", walk_state);
/* Create the processor object */
@@ -463,7 +462,7 @@ acpi_ex_create_processor (
* Initialize the processor object from the operands
*/
obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
- obj_desc->processor.address = (ACPI_IO_ADDRESS) operand[2]->integer.value;
+ obj_desc->processor.address = (acpi_io_address) operand[2]->integer.value;
obj_desc->processor.length = (u8) operand[3]->integer.value;
/* Install the processor object in the parent Node */
@@ -481,15 +480,15 @@ acpi_ex_create_processor (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_power_resource
+ * FUNCTION: acpi_ex_create_power_resource
*
- * PARAMETERS: Walk_state - Current state
+ * PARAMETERS: walk_state - Current state
*
* RETURN: Status
*
- * DESCRIPTION: Create a new Power_resource object and populate the fields
+ * DESCRIPTION: Create a new power_resource object and populate the fields
*
- * Power_resource (Name[0], System_level[1], Resource_order[2])
+ * power_resource (Name[0], system_level[1], resource_order[2])
*
****************************************************************************/
@@ -502,7 +501,7 @@ acpi_ex_create_power_resource (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ex_create_power_resource", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ex_create_power_resource", walk_state);
/* Create the power resource object */
@@ -533,11 +532,11 @@ acpi_ex_create_power_resource (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_create_method
+ * FUNCTION: acpi_ex_create_method
*
- * PARAMETERS: Aml_start - First byte of the method's AML
- * Aml_length - AML byte count for this method
- * Walk_state - Current state
+ * PARAMETERS: aml_start - First byte of the method's AML
+ * aml_length - AML byte count for this method
+ * walk_state - Current state
*
* RETURN: Status
*
@@ -557,7 +556,7 @@ acpi_ex_create_method (
u8 method_flags;
- ACPI_FUNCTION_TRACE_PTR ("Ex_create_method", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ex_create_method", walk_state);
/* Create a new method object */
@@ -586,7 +585,7 @@ acpi_ex_create_method (
if (method_flags & METHOD_FLAGS_SERIALIZED) {
/*
* ACPI 1.0: Concurrency = 1
- * ACPI 2.0: Concurrency = (Sync_level (in method declaration) + 1)
+ * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1)
*/
obj_desc->method.concurrency = (u8)
(((method_flags & METHOD_FLAGS_SYNCH_LEVEL) >> 4) + 1);
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 48a22a7bdf1d..f109dbce5828 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
- * $Revision: 164 $
*
*****************************************************************************/
@@ -42,9 +41,9 @@
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_dump_operand
+ * FUNCTION: acpi_ex_dump_operand
*
- * PARAMETERS: *Obj_desc - Pointer to entry to be dumped
+ * PARAMETERS: *obj_desc - Pointer to entry to be dumped
*
* RETURN: Status
*
@@ -62,7 +61,7 @@ acpi_ex_dump_operand (
u16 element_index;
- ACPI_FUNCTION_NAME ("Ex_dump_operand")
+ ACPI_FUNCTION_NAME ("ex_dump_operand")
if (!((ACPI_LV_EXEC & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
@@ -91,7 +90,7 @@ acpi_ex_dump_operand (
return;
}
- /* Obj_desc is a valid object */
+ /* obj_desc is a valid object */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
@@ -122,7 +121,7 @@ acpi_ex_dump_operand (
case AML_REF_OF_OP:
- acpi_os_printf ("Reference: (Ref_of) %p\n",
+ acpi_os_printf ("Reference: (ref_of) %p\n",
obj_desc->reference.object);
break;
@@ -271,14 +270,14 @@ acpi_ex_dump_operand (
case ACPI_TYPE_LOCAL_BANK_FIELD:
- acpi_os_printf ("Bank_field\n");
+ acpi_os_printf ("bank_field\n");
break;
case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf (
- "Region_field: Bits=%X Acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
+ "region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
obj_desc->field.bit_length, obj_desc->field.access_byte_width,
obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
@@ -289,14 +288,14 @@ acpi_ex_dump_operand (
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- acpi_os_printf ("Index_field\n");
+ acpi_os_printf ("index_field\n");
break;
case ACPI_TYPE_BUFFER_FIELD:
acpi_os_printf (
- "Buffer_field: %X bits at byte %X bit %X of \n",
+ "buffer_field: %X bits at byte %X bit %X of \n",
obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset,
obj_desc->buffer_field.start_field_bit_offset);
@@ -371,11 +370,11 @@ acpi_ex_dump_operand (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_dump_operands
+ * FUNCTION: acpi_ex_dump_operands
*
- * PARAMETERS: Interpreter_mode - Load or Exec
+ * PARAMETERS: interpreter_mode - Load or Exec
* *Ident - Identification
- * Num_levels - # of stack entries to dump above line
+ * num_levels - # of stack entries to dump above line
* *Note - Output notation
*
* DESCRIPTION: Dump the object stack
@@ -392,11 +391,11 @@ acpi_ex_dump_operands (
char *module_name,
u32 line_number)
{
- NATIVE_UINT i;
+ acpi_native_uint i;
acpi_operand_object **obj_desc;
- ACPI_FUNCTION_NAME ("Ex_dump_operands");
+ ACPI_FUNCTION_NAME ("ex_dump_operands");
if (!ident) {
@@ -431,7 +430,7 @@ acpi_ex_dump_operands (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_out*
+ * FUNCTION: acpi_ex_out*
*
* PARAMETERS: Title - Descriptive text
* Value - Value to be displayed
@@ -469,7 +468,7 @@ acpi_ex_out_integer (
void
acpi_ex_out_address (
char *title,
- ACPI_PHYSICAL_ADDRESS value)
+ acpi_physical_address value)
{
#if ACPI_MACHINE_WIDTH == 16
@@ -483,7 +482,7 @@ acpi_ex_out_address (
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_dump_node
+ * FUNCTION: acpi_ex_dump_node
*
* PARAMETERS: *Node - Descriptor to dump
* Flags - Force display
@@ -513,15 +512,15 @@ acpi_ex_dump_node (
acpi_ex_out_integer ("Owner Id", node->owner_id);
acpi_ex_out_integer ("Reference Count", node->reference_count);
acpi_ex_out_pointer ("Attached Object", acpi_ns_get_attached_object (node));
- acpi_ex_out_pointer ("Child_list", node->child);
- acpi_ex_out_pointer ("Next_peer", node->peer);
+ acpi_ex_out_pointer ("child_list", node->child);
+ acpi_ex_out_pointer ("next_peer", node->peer);
acpi_ex_out_pointer ("Parent", acpi_ns_get_parent_node (node));
}
/*****************************************************************************
*
- * FUNCTION: Acpi_ex_dump_object_descriptor
+ * FUNCTION: acpi_ex_dump_object_descriptor
*
* PARAMETERS: *Object - Descriptor to dump
* Flags - Force display
@@ -538,7 +537,7 @@ acpi_ex_dump_object_descriptor (
u32 i;
- ACPI_FUNCTION_TRACE ("Ex_dump_object_descriptor");
+ ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor");
if (!flags) {
@@ -555,7 +554,7 @@ acpi_ex_dump_object_descriptor (
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
- acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
+ acpi_os_printf ("ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
return_VOID;
}
@@ -617,9 +616,9 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_DEVICE:
- acpi_ex_out_pointer ("Addr_handler", obj_desc->device.addr_handler);
- acpi_ex_out_pointer ("Sys_handler", obj_desc->device.sys_handler);
- acpi_ex_out_pointer ("Drv_handler", obj_desc->device.drv_handler);
+ acpi_ex_out_pointer ("addr_handler", obj_desc->device.addr_handler);
+ acpi_ex_out_pointer ("sys_handler", obj_desc->device.sys_handler);
+ acpi_ex_out_pointer ("drv_handler", obj_desc->device.drv_handler);
break;
@@ -631,41 +630,41 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_METHOD:
- acpi_ex_out_integer ("Param_count", obj_desc->method.param_count);
+ acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
- acpi_ex_out_integer ("Owning_id", obj_desc->method.owning_id);
- acpi_ex_out_integer ("Aml_length", obj_desc->method.aml_length);
- acpi_ex_out_pointer ("Aml_start", obj_desc->method.aml_start);
+ acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id);
+ acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
+ acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
break;
case ACPI_TYPE_MUTEX:
- acpi_ex_out_integer ("Sync_level", obj_desc->mutex.sync_level);
- acpi_ex_out_pointer ("Owner_thread", obj_desc->mutex.owner_thread);
- acpi_ex_out_integer ("Acquisition_depth",obj_desc->mutex.acquisition_depth);
+ acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level);
+ acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread);
+ acpi_ex_out_integer ("acquisition_depth",obj_desc->mutex.acquisition_depth);
acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore);
break;
case ACPI_TYPE_REGION:
- acpi_ex_out_integer ("Space_id", obj_desc->region.space_id);
+ acpi_ex_out_integer ("space_id", obj_desc->region.space_id);
acpi_ex_out_integer ("Flags", obj_desc->region.flags);
acpi_ex_out_address ("Address", obj_desc->region.address);
acpi_ex_out_integer ("Length", obj_desc->region.length);
- acpi_ex_out_pointer ("Addr_handler", obj_desc->region.addr_handler);
+ acpi_ex_out_pointer ("addr_handler", obj_desc->region.addr_handler);
acpi_ex_out_pointer ("Next", obj_desc->region.next);
break;
case ACPI_TYPE_POWER:
- acpi_ex_out_integer ("System_level", obj_desc->power_resource.system_level);
- acpi_ex_out_integer ("Resource_order", obj_desc->power_resource.resource_order);
- acpi_ex_out_pointer ("Sys_handler", obj_desc->power_resource.sys_handler);
- acpi_ex_out_pointer ("Drv_handler", obj_desc->power_resource.drv_handler);
+ acpi_ex_out_integer ("system_level", obj_desc->power_resource.system_level);
+ acpi_ex_out_integer ("resource_order", obj_desc->power_resource.resource_order);
+ acpi_ex_out_pointer ("sys_handler", obj_desc->power_resource.sys_handler);
+ acpi_ex_out_pointer ("drv_handler", obj_desc->power_resource.drv_handler);
break;
@@ -673,18 +672,18 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("Processor ID", obj_desc->processor.proc_id);
acpi_ex_out_integer ("Length", obj_desc->processor.length);
- acpi_ex_out_address ("Address", (ACPI_PHYSICAL_ADDRESS) obj_desc->processor.address);
- acpi_ex_out_pointer ("Sys_handler", obj_desc->processor.sys_handler);
- acpi_ex_out_pointer ("Drv_handler", obj_desc->processor.drv_handler);
- acpi_ex_out_pointer ("Addr_handler", obj_desc->processor.addr_handler);
+ acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address);
+ acpi_ex_out_pointer ("sys_handler", obj_desc->processor.sys_handler);
+ acpi_ex_out_pointer ("drv_handler", obj_desc->processor.drv_handler);
+ acpi_ex_out_pointer ("addr_handler", obj_desc->processor.addr_handler);
break;
case ACPI_TYPE_THERMAL:
- acpi_ex_out_pointer ("Sys_handler", obj_desc->thermal_zone.sys_handler);
- acpi_ex_out_pointer ("Drv_handler", obj_desc->thermal_zone.drv_handler);
- acpi_ex_out_pointer ("Addr_handler", obj_desc->thermal_zone.addr_handler);
+ acpi_ex_out_pointer ("sys_handler", obj_desc->thermal_zone.sys_handler);
+ acpi_ex_out_pointer ("drv_handler", obj_desc->thermal_zone.drv_handler);
+ acpi_ex_out_pointer ("addr_handler", obj_desc->thermal_zone.addr_handler);
break;
@@ -693,29 +692,29 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- acpi_ex_out_integer ("Field_flags", obj_desc->common_field.field_flags);
- acpi_ex_out_integer ("Access_byte_width", obj_desc->common_field.access_byte_width);
- acpi_ex_out_integer ("Bit_length", obj_desc->common_field.bit_length);
- acpi_ex_out_integer ("Fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
- acpi_ex_out_integer ("Base_byte_offset", obj_desc->common_field.base_byte_offset);
- acpi_ex_out_integer ("Datum_valid_bits", obj_desc->common_field.datum_valid_bits);
- acpi_ex_out_integer ("End_fld_valid_bits", obj_desc->common_field.end_field_valid_bits);
- acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits);
- acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node);
+ acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags);
+ acpi_ex_out_integer ("access_byte_width", obj_desc->common_field.access_byte_width);
+ acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length);
+ acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
+ acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset);
+ acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits);
+ acpi_ex_out_integer ("end_fld_valid_bits", obj_desc->common_field.end_field_valid_bits);
+ acpi_ex_out_integer ("end_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits);
+ acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node);
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_BUFFER_FIELD:
- acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj);
+ acpi_ex_out_pointer ("buffer_obj", obj_desc->buffer_field.buffer_obj);
break;
case ACPI_TYPE_LOCAL_REGION_FIELD:
- acpi_ex_out_pointer ("Region_obj", obj_desc->field.region_obj);
+ acpi_ex_out_pointer ("region_obj", obj_desc->field.region_obj);
break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_ex_out_integer ("Value", obj_desc->bank_field.value);
- acpi_ex_out_pointer ("Region_obj", obj_desc->bank_field.region_obj);
- acpi_ex_out_pointer ("Bank_obj", obj_desc->bank_field.bank_obj);
+ acpi_ex_out_pointer ("region_obj", obj_desc->bank_field.region_obj);
+ acpi_ex_out_pointer ("bank_obj", obj_desc->bank_field.bank_obj);
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
@@ -733,10 +732,10 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_REFERENCE:
- acpi_ex_out_integer ("Target_type", obj_desc->reference.target_type);
+ acpi_ex_out_integer ("target_type", obj_desc->reference.target_type);
acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name);
acpi_ex_out_integer ("Offset", obj_desc->reference.offset);
- acpi_ex_out_pointer ("Obj_desc", obj_desc->reference.object);
+ acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object);
acpi_ex_out_pointer ("Node", obj_desc->reference.node);
acpi_ex_out_pointer ("Where", obj_desc->reference.where);
break;
@@ -744,9 +743,9 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
- acpi_ex_out_integer ("Space_id", obj_desc->addr_handler.space_id);
+ acpi_ex_out_integer ("space_id", obj_desc->addr_handler.space_id);
acpi_ex_out_pointer ("Next", obj_desc->addr_handler.next);
- acpi_ex_out_pointer ("Region_list", obj_desc->addr_handler.region_list);
+ acpi_ex_out_pointer ("region_list", obj_desc->addr_handler.region_list);
acpi_ex_out_pointer ("Node", obj_desc->addr_handler.node);
acpi_ex_out_pointer ("Context", obj_desc->addr_handler.context);
break;
@@ -764,7 +763,7 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_LOCAL_DATA:
default:
- acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %s\n",
+ acpi_os_printf ("ex_dump_object_descriptor: Display not implemented for object type %s\n",
acpi_ut_get_object_type_name (obj_desc));
break;
}
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index 508aa479358d..7ac114676ac1 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
- * $Revision: 117 $
*
*****************************************************************************/
@@ -35,11 +34,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_read_data_from_field
+ * FUNCTION: acpi_ex_read_data_from_field
*
- * PARAMETERS: Walk_state - Current execution state
- * Obj_desc - The named field
- * Ret_buffer_desc - Where the return data object is stored
+ * PARAMETERS: walk_state - Current execution state
+ * obj_desc - The named field
+ * ret_buffer_desc - Where the return data object is stored
*
* RETURN: Status
*
@@ -56,12 +55,12 @@ acpi_ex_read_data_from_field (
{
acpi_status status;
acpi_operand_object *buffer_desc;
- ACPI_SIZE length;
+ acpi_size length;
void *buffer;
u8 locked;
- ACPI_FUNCTION_TRACE_PTR ("Ex_read_data_from_field", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_read_data_from_field", obj_desc);
/* Parameter validation */
@@ -72,7 +71,7 @@ acpi_ex_read_data_from_field (
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
/*
- * If the Buffer_field arguments have not been previously evaluated,
+ * If the buffer_field arguments have not been previously evaluated,
* evaluate them now and save the results.
*/
if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
@@ -118,7 +117,7 @@ acpi_ex_read_data_from_field (
*
* Note: Field.length is in bits.
*/
- length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length);
+ length = (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES (obj_desc->field.bit_length);
if (length > acpi_gbl_integer_byte_width) {
/* Field is too large for an Integer, create a Buffer instead */
@@ -145,7 +144,7 @@ acpi_ex_read_data_from_field (
"Obj=%p Type=%X Buf=%p Len=%X\n",
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, (u32) length));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Field_write: Bit_len=%X Bit_off=%X Byte_off=%X\n",
+ "field_write: bit_len=%X bit_off=%X byte_off=%X\n",
obj_desc->common_field.bit_length,
obj_desc->common_field.start_field_bit_offset,
obj_desc->common_field.base_byte_offset));
@@ -174,10 +173,10 @@ exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_write_data_to_field
+ * FUNCTION: acpi_ex_write_data_to_field
*
- * PARAMETERS: Source_desc - Contains data to write
- * Obj_desc - The named field
+ * PARAMETERS: source_desc - Contains data to write
+ * obj_desc - The named field
*
* RETURN: Status
*
@@ -200,7 +199,7 @@ acpi_ex_write_data_to_field (
acpi_operand_object *buffer_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ex_write_data_to_field", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_write_data_to_field", obj_desc);
/* Parameter validation */
@@ -211,7 +210,7 @@ acpi_ex_write_data_to_field (
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
/*
- * If the Buffer_field arguments have not been previously evaluated,
+ * If the buffer_field arguments have not been previously evaluated,
* evaluate them now and save the results.
*/
if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
@@ -320,7 +319,7 @@ acpi_ex_write_data_to_field (
"Obj=%p Type=%X Buf=%p Len=%X\n",
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc), buffer, length));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Field_read: Bit_len=%X Bit_off=%X Byte_off=%X\n",
+ "field_read: bit_len=%X bit_off=%X byte_off=%X\n",
obj_desc->common_field.bit_length,
obj_desc->common_field.start_field_bit_offset,
obj_desc->common_field.base_byte_offset));
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index 784573474e00..a38dd560a1df 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
- * $Revision: 91 $
*
*****************************************************************************/
@@ -37,16 +36,16 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_setup_region
+ * FUNCTION: acpi_ex_setup_region
*
- * PARAMETERS: *Obj_desc - Field to be read or written
- * Field_datum_byte_offset - Byte offset of this datum within the
+ * PARAMETERS: *obj_desc - Field to be read or written
+ * field_datum_byte_offset - Byte offset of this datum within the
* parent field
*
* RETURN: Status
*
- * DESCRIPTION: Common processing for Acpi_ex_extract_from_field and
- * Acpi_ex_insert_into_field. Initialize the
+ * DESCRIPTION: Common processing for acpi_ex_extract_from_field and
+ * acpi_ex_insert_into_field. Initialize the
*
******************************************************************************/
@@ -59,7 +58,7 @@ acpi_ex_setup_region (
acpi_operand_object *rgn_desc;
- ACPI_FUNCTION_TRACE_U32 ("Ex_setup_region", field_datum_byte_offset);
+ ACPI_FUNCTION_TRACE_U32 ("ex_setup_region", field_datum_byte_offset);
rgn_desc = obj_desc->common_field.region_obj;
@@ -101,7 +100,7 @@ acpi_ex_setup_region (
+ obj_desc->common_field.access_byte_width)) {
if (rgn_desc->region.length < obj_desc->common_field.access_byte_width) {
/*
- * This is the case where the Access_type (Acc_word, etc.) is wider
+ * This is the case where the access_type (acc_word, etc.) is wider
* than the region itself. For example, a region of length one
* byte, and a field with Dword access specified.
*/
@@ -130,10 +129,10 @@ acpi_ex_setup_region (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_access_region
+ * FUNCTION: acpi_ex_access_region
*
- * PARAMETERS: *Obj_desc - Field to be read
- * Field_datum_byte_offset - Byte offset of this datum within the
+ * PARAMETERS: *obj_desc - Field to be read
+ * field_datum_byte_offset - Byte offset of this datum within the
* parent field
* *Value - Where to store value (must at least
* the size of acpi_integer)
@@ -155,10 +154,10 @@ acpi_ex_access_region (
{
acpi_status status;
acpi_operand_object *rgn_desc;
- ACPI_PHYSICAL_ADDRESS address;
+ acpi_physical_address address;
- ACPI_FUNCTION_TRACE ("Ex_access_region");
+ ACPI_FUNCTION_TRACE ("ex_access_region");
/*
@@ -198,7 +197,7 @@ acpi_ex_access_region (
field_datum_byte_offset,
ACPI_HIDWORD (address), ACPI_LODWORD (address)));
- /* Invoke the appropriate Address_space/Op_region handler */
+ /* Invoke the appropriate address_space/op_region handler */
status = acpi_ev_address_space_dispatch (rgn_desc, function,
address, ACPI_MUL_8 (obj_desc->common_field.access_byte_width), value);
@@ -224,9 +223,9 @@ acpi_ex_access_region (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_register_overflow
+ * FUNCTION: acpi_ex_register_overflow
*
- * PARAMETERS: *Obj_desc - Register(Field) to be written
+ * PARAMETERS: *obj_desc - Register(Field) to be written
* Value - Value to be stored
*
* RETURN: TRUE if value overflows the field, FALSE otherwise
@@ -269,19 +268,19 @@ acpi_ex_register_overflow (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_field_datum_io
+ * FUNCTION: acpi_ex_field_datum_io
*
- * PARAMETERS: *Obj_desc - Field to be read
- * Field_datum_byte_offset - Byte offset of this datum within the
+ * PARAMETERS: *obj_desc - Field to be read
+ * field_datum_byte_offset - Byte offset of this datum within the
* parent field
* *Value - Where to store value (must be 64 bits)
- * Read_write - Read or Write flag
+ * read_write - Read or Write flag
*
* RETURN: Status
*
- * DESCRIPTION: Read or Write a single datum of a field. The Field_type is
+ * DESCRIPTION: Read or Write a single datum of a field. The field_type is
* demultiplexed here to handle the different types of fields
- * (Buffer_field, Region_field, Index_field, Bank_field)
+ * (buffer_field, region_field, index_field, bank_field)
*
******************************************************************************/
@@ -296,7 +295,7 @@ acpi_ex_field_datum_io (
acpi_integer local_value;
- ACPI_FUNCTION_TRACE_U32 ("Ex_field_datum_io", field_datum_byte_offset);
+ ACPI_FUNCTION_TRACE_U32 ("ex_field_datum_io", field_datum_byte_offset);
if (read_write == ACPI_READ) {
@@ -313,15 +312,15 @@ acpi_ex_field_datum_io (
/*
* The four types of fields are:
*
- * Buffer_fields - Read/write from/to a Buffer
- * Region_fields - Read/write from/to a Operation Region.
- * Bank_fields - Write to a Bank Register, then read/write from/to an Op_region
- * Index_fields - Write to an Index Register, then read/write from/to a Data Register
+ * buffer_fields - Read/write from/to a Buffer
+ * region_fields - Read/write from/to a Operation Region.
+ * bank_fields - Write to a Bank Register, then read/write from/to an op_region
+ * index_fields - Write to an Index Register, then read/write from/to a Data Register
*/
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_BUFFER_FIELD:
/*
- * If the Buffer_field arguments have not been previously evaluated,
+ * If the buffer_field arguments have not been previously evaluated,
* evaluate them now and save the results.
*/
if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
@@ -358,7 +357,7 @@ acpi_ex_field_datum_io (
case ACPI_TYPE_LOCAL_BANK_FIELD:
- /* Ensure that the Bank_value is not beyond the capacity of the register */
+ /* Ensure that the bank_value is not beyond the capacity of the register */
if (acpi_ex_register_overflow (obj_desc->bank_field.bank_obj,
(acpi_integer) obj_desc->bank_field.value)) {
@@ -366,8 +365,8 @@ acpi_ex_field_datum_io (
}
/*
- * For Bank_fields, we must write the Bank_value to the Bank_register
- * (itself a Region_field) before we can access the data.
+ * For bank_fields, we must write the bank_value to the bank_register
+ * (itself a region_field) before we can access the data.
*/
status = acpi_ex_insert_into_field (obj_desc->bank_field.bank_obj,
&obj_desc->bank_field.value,
@@ -378,7 +377,7 @@ acpi_ex_field_datum_io (
/*
* Now that the Bank has been selected, fall through to the
- * Region_field case and write the datum to the Operation Region
+ * region_field case and write the datum to the Operation Region
*/
/*lint -fallthrough */
@@ -386,7 +385,7 @@ acpi_ex_field_datum_io (
case ACPI_TYPE_LOCAL_REGION_FIELD:
/*
- * For simple Region_fields, we just directly access the owning
+ * For simple region_fields, we just directly access the owning
* Operation Region.
*/
status = acpi_ex_access_region (obj_desc, field_datum_byte_offset, value,
@@ -397,14 +396,14 @@ acpi_ex_field_datum_io (
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- /* Ensure that the Index_value is not beyond the capacity of the register */
+ /* Ensure that the index_value is not beyond the capacity of the register */
if (acpi_ex_register_overflow (obj_desc->index_field.index_obj,
(acpi_integer) obj_desc->index_field.value)) {
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
}
- /* Write the index value to the Index_register (itself a Region_field) */
+ /* Write the index value to the index_register (itself a region_field) */
status = acpi_ex_insert_into_field (obj_desc->index_field.index_obj,
&obj_desc->index_field.value,
@@ -414,7 +413,7 @@ acpi_ex_field_datum_io (
}
if (read_write == ACPI_READ) {
- /* Read the datum from the Data_register */
+ /* Read the datum from the data_register */
status = acpi_ex_extract_from_field (obj_desc->index_field.data_obj,
value, obj_desc->common_field.access_byte_width);
@@ -453,9 +452,9 @@ acpi_ex_field_datum_io (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_write_with_update_rule
+ * FUNCTION: acpi_ex_write_with_update_rule
*
- * PARAMETERS: *Obj_desc - Field to be set
+ * PARAMETERS: *obj_desc - Field to be set
* Value - Value to store
*
* RETURN: Status
@@ -476,7 +475,7 @@ acpi_ex_write_with_update_rule (
acpi_integer current_value;
- ACPI_FUNCTION_TRACE_U32 ("Ex_write_with_update_rule", mask);
+ ACPI_FUNCTION_TRACE_U32 ("ex_write_with_update_rule", mask);
/* Start with the new bits */
@@ -522,7 +521,7 @@ acpi_ex_write_with_update_rule (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Write_with_update_rule: Unknown Update_rule setting: %X\n",
+ "write_with_update_rule: Unknown update_rule setting: %X\n",
(obj_desc->common_field.field_flags & AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
@@ -534,7 +533,7 @@ acpi_ex_write_with_update_rule (
&merged_value, ACPI_WRITE);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Mask %8.8X%8.8X Datum_offset %X Value %8.8X%8.8X, Merged_value %8.8X%8.8X\n",
+ "Mask %8.8X%8.8X datum_offset %X Value %8.8X%8.8X, merged_value %8.8X%8.8X\n",
ACPI_HIDWORD (mask), ACPI_LODWORD (mask),
field_datum_byte_offset,
ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value),
@@ -546,11 +545,11 @@ acpi_ex_write_with_update_rule (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_get_buffer_datum
+ * FUNCTION: acpi_ex_get_buffer_datum
*
* PARAMETERS: Datum - Where the Datum is returned
* Buffer - Raw field buffer
- * Byte_granularity - 1/2/4/8 Granularity of the field
+ * byte_granularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
* Offset - Datum offset into the buffer
*
@@ -602,11 +601,11 @@ acpi_ex_get_buffer_datum(
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_set_buffer_datum
+ * FUNCTION: acpi_ex_set_buffer_datum
*
- * PARAMETERS: Merged_datum - Value to store
+ * PARAMETERS: merged_datum - Value to store
* Buffer - Receiving buffer
- * Byte_granularity - 1/2/4/8 Granularity of the field
+ * byte_granularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
* Offset - Datum offset into the buffer
*
@@ -658,9 +657,9 @@ acpi_ex_set_buffer_datum (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_extract_from_field
+ * FUNCTION: acpi_ex_extract_from_field
*
- * PARAMETERS: *Obj_desc - Field to be read
+ * PARAMETERS: *obj_desc - Field to be read
* *Value - Where to store value
*
* RETURN: Status
@@ -685,7 +684,7 @@ acpi_ex_extract_from_field (
u32 datum_count;
- ACPI_FUNCTION_TRACE ("Ex_extract_from_field");
+ ACPI_FUNCTION_TRACE ("ex_extract_from_field");
/*
@@ -706,7 +705,7 @@ acpi_ex_extract_from_field (
obj_desc->common_field.access_byte_width);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Byte_len=%X, Datum_len=%X, Byte_gran=%X\n",
+ "byte_len=%X, datum_len=%X, byte_gran=%X\n",
byte_field_length, datum_count,obj_desc->common_field.access_byte_width));
/*
@@ -834,9 +833,9 @@ acpi_ex_extract_from_field (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_insert_into_field
+ * FUNCTION: acpi_ex_insert_into_field
*
- * PARAMETERS: *Obj_desc - Field to be set
+ * PARAMETERS: *obj_desc - Field to be set
* Buffer - Value to store
*
* RETURN: Status
@@ -862,7 +861,7 @@ acpi_ex_insert_into_field (
u32 datum_count;
- ACPI_FUNCTION_TRACE ("Ex_insert_into_field");
+ ACPI_FUNCTION_TRACE ("ex_insert_into_field");
/*
@@ -884,7 +883,7 @@ acpi_ex_insert_into_field (
datum_count = ACPI_ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Byte_len=%X, Datum_len=%X, Byte_gran=%X\n",
+ "byte_len=%X, datum_len=%X, byte_gran=%X\n",
byte_field_length, datum_count, obj_desc->common_field.access_byte_width));
/*
@@ -907,7 +906,7 @@ acpi_ex_insert_into_field (
* Note: The code in this section also handles the aligned case
*
* Construct Mask with 1 bits where the field is, 0 bits elsewhere
- * (Only the bottom 5 bits of Bit_length are valid for a shift operation)
+ * (Only the bottom 5 bits of bit_length are valid for a shift operation)
*
* Mask off bits that are "below" the field (if any)
*/
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index d097074695da..2629767a4633 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
- * $Revision: 114 $
*
*****************************************************************************/
@@ -36,16 +35,16 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_get_object_reference
+ * FUNCTION: acpi_ex_get_object_reference
*
- * PARAMETERS: Obj_desc - Create a reference to this object
- * Return_desc - Where to store the reference
- * Walk_state - Current state
+ * PARAMETERS: obj_desc - Create a reference to this object
+ * return_desc - Where to store the reference
+ * walk_state - Current state
*
* RETURN: Status
*
* DESCRIPTION: Obtain and return a "reference" to the target object
- * Common code for the Ref_of_op and the Cond_ref_of_op.
+ * Common code for the ref_of_op and the cond_ref_of_op.
*
******************************************************************************/
@@ -59,7 +58,7 @@ acpi_ex_get_object_reference (
acpi_operand_object *referenced_obj;
- ACPI_FUNCTION_TRACE_PTR ("Ex_get_object_reference", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_get_object_reference", obj_desc);
*return_desc = NULL;
@@ -129,11 +128,11 @@ acpi_ex_get_object_reference (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_concat_template
+ * FUNCTION: acpi_ex_concat_template
*
- * PARAMETERS: *Obj_desc - Object to be converted. Must be an
+ * PARAMETERS: *obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
- * Walk_state - Current walk state
+ * walk_state - Current walk state
*
* RETURN: Status
*
@@ -152,14 +151,14 @@ acpi_ex_concat_template (
u8 *new_buf;
u8 *end_tag1;
u8 *end_tag2;
- ACPI_SIZE length1;
- ACPI_SIZE length2;
+ acpi_size length1;
+ acpi_size length2;
- ACPI_FUNCTION_TRACE ("Ex_concat_template");
+ ACPI_FUNCTION_TRACE ("ex_concat_template");
- /* Find the End_tags in each resource template */
+ /* Find the end_tags in each resource template */
end_tag1 = acpi_ut_get_resource_end_tag (obj_desc1);
end_tag2 = acpi_ut_get_resource_end_tag (obj_desc2);
@@ -201,12 +200,12 @@ acpi_ex_concat_template (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_do_concatenate
+ * FUNCTION: acpi_ex_do_concatenate
*
- * PARAMETERS: Obj_desc1 - First source object
- * Obj_desc2 - Second source object
- * Actual_return_desc - Where to place the return object
- * Walk_state - Current walk state
+ * PARAMETERS: obj_desc1 - First source object
+ * obj_desc2 - Second source object
+ * actual_return_desc - Where to place the return object
+ * walk_state - Current walk state
*
* RETURN: Status
*
@@ -281,11 +280,11 @@ acpi_ex_do_concatenate (
/* Operand0 is string */
- new_buf = ACPI_MEM_CALLOCATE ((ACPI_SIZE) obj_desc1->string.length +
- (ACPI_SIZE) obj_desc2->string.length + 1);
+ new_buf = ACPI_MEM_CALLOCATE ((acpi_size) obj_desc1->string.length +
+ (acpi_size) obj_desc2->string.length + 1);
if (!new_buf) {
ACPI_REPORT_ERROR
- (("Ex_do_concatenate: String allocation failure\n"));
+ (("ex_do_concatenate: String allocation failure\n"));
status = AE_NO_MEMORY;
goto cleanup;
}
@@ -309,8 +308,8 @@ acpi_ex_do_concatenate (
/* Result of two Buffers is a Buffer */
return_desc = acpi_ut_create_buffer_object (
- (ACPI_SIZE) obj_desc1->buffer.length +
- (ACPI_SIZE) obj_desc2->buffer.length);
+ (acpi_size) obj_desc1->buffer.length +
+ (acpi_size) obj_desc2->buffer.length);
if (!return_desc) {
return (AE_NO_MEMORY);
}
@@ -348,7 +347,7 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_do_math_op
+ * FUNCTION: acpi_ex_do_math_op
*
* PARAMETERS: Opcode - AML opcode
* Operand0 - Integer operand #0
@@ -406,12 +405,12 @@ acpi_ex_do_math_op (
return (operand0 * operand1);
- case AML_SHIFT_LEFT_OP: /* Shift_left (Operand, Shift_count, Result) */
+ case AML_SHIFT_LEFT_OP: /* shift_left (Operand, shift_count, Result) */
return (operand0 << operand1);
- case AML_SHIFT_RIGHT_OP: /* Shift_right (Operand, Shift_count, Result) */
+ case AML_SHIFT_RIGHT_OP: /* shift_right (Operand, shift_count, Result) */
return (operand0 >> operand1);
@@ -429,7 +428,7 @@ acpi_ex_do_math_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_do_logical_op
+ * FUNCTION: acpi_ex_do_logical_op
*
* PARAMETERS: Opcode - AML opcode
* Operand0 - Integer operand #0
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index b7b8d7ceb582..bac364f30205 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exmutex - ASL Mutex Acquire/Release functions
- * $Revision: 17 $
*
*****************************************************************************/
@@ -34,13 +33,13 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_unlink_mutex
+ * FUNCTION: acpi_ex_unlink_mutex
*
- * PARAMETERS: *Obj_desc - The mutex to be unlinked
+ * PARAMETERS: *obj_desc - The mutex to be unlinked
*
* RETURN: Status
*
- * DESCRIPTION: Remove a mutex from the "Acquired_mutex" list
+ * DESCRIPTION: Remove a mutex from the "acquired_mutex" list
*
******************************************************************************/
@@ -48,7 +47,7 @@ void
acpi_ex_unlink_mutex (
acpi_operand_object *obj_desc)
{
- ACPI_THREAD_STATE *thread = obj_desc->mutex.owner_thread;
+ acpi_thread_state *thread = obj_desc->mutex.owner_thread;
if (!thread) {
@@ -70,21 +69,21 @@ acpi_ex_unlink_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_link_mutex
+ * FUNCTION: acpi_ex_link_mutex
*
- * PARAMETERS: *Obj_desc - The mutex to be linked
- * *List_head - head of the "Acquired_mutex" list
+ * PARAMETERS: *obj_desc - The mutex to be linked
+ * *list_head - head of the "acquired_mutex" list
*
* RETURN: Status
*
- * DESCRIPTION: Add a mutex to the "Acquired_mutex" list for this walk
+ * DESCRIPTION: Add a mutex to the "acquired_mutex" list for this walk
*
******************************************************************************/
void
acpi_ex_link_mutex (
acpi_operand_object *obj_desc,
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
acpi_operand_object *list_head;
@@ -110,10 +109,10 @@ acpi_ex_link_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_acquire_mutex
+ * FUNCTION: acpi_ex_acquire_mutex
*
- * PARAMETERS: *Time_desc - The 'time to delay' object descriptor
- * *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *time_desc - The 'time to delay' object descriptor
+ * *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
@@ -130,7 +129,7 @@ acpi_ex_acquire_mutex (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_acquire_mutex", obj_desc);
if (!obj_desc) {
@@ -150,7 +149,7 @@ acpi_ex_acquire_mutex (
* mutex. This mechanism provides some deadlock prevention
*/
if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
- ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect Sync_level\n",
+ ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
}
@@ -173,7 +172,7 @@ acpi_ex_acquire_mutex (
status = acpi_ex_system_acquire_mutex (time_desc, obj_desc);
if (ACPI_FAILURE (status)) {
- /* Includes failure from a timeout on Time_desc */
+ /* Includes failure from a timeout on time_desc */
return_ACPI_STATUS (status);
}
@@ -195,9 +194,9 @@ acpi_ex_acquire_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_release_mutex
+ * FUNCTION: acpi_ex_release_mutex
*
- * PARAMETERS: *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
@@ -213,7 +212,7 @@ acpi_ex_release_mutex (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_release_mutex");
+ ACPI_FUNCTION_TRACE ("ex_release_mutex");
if (!obj_desc) {
@@ -252,7 +251,7 @@ acpi_ex_release_mutex (
* equal to the current sync level
*/
if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
- ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect Sync_level\n",
+ ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
}
@@ -286,9 +285,9 @@ acpi_ex_release_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_release_all_mutexes
+ * FUNCTION: acpi_ex_release_all_mutexes
*
- * PARAMETERS: *Mutex_list - Head of the mutex list
+ * PARAMETERS: *mutex_list - Head of the mutex list
*
* RETURN: Status
*
@@ -298,7 +297,7 @@ acpi_ex_release_mutex (
void
acpi_ex_release_all_mutexes (
- ACPI_THREAD_STATE *thread)
+ acpi_thread_state *thread)
{
acpi_operand_object *next = thread->acquired_mutex_list;
acpi_operand_object *this;
diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
index c1d482359b86..fd8159362de2 100644
--- a/drivers/acpi/executer/exnames.c
+++ b/drivers/acpi/executer/exnames.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exnames - interpreter/scanner name load/execute
- * $Revision: 93 $
*
*****************************************************************************/
@@ -43,11 +42,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_allocate_name_string
+ * FUNCTION: acpi_ex_allocate_name_string
*
- * PARAMETERS: Prefix_count - Count of parent levels. Special cases:
+ * PARAMETERS: prefix_count - Count of parent levels. Special cases:
* (-1) = root, 0 = none
- * Num_name_segs - count of 4-character name segments
+ * num_name_segs - count of 4-character name segments
*
* RETURN: A pointer to the allocated string segment. This segment must
* be deleted by the caller.
@@ -66,11 +65,11 @@ acpi_ex_allocate_name_string (
char *name_string;
u32 size_needed;
- ACPI_FUNCTION_TRACE ("Ex_allocate_name_string");
+ ACPI_FUNCTION_TRACE ("ex_allocate_name_string");
/*
- * Allow room for all \ and ^ prefixes, all segments, and a Multi_name_prefix.
+ * Allow room for all \ and ^ prefixes, all segments, and a multi_name_prefix.
* Also, one byte for the null terminator.
* This may actually be somewhat longer than needed.
*/
@@ -89,7 +88,7 @@ acpi_ex_allocate_name_string (
*/
name_string = ACPI_MEM_ALLOCATE (size_needed);
if (!name_string) {
- ACPI_REPORT_ERROR (("Ex_allocate_name_string: Could not allocate size %d\n", size_needed));
+ ACPI_REPORT_ERROR (("ex_allocate_name_string: Could not allocate size %d\n", size_needed));
return_PTR (NULL);
}
@@ -122,7 +121,7 @@ acpi_ex_allocate_name_string (
}
/*
- * Terminate string following prefixes. Acpi_ex_name_segment() will
+ * Terminate string following prefixes. acpi_ex_name_segment() will
* append the segment(s)
*/
*temp_ptr = 0;
@@ -132,9 +131,9 @@ acpi_ex_allocate_name_string (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_name_segment
+ * FUNCTION: acpi_ex_name_segment
*
- * PARAMETERS: Interpreter_mode - Current running mode (load1/Load2/Exec)
+ * PARAMETERS: interpreter_mode - Current running mode (load1/Load2/Exec)
*
* RETURN: Status
*
@@ -153,7 +152,7 @@ acpi_ex_name_segment (
char char_buf[5];
- ACPI_FUNCTION_TRACE ("Ex_name_segment");
+ ACPI_FUNCTION_TRACE ("ex_name_segment");
/*
@@ -219,9 +218,9 @@ acpi_ex_name_segment (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_get_name_string
+ * FUNCTION: acpi_ex_get_name_string
*
- * PARAMETERS: Data_type - Data type to be associated with this name
+ * PARAMETERS: data_type - Data type to be associated with this name
*
* RETURN: Status
*
@@ -244,13 +243,13 @@ acpi_ex_get_name_string (
u8 has_prefix = FALSE;
- ACPI_FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address);
+ ACPI_FUNCTION_TRACE_PTR ("ex_get_name_string", aml_address);
if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type ||
ACPI_TYPE_LOCAL_BANK_FIELD == data_type ||
ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) {
- /* Disallow prefixes for types associated with Field_unit names */
+ /* Disallow prefixes for types associated with field_unit names */
name_string = acpi_ex_allocate_name_string (0, 1);
if (!name_string) {
@@ -262,17 +261,17 @@ acpi_ex_get_name_string (
}
else {
/*
- * Data_type is not a field name.
+ * data_type is not a field name.
* Examine first character of name for root or parent prefix operators
*/
switch (*aml_address) {
case AML_ROOT_PREFIX:
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Root_prefix(\\) at %p\n", aml_address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "root_prefix(\\) at %p\n", aml_address));
/*
- * Remember that we have a Root_prefix --
- * see comment in Acpi_ex_allocate_name_string()
+ * Remember that we have a root_prefix --
+ * see comment in acpi_ex_allocate_name_string()
*/
aml_address++;
prefix_count = ACPI_UINT32_MAX;
@@ -285,7 +284,7 @@ acpi_ex_get_name_string (
/* Increment past possibly multiple parent prefixes */
do {
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Parent_prefix (^) at %p\n", aml_address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "parent_prefix (^) at %p\n", aml_address));
aml_address++;
prefix_count++;
@@ -309,7 +308,7 @@ acpi_ex_get_name_string (
switch (*aml_address) {
case AML_DUAL_NAME_PREFIX:
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Dual_name_prefix at %p\n", aml_address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "dual_name_prefix at %p\n", aml_address));
aml_address++;
name_string = acpi_ex_allocate_name_string (prefix_count, 2);
@@ -331,7 +330,7 @@ acpi_ex_get_name_string (
case AML_MULTI_NAME_PREFIX_OP:
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Multi_name_prefix at %p\n", aml_address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "multi_name_prefix at %p\n", aml_address));
/* Fetch count of segments remaining in name path */
@@ -359,10 +358,10 @@ acpi_ex_get_name_string (
case 0:
- /* Null_name valid as of 8-12-98 ASL/AML Grammar Update */
+ /* null_name valid as of 8-12-98 ASL/AML Grammar Update */
if (prefix_count == ACPI_UINT32_MAX) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Name_seg is \"\\\" followed by NULL\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "name_seg is \"\\\" followed by NULL\n"));
}
/* Consume the NULL byte */
@@ -396,7 +395,7 @@ acpi_ex_get_name_string (
/* Ran out of segments after processing a prefix */
ACPI_REPORT_ERROR (
- ("Ex_do_name: Malformed Name at %p\n", name_string));
+ ("ex_do_name: Malformed Name at %p\n", name_string));
status = AE_AML_BAD_NAME;
}
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 8578e4fe153b..2f8a0426803a 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
- * $Revision: 146 $
*
*****************************************************************************/
@@ -61,9 +60,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_1A_0T_0R
+ * FUNCTION: acpi_ex_opcode_1A_0T_0R
*
- * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ * PARAMETERS: walk_state - Current state (contains AML opcode)
*
* RETURN: Status
*
@@ -80,37 +79,37 @@ acpi_ex_opcode_1A_0T_0R (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the AML opcode */
switch (walk_state->opcode) {
- case AML_RELEASE_OP: /* Release (Mutex_object) */
+ case AML_RELEASE_OP: /* Release (mutex_object) */
status = acpi_ex_release_mutex (operand[0], walk_state);
break;
- case AML_RESET_OP: /* Reset (Event_object) */
+ case AML_RESET_OP: /* Reset (event_object) */
status = acpi_ex_system_reset_event (operand[0]);
break;
- case AML_SIGNAL_OP: /* Signal (Event_object) */
+ case AML_SIGNAL_OP: /* Signal (event_object) */
status = acpi_ex_system_signal_event (operand[0]);
break;
- case AML_SLEEP_OP: /* Sleep (Msec_time) */
+ case AML_SLEEP_OP: /* Sleep (msec_time) */
status = acpi_ex_system_do_suspend ((u32) operand[0]->integer.value);
break;
- case AML_STALL_OP: /* Stall (Usec_time) */
+ case AML_STALL_OP: /* Stall (usec_time) */
status = acpi_ex_system_do_stall ((u32) operand[0]->integer.value);
break;
@@ -124,7 +123,7 @@ acpi_ex_opcode_1A_0T_0R (
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
break;
@@ -136,9 +135,9 @@ acpi_ex_opcode_1A_0T_0R (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_1A_1T_0R
+ * FUNCTION: acpi_ex_opcode_1A_1T_0R
*
- * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ * PARAMETERS: walk_state - Current state (contains AML opcode)
*
* RETURN: Status
*
@@ -155,7 +154,7 @@ acpi_ex_opcode_1A_1T_0R (
acpi_operand_object **operand = &walk_state->operands[0];
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the AML opcode */
@@ -168,7 +167,7 @@ acpi_ex_opcode_1A_1T_0R (
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
@@ -183,9 +182,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_1A_1T_1R
+ * FUNCTION: acpi_ex_opcode_1A_1T_1R
*
- * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ * PARAMETERS: walk_state - Current state (contains AML opcode)
*
* RETURN: Status
*
@@ -208,7 +207,7 @@ acpi_ex_opcode_1A_1T_1R (
acpi_integer digit;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the AML opcode */
@@ -236,7 +235,7 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_FIND_SET_LEFT_BIT_OP: /* Find_set_left_bit (Operand, Result) */
+ case AML_FIND_SET_LEFT_BIT_OP: /* find_set_left_bit (Operand, Result) */
return_desc->integer.value = operand[0]->integer.value;
@@ -252,7 +251,7 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_FIND_SET_RIGHT_BIT_OP: /* Find_set_right_bit (Operand, Result) */
+ case AML_FIND_SET_RIGHT_BIT_OP: /* find_set_right_bit (Operand, Result) */
return_desc->integer.value = operand[0]->integer.value;
@@ -270,7 +269,7 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_FROM_BCD_OP: /* From_bcd (BCDValue, Result) */
+ case AML_FROM_BCD_OP: /* from_bcd (BCDValue, Result) */
/*
* The 64-bit ACPI integer can hold 16 4-bit BCD integers
@@ -303,7 +302,7 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_TO_BCD_OP: /* To_bcd (Operand, Result) */
+ case AML_TO_BCD_OP: /* to_bcd (Operand, Result) */
if (operand[0]->integer.value > ACPI_MAX_BCD_VALUE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "BCD overflow: %8.8X%8.8X\n",
@@ -332,7 +331,7 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_COND_REF_OF_OP: /* Cond_ref_of (Source_object, Result) */
+ case AML_COND_REF_OF_OP: /* cond_ref_of (source_object, Result) */
/*
* This op is a little strange because the internal return value is
@@ -407,32 +406,32 @@ acpi_ex_opcode_1A_1T_1R (
break;
- case AML_TO_DECSTRING_OP: /* To_decimal_string (Data, Result) */
+ case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */
status = acpi_ex_convert_to_string (operand[0], &return_desc, 10, ACPI_UINT32_MAX, walk_state);
break;
- case AML_TO_HEXSTRING_OP: /* To_hex_string (Data, Result) */
+ case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */
status = acpi_ex_convert_to_string (operand[0], &return_desc, 16, ACPI_UINT32_MAX, walk_state);
break;
- case AML_TO_BUFFER_OP: /* To_buffer (Data, Result) */
+ case AML_TO_BUFFER_OP: /* to_buffer (Data, Result) */
status = acpi_ex_convert_to_buffer (operand[0], &return_desc, walk_state);
break;
- case AML_TO_INTEGER_OP: /* To_integer (Data, Result) */
+ case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */
status = acpi_ex_convert_to_integer (operand[0], &return_desc, walk_state);
break;
- case AML_SHIFT_LEFT_BIT_OP: /* Shift_left_bit (Source, Bit_num) */
- case AML_SHIFT_RIGHT_BIT_OP: /* Shift_right_bit (Source, Bit_num) */
+ case AML_SHIFT_LEFT_BIT_OP: /* shift_left_bit (Source, bit_num) */
+ case AML_SHIFT_RIGHT_BIT_OP: /* shift_right_bit (Source, bit_num) */
/*
* These are two obsolete opcodes
@@ -445,7 +444,7 @@ acpi_ex_opcode_1A_1T_1R (
default: /* Unknown opcode */
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
@@ -475,9 +474,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_1A_0T_1R
+ * FUNCTION: acpi_ex_opcode_1A_0T_1R
*
- * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ * PARAMETERS: walk_state - Current state (contains AML opcode)
*
* RETURN: Status
*
@@ -497,7 +496,7 @@ acpi_ex_opcode_1A_0T_1R (
acpi_integer value;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_1A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the AML opcode */
@@ -530,8 +529,8 @@ acpi_ex_opcode_1A_0T_1R (
}
/*
- * Convert the Return_desc Reference to a Number
- * (This removes a reference on the Return_desc object)
+ * Convert the return_desc Reference to a Number
+ * (This removes a reference on the return_desc object)
*/
status = acpi_ex_resolve_operands (AML_LNOT_OP, &return_desc, walk_state);
if (ACPI_FAILURE (status)) {
@@ -542,7 +541,7 @@ acpi_ex_opcode_1A_0T_1R (
}
/*
- * Return_desc is now guaranteed to be an Integer object
+ * return_desc is now guaranteed to be an Integer object
* Do the actual increment or decrement
*/
if (AML_INCREMENT_OP == walk_state->opcode) {
@@ -558,7 +557,7 @@ acpi_ex_opcode_1A_0T_1R (
break;
- case AML_TYPE_OP: /* Object_type (Source_object) */
+ case AML_TYPE_OP: /* object_type (source_object) */
/* Get the type of the base object */
@@ -579,7 +578,7 @@ acpi_ex_opcode_1A_0T_1R (
break;
- case AML_SIZE_OF_OP: /* Size_of (Source_object) */
+ case AML_SIZE_OF_OP: /* size_of (source_object) */
/* Get the base object */
@@ -607,7 +606,7 @@ acpi_ex_opcode_1A_0T_1R (
break;
default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Size_of, Not Buf/Str/Pkg - found type %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "size_of, Not Buf/Str/Pkg - found type %s\n",
acpi_ut_get_type_name (type)));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
@@ -627,7 +626,7 @@ acpi_ex_opcode_1A_0T_1R (
break;
- case AML_REF_OF_OP: /* Ref_of (Source_object) */
+ case AML_REF_OF_OP: /* ref_of (source_object) */
status = acpi_ex_get_object_reference (operand[0], &return_desc, walk_state);
if (ACPI_FAILURE (status)) {
@@ -636,7 +635,7 @@ acpi_ex_opcode_1A_0T_1R (
break;
- case AML_DEREF_OF_OP: /* Deref_of (Obj_reference | String) */
+ case AML_DEREF_OF_OP: /* deref_of (obj_reference | String) */
/* Check for a method local or argument, or standalone String */
@@ -644,7 +643,7 @@ acpi_ex_opcode_1A_0T_1R (
switch (ACPI_GET_OBJECT_TYPE (operand[0])) {
case ACPI_TYPE_LOCAL_REFERENCE:
/*
- * This is a Deref_of (Local_x | Arg_x)
+ * This is a deref_of (local_x | arg_x)
*
* Must resolve/dereference the local/arg reference first
*/
@@ -688,7 +687,7 @@ acpi_ex_opcode_1A_0T_1R (
case ACPI_TYPE_STRING:
/*
- * This is a Deref_of (String). The string is a reference to a named ACPI object.
+ * This is a deref_of (String). The string is a reference to a named ACPI object.
*
* 1) Find the owning Node
* 2) Dereference the node to an actual object. Could be a Field, so we nee
@@ -717,16 +716,16 @@ acpi_ex_opcode_1A_0T_1R (
if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) == ACPI_DESC_TYPE_NAMED) {
/*
- * This is a Deref_of (Object_reference)
+ * This is a deref_of (object_reference)
* Get the actual object from the Node (This is the dereference).
- * -- This case may only happen when a Local_x or Arg_x is dereferenced above.
+ * -- This case may only happen when a local_x or arg_x is dereferenced above.
*/
return_desc = acpi_ns_get_attached_object ((acpi_namespace_node *) operand[0]);
}
else {
/*
* This must be a reference object produced by either the Index() or
- * Ref_of() operator
+ * ref_of() operator
*/
switch (operand[0]->reference.opcode) {
case AML_INDEX_OP:
@@ -789,7 +788,7 @@ acpi_ex_opcode_1A_0T_1R (
default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Index Target_type %X in obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Index target_type %X in obj %p\n",
operand[0]->reference.target_type, operand[0]));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
@@ -825,7 +824,7 @@ acpi_ex_opcode_1A_0T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 8831fd229900..3562e75107b8 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
- * $Revision: 116 $
*
*****************************************************************************/
@@ -60,9 +59,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_2A_0T_0R
+ * FUNCTION: acpi_ex_opcode_2A_0T_0R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -82,14 +81,14 @@ acpi_ex_opcode_2A_0T_0R (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_0R",
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_0R",
acpi_ps_get_opcode_name (walk_state->opcode));
/* Examine the opcode */
switch (walk_state->opcode) {
- case AML_NOTIFY_OP: /* Notify (Notify_object, Notify_value) */
+ case AML_NOTIFY_OP: /* Notify (notify_object, notify_value) */
/* The first operand is a namespace node */
@@ -119,7 +118,7 @@ acpi_ex_opcode_2A_0T_0R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
}
@@ -130,9 +129,9 @@ acpi_ex_opcode_2A_0T_0R (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_2A_2T_1R
+ * FUNCTION: acpi_ex_opcode_2A_2T_1R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -151,14 +150,14 @@ acpi_ex_opcode_2A_2T_1R (
acpi_status status;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_2T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
/*
* Execute the opcode
*/
switch (walk_state->opcode) {
- case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, Remainder_result Quotient_result) */
+ case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, remainder_result quotient_result) */
return_desc1 = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
if (!return_desc1) {
@@ -172,7 +171,7 @@ acpi_ex_opcode_2A_2T_1R (
goto cleanup;
}
- /* Quotient to Return_desc1, remainder to Return_desc2 */
+ /* Quotient to return_desc1, remainder to return_desc2 */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
&return_desc1->integer.value, &return_desc2->integer.value);
@@ -184,7 +183,7 @@ acpi_ex_opcode_2A_2T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
@@ -227,9 +226,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_2A_1T_1R
+ * FUNCTION: acpi_ex_opcode_2A_1T_1R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -247,10 +246,10 @@ acpi_ex_opcode_2A_1T_1R (
acpi_operand_object *temp_desc = NULL;
u32 index;
acpi_status status = AE_OK;
- ACPI_SIZE length;
+ acpi_size length;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
/*
@@ -273,7 +272,7 @@ acpi_ex_opcode_2A_1T_1R (
switch (walk_state->opcode) {
- case AML_MOD_OP: /* Mod (Dividend, Divisor, Remainder_result (ACPI 2.0) */
+ case AML_MOD_OP: /* Mod (Dividend, Divisor, remainder_result (ACPI 2.0) */
return_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
if (!return_desc) {
@@ -281,7 +280,7 @@ acpi_ex_opcode_2A_1T_1R (
goto cleanup;
}
- /* Return_desc will contain the remainder */
+ /* return_desc will contain the remainder */
status = acpi_ut_divide (&operand[0]->integer.value, &operand[1]->integer.value,
NULL, &return_desc->integer.value);
@@ -330,7 +329,7 @@ acpi_ex_opcode_2A_1T_1R (
break;
- case AML_TO_STRING_OP: /* To_string (Buffer, Length, Result) (ACPI 2.0) */
+ case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */
/*
* Input object is guaranteed to be a buffer at this point (it may have
@@ -383,7 +382,7 @@ acpi_ex_opcode_2A_1T_1R (
break;
- case AML_CONCAT_RES_OP: /* Concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
+ case AML_CONCAT_RES_OP: /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
status = acpi_ex_concat_template (operand[0], operand[1], &return_desc, walk_state);
break;
@@ -449,7 +448,7 @@ acpi_ex_opcode_2A_1T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
break;
@@ -460,7 +459,7 @@ store_result_to_target:
if (ACPI_SUCCESS (status)) {
/*
- * Store the result of the operation (which is now in Return_desc) into
+ * Store the result of the operation (which is now in return_desc) into
* the Target descriptor.
*/
status = acpi_ex_store (return_desc, operand[2], walk_state);
@@ -488,9 +487,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_2A_0T_1R
+ * FUNCTION: acpi_ex_opcode_2A_0T_1R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -508,7 +507,7 @@ acpi_ex_opcode_2A_0T_1R (
u8 logical_result = FALSE;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_2A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
/* Create the internal return object */
@@ -522,7 +521,7 @@ acpi_ex_opcode_2A_0T_1R (
/*
* Execute the Opcode
*/
- if (walk_state->op_info->flags & AML_LOGICAL) /* Logical_op (Operand0, Operand1) */ {
+ if (walk_state->op_info->flags & AML_LOGICAL) /* logical_op (Operand0, Operand1) */ {
logical_result = acpi_ex_do_logical_op (walk_state->opcode,
operand[0]->integer.value,
operand[1]->integer.value);
@@ -531,7 +530,7 @@ acpi_ex_opcode_2A_0T_1R (
switch (walk_state->opcode) {
- case AML_ACQUIRE_OP: /* Acquire (Mutex_object, Timeout) */
+ case AML_ACQUIRE_OP: /* Acquire (mutex_object, Timeout) */
status = acpi_ex_acquire_mutex (operand[1], operand[0], walk_state);
if (status == AE_TIME) {
@@ -541,7 +540,7 @@ acpi_ex_opcode_2A_0T_1R (
break;
- case AML_WAIT_OP: /* Wait (Event_object, Timeout) */
+ case AML_WAIT_OP: /* Wait (event_object, Timeout) */
status = acpi_ex_system_wait_event (operand[1], operand[0]);
if (status == AE_TIME) {
@@ -553,7 +552,7 @@ acpi_ex_opcode_2A_0T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
@@ -562,7 +561,7 @@ acpi_ex_opcode_2A_0T_1R (
store_logical_result:
/*
- * Set return value to according to Logical_result. logical TRUE (all ones)
+ * Set return value to according to logical_result. logical TRUE (all ones)
* Default is FALSE (zero)
*/
if (logical_result) {
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
index af3cf5142d4c..f3cab1837b83 100644
--- a/drivers/acpi/executer/exoparg3.c
+++ b/drivers/acpi/executer/exoparg3.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exoparg3 - AML execution - opcodes with 3 arguments
- * $Revision: 15 $
*
*****************************************************************************/
@@ -60,9 +59,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_3A_0T_0R
+ * FUNCTION: acpi_ex_opcode_3A_0T_0R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -75,24 +74,24 @@ acpi_ex_opcode_3A_0T_0R (
acpi_walk_state *walk_state)
{
acpi_operand_object **operand = &walk_state->operands[0];
- ACPI_SIGNAL_FATAL_INFO *fatal;
+ acpi_signal_fatal_info *fatal;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_0T_0R", acpi_ps_get_opcode_name (walk_state->opcode));
switch (walk_state->opcode) {
- case AML_FATAL_OP: /* Fatal (Fatal_type Fatal_code Fatal_arg) */
+ case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+ "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(u32) operand[0]->integer.value, (u32) operand[1]->integer.value,
(u32) operand[2]->integer.value));
- fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
+ fatal = ACPI_MEM_ALLOCATE (sizeof (acpi_signal_fatal_info));
if (fatal) {
fatal->type = (u32) operand[0]->integer.value;
fatal->code = (u32) operand[1]->integer.value;
@@ -112,7 +111,7 @@ acpi_ex_opcode_3A_0T_0R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
@@ -127,9 +126,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_3A_1T_1R
+ * FUNCTION: acpi_ex_opcode_3A_1T_1R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -145,11 +144,11 @@ acpi_ex_opcode_3A_1T_1R (
acpi_operand_object *return_desc = NULL;
char *buffer;
acpi_status status = AE_OK;
- NATIVE_UINT index;
- ACPI_SIZE length;
+ acpi_native_uint index;
+ acpi_size length;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_3A_1T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
switch (walk_state->opcode) {
@@ -167,8 +166,8 @@ acpi_ex_opcode_3A_1T_1R (
/* Get the Integer values from the objects */
- index = (NATIVE_UINT) operand[1]->integer.value;
- length = (ACPI_SIZE) operand[2]->integer.value;
+ index = (acpi_native_uint) operand[1]->integer.value;
+ length = (acpi_size) operand[2]->integer.value;
/*
* If the index is beyond the length of the String/Buffer, or if the
@@ -180,12 +179,12 @@ acpi_ex_opcode_3A_1T_1R (
if ((index + length) >
operand[0]->string.length) {
- length = (ACPI_SIZE) operand[0]->string.length - index;
+ length = (acpi_size) operand[0]->string.length - index;
}
/* Allocate a new buffer for the String/Buffer */
- buffer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) length + 1);
+ buffer = ACPI_MEM_CALLOCATE ((acpi_size) length + 1);
if (!buffer) {
status = AE_NO_MEMORY;
goto cleanup;
@@ -206,7 +205,7 @@ acpi_ex_opcode_3A_1T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c
index 251c4b435553..3260c23bed3d 100644
--- a/drivers/acpi/executer/exoparg6.c
+++ b/drivers/acpi/executer/exoparg6.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exoparg6 - AML execution - opcodes with 6 arguments
- * $Revision: 11 $
*
*****************************************************************************/
@@ -60,11 +59,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_do_match
+ * FUNCTION: acpi_ex_do_match
*
- * PARAMETERS: Match_op - The AML match operand
- * Package_value - Value from the target package
- * Match_value - Value to be matched
+ * PARAMETERS: match_op - The AML match operand
+ * package_value - Value from the target package
+ * match_value - Value to be matched
*
* RETURN: TRUE if the match is successful, FALSE otherwise
*
@@ -137,9 +136,9 @@ acpi_ex_do_match (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_opcode_6A_0T_1R
+ * FUNCTION: acpi_ex_opcode_6A_0T_1R
*
- * PARAMETERS: Walk_state - Current walk state
+ * PARAMETERS: walk_state - Current walk state
*
* RETURN: Status
*
@@ -158,14 +157,14 @@ acpi_ex_opcode_6A_0T_1R (
acpi_operand_object *this_element;
- ACPI_FUNCTION_TRACE_STR ("Ex_opcode_6A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
+ ACPI_FUNCTION_TRACE_STR ("ex_opcode_6A_0T_1R", acpi_ps_get_opcode_name (walk_state->opcode));
switch (walk_state->opcode) {
case AML_MATCH_OP:
/*
- * Match (Search_package[0], Match_op1[1], Match_object1[2],
- * Match_op2[3], Match_object2[4], Start_index[5])
+ * Match (search_package[0], match_op1[1], match_object1[2],
+ * match_op2[3], match_object2[4], start_index[5])
*/
/* Validate match comparison sub-opcodes */
@@ -201,7 +200,7 @@ acpi_ex_opcode_6A_0T_1R (
* and the next should be examined.
*
* Upon finding a match, the loop will terminate via "break" at
- * the bottom. If it terminates "normally", Match_value will be -1
+ * the bottom. If it terminates "normally", match_value will be -1
* (its initial value) indicating that no match was found. When
* returned as a Number, this will produce the Ones value as specified.
*/
@@ -247,7 +246,7 @@ acpi_ex_opcode_6A_0T_1R (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n",
walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c
index ea4b77912d8a..11ea877c9dc2 100644
--- a/drivers/acpi/executer/exprep.c
+++ b/drivers/acpi/executer/exprep.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
- * $Revision: 121 $
*
*****************************************************************************/
@@ -37,15 +36,15 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_decode_field_access
+ * FUNCTION: acpi_ex_decode_field_access
*
* PARAMETERS: Access - Encoded field access bits
* Length - Field length.
*
* RETURN: Field granularity (8, 16, 32 or 64) and
- * Byte_alignment (1, 2, 3, or 4)
+ * byte_alignment (1, 2, 3, or 4)
*
- * DESCRIPTION: Decode the Access_type bits of a field definition.
+ * DESCRIPTION: Decode the access_type bits of a field definition.
*
******************************************************************************/
@@ -61,7 +60,7 @@ acpi_ex_decode_field_access (
/* u32 Length; */
- ACPI_FUNCTION_NAME ("Ex_decode_field_access");
+ ACPI_FUNCTION_NAME ("ex_decode_field_access");
access = (field_flags & AML_FIELD_ACCESS_TYPE_MASK);
@@ -138,8 +137,8 @@ acpi_ex_decode_field_access (
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
/*
- * Buffer_field access can be on any byte boundary, so the
- * Byte_alignment is always 1 byte -- regardless of any Byte_alignment
+ * buffer_field access can be on any byte boundary, so the
+ * byte_alignment is always 1 byte -- regardless of any byte_alignment
* implied by the field access type.
*/
byte_alignment = 1;
@@ -152,14 +151,14 @@ acpi_ex_decode_field_access (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_prep_common_field_object
+ * FUNCTION: acpi_ex_prep_common_field_object
*
- * PARAMETERS: Obj_desc - The field object
- * Field_flags - Access, Lock_rule, and Update_rule.
- * The format of a Field_flag is described
+ * PARAMETERS: obj_desc - The field object
+ * field_flags - Access, lock_rule, and update_rule.
+ * The format of a field_flag is described
* in the ACPI specification
- * Field_bit_position - Field start position
- * Field_bit_length - Field length in number of bits
+ * field_bit_position - Field start position
+ * field_bit_length - Field length in number of bits
*
* RETURN: Status
*
@@ -183,7 +182,7 @@ acpi_ex_prep_common_field_object (
u32 nearest_byte_address;
- ACPI_FUNCTION_TRACE ("Ex_prep_common_field_object");
+ ACPI_FUNCTION_TRACE ("ex_prep_common_field_object");
/*
@@ -198,17 +197,17 @@ acpi_ex_prep_common_field_object (
/*
* Decode the access type so we can compute offsets. The access type gives
* two pieces of information - the width of each field access and the
- * necessary Byte_alignment (address granularity) of the access.
+ * necessary byte_alignment (address granularity) of the access.
*
- * For Any_acc, the Access_bit_width is the largest width that is both
+ * For any_acc, the access_bit_width is the largest width that is both
* necessary and possible in an attempt to access the whole field in one
- * I/O operation. However, for Any_acc, the Byte_alignment is always one
+ * I/O operation. However, for any_acc, the byte_alignment is always one
* byte.
*
- * For all Buffer Fields, the Byte_alignment is always one byte.
+ * For all Buffer Fields, the byte_alignment is always one byte.
*
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
- * the same (equivalent) as the Byte_alignment.
+ * the same (equivalent) as the byte_alignment.
*/
access_bit_width = acpi_ex_decode_field_access (obj_desc, field_flags,
&byte_alignment);
@@ -222,12 +221,12 @@ acpi_ex_prep_common_field_object (
ACPI_DIV_8 (access_bit_width); /* 1, 2, 4, 8 */
/*
- * Base_byte_offset is the address of the start of the field within the
+ * base_byte_offset is the address of the start of the field within the
* region. It is the byte address of the first *datum* (field-width data
* unit) of the field. (i.e., the first datum that contains at least the
* first *bit* of the field.)
*
- * Note: Byte_alignment is always either equal to the Access_bit_width or 8
+ * Note: byte_alignment is always either equal to the access_bit_width or 8
* (Byte access), and it defines the addressing granularity of the parent
* region or buffer.
*/
@@ -237,7 +236,7 @@ acpi_ex_prep_common_field_object (
ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment);
/*
- * Start_field_bit_offset is the offset of the first bit of the field within
+ * start_field_bit_offset is the offset of the first bit of the field within
* a field datum.
*/
obj_desc->common_field.start_field_bit_offset = (u8)
@@ -253,13 +252,13 @@ acpi_ex_prep_common_field_object (
obj_desc->common_field.end_field_valid_bits = (u8)
((obj_desc->common_field.start_field_bit_offset + field_bit_length) %
access_bit_width);
- /* Start_buffer_bit_offset always = 0 */
+ /* start_buffer_bit_offset always = 0 */
obj_desc->common_field.end_buffer_valid_bits = (u8)
(field_bit_length % access_bit_width);
/*
- * Datum_valid_bits is the number of valid field bits in the first
+ * datum_valid_bits is the number of valid field bits in the first
* field datum.
*/
obj_desc->common_field.datum_valid_bits = (u8)
@@ -280,38 +279,38 @@ acpi_ex_prep_common_field_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_prep_field_value
+ * FUNCTION: acpi_ex_prep_field_value
*
* PARAMETERS: Node - Owning Node
- * Region_node - Region in which field is being defined
- * Field_flags - Access, Lock_rule, and Update_rule.
- * Field_bit_position - Field start position
- * Field_bit_length - Field length in number of bits
+ * region_node - Region in which field is being defined
+ * field_flags - Access, lock_rule, and update_rule.
+ * field_bit_position - Field start position
+ * field_bit_length - Field length in number of bits
*
* RETURN: Status
*
- * DESCRIPTION: Construct an acpi_operand_object of type Def_field and
+ * DESCRIPTION: Construct an acpi_operand_object of type def_field and
* connect it to the parent Node.
*
******************************************************************************/
acpi_status
acpi_ex_prep_field_value (
- ACPI_CREATE_FIELD_INFO *info)
+ acpi_create_field_info *info)
{
acpi_operand_object *obj_desc;
u32 type;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_prep_field_value");
+ ACPI_FUNCTION_TRACE ("ex_prep_field_value");
/* Parameter validation */
if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) {
if (!info->region_node) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null region_node\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
@@ -354,7 +353,7 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->field.region_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Region_field: Bitoff=%X Off=%X Gran=%X Region %p\n",
+ "region_field: Bitoff=%X Off=%X Gran=%X Region %p\n",
obj_desc->field.start_field_bit_offset, obj_desc->field.base_byte_offset,
obj_desc->field.access_byte_width, obj_desc->field.region_obj));
break;
@@ -372,7 +371,7 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->bank_field.bank_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Bank Field: Bit_off=%X Off=%X Gran=%X Region %p Bank_reg %p\n",
+ "Bank Field: bit_off=%X Off=%X Gran=%X Region %p bank_reg %p\n",
obj_desc->bank_field.start_field_bit_offset,
obj_desc->bank_field.base_byte_offset,
obj_desc->field.access_byte_width,
@@ -399,7 +398,7 @@ acpi_ex_prep_field_value (
acpi_ut_add_reference (obj_desc->index_field.index_obj);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
+ "index_field: bitoff=%X off=%X gran=%X Index %p Data %p\n",
obj_desc->index_field.start_field_bit_offset,
obj_desc->index_field.base_byte_offset,
obj_desc->field.access_byte_width,
@@ -413,13 +412,13 @@ acpi_ex_prep_field_value (
}
/*
- * Store the constructed descriptor (Obj_desc) into the parent Node,
- * preserving the current type of that Named_obj.
+ * Store the constructed descriptor (obj_desc) into the parent Node,
+ * preserving the current type of that named_obj.
*/
status = acpi_ns_attach_object (info->field_node, obj_desc,
acpi_ns_get_type (info->field_node));
- ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set Named_obj %p (%4.4s) val = %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set named_obj %p (%4.4s) val = %p\n",
info->field_node, info->field_node->name.ascii, obj_desc));
/* Remove local reference to the object */
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 00fad25b474a..b77fa6b6985d 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -1,8 +1,7 @@
/******************************************************************************
*
- * Module Name: exregion - ACPI default Op_region (address space) handlers
- * $Revision: 81 $
+ * Module Name: exregion - ACPI default op_region (address space) handlers
*
*****************************************************************************/
@@ -35,14 +34,14 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_memory_space_handler
+ * FUNCTION: acpi_ex_system_memory_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
@@ -54,7 +53,7 @@
acpi_status
acpi_ex_system_memory_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -64,12 +63,12 @@ acpi_ex_system_memory_space_handler (
void *logical_addr_ptr = NULL;
acpi_mem_space_context *mem_info = region_context;
u32 length;
- ACPI_SIZE window_size;
+ acpi_size window_size;
#ifndef _HW_ALIGNMENT_SUPPORT
u32 remainder;
#endif
- ACPI_FUNCTION_TRACE ("Ex_system_memory_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_system_memory_space_handler");
/* Validate and translate the bit width */
@@ -92,7 +91,7 @@ acpi_ex_system_memory_space_handler (
break;
default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid System_memory width %d\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid system_memory width %d\n",
bit_width));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
@@ -132,7 +131,7 @@ acpi_ex_system_memory_space_handler (
* Don't attempt to map memory beyond the end of the region, and
* constrain the maximum mapping size to something reasonable.
*/
- window_size = (ACPI_SIZE) ((mem_info->address + mem_info->length) - address);
+ window_size = (acpi_size) ((mem_info->address + mem_info->length) - address);
if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) {
window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE;
}
@@ -162,7 +161,7 @@ acpi_ex_system_memory_space_handler (
((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "System_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+ "system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
ACPI_HIDWORD (address), ACPI_LODWORD (address)));
/*
@@ -196,7 +195,7 @@ acpi_ex_system_memory_space_handler (
break;
#endif
default:
- /* Bit_width was already validated */
+ /* bit_width was already validated */
break;
}
break;
@@ -223,7 +222,7 @@ acpi_ex_system_memory_space_handler (
#endif
default:
- /* Bit_width was already validated */
+ /* bit_width was already validated */
break;
}
break;
@@ -239,14 +238,14 @@ acpi_ex_system_memory_space_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_io_space_handler
+ * FUNCTION: acpi_ex_system_io_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
@@ -258,7 +257,7 @@ acpi_ex_system_memory_space_handler (
acpi_status
acpi_ex_system_io_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -267,11 +266,11 @@ acpi_ex_system_io_space_handler (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_system_io_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_system_io_space_handler");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "System_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+ "system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
ACPI_HIDWORD (address), ACPI_LODWORD (address)));
/* Decode the function parameter */
@@ -280,12 +279,12 @@ acpi_ex_system_io_space_handler (
case ACPI_READ:
*value = 0;
- status = acpi_os_read_port ((ACPI_IO_ADDRESS) address, value, bit_width);
+ status = acpi_os_read_port ((acpi_io_address) address, value, bit_width);
break;
case ACPI_WRITE:
- status = acpi_os_write_port ((ACPI_IO_ADDRESS) address, *value, bit_width);
+ status = acpi_os_write_port ((acpi_io_address) address, *value, bit_width);
break;
default:
@@ -299,14 +298,14 @@ acpi_ex_system_io_space_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_pci_config_space_handler
+ * FUNCTION: acpi_ex_pci_config_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
@@ -318,7 +317,7 @@ acpi_ex_system_io_space_handler (
acpi_status
acpi_ex_pci_config_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -329,17 +328,17 @@ acpi_ex_pci_config_space_handler (
u16 pci_register;
- ACPI_FUNCTION_TRACE ("Ex_pci_config_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_pci_config_space_handler");
/*
- * The arguments to Acpi_os(Read|Write)Pci_configuration are:
+ * The arguments to acpi_os(Read|Write)pci_configuration are:
*
- * Pci_segment is the PCI bus segment range 0-31
- * Pci_bus is the PCI bus number range 0-255
- * Pci_device is the PCI device number range 0-31
- * Pci_function is the PCI device function number
- * Pci_register is the Config space register range 0-255 bytes
+ * pci_segment is the PCI bus segment range 0-31
+ * pci_bus is the PCI bus number range 0-255
+ * pci_device is the PCI device number range 0-31
+ * pci_function is the PCI device function number
+ * pci_register is the Config space register range 0-255 bytes
*
* Value - input value for write, output address for read
*
@@ -348,7 +347,7 @@ acpi_ex_pci_config_space_handler (
pci_register = (u16) (u32) address;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+ "pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
function, bit_width, pci_id->segment, pci_id->bus, pci_id->device,
pci_id->function, pci_register));
@@ -376,14 +375,14 @@ acpi_ex_pci_config_space_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_cmos_space_handler
+ * FUNCTION: acpi_ex_cmos_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
@@ -395,7 +394,7 @@ acpi_ex_pci_config_space_handler (
acpi_status
acpi_ex_cmos_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -404,7 +403,7 @@ acpi_ex_cmos_space_handler (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_cmos_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_cmos_space_handler");
return_ACPI_STATUS (status);
@@ -413,26 +412,26 @@ acpi_ex_cmos_space_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_pci_bar_space_handler
+ * FUNCTION: acpi_ex_pci_bar_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
*
- * DESCRIPTION: Handler for the PCI Bar_target address space (Op Region)
+ * DESCRIPTION: Handler for the PCI bar_target address space (Op Region)
*
******************************************************************************/
acpi_status
acpi_ex_pci_bar_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -441,7 +440,7 @@ acpi_ex_pci_bar_space_handler (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_pci_bar_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_pci_bar_space_handler");
return_ACPI_STATUS (status);
@@ -450,14 +449,14 @@ acpi_ex_pci_bar_space_handler (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_data_table_space_handler
+ * FUNCTION: acpi_ex_data_table_space_handler
*
* PARAMETERS: Function - Read or Write operation
* Address - Where in the space to read or write
- * Bit_width - Field width in bits (8, 16, or 32)
+ * bit_width - Field width in bits (8, 16, or 32)
* Value - Pointer to in or out value
- * Handler_context - Pointer to Handler's context
- * Region_context - Pointer to context specific to the
+ * handler_context - Pointer to Handler's context
+ * region_context - Pointer to context specific to the
* accessed region
*
* RETURN: Status
@@ -469,7 +468,7 @@ acpi_ex_pci_bar_space_handler (
acpi_status
acpi_ex_data_table_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -481,7 +480,7 @@ acpi_ex_data_table_space_handler (
char *logical_addr_ptr;
- ACPI_FUNCTION_TRACE ("Ex_data_table_space_handler");
+ ACPI_FUNCTION_TRACE ("ex_data_table_space_handler");
logical_addr_ptr = ACPI_PHYSADDR_TO_PTR (address);
diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index 8aa0ab7defd4..e1510cf46429 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
- * $Revision: 61 $
*
*****************************************************************************/
@@ -37,12 +36,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_node_to_value
+ * FUNCTION: acpi_ex_resolve_node_to_value
*
- * PARAMETERS: Object_ptr - Pointer to a location that contains
+ * PARAMETERS: object_ptr - Pointer to a location that contains
* a pointer to a NS node, and will receive a
* pointer to the resolved object.
- * Walk_state - Current state. Valid only if executing AML
+ * walk_state - Current state. Valid only if executing AML
* code. NULL if simply resolving an object
*
* RETURN: Status
@@ -74,7 +73,7 @@ acpi_ex_resolve_node_to_value (
acpi_object_type entry_type;
- ACPI_FUNCTION_TRACE ("Ex_resolve_node_to_value");
+ ACPI_FUNCTION_TRACE ("ex_resolve_node_to_value");
/*
@@ -85,7 +84,7 @@ acpi_ex_resolve_node_to_value (
source_desc = acpi_ns_get_attached_object (node);
entry_type = acpi_ns_get_type ((acpi_handle) node);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p source_desc=%p [%s]\n",
node, source_desc, acpi_ut_get_type_name (entry_type)));
if (entry_type == ACPI_TYPE_LOCAL_ALIAS) {
@@ -189,7 +188,7 @@ acpi_ex_resolve_node_to_value (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "field_read Node=%p source_desc=%p Type=%X\n",
node, source_desc, entry_type));
status = acpi_ex_read_data_from_field (walk_state, source_desc, &obj_desc);
@@ -242,7 +241,7 @@ acpi_ex_resolve_node_to_value (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
- } /* switch (Entry_type) */
+ } /* switch (entry_type) */
/* Put the object descriptor on the stack */
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 1b0a3525134b..0222d9c9d90f 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
- * $Revision: 118 $
*
*****************************************************************************/
@@ -38,12 +37,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_to_value
+ * FUNCTION: acpi_ex_resolve_to_value
*
- * PARAMETERS: **Stack_ptr - Points to entry on Obj_stack, which can
+ * PARAMETERS: **stack_ptr - Points to entry on obj_stack, which can
* be either an (acpi_operand_object *)
* or an acpi_handle.
- * Walk_state - Current method state
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -59,7 +58,7 @@ acpi_ex_resolve_to_value (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ex_resolve_to_value", stack_ptr);
+ ACPI_FUNCTION_TRACE_PTR ("ex_resolve_to_value", stack_ptr);
if (!stack_ptr || !*stack_ptr) {
@@ -68,9 +67,9 @@ acpi_ex_resolve_to_value (
}
/*
- * The entity pointed to by the Stack_ptr can be either
+ * The entity pointed to by the stack_ptr can be either
* 1) A valid acpi_operand_object, or
- * 2) A acpi_namespace_node (Named_obj)
+ * 2) A acpi_namespace_node (named_obj)
*/
if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_OPERAND) {
status = acpi_ex_resolve_object_to_value (stack_ptr, walk_state);
@@ -80,7 +79,7 @@ acpi_ex_resolve_to_value (
}
/*
- * Object on the stack may have changed if Acpi_ex_resolve_object_to_value()
+ * Object on the stack may have changed if acpi_ex_resolve_object_to_value()
* was called (i.e., we can't use an _else_ here.)
*/
if (ACPI_GET_DESCRIPTOR_TYPE (*stack_ptr) == ACPI_DESC_TYPE_NAMED) {
@@ -99,11 +98,11 @@ acpi_ex_resolve_to_value (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_object_to_value
+ * FUNCTION: acpi_ex_resolve_object_to_value
*
- * PARAMETERS: Stack_ptr - Pointer to a stack location that contains a
+ * PARAMETERS: stack_ptr - Pointer to a stack location that contains a
* ptr to an internal object.
- * Walk_state - Current method state
+ * walk_state - Current method state
*
* RETURN: Status
*
@@ -124,7 +123,7 @@ acpi_ex_resolve_object_to_value (
u16 opcode;
- ACPI_FUNCTION_TRACE ("Ex_resolve_object_to_value");
+ ACPI_FUNCTION_TRACE ("ex_resolve_object_to_value");
stack_desc = *stack_ptr;
@@ -141,7 +140,7 @@ acpi_ex_resolve_object_to_value (
/*
* Convert indirect name ptr to a direct name ptr.
- * Then, Acpi_ex_resolve_node_to_value can be used to get the value
+ * Then, acpi_ex_resolve_node_to_value can be used to get the value
*/
temp_node = stack_desc->reference.object;
@@ -175,7 +174,7 @@ acpi_ex_resolve_object_to_value (
acpi_ut_remove_reference (stack_desc);
*stack_ptr = obj_desc;
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] Value_obj is %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] value_obj is %p\n",
stack_desc->reference.offset, obj_desc));
break;
@@ -220,7 +219,7 @@ acpi_ex_resolve_object_to_value (
/* Invalid reference object */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Unknown Target_type %X in Index/Reference obj %p\n",
+ "Unknown target_type %X in Index/Reference obj %p\n",
stack_desc->reference.target_type, stack_desc));
status = AE_AML_INTERNAL;
break;
@@ -266,7 +265,7 @@ acpi_ex_resolve_object_to_value (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "field_read source_desc=%p Type=%X\n",
stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc)));
status = acpi_ex_read_data_from_field (walk_state, stack_desc, &obj_desc);
@@ -283,12 +282,12 @@ acpi_ex_resolve_object_to_value (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_multiple
+ * FUNCTION: acpi_ex_resolve_multiple
*
- * PARAMETERS: Walk_state - Current state (contains AML opcode)
+ * PARAMETERS: walk_state - Current state (contains AML opcode)
* Operand - Starting point for resolution
- * Return_type - Where the object type is returned
- * Return_desc - Where the resolved object is returned
+ * return_type - Where the object type is returned
+ * return_desc - Where the resolved object is returned
*
* RETURN: Status
*
@@ -309,13 +308,13 @@ acpi_ex_resolve_multiple (
acpi_object_type type;
- ACPI_FUNCTION_TRACE ("Acpi_ex_resolve_multiple");
+ ACPI_FUNCTION_TRACE ("acpi_ex_resolve_multiple");
/*
- * For reference objects created via the Ref_of or Index operators,
+ * For reference objects created via the ref_of or Index operators,
* we need to get to the base object (as per the ACPI specification
- * of the Object_type and Size_of operators). This means traversing
+ * of the object_type and size_of operators). This means traversing
* the list of possibly many nested references.
*/
while (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
@@ -402,7 +401,7 @@ acpi_ex_resolve_multiple (
case AML_DEBUG_OP:
- /* The Debug Object is of type "Debug_object" */
+ /* The Debug Object is of type "debug_object" */
type = ACPI_TYPE_DEBUG_OBJECT;
goto exit;
@@ -410,7 +409,7 @@ acpi_ex_resolve_multiple (
default:
- ACPI_REPORT_ERROR (("Acpi_ex_resolve_multiple: Unknown Reference subtype %X\n",
+ ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Unknown Reference subtype %X\n",
obj_desc->reference.opcode));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -418,7 +417,7 @@ acpi_ex_resolve_multiple (
/*
* Now we are guaranteed to have an object that has not been created
- * via the Ref_of or Index operators.
+ * via the ref_of or Index operators.
*/
type = ACPI_GET_OBJECT_TYPE (obj_desc);
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index 6933061859d3..719cbd2979b8 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
- * $Revision: 60 $
*
*****************************************************************************/
@@ -37,10 +36,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_check_object_type
+ * FUNCTION: acpi_ex_check_object_type
*
- * PARAMETERS: Type_needed Object type needed
- * This_type Actual object type
+ * PARAMETERS: type_needed Object type needed
+ * this_type Actual object type
* Object Object pointer
*
* RETURN: Status
@@ -55,7 +54,7 @@ acpi_ex_check_object_type (
acpi_object_type this_type,
void *object)
{
- ACPI_FUNCTION_NAME ("Ex_check_object_type");
+ ACPI_FUNCTION_NAME ("ex_check_object_type");
if (type_needed == ACPI_TYPE_ANY) {
@@ -91,19 +90,19 @@ acpi_ex_check_object_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_operands
+ * FUNCTION: acpi_ex_resolve_operands
*
* PARAMETERS: Opcode - Opcode being interpreted
- * Stack_ptr - Pointer to the operand stack to be
+ * stack_ptr - Pointer to the operand stack to be
* resolved
- * Walk_state - Current state
+ * walk_state - Current state
*
* RETURN: Status
*
* DESCRIPTION: Convert multiple input operands to the types required by the
* target operator.
*
- * Each 5-bit group in Arg_types represents one required
+ * Each 5-bit group in arg_types represents one required
* operand and indicates the required Type. The corresponding operand
* will be converted to the required type if possible, otherwise we
* abort with an exception.
@@ -126,7 +125,7 @@ acpi_ex_resolve_operands (
acpi_object_type type_needed;
- ACPI_FUNCTION_TRACE_U32 ("Ex_resolve_operands", opcode);
+ ACPI_FUNCTION_TRACE_U32 ("ex_resolve_operands", opcode);
op_info = acpi_ps_get_opcode_info (opcode);
@@ -142,11 +141,11 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (AE_AML_INTERNAL);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] Operand_types=%X \n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode %X [%s] operand_types=%X \n",
opcode, op_info->name, arg_types));
/*
- * Normal exit is with (Arg_types == 0) at end of argument list.
+ * Normal exit is with (arg_types == 0) at end of argument list.
* Function will return an exception from within the loop upon
* finding an entry which is not (or cannot be converted
* to) the required type; if stack underflows; or upon
@@ -294,8 +293,8 @@ acpi_ex_resolve_operands (
case ARGI_ANYTYPE:
/*
- * We don't want to resolve Index_op reference objects during
- * a store because this would be an implicit De_ref_of operation.
+ * We don't want to resolve index_op reference objects during
+ * a store because this would be an implicit de_ref_of operation.
* Instead, we just want to store the reference object.
* -- All others must be resolved below.
*/
@@ -461,8 +460,8 @@ acpi_ex_resolve_operands (
case ARGI_DATAOBJECT:
/*
- * ARGI_DATAOBJECT is only used by the Size_of operator.
- * Need a buffer, string, package, or Ref_of reference.
+ * ARGI_DATAOBJECT is only used by the size_of operator.
+ * Need a buffer, string, package, or ref_of reference.
*
* The only reference allowed here is a direct reference to
* a namespace node.
@@ -531,7 +530,7 @@ acpi_ex_resolve_operands (
next_operand:
/*
- * If more operands needed, decrement Stack_ptr to point
+ * If more operands needed, decrement stack_ptr to point
* to next operand on stack
*/
if (GET_CURRENT_ARG_TYPE (arg_types)) {
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index d9a61f7b6981..a22e0b266091 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
- * $Revision: 174 $
*
*****************************************************************************/
@@ -38,18 +37,18 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store
+ * FUNCTION: acpi_ex_store
*
- * PARAMETERS: *Source_desc - Value to be stored
- * *Dest_desc - Where to store it. Must be an NS node
+ * PARAMETERS: *source_desc - Value to be stored
+ * *dest_desc - Where to store it. Must be an NS node
* or an acpi_operand_object of type
* Reference;
- * Walk_state - Current walk state
+ * walk_state - Current walk state
*
* RETURN: Status
*
- * DESCRIPTION: Store the value described by Source_desc into the location
- * described by Dest_desc. Called by various interpreter
+ * DESCRIPTION: Store the value described by source_desc into the location
+ * described by dest_desc. Called by various interpreter
* functions to store the result of an operation into
* the destination operand -- not just simply the actual "Store"
* ASL operator.
@@ -66,7 +65,7 @@ acpi_ex_store (
acpi_operand_object *ref_desc = dest_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ex_store", dest_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_store", dest_desc);
/* Validate parameters */
@@ -76,7 +75,7 @@ acpi_ex_store (
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
- /* Dest_desc can be either a namespace node or an ACPI object */
+ /* dest_desc can be either a namespace node or an ACPI object */
if (ACPI_GET_DESCRIPTOR_TYPE (dest_desc) == ACPI_DESC_TYPE_NAMED) {
/*
@@ -114,7 +113,7 @@ acpi_ex_store (
ACPI_DUMP_STACK_ENTRY (source_desc);
ACPI_DUMP_STACK_ENTRY (dest_desc);
- ACPI_DUMP_OPERANDS (&dest_desc, ACPI_IMODE_EXECUTE, "Ex_store",
+ ACPI_DUMP_OPERANDS (&dest_desc, ACPI_IMODE_EXECUTE, "ex_store",
2, "Target is not a Reference or Constant object");
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -224,11 +223,11 @@ acpi_ex_store (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store_object_to_index
+ * FUNCTION: acpi_ex_store_object_to_index
*
- * PARAMETERS: *Source_desc - Value to be stored
- * *Dest_desc - Named object to receive the value
- * Walk_state - Current walk state
+ * PARAMETERS: *source_desc - Value to be stored
+ * *dest_desc - Named object to receive the value
+ * walk_state - Current walk state
*
* RETURN: Status
*
@@ -248,7 +247,7 @@ acpi_ex_store_object_to_index (
u8 value = 0;
- ACPI_FUNCTION_TRACE ("Ex_store_object_to_index");
+ ACPI_FUNCTION_TRACE ("ex_store_object_to_index");
/*
@@ -264,7 +263,7 @@ acpi_ex_store_object_to_index (
* source object.
*/
/*
- * The object at *(Index_desc->Reference.Where) is the
+ * The object at *(index_desc->Reference.Where) is the
* element within the package that is to be modified.
*/
obj_desc = *(index_desc->reference.where);
@@ -299,7 +298,7 @@ acpi_ex_store_object_to_index (
case ACPI_TYPE_BUFFER_FIELD:
/*
- * Store into a Buffer (not actually a real Buffer_field) at a
+ * Store into a Buffer (not actually a real buffer_field) at a
* location defined by an Index.
*
* The first 8-bit element of the source object is written to the
@@ -355,7 +354,7 @@ acpi_ex_store_object_to_index (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Target is not a Package or Buffer_field\n"));
+ "Target is not a Package or buffer_field\n"));
status = AE_AML_OPERAND_TYPE;
break;
}
@@ -366,11 +365,11 @@ acpi_ex_store_object_to_index (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store_object_to_node
+ * FUNCTION: acpi_ex_store_object_to_node
*
- * PARAMETERS: Source_desc - Value to be stored
+ * PARAMETERS: source_desc - Value to be stored
* Node - Named object to receive the value
- * Walk_state - Current walk state
+ * walk_state - Current walk state
*
* RETURN: Status
*
@@ -401,7 +400,7 @@ acpi_ex_store_object_to_node (
acpi_object_type target_type;
- ACPI_FUNCTION_TRACE_PTR ("Ex_store_object_to_node", source_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_node", source_desc);
/*
@@ -456,9 +455,9 @@ acpi_ex_store_object_to_node (
if (new_desc != target_desc) {
/*
- * Store the new New_desc as the new value of the Name, and set
+ * Store the new new_desc as the new value of the Name, and set
* the Name's type to that of the value being stored in it.
- * Source_desc reference count is incremented by Attach_object.
+ * source_desc reference count is incremented by attach_object.
*
* Note: This may change the type of the node if an explicit store
* has been performed such that the node/object type has been
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
index cb53c9a80b8d..222cc6b307ad 100644
--- a/drivers/acpi/executer/exstoren.c
+++ b/drivers/acpi/executer/exstoren.c
@@ -3,7 +3,6 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
- * $Revision: 54 $
*
*****************************************************************************/
@@ -36,16 +35,16 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_resolve_object
+ * FUNCTION: acpi_ex_resolve_object
*
- * PARAMETERS: Source_desc_ptr - Pointer to the source object
- * Target_type - Current type of the target
- * Walk_state - Current walk state
+ * PARAMETERS: source_desc_ptr - Pointer to the source object
+ * target_type - Current type of the target
+ * walk_state - Current walk state
*
- * RETURN: Status, resolved object in Source_desc_ptr.
+ * RETURN: Status, resolved object in source_desc_ptr.
*
* DESCRIPTION: Resolve an object. If the object is a reference, dereference
- * it and return the actual object in the Source_desc_ptr.
+ * it and return the actual object in the source_desc_ptr.
*
******************************************************************************/
@@ -59,7 +58,7 @@ acpi_ex_resolve_object (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_resolve_object");
+ ACPI_FUNCTION_TRACE ("ex_resolve_object");
/*
@@ -114,7 +113,7 @@ acpi_ex_resolve_object (
case ACPI_TYPE_LOCAL_ALIAS:
/*
- * Aliases are resolved by Acpi_ex_prep_operands
+ * Aliases are resolved by acpi_ex_prep_operands
*/
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into Alias - should never happen\n"));
status = AE_AML_INTERNAL;
@@ -137,12 +136,12 @@ acpi_ex_resolve_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store_object_to_object
+ * FUNCTION: acpi_ex_store_object_to_object
*
- * PARAMETERS: Source_desc - Object to store
- * Dest_desc - Object to receive a copy of the source
- * New_desc - New object if Dest_desc is obsoleted
- * Walk_state - Current walk state
+ * PARAMETERS: source_desc - Object to store
+ * dest_desc - Object to receive a copy of the source
+ * new_desc - New object if dest_desc is obsoleted
+ * walk_state - Current walk state
*
* RETURN: Status
*
@@ -164,7 +163,7 @@ acpi_ex_resolve_object (
* This module allows destination types of Number, String,
* Buffer, and Package.
*
- * Assumes parameters are already validated. NOTE: Source_desc
+ * Assumes parameters are already validated. NOTE: source_desc
* resolution (from a reference object) must be performed by
* the caller if necessary.
*
@@ -181,7 +180,7 @@ acpi_ex_store_object_to_object (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ex_store_object_to_object", source_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_object", source_desc);
actual_src_desc = source_desc;
@@ -201,8 +200,8 @@ acpi_ex_store_object_to_object (
* Perform the "implicit conversion" of the source to the current type
* of the target as per the ACPI specification.
*
- * If no conversion performed, Actual_src_desc = Source_desc.
- * Otherwise, Actual_src_desc is a temporary object to hold the
+ * If no conversion performed, actual_src_desc = source_desc.
+ * Otherwise, actual_src_desc is a temporary object to hold the
* converted object.
*/
status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), source_desc,
@@ -213,7 +212,7 @@ acpi_ex_store_object_to_object (
if (source_desc == actual_src_desc) {
/*
- * No conversion was performed. Return the Source_desc as the
+ * No conversion was performed. Return the source_desc as the
* new object.
*/
*new_desc = source_desc;
diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c
index 9bb0c1edf000..496cf0798859 100644
--- a/drivers/acpi/executer/exstorob.c
+++ b/drivers/acpi/executer/exstorob.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
- * $Revision: 49 $
*
*****************************************************************************/
@@ -35,10 +34,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store_buffer_to_buffer
+ * FUNCTION: acpi_ex_store_buffer_to_buffer
*
- * PARAMETERS: Source_desc - Source object to copy
- * Target_desc - Destination object of the copy
+ * PARAMETERS: source_desc - Source object to copy
+ * target_desc - Destination object of the copy
*
* RETURN: Status
*
@@ -55,11 +54,11 @@ acpi_ex_store_buffer_to_buffer (
u8 *buffer;
- ACPI_FUNCTION_TRACE_PTR ("Ex_store_buffer_to_buffer", source_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_store_buffer_to_buffer", source_desc);
/*
- * We know that Source_desc is a buffer by now
+ * We know that source_desc is a buffer by now
*/
buffer = (u8 *) source_desc->buffer.pointer;
length = source_desc->buffer.length;
@@ -109,10 +108,10 @@ acpi_ex_store_buffer_to_buffer (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_store_string_to_string
+ * FUNCTION: acpi_ex_store_string_to_string
*
- * PARAMETERS: Source_desc - Source object to copy
- * Target_desc - Destination object of the copy
+ * PARAMETERS: source_desc - Source object to copy
+ * target_desc - Destination object of the copy
*
* RETURN: Status
*
@@ -129,11 +128,11 @@ acpi_ex_store_string_to_string (
u8 *buffer;
- ACPI_FUNCTION_TRACE_PTR ("Ex_store_string_to_string", source_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_store_string_to_string", source_desc);
/*
- * We know that Source_desc is a string by now.
+ * We know that source_desc is a string by now.
*/
buffer = (u8 *) source_desc->string.pointer;
length = source_desc->string.length;
@@ -148,7 +147,7 @@ acpi_ex_store_string_to_string (
* String will fit in existing non-static buffer.
* Clear old string and copy in the new one
*/
- ACPI_MEMSET (target_desc->string.pointer, 0, (ACPI_SIZE) target_desc->string.length + 1);
+ ACPI_MEMSET (target_desc->string.pointer, 0, (acpi_size) target_desc->string.length + 1);
ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
}
else {
@@ -164,7 +163,7 @@ acpi_ex_store_string_to_string (
ACPI_MEM_FREE (target_desc->string.pointer);
}
- target_desc->string.pointer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) length + 1);
+ target_desc->string.pointer = ACPI_MEM_CALLOCATE ((acpi_size) length + 1);
if (!target_desc->string.pointer) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index a87717779418..6af31b016a83 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
- * $Revision: 74 $
*
*****************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_wait_semaphore
+ * FUNCTION: acpi_ex_system_wait_semaphore
*
* PARAMETERS: Semaphore - OSD semaphore to wait on
* Timeout - Max time to wait
@@ -57,7 +56,7 @@ acpi_ex_system_wait_semaphore (
acpi_status status2;
- ACPI_FUNCTION_TRACE ("Ex_system_wait_semaphore");
+ ACPI_FUNCTION_TRACE ("ex_system_wait_semaphore");
status = acpi_os_wait_semaphore (semaphore, 1, 0);
@@ -91,9 +90,9 @@ acpi_ex_system_wait_semaphore (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_do_stall
+ * FUNCTION: acpi_ex_system_do_stall
*
- * PARAMETERS: How_long - The amount of time to stall
+ * PARAMETERS: how_long - The amount of time to stall
*
* RETURN: Status
*
@@ -133,9 +132,9 @@ acpi_ex_system_do_stall (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_do_suspend
+ * FUNCTION: acpi_ex_system_do_suspend
*
- * PARAMETERS: How_long - The amount of time to suspend
+ * PARAMETERS: how_long - The amount of time to suspend
*
* RETURN: None
*
@@ -169,16 +168,16 @@ acpi_ex_system_do_suspend (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_acquire_mutex
+ * FUNCTION: acpi_ex_system_acquire_mutex
*
- * PARAMETERS: *Time_desc - The 'time to delay' object descriptor
- * *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *time_desc - The 'time to delay' object descriptor
+ * *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
* DESCRIPTION: Provides an access point to perform synchronization operations
* within the AML. This function will cause a lock to be generated
- * for the Mutex pointed to by Obj_desc.
+ * for the Mutex pointed to by obj_desc.
*
******************************************************************************/
@@ -190,7 +189,7 @@ acpi_ex_system_acquire_mutex (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ex_system_acquire_mutex", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ex_system_acquire_mutex", obj_desc);
if (!obj_desc) {
@@ -213,9 +212,9 @@ acpi_ex_system_acquire_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_release_mutex
+ * FUNCTION: acpi_ex_system_release_mutex
*
- * PARAMETERS: *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
@@ -233,7 +232,7 @@ acpi_ex_system_release_mutex (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_system_release_mutex");
+ ACPI_FUNCTION_TRACE ("ex_system_release_mutex");
if (!obj_desc) {
@@ -255,9 +254,9 @@ acpi_ex_system_release_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_signal_event
+ * FUNCTION: acpi_ex_system_signal_event
*
- * PARAMETERS: *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *obj_desc - The object descriptor for this op
*
* RETURN: AE_OK
*
@@ -273,7 +272,7 @@ acpi_ex_system_signal_event (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_system_signal_event");
+ ACPI_FUNCTION_TRACE ("ex_system_signal_event");
if (obj_desc) {
@@ -286,10 +285,10 @@ acpi_ex_system_signal_event (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_wait_event
+ * FUNCTION: acpi_ex_system_wait_event
*
- * PARAMETERS: *Time_desc - The 'time to delay' object descriptor
- * *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *time_desc - The 'time to delay' object descriptor
+ * *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
@@ -307,7 +306,7 @@ acpi_ex_system_wait_event (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ex_system_wait_event");
+ ACPI_FUNCTION_TRACE ("ex_system_wait_event");
if (obj_desc) {
@@ -321,9 +320,9 @@ acpi_ex_system_wait_event (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_system_reset_event
+ * FUNCTION: acpi_ex_system_reset_event
*
- * PARAMETERS: *Obj_desc - The object descriptor for this op
+ * PARAMETERS: *obj_desc - The object descriptor for this op
*
* RETURN: Status
*
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 8079680cbb1c..ecd2db932dda 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
- * $Revision: 107 $
*
*****************************************************************************/
@@ -54,7 +53,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_enter_interpreter
+ * FUNCTION: acpi_ex_enter_interpreter
*
* PARAMETERS: None
*
@@ -68,7 +67,7 @@ acpi_ex_enter_interpreter (void)
{
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_enter_interpreter");
+ ACPI_FUNCTION_TRACE ("ex_enter_interpreter");
status = acpi_ut_acquire_mutex (ACPI_MTX_EXECUTE);
@@ -82,7 +81,7 @@ acpi_ex_enter_interpreter (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_exit_interpreter
+ * FUNCTION: acpi_ex_exit_interpreter
*
* PARAMETERS: None
*
@@ -106,7 +105,7 @@ acpi_ex_exit_interpreter (void)
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_exit_interpreter");
+ ACPI_FUNCTION_TRACE ("ex_exit_interpreter");
status = acpi_ut_release_mutex (ACPI_MTX_EXECUTE);
@@ -120,9 +119,9 @@ acpi_ex_exit_interpreter (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_truncate_for32bit_table
+ * FUNCTION: acpi_ex_truncate_for32bit_table
*
- * PARAMETERS: Obj_desc - Object to be truncated
+ * PARAMETERS: obj_desc - Object to be truncated
*
* RETURN: none
*
@@ -160,10 +159,10 @@ acpi_ex_truncate_for32bit_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_acquire_global_lock
+ * FUNCTION: acpi_ex_acquire_global_lock
*
- * PARAMETERS: Field_flags - Flags with Lock rule:
- * Always_lock or Never_lock
+ * PARAMETERS: field_flags - Flags with Lock rule:
+ * always_lock or never_lock
*
* RETURN: TRUE/FALSE indicating whether the lock was actually acquired
*
@@ -181,10 +180,10 @@ acpi_ex_acquire_global_lock (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_acquire_global_lock");
+ ACPI_FUNCTION_TRACE ("ex_acquire_global_lock");
- /* Only attempt lock if the Always_lock bit is set */
+ /* Only attempt lock if the always_lock bit is set */
if (field_flags & AML_FIELD_LOCK_RULE_MASK) {
/* We should attempt to get the lock, wait forever */
@@ -205,10 +204,10 @@ acpi_ex_acquire_global_lock (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_release_global_lock
+ * FUNCTION: acpi_ex_release_global_lock
*
- * PARAMETERS: Locked_by_me - Return value from corresponding call to
- * Acquire_global_lock.
+ * PARAMETERS: locked_by_me - Return value from corresponding call to
+ * acquire_global_lock.
*
* RETURN: Status
*
@@ -223,7 +222,7 @@ acpi_ex_release_global_lock (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ex_release_global_lock");
+ ACPI_FUNCTION_TRACE ("ex_release_global_lock");
/* Only attempt unlock if the caller locked it */
@@ -246,7 +245,7 @@ acpi_ex_release_global_lock (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_digits_needed
+ * FUNCTION: acpi_ex_digits_needed
*
* PARAMETERS: Value - Value to be represented
* Base - Base of representation
@@ -265,7 +264,7 @@ acpi_ex_digits_needed (
acpi_integer quotient;
- ACPI_FUNCTION_TRACE ("Ex_digits_needed");
+ ACPI_FUNCTION_TRACE ("ex_digits_needed");
/*
@@ -286,10 +285,10 @@ acpi_ex_digits_needed (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_eisa_id_to_string
+ * FUNCTION: acpi_ex_eisa_id_to_string
*
- * PARAMETERS: Numeric_id - EISA ID to be converted
- * Out_string - Where to put the converted string (8 bytes)
+ * PARAMETERS: numeric_id - EISA ID to be converted
+ * out_string - Where to put the converted string (8 bytes)
*
* DESCRIPTION: Convert a numeric EISA ID to string representation
*
@@ -323,10 +322,10 @@ acpi_ex_eisa_id_to_string (
/*******************************************************************************
*
- * FUNCTION: Acpi_ex_unsigned_integer_to_string
+ * FUNCTION: acpi_ex_unsigned_integer_to_string
*
* PARAMETERS: Value - Value to be converted
- * Out_string - Where to put the converted string (8 bytes)
+ * out_string - Where to put the converted string (8 bytes)
*
* RETURN: Convert a number to string representation
*
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 77a79ee88734..e262dd1696ef 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -181,8 +181,10 @@ acpi_fan_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
index b672760a427c..0b1bf2239a8d 100644
--- a/drivers/acpi/hardware/hwacpi.c
+++ b/drivers/acpi/hardware/hwacpi.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
- * $Revision: 61 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/******************************************************************************
*
- * FUNCTION: Acpi_hw_initialize
+ * FUNCTION: acpi_hw_initialize
*
* PARAMETERS: None
*
@@ -51,7 +50,7 @@ acpi_hw_initialize (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Hw_initialize");
+ ACPI_FUNCTION_TRACE ("hw_initialize");
/* We must have the ACPI tables by the time we get here */
@@ -75,7 +74,7 @@ acpi_hw_initialize (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_set_mode
+ * FUNCTION: acpi_hw_set_mode
*
* PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY
*
@@ -94,7 +93,7 @@ acpi_hw_set_mode (
u32 retry;
- ACPI_FUNCTION_TRACE ("Hw_set_mode");
+ ACPI_FUNCTION_TRACE ("hw_set_mode");
/*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
@@ -170,7 +169,7 @@ acpi_hw_set_mode (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_get_mode
+ * FUNCTION: acpi_hw_get_mode
*
* PARAMETERS: none
*
@@ -188,7 +187,7 @@ acpi_hw_get_mode (void)
u32 value;
- ACPI_FUNCTION_TRACE ("Hw_get_mode");
+ ACPI_FUNCTION_TRACE ("hw_get_mode");
status = acpi_get_register (ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
if (ACPI_FAILURE (status)) {
diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c
index 4ec7d4097414..56507fdfaf38 100644
--- a/drivers/acpi/hardware/hwgpe.c
+++ b/drivers/acpi/hardware/hwgpe.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: hwgpe - Low level GPE enable/disable/clear functions
- * $Revision: 42 $
*
*****************************************************************************/
@@ -33,9 +32,9 @@
/******************************************************************************
*
- * FUNCTION: Acpi_hw_get_gpe_bit_mask
+ * FUNCTION: acpi_hw_get_gpe_bit_mask
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: Gpe register bitmask for this gpe level
*
@@ -53,9 +52,9 @@ acpi_hw_get_gpe_bit_mask (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_enable_gpe
+ * FUNCTION: acpi_hw_enable_gpe
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -103,9 +102,9 @@ acpi_hw_enable_gpe (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_enable_gpe_for_wakeup
+ * FUNCTION: acpi_hw_enable_gpe_for_wakeup
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -142,9 +141,9 @@ acpi_hw_enable_gpe_for_wakeup (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_disable_gpe
+ * FUNCTION: acpi_hw_disable_gpe
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -196,9 +195,9 @@ acpi_hw_disable_gpe (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_disable_gpe_for_wakeup
+ * FUNCTION: acpi_hw_disable_gpe_for_wakeup
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -235,9 +234,9 @@ acpi_hw_disable_gpe_for_wakeup (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_clear_gpe
+ * FUNCTION: acpi_hw_clear_gpe
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -278,9 +277,9 @@ acpi_hw_clear_gpe (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_get_gpe_status
+ * FUNCTION: acpi_hw_get_gpe_status
*
- * PARAMETERS: Gpe_number - The GPE
+ * PARAMETERS: gpe_number - The GPE
*
* RETURN: None
*
@@ -296,7 +295,7 @@ acpi_hw_get_gpe_status (
u32 in_byte = 0;
u32 register_index = 0;
u8 bit_mask = 0;
- ACPI_GPE_REGISTER_INFO *gpe_register_info;
+ acpi_gpe_register_info *gpe_register_info;
acpi_status status;
@@ -351,7 +350,7 @@ acpi_hw_get_gpe_status (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_disable_non_wakeup_gpes
+ * FUNCTION: acpi_hw_disable_non_wakeup_gpes
*
* PARAMETERS: None
*
@@ -359,7 +358,7 @@ acpi_hw_get_gpe_status (
*
* DESCRIPTION: Disable all non-wakeup GPEs
* Call with interrupts disabled. The interrupt handler also
- * modifies Acpi_gbl_Gpe_register_info[i].Enable, so it should not be
+ * modifies acpi_gbl_gpe_register_info[i].Enable, so it should not be
* given the chance to run until after non-wake GPEs are
* re-enabled.
*
@@ -370,7 +369,7 @@ acpi_hw_disable_non_wakeup_gpes (
void)
{
u32 i;
- ACPI_GPE_REGISTER_INFO *gpe_register_info;
+ acpi_gpe_register_info *gpe_register_info;
u32 in_value;
acpi_status status;
@@ -408,7 +407,7 @@ acpi_hw_disable_non_wakeup_gpes (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_enable_non_wakeup_gpes
+ * FUNCTION: acpi_hw_enable_non_wakeup_gpes
*
* PARAMETERS: None
*
@@ -423,7 +422,7 @@ acpi_hw_enable_non_wakeup_gpes (
void)
{
u32 i;
- ACPI_GPE_REGISTER_INFO *gpe_register_info;
+ acpi_gpe_register_info *gpe_register_info;
acpi_status status;
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index 626349b68751..f32bddfb8765 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -3,7 +3,6 @@
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
- * $Revision: 138 $
*
******************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_hw_clear_acpi_status
+ * FUNCTION: acpi_hw_clear_acpi_status
*
* PARAMETERS: none
*
@@ -48,17 +47,17 @@
acpi_status
acpi_hw_clear_acpi_status (void)
{
- NATIVE_UINT_MAX32 i;
- NATIVE_UINT gpe_block;
+ acpi_native_uint i;
+ acpi_native_uint gpe_block;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Hw_clear_acpi_status");
+ ACPI_FUNCTION_TRACE ("hw_clear_acpi_status");
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %04X\n",
ACPI_BITMASK_ALL_FIXED_STATUS,
- (u16) acpi_gbl_FADT->Xpm1a_evt_blk.address));
+ (u16) acpi_gbl_FADT->xpm1a_evt_blk.address));
status = acpi_ut_acquire_mutex (ACPI_MTX_HARDWARE);
@@ -74,9 +73,9 @@ acpi_hw_clear_acpi_status (void)
/* Clear the fixed events */
- if (acpi_gbl_FADT->Xpm1b_evt_blk.address) {
+ if (acpi_gbl_FADT->xpm1b_evt_blk.address) {
status = acpi_hw_low_level_write (16, ACPI_BITMASK_ALL_FIXED_STATUS,
- &acpi_gbl_FADT->Xpm1b_evt_blk, 0);
+ &acpi_gbl_FADT->xpm1b_evt_blk, 0);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
@@ -87,7 +86,7 @@ acpi_hw_clear_acpi_status (void)
for (gpe_block = 0; gpe_block < ACPI_MAX_GPE_BLOCKS; gpe_block++) {
for (i = 0; i < acpi_gbl_gpe_block_info[gpe_block].register_count; i++) {
status = acpi_hw_low_level_write (8, 0xFF,
- acpi_gbl_gpe_block_info[gpe_block].block_address, i);
+ acpi_gbl_gpe_block_info[gpe_block].block_address, (u32) i);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
@@ -102,11 +101,11 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_get_sleep_type_data
+ * FUNCTION: acpi_get_sleep_type_data
*
- * PARAMETERS: Sleep_state - Numeric sleep state
- * *Sleep_type_a - Where SLP_TYPa is returned
- * *Sleep_type_b - Where SLP_TYPb is returned
+ * PARAMETERS: sleep_state - Numeric sleep state
+ * *sleep_type_a - Where SLP_TYPa is returned
+ * *sleep_type_b - Where SLP_TYPb is returned
*
* RETURN: Status - ACPI status
*
@@ -125,7 +124,7 @@ acpi_get_sleep_type_data (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Acpi_get_sleep_type_data");
+ ACPI_FUNCTION_TRACE ("acpi_get_sleep_type_data");
/*
@@ -142,7 +141,7 @@ acpi_get_sleep_type_data (
status = acpi_ns_evaluate_by_name ((char *) acpi_gbl_db_sleep_states[sleep_state],
NULL, &obj_desc);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s while evaluating Sleep_state [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s while evaluating sleep_state [%s]\n",
acpi_format_exception (status), acpi_gbl_db_sleep_states[sleep_state]));
return_ACPI_STATUS (status);
@@ -187,7 +186,7 @@ acpi_get_sleep_type_data (
}
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While evaluating Sleep_state [%s], bad Sleep object %p type %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While evaluating sleep_state [%s], bad Sleep object %p type %s\n",
acpi_gbl_db_sleep_states[sleep_state], obj_desc, acpi_ut_get_object_type_name (obj_desc)));
}
@@ -198,25 +197,25 @@ acpi_get_sleep_type_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_hw_get_register_bit_mask
+ * FUNCTION: acpi_hw_get_register_bit_mask
*
- * PARAMETERS: Register_id - Index of ACPI Register to access
+ * PARAMETERS: register_id - Index of ACPI Register to access
*
* RETURN: The bit mask to be used when accessing the register
*
- * DESCRIPTION: Map Register_id into a register bit mask.
+ * DESCRIPTION: Map register_id into a register bit mask.
*
******************************************************************************/
-ACPI_BIT_REGISTER_INFO *
+acpi_bit_register_info *
acpi_hw_get_bit_register_info (
u32 register_id)
{
- ACPI_FUNCTION_NAME ("Hw_get_bit_register_info");
+ ACPI_FUNCTION_NAME ("hw_get_bit_register_info");
if (register_id > ACPI_BITREG_MAX) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid Bit_register ID: %X\n", register_id));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid bit_register ID: %X\n", register_id));
return (NULL);
}
@@ -226,15 +225,15 @@ acpi_hw_get_bit_register_info (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_register
+ * FUNCTION: acpi_get_register
*
- * PARAMETERS: Register_id - Index of ACPI Register to access
- * Use_lock - Lock the hardware
+ * PARAMETERS: register_id - Index of ACPI Register to access
+ * use_lock - Lock the hardware
*
* RETURN: Value is read from specified Register. Value returned is
* normalized to bit0 (is shifted all the way right)
*
- * DESCRIPTION: ACPI Bit_register read function.
+ * DESCRIPTION: ACPI bit_register read function.
*
******************************************************************************/
@@ -245,11 +244,11 @@ acpi_get_register (
u32 flags)
{
u32 register_value = 0;
- ACPI_BIT_REGISTER_INFO *bit_reg_info;
+ acpi_bit_register_info *bit_reg_info;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_register");
+ ACPI_FUNCTION_TRACE ("acpi_get_register");
/* Get the info structure corresponding to the requested ACPI Register */
@@ -290,9 +289,9 @@ acpi_get_register (
/*******************************************************************************
*
- * FUNCTION: Acpi_set_register
+ * FUNCTION: acpi_set_register
*
- * PARAMETERS: Register_id - ID of ACPI Bit_register to access
+ * PARAMETERS: register_id - ID of ACPI bit_register to access
* Value - (only used on write) value to write to the
* Register, NOT pre-normalized to the bit pos.
* Flags - Lock the hardware or not
@@ -310,18 +309,18 @@ acpi_set_register (
u32 flags)
{
u32 register_value = 0;
- ACPI_BIT_REGISTER_INFO *bit_reg_info;
+ acpi_bit_register_info *bit_reg_info;
acpi_status status;
- ACPI_FUNCTION_TRACE_U32 ("Acpi_set_register", register_id);
+ ACPI_FUNCTION_TRACE_U32 ("acpi_set_register", register_id);
/* Get the info structure corresponding to the requested ACPI Register */
bit_reg_info = acpi_hw_get_bit_register_info (register_id);
if (!bit_reg_info) {
- ACPI_REPORT_ERROR (("Bad ACPI HW Register_id: %X\n", register_id));
+ ACPI_REPORT_ERROR (("Bad ACPI HW register_id: %X\n", register_id));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -403,16 +402,16 @@ acpi_set_register (
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n",
register_value,
- ACPI_HIDWORD (acpi_gbl_FADT->Xpm2_cnt_blk.address),
- ACPI_LODWORD (acpi_gbl_FADT->Xpm2_cnt_blk.address)));
+ ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
+ ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position,
bit_reg_info->access_bit_mask, value);
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n",
register_value,
- ACPI_HIDWORD (acpi_gbl_FADT->Xpm2_cnt_blk.address),
- ACPI_LODWORD (acpi_gbl_FADT->Xpm2_cnt_blk.address)));
+ ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
+ ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
ACPI_REGISTER_PM2_CONTROL, (u8) (register_value));
@@ -441,10 +440,10 @@ unlock_and_exit:
/******************************************************************************
*
- * FUNCTION: Acpi_hw_register_read
+ * FUNCTION: acpi_hw_register_read
*
- * PARAMETERS: Use_lock - Mutex hw access.
- * Register_id - Register_iD + Offset.
+ * PARAMETERS: use_lock - Mutex hw access.
+ * register_id - register_iD + Offset.
*
* RETURN: Value read or written.
*
@@ -465,7 +464,7 @@ acpi_hw_register_read (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Hw_register_read");
+ ACPI_FUNCTION_TRACE ("hw_register_read");
if (ACPI_MTX_LOCK == use_lock) {
@@ -478,12 +477,12 @@ acpi_hw_register_read (
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
- status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_evt_blk, 0);
+ status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->xpm1a_evt_blk, 0);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_evt_blk, 0);
+ status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->xpm1b_evt_blk, 0);
value1 |= value2;
break;
@@ -491,37 +490,37 @@ acpi_hw_register_read (
case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access*/
bank_offset = ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len);
- status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset);
+ status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->xpm1a_evt_blk, bank_offset);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset);
+ status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->xpm1b_evt_blk, bank_offset);
value1 |= value2;
break;
case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
- status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0);
+ status = acpi_hw_low_level_read (16, &value1, &acpi_gbl_FADT->xpm1a_cnt_blk, 0);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0);
+ status = acpi_hw_low_level_read (16, &value2, &acpi_gbl_FADT->xpm1b_cnt_blk, 0);
value1 |= value2;
break;
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
- status = acpi_hw_low_level_read (8, &value1, &acpi_gbl_FADT->Xpm2_cnt_blk, 0);
+ status = acpi_hw_low_level_read (8, &value1, &acpi_gbl_FADT->xpm2_cnt_blk, 0);
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
- status = acpi_hw_low_level_read (32, &value1, &acpi_gbl_FADT->Xpm_tmr_blk, 0);
+ status = acpi_hw_low_level_read (32, &value1, &acpi_gbl_FADT->xpm_tmr_blk, 0);
break;
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
@@ -550,10 +549,10 @@ unlock_and_exit:
/******************************************************************************
*
- * FUNCTION: Acpi_hw_register_write
+ * FUNCTION: acpi_hw_register_write
*
- * PARAMETERS: Use_lock - Mutex hw access.
- * Register_id - Register_iD + Offset.
+ * PARAMETERS: use_lock - Mutex hw access.
+ * register_id - register_iD + Offset.
*
* RETURN: Value read or written.
*
@@ -572,7 +571,7 @@ acpi_hw_register_write (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Hw_register_write");
+ ACPI_FUNCTION_TRACE ("hw_register_write");
if (ACPI_MTX_LOCK == use_lock) {
@@ -585,59 +584,59 @@ acpi_hw_register_write (
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1a_evt_blk, 0);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1b_evt_blk, 0);
break;
case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access*/
bank_offset = ACPI_DIV_2 (acpi_gbl_FADT->pm1_evt_len);
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_evt_blk, bank_offset);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1a_evt_blk, bank_offset);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_evt_blk, bank_offset);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1b_evt_blk, bank_offset);
break;
case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1a_cnt_blk, 0);
if (ACPI_FAILURE (status)) {
goto unlock_and_exit;
}
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1b_cnt_blk, 0);
break;
case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1a_cnt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1a_cnt_blk, 0);
break;
case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */
- status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->Xpm1b_cnt_blk, 0);
+ status = acpi_hw_low_level_write (16, value, &acpi_gbl_FADT->xpm1b_cnt_blk, 0);
break;
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
- status = acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->Xpm2_cnt_blk, 0);
+ status = acpi_hw_low_level_write (8, value, &acpi_gbl_FADT->xpm2_cnt_blk, 0);
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
- status = acpi_hw_low_level_write (32, value, &acpi_gbl_FADT->Xpm_tmr_blk, 0);
+ status = acpi_hw_low_level_write (32, value, &acpi_gbl_FADT->xpm_tmr_blk, 0);
break;
@@ -665,7 +664,7 @@ unlock_and_exit:
/******************************************************************************
*
- * FUNCTION: Acpi_hw_low_level_read
+ * FUNCTION: acpi_hw_low_level_read
*
* PARAMETERS: Register - GAS register structure
* Offset - Offset from the base address in the GAS
@@ -684,14 +683,14 @@ acpi_hw_low_level_read (
acpi_generic_address *reg,
u32 offset)
{
- ACPI_PHYSICAL_ADDRESS mem_address;
- ACPI_IO_ADDRESS io_address;
+ acpi_physical_address mem_address;
+ acpi_io_address io_address;
acpi_pci_id pci_id;
u16 pci_register;
acpi_status status;
- ACPI_FUNCTION_NAME ("Hw_low_level_read");
+ ACPI_FUNCTION_NAME ("hw_low_level_read");
/*
@@ -713,7 +712,7 @@ acpi_hw_low_level_read (
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
mem_address = (reg->address
- + (ACPI_PHYSICAL_ADDRESS) offset);
+ + (acpi_physical_address) offset);
status = acpi_os_read_memory (mem_address, value, width);
break;
@@ -721,8 +720,8 @@ acpi_hw_low_level_read (
case ACPI_ADR_SPACE_SYSTEM_IO:
- io_address = (ACPI_IO_ADDRESS) (reg->address
- + (ACPI_PHYSICAL_ADDRESS) offset);
+ io_address = (acpi_io_address) (reg->address
+ + (acpi_physical_address) offset);
status = acpi_os_read_port (io_address, value, width);
break;
@@ -753,7 +752,7 @@ acpi_hw_low_level_read (
/******************************************************************************
*
- * FUNCTION: Acpi_hw_low_level_write
+ * FUNCTION: acpi_hw_low_level_write
*
* PARAMETERS: Width - 8, 16, or 32
* Value - To be written
@@ -774,14 +773,14 @@ acpi_hw_low_level_write (
acpi_generic_address *reg,
u32 offset)
{
- ACPI_PHYSICAL_ADDRESS mem_address;
- ACPI_IO_ADDRESS io_address;
+ acpi_physical_address mem_address;
+ acpi_io_address io_address;
acpi_pci_id pci_id;
u16 pci_register;
acpi_status status;
- ACPI_FUNCTION_NAME ("Hw_low_level_write");
+ ACPI_FUNCTION_NAME ("hw_low_level_write");
/*
@@ -801,7 +800,7 @@ acpi_hw_low_level_write (
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
mem_address = (reg->address
- + (ACPI_PHYSICAL_ADDRESS) offset);
+ + (acpi_physical_address) offset);
status = acpi_os_write_memory (mem_address, (acpi_integer) value, width);
break;
@@ -809,8 +808,8 @@ acpi_hw_low_level_write (
case ACPI_ADR_SPACE_SYSTEM_IO:
- io_address = (ACPI_IO_ADDRESS) (reg->address
- + (ACPI_PHYSICAL_ADDRESS) offset);
+ io_address = (acpi_io_address) (reg->address
+ + (acpi_physical_address) offset);
status = acpi_os_write_port (io_address, (acpi_integer) value, width);
break;
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index b80531f759b7..475e624fcf71 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
- * $Revision: 48 $
*
*****************************************************************************/
@@ -32,23 +31,23 @@
/******************************************************************************
*
- * FUNCTION: Acpi_set_firmware_waking_vector
+ * FUNCTION: acpi_set_firmware_waking_vector
*
- * PARAMETERS: Physical_address - Physical address of ACPI real mode
+ * PARAMETERS: physical_address - Physical address of ACPI real mode
* entry point.
*
* RETURN: Status
*
- * DESCRIPTION: Access function for d_firmware_waking_vector field in FACS
+ * DESCRIPTION: access function for d_firmware_waking_vector field in FACS
*
******************************************************************************/
acpi_status
acpi_set_firmware_waking_vector (
- ACPI_PHYSICAL_ADDRESS physical_address)
+ acpi_physical_address physical_address)
{
- ACPI_FUNCTION_TRACE ("Acpi_set_firmware_waking_vector");
+ ACPI_FUNCTION_TRACE ("acpi_set_firmware_waking_vector");
/* Set the vector */
@@ -68,24 +67,24 @@ acpi_set_firmware_waking_vector (
/******************************************************************************
*
- * FUNCTION: Acpi_get_firmware_waking_vector
+ * FUNCTION: acpi_get_firmware_waking_vector
*
- * PARAMETERS: *Physical_address - Output buffer where contents of
- * the Firmware_waking_vector field of
+ * PARAMETERS: *physical_address - Output buffer where contents of
+ * the firmware_waking_vector field of
* the FACS will be stored.
*
* RETURN: Status
*
- * DESCRIPTION: Access function for Firmware_waking_vector field in FACS
+ * DESCRIPTION: Access function for firmware_waking_vector field in FACS
*
******************************************************************************/
acpi_status
acpi_get_firmware_waking_vector (
- ACPI_PHYSICAL_ADDRESS *physical_address)
+ acpi_physical_address *physical_address)
{
- ACPI_FUNCTION_TRACE ("Acpi_get_firmware_waking_vector");
+ ACPI_FUNCTION_TRACE ("acpi_get_firmware_waking_vector");
if (!physical_address) {
@@ -95,7 +94,7 @@ acpi_get_firmware_waking_vector (
/* Get the vector */
if (acpi_gbl_common_fACS.vector_width == 32) {
- *physical_address = (ACPI_PHYSICAL_ADDRESS)
+ *physical_address = (acpi_physical_address)
*(ACPI_CAST_PTR (u32, acpi_gbl_common_fACS.firmware_waking_vector));
}
else {
@@ -109,9 +108,9 @@ acpi_get_firmware_waking_vector (
/******************************************************************************
*
- * FUNCTION: Acpi_enter_sleep_state_prep
+ * FUNCTION: acpi_enter_sleep_state_prep
*
- * PARAMETERS: Sleep_state - Which sleep state to enter
+ * PARAMETERS: sleep_state - Which sleep state to enter
*
* RETURN: Status
*
@@ -131,7 +130,7 @@ acpi_enter_sleep_state_prep (
acpi_object arg;
- ACPI_FUNCTION_TRACE ("Acpi_enter_sleep_state_prep");
+ ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_prep");
/*
@@ -169,9 +168,9 @@ acpi_enter_sleep_state_prep (
/******************************************************************************
*
- * FUNCTION: Acpi_enter_sleep_state
+ * FUNCTION: acpi_enter_sleep_state
*
- * PARAMETERS: Sleep_state - Which sleep state to enter
+ * PARAMETERS: sleep_state - Which sleep state to enter
*
* RETURN: Status
*
@@ -186,13 +185,13 @@ acpi_enter_sleep_state (
{
u32 PM1Acontrol;
u32 PM1Bcontrol;
- ACPI_BIT_REGISTER_INFO *sleep_type_reg_info;
- ACPI_BIT_REGISTER_INFO *sleep_enable_reg_info;
+ acpi_bit_register_info *sleep_type_reg_info;
+ acpi_bit_register_info *sleep_enable_reg_info;
u32 in_value;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_enter_sleep_state");
+ ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state");
if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) ||
@@ -319,9 +318,9 @@ acpi_enter_sleep_state (
/******************************************************************************
*
- * FUNCTION: Acpi_leave_sleep_state
+ * FUNCTION: acpi_leave_sleep_state
*
- * PARAMETERS: Sleep_state - Which sleep state we just exited
+ * PARAMETERS: sleep_state - Which sleep state we just exited
*
* RETURN: Status
*
@@ -338,10 +337,10 @@ acpi_leave_sleep_state (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_leave_sleep_state");
+ ACPI_FUNCTION_TRACE ("acpi_leave_sleep_state");
- /* Ensure Enter_sleep_state_prep -> Enter_sleep_state ordering */
+ /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */
acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID;
diff --git a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c
index 3f56f3c34fcc..42f22de5a26b 100644
--- a/drivers/acpi/hardware/hwtimer.c
+++ b/drivers/acpi/hardware/hwtimer.c
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Name: hwtimer.c - ACPI Power Management Timer Interface
- * $Revision: 21 $
*
*****************************************************************************/
@@ -32,7 +31,7 @@
/******************************************************************************
*
- * FUNCTION: Acpi_get_timer_resolution
+ * FUNCTION: acpi_get_timer_resolution
*
* PARAMETERS: none
*
@@ -46,7 +45,7 @@ acpi_status
acpi_get_timer_resolution (
u32 *resolution)
{
- ACPI_FUNCTION_TRACE ("Acpi_get_timer_resolution");
+ ACPI_FUNCTION_TRACE ("acpi_get_timer_resolution");
if (!resolution) {
@@ -66,7 +65,7 @@ acpi_get_timer_resolution (
/******************************************************************************
*
- * FUNCTION: Acpi_get_timer
+ * FUNCTION: acpi_get_timer
*
* PARAMETERS: none
*
@@ -83,14 +82,14 @@ acpi_get_timer (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_timer");
+ ACPI_FUNCTION_TRACE ("acpi_get_timer");
if (!ticks) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- status = acpi_hw_low_level_read (32, ticks, &acpi_gbl_FADT->Xpm_tmr_blk, 0);
+ status = acpi_hw_low_level_read (32, ticks, &acpi_gbl_FADT->xpm_tmr_blk, 0);
return_ACPI_STATUS (status);
}
@@ -98,13 +97,13 @@ acpi_get_timer (
/******************************************************************************
*
- * FUNCTION: Acpi_get_timer_duration
+ * FUNCTION: acpi_get_timer_duration
*
- * PARAMETERS: Start_ticks
- * End_ticks
- * Time_elapsed
+ * PARAMETERS: start_ticks
+ * end_ticks
+ * time_elapsed
*
- * RETURN: Time_elapsed
+ * RETURN: time_elapsed
*
* DESCRIPTION: Computes the time elapsed (in microseconds) between two
* PM Timer time stamps, taking into account the possibility of
@@ -134,7 +133,7 @@ acpi_get_timer_duration (
acpi_integer out_quotient;
- ACPI_FUNCTION_TRACE ("Acpi_get_timer_duration");
+ ACPI_FUNCTION_TRACE ("acpi_get_timer_duration");
if (!time_elapsed) {
@@ -172,7 +171,7 @@ acpi_get_timer_duration (
*
* Requires a 64-bit divide:
*
- * Time_elapsed = (Delta_ticks * 1000000) / PM_TIMER_FREQUENCY;
+ * time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY;
*/
normalized_ticks.full = ((u64) delta_ticks) * 1000000;
diff --git a/drivers/acpi/include/acconfig.h b/drivers/acpi/include/acconfig.h
index b6f8c26c9c53..0458b93ab494 100644
--- a/drivers/acpi/include/acconfig.h
+++ b/drivers/acpi/include/acconfig.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 123 $
*
*****************************************************************************/
@@ -54,7 +53,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20021212
+#define ACPI_CA_VERSION 0x20021217
/* Version of ACPI supported */
@@ -149,7 +148,7 @@
#define ACPI_NUM_PREDEFINED_REGIONS 8
#define ACPI_USER_REGION_BEGIN 0x80
-/* Maximum Space_ids for Operation Regions */
+/* Maximum space_ids for Operation Regions */
#define ACPI_MAX_ADDRESS_SPACE 255
diff --git a/drivers/acpi/include/acdebug.h b/drivers/acpi/include/acdebug.h
index 960004b5524a..3a3cc90179ae 100644
--- a/drivers/acpi/include/acdebug.h
+++ b/drivers/acpi/include/acdebug.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
- * $Revision: 65 $
*
*****************************************************************************/
diff --git a/drivers/acpi/include/acdispat.h b/drivers/acpi/include/acdispat.h
index 1ecd03f5826f..53328058ef7f 100644
--- a/drivers/acpi/include/acdispat.h
+++ b/drivers/acpi/include/acdispat.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
- * $Revision: 55 $
*
*****************************************************************************/
@@ -146,7 +145,7 @@ acpi_ds_exec_end_op (
acpi_status
acpi_ds_get_field_names (
- ACPI_CREATE_FIELD_INFO *info,
+ acpi_create_field_info *info,
acpi_walk_state *walk_state,
acpi_parse_object *arg);
@@ -282,7 +281,7 @@ acpi_ds_parse_method (
acpi_status
acpi_ds_call_control_method (
- ACPI_THREAD_STATE *thread,
+ acpi_thread_state *thread,
acpi_walk_state *walk_state,
acpi_parse_object *op);
@@ -410,7 +409,7 @@ acpi_ds_create_walk_state (
acpi_owner_id owner_id,
acpi_parse_object *origin,
acpi_operand_object *mth_desc,
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
acpi_status
acpi_ds_init_aml_walk (
@@ -438,12 +437,12 @@ acpi_ds_delete_walk_state (
acpi_walk_state *
acpi_ds_pop_walk_state (
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
void
acpi_ds_push_walk_state (
acpi_walk_state *walk_state,
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
acpi_status
acpi_ds_result_stack_pop (
@@ -459,7 +458,7 @@ acpi_ds_result_stack_clear (
acpi_walk_state *
acpi_ds_get_current_walk_state (
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
void
acpi_ds_delete_walk_state_cache (
diff --git a/drivers/acpi/include/acevents.h b/drivers/acpi/include/acevents.h
index 08078d5f0173..68bb50b675f3 100644
--- a/drivers/acpi/include/acevents.h
+++ b/drivers/acpi/include/acevents.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
- * $Revision: 80 $
*
*****************************************************************************/
@@ -123,7 +122,7 @@ acpi_status
acpi_ev_address_space_dispatch (
acpi_operand_object *region_obj,
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
void *value);
diff --git a/drivers/acpi/include/acexcep.h b/drivers/acpi/include/acexcep.h
index 9c966115b77e..5db7e41a4cb5 100644
--- a/drivers/acpi/include/acexcep.h
+++ b/drivers/acpi/include/acexcep.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acexcep.h - Exception codes returned by the ACPI subsystem
- * $Revision: 66 $
*
*****************************************************************************/
diff --git a/drivers/acpi/include/acglobal.h b/drivers/acpi/include/acglobal.h
index 250c393e75bb..d32632d64851 100644
--- a/drivers/acpi/include/acglobal.h
+++ b/drivers/acpi/include/acglobal.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
- * $Revision: 135 $
*
*****************************************************************************/
@@ -64,7 +63,7 @@ extern u32 acpi_gbl_nesting_level;
/*
* Table pointers.
- * Although these pointers are somewhat redundant with the global Acpi_table,
+ * Although these pointers are somewhat redundant with the global acpi_table,
* they are convenient because they are typed pointers.
*
* These tables are single-table only; meaning that there can be at most one
@@ -73,7 +72,7 @@ extern u32 acpi_gbl_nesting_level;
*/
ACPI_EXTERN u32 acpi_gbl_table_flags;
ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
-ACPI_EXTERN RSDP_DESCRIPTOR *acpi_gbl_RSDP;
+ACPI_EXTERN rsdp_descriptor *acpi_gbl_RSDP;
ACPI_EXTERN xsdt_descriptor *acpi_gbl_XSDT;
ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT;
ACPI_EXTERN acpi_table_header *acpi_gbl_DSDT;
@@ -115,10 +114,10 @@ ACPI_EXTERN acpi_mutex_info acpi_gbl_acpi_mutex_info [NUM_MTX];
****************************************************************************/
-ACPI_EXTERN ACPI_MEMORY_LIST acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS];
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_drv_notify;
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER acpi_gbl_sys_notify;
-ACPI_EXTERN ACPI_INIT_HANDLER acpi_gbl_init_handler;
+ACPI_EXTERN acpi_memory_list acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS];
+ACPI_EXTERN acpi_object_notify_handler acpi_gbl_drv_notify;
+ACPI_EXTERN acpi_object_notify_handler acpi_gbl_sys_notify;
+ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
ACPI_EXTERN acpi_walk_state *acpi_gbl_breakpoint_walk;
ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore;
@@ -170,8 +169,8 @@ extern const acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFIN
ACPI_EXTERN u32 acpi_gbl_current_node_count;
ACPI_EXTERN u32 acpi_gbl_current_node_size;
ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
-ACPI_EXTERN ACPI_SIZE acpi_gbl_entry_stack_pointer;
-ACPI_EXTERN ACPI_SIZE acpi_gbl_lowest_stack_pointer;
+ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer;
+ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
#endif
@@ -182,7 +181,7 @@ ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
****************************************************************************/
-ACPI_EXTERN ACPI_THREAD_STATE *acpi_gbl_current_walk_list;
+ACPI_EXTERN acpi_thread_state *acpi_gbl_current_walk_list;
/* Control method single step flag */
@@ -203,7 +202,7 @@ ACPI_EXTERN acpi_parse_object *acpi_gbl_parsed_namespace_root;
*
****************************************************************************/
-extern ACPI_BIT_REGISTER_INFO acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
+extern acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
ACPI_EXTERN u8 acpi_gbl_sleep_type_a;
ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
@@ -215,14 +214,14 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
****************************************************************************/
extern acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
-ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
+ACPI_EXTERN acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
ACPI_EXTERN acpi_handle acpi_gbl_gpe_obj_handle;
ACPI_EXTERN u32 acpi_gbl_gpe_register_count;
ACPI_EXTERN u32 acpi_gbl_gpe_number_max;
-ACPI_EXTERN ACPI_GPE_REGISTER_INFO *acpi_gbl_gpe_register_info;
-ACPI_EXTERN ACPI_GPE_NUMBER_INFO *acpi_gbl_gpe_number_info;
-ACPI_EXTERN ACPI_GPE_BLOCK_INFO acpi_gbl_gpe_block_info[ACPI_MAX_GPE_BLOCKS];
+ACPI_EXTERN acpi_gpe_register_info *acpi_gbl_gpe_register_info;
+ACPI_EXTERN acpi_gpe_number_info *acpi_gbl_gpe_number_info;
+ACPI_EXTERN acpi_gpe_block_info acpi_gbl_gpe_block_info[ACPI_MAX_GPE_BLOCKS];
/*
* GPE translation table
@@ -231,7 +230,7 @@ ACPI_EXTERN ACPI_GPE_BLOCK_INFO acpi_gbl_gpe_block_info[ACPI_MAX_GPE_BLO
* This table is needed because the GPE numbers supported by block 1 do not
* have to be contiguous with the GPE numbers supported by block 0.
*/
-ACPI_EXTERN ACPI_GPE_INDEX_INFO *acpi_gbl_gpe_number_to_index;
+ACPI_EXTERN acpi_gpe_index_info *acpi_gbl_gpe_number_to_index;
/*****************************************************************************
diff --git a/drivers/acpi/include/achware.h b/drivers/acpi/include/achware.h
index f4df5ca0dfe3..57469b26dff4 100644
--- a/drivers/acpi/include/achware.h
+++ b/drivers/acpi/include/achware.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: achware.h -- hardware specific interfaces
- * $Revision: 60 $
*
*****************************************************************************/
@@ -60,7 +59,7 @@ acpi_hw_get_mode_capabilities (
/* Register I/O Prototypes */
-ACPI_BIT_REGISTER_INFO *
+acpi_bit_register_info *
acpi_hw_get_bit_register_info (
u32 register_id);
diff --git a/drivers/acpi/include/acinterp.h b/drivers/acpi/include/acinterp.h
index 3367ab2f5cd2..7831616ccf9b 100644
--- a/drivers/acpi/include/acinterp.h
+++ b/drivers/acpi/include/acinterp.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
- * $Revision: 144 $
*
*****************************************************************************/
@@ -310,7 +309,7 @@ acpi_ex_release_mutex (
void
acpi_ex_release_all_mutexes (
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
void
acpi_ex_unlink_mutex (
@@ -319,7 +318,7 @@ acpi_ex_unlink_mutex (
void
acpi_ex_link_mutex (
acpi_operand_object *obj_desc,
- ACPI_THREAD_STATE *thread);
+ acpi_thread_state *thread);
/*
* exprep - ACPI AML (p-code) execution - prep utilities
@@ -335,7 +334,7 @@ acpi_ex_prep_common_field_object (
acpi_status
acpi_ex_prep_field_value (
- ACPI_CREATE_FIELD_INFO *info);
+ acpi_create_field_info *info);
/*
* exsystem - Interface to OS services
@@ -489,7 +488,7 @@ acpi_ex_out_integer (
void
acpi_ex_out_address (
char *title,
- ACPI_PHYSICAL_ADDRESS value);
+ acpi_physical_address value);
/*
@@ -639,13 +638,13 @@ acpi_ex_unsigned_integer_to_string (
/*
- * exregion - default Op_region handlers
+ * exregion - default op_region handlers
*/
acpi_status
acpi_ex_system_memory_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -654,7 +653,7 @@ acpi_ex_system_memory_space_handler (
acpi_status
acpi_ex_system_io_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -663,7 +662,7 @@ acpi_ex_system_io_space_handler (
acpi_status
acpi_ex_pci_config_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -672,7 +671,7 @@ acpi_ex_pci_config_space_handler (
acpi_status
acpi_ex_cmos_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -681,7 +680,7 @@ acpi_ex_cmos_space_handler (
acpi_status
acpi_ex_pci_bar_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -690,7 +689,7 @@ acpi_ex_pci_bar_space_handler (
acpi_status
acpi_ex_embedded_controller_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -699,7 +698,7 @@ acpi_ex_embedded_controller_space_handler (
acpi_status
acpi_ex_sm_bus_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -709,7 +708,7 @@ acpi_ex_sm_bus_space_handler (
acpi_status
acpi_ex_data_table_space_handler (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
diff --git a/drivers/acpi/include/aclocal.h b/drivers/acpi/include/aclocal.h
index aeef057c2a08..c4c39b1ba19f 100644
--- a/drivers/acpi/include/aclocal.h
+++ b/drivers/acpi/include/aclocal.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 183 $
*
*****************************************************************************/
@@ -30,7 +29,7 @@
#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
typedef void* acpi_mutex;
-typedef u32 ACPI_MUTEX_HANDLE;
+typedef u32 acpi_mutex_handle;
/* Total number of aml opcodes defined */
@@ -47,12 +46,12 @@ typedef u32 ACPI_MUTEX_HANDLE;
/*
* Predefined handles for the mutex objects used within the subsystem
- * All mutex objects are automatically created by Acpi_ut_mutex_initialize.
+ * All mutex objects are automatically created by acpi_ut_mutex_initialize.
*
* The acquire/release ordering protocol is implied via this list. Mutexes
* with a lower value must be acquired before mutexes with a higher value.
*
- * NOTE: any changes here must be reflected in the Acpi_gbl_Mutex_names table also!
+ * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also!
*/
#define ACPI_MTX_EXECUTE 0
@@ -85,14 +84,14 @@ static char *acpi_gbl_mutex_names[] =
"ACPI_MTX_Parser",
"ACPI_MTX_Dispatcher",
"ACPI_MTX_Tables",
- "ACPI_MTX_Op_regions",
+ "ACPI_MTX_op_regions",
"ACPI_MTX_Namespace",
"ACPI_MTX_Events",
"ACPI_MTX_Hardware",
"ACPI_MTX_Caches",
"ACPI_MTX_Memory",
- "ACPI_MTX_Debug_cmd_complete",
- "ACPI_MTX_Debug_cmd_ready",
+ "ACPI_MTX_debug_cmd_complete",
+ "ACPI_MTX_debug_cmd_ready",
};
#endif
@@ -158,9 +157,9 @@ typedef enum
/*
* The Node describes a named object that appears in the AML
- * An Acpi_node is used to store Nodes.
+ * An acpi_node is used to store Nodes.
*
- * Data_type is used to differentiate between internal descriptors, and MUST
+ * data_type is used to differentiate between internal descriptors, and MUST
* be the first byte in this structure.
*/
@@ -168,14 +167,14 @@ typedef union acpi_name_union
{
u32 integer;
char ascii[4];
-} ACPI_NAME_UNION;
+} acpi_name_union;
typedef struct acpi_node
{
u8 descriptor; /* Used to differentiate object descriptor types */
u8 type; /* Type associated with this name */
u16 owner_id;
- ACPI_NAME_UNION name; /* ACPI Name, always 4 chars per ACPI spec */
+ acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
union acpi_operand_obj *object; /* Pointer to attached ACPI object (optional) */
@@ -215,7 +214,7 @@ typedef struct acpi_table_desc
u8 *aml_start;
u64 physical_address;
u32 aml_length;
- ACPI_SIZE length;
+ acpi_size length;
u32 count;
acpi_owner_id table_id;
u8 type;
@@ -288,7 +287,7 @@ typedef struct
u8 attribute;
u8 field_type;
-} ACPI_CREATE_FIELD_INFO;
+} acpi_create_field_info;
/*****************************************************************************
@@ -305,7 +304,7 @@ typedef struct
u16 register_count;
u8 block_base_number;
-} ACPI_GPE_BLOCK_INFO;
+} acpi_gpe_block_info;
/* Information about a particular GPE register pair */
@@ -318,7 +317,7 @@ typedef struct
u8 wake_enable; /* Mask of bits to keep enabled when sleeping */
u8 base_gpe_number; /* Base GPE number for this register */
-} ACPI_GPE_REGISTER_INFO;
+} acpi_gpe_register_info;
#define ACPI_GPE_LEVEL_TRIGGERED 1
@@ -336,14 +335,14 @@ typedef struct
u8 bit_mask;
-} ACPI_GPE_NUMBER_INFO;
+} acpi_gpe_number_info;
typedef struct
{
u8 number_index;
-} ACPI_GPE_INDEX_INFO;
+} acpi_gpe_index_info;
/* Information about each particular fixed event */
@@ -352,7 +351,7 @@ typedef struct
acpi_event_handler handler; /* Address of handler. */
void *context; /* Context to be passed to handler */
-} ACPI_FIXED_EVENT_HANDLER;
+} acpi_fixed_event_handler;
typedef struct
@@ -481,12 +480,12 @@ typedef struct acpi_pscope_state
typedef struct acpi_thread_state
{
ACPI_STATE_COMMON
- struct acpi_walk_state *walk_state_list; /* Head of list of Walk_states for this thread */
+ struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
union acpi_operand_obj *acquired_mutex_list; /* List of all currently acquired mutexes */
u32 thread_id; /* Running thread ID */
u16 current_sync_level; /* Mutex Sync (nested acquire) level */
-} ACPI_THREAD_STATE;
+} acpi_thread_state;
/*
@@ -536,7 +535,7 @@ typedef union acpi_gen_state
acpi_scope_state scope;
acpi_pscope_state parse_scope;
acpi_pkg_state pkg;
- ACPI_THREAD_STATE thread;
+ acpi_thread_state thread;
acpi_result_values results;
acpi_notify_info notify;
@@ -622,11 +621,11 @@ typedef union acpi_parse_val
typedef struct acpi_parseobj_common
{
ACPI_PARSE_COMMON
-} ACPI_PARSE_OBJ_COMMON;
+} acpi_parse_obj_common;
/*
- * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and Op_regions),
+ * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
* and bytelists.
*/
typedef struct acpi_parseobj_named
@@ -637,7 +636,7 @@ typedef struct acpi_parseobj_named
u32 length; /* AML length */
u32 name; /* 4-byte name or zero if no name */
-} ACPI_PARSE_OBJ_NAMED;
+} acpi_parse_obj_named;
/* The parse node is the fundamental element of the parse tree */
@@ -673,14 +672,14 @@ typedef struct acpi_parseobj_asl
u8 extra;
char parse_op_name[12];
-} ACPI_PARSE_OBJ_ASL;
+} acpi_parse_obj_asl;
typedef union acpi_parse_obj
{
- ACPI_PARSE_OBJ_COMMON common;
- ACPI_PARSE_OBJ_NAMED named;
- ACPI_PARSE_OBJ_ASL asl;
+ acpi_parse_obj_common common;
+ acpi_parse_obj_named named;
+ acpi_parse_obj_asl asl;
} acpi_parse_object;
@@ -713,7 +712,7 @@ typedef struct acpi_parse_state
#define ACPI_PARSEOP_BYTELIST 0x08
#define ACPI_PARSEOP_IN_CACHE 0x80
-/* Parse object Disasm_flags */
+/* Parse object disasm_flags */
#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMLIST 0x02
@@ -735,7 +734,7 @@ typedef struct
u8 bit_position;
u16 access_bit_mask;
-} ACPI_BIT_REGISTER_INFO;
+} acpi_bit_register_info;
/*
@@ -753,7 +752,7 @@ typedef struct
#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09
-/* Masks used to access the Bit_registers */
+/* Masks used to access the bit_registers */
#define ACPI_BITMASK_TIMER_STATUS 0x0001
#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
@@ -786,7 +785,7 @@ typedef struct
#define ACPI_BITMASK_ARB_DISABLE 0x0001
-/* Raw bit position of each Bit_register */
+/* Raw bit position of each bit_register */
#define ACPI_BITPOSITION_TIMER_STATUS 0x00
#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
@@ -818,7 +817,7 @@ typedef struct
****************************************************************************/
-/* Resource_type values */
+/* resource_type values */
#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
#define ACPI_RESOURCE_TYPE_IO_RANGE 1
@@ -981,7 +980,7 @@ typedef struct
char *list_name;
#endif
-} ACPI_MEMORY_LIST;
+} acpi_memory_list;
#endif /* __ACLOCAL_H__ */
diff --git a/drivers/acpi/include/acmacros.h b/drivers/acpi/include/acmacros.h
index 3646ed8ca685..52d78fe31c09 100644
--- a/drivers/acpi/include/acmacros.h
+++ b/drivers/acpi/include/acmacros.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
- * $Revision: 135 $
*
*****************************************************************************/
@@ -71,7 +70,7 @@
#define ACPI_HIDWORD(l) ((u32)(((*(uint64_struct *)(void *)(&l))).hi))
#define ACPI_GET_ADDRESS(a) (a)
-#define ACPI_STORE_ADDRESS(a,b) ((a)=(ACPI_PHYSICAL_ADDRESS)(b))
+#define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b))
#define ACPI_VALID_ADDRESS(a) (a)
#endif
#endif
@@ -84,14 +83,14 @@
/* Pointer arithmetic */
-#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (NATIVE_UINT)(b))
-#define ACPI_PTR_DIFF(a,b) (NATIVE_UINT) ((char *)(a) - (char *)(b))
+#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b))
+#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b))
/* Pointer/Integer type conversions */
-#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(NATIVE_UINT)i)
+#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i)
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
-#define ACPI_OFFSET(d,f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
+#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p))
@@ -178,15 +177,15 @@
/*
* Rounding macros (Power of two boundaries only)
*/
-#define ACPI_ROUND_DOWN(value,boundary) (((NATIVE_UINT)(value)) & (~(((NATIVE_UINT) boundary)-1)))
-#define ACPI_ROUND_UP(value,boundary) ((((NATIVE_UINT)(value)) + (((NATIVE_UINT) boundary)-1)) & (~(((NATIVE_UINT) boundary)-1)))
+#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1)))
+#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1)))
#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4)
#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8)
#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY)
-#define ACPI_ROUND_UP_TO_32_bITS(a) ACPI_ROUND_UP(a,4)
-#define ACPI_ROUND_UP_TO_64_bITS(a) ACPI_ROUND_UP(a,8)
+#define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4)
+#define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8)
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY)
@@ -256,8 +255,8 @@
*
* The "Descriptor" field is the first field in both structures.
*/
-#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->descriptor_id)
-#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((ACPI_DESCRIPTOR *)(void *)(d))->descriptor_id = t)
+#define ACPI_GET_DESCRIPTOR_TYPE(d) (((acpi_descriptor *)(void *)(d))->descriptor_id)
+#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((acpi_descriptor *)(void *)(d))->descriptor_id = t)
/* Macro to test the object type */
@@ -269,32 +268,16 @@
#define ACPI_IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0)
/*
- * Macro to check if a pointer is within an ACPI table.
- * Parameter (a) is the pointer to check. Parameter (b) must be defined
- * as a pointer to an acpi_table_header. (b+1) then points past the header,
- * and ((u8 *)b+b->Length) points one byte past the end of the table.
- */
-#if ACPI_MACHINE_WIDTH != 16
-#define ACPI_IS_IN_ACPI_TABLE(a,b) (((u8 *)(a) >= (u8 *)(b + 1)) &&\
- ((u8 *)(a) < ((u8 *)b + b->length)))
-
-#else
-#define ACPI_IS_IN_ACPI_TABLE(a,b) (_segment)(a) == (_segment)(b) &&\
- (((u8 *)(a) >= (u8 *)(b + 1)) &&\
- ((u8 *)(a) < ((u8 *)b + b->length)))
-#endif
-
-/*
* Macros for the master AML opcode table
*/
#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
-#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,Pargs,Iargs,flags,obj_type,class,type}
+#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type}
#else
-#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {Pargs,Iargs,flags,obj_type,class,type}
+#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type}
#endif
#ifdef ACPI_DISASSEMBLER
-#define ACPI_DISASM_ONLY_MEMBERS(a) a;
+#define ACPI_DISASM_ONLY_MEMBERS(a) a;
#else
#define ACPI_DISASM_ONLY_MEMBERS(a)
#endif
@@ -335,10 +318,10 @@
* 5) Expand address to 64 bits
*/
#define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d) do {a.address_space_id = (u8) d;\
- a.register_bit_width = (u8) ACPI_MUL_8 (b);\
- a.register_bit_offset = 0;\
- a.reserved = 0;\
- ACPI_STORE_ADDRESS (a.address,(ACPI_PHYSICAL_ADDRESS) c);} while (0)
+ a.register_bit_width = (u8) ACPI_MUL_8 (b);\
+ a.register_bit_offset = 0;\
+ a.reserved = 0;\
+ ACPI_STORE_ADDRESS (a.address,(acpi_physical_address) c);} while (0)
/* ACPI V1.0 entries -- address space is always I/O */
@@ -360,9 +343,9 @@
#ifdef ACPI_DEBUG_OUTPUT
#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
- acpi_os_printf ACPI_PARAM_LIST(fp);}
+ acpi_os_printf ACPI_PARAM_LIST(fp);}
#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \
- acpi_os_printf ACPI_PARAM_LIST(fp);}
+ acpi_os_printf ACPI_PARAM_LIST(fp);}
#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \
acpi_os_printf ACPI_PARAM_LIST(fp);}
#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e);
@@ -403,7 +386,7 @@
/*
* Function entry tracing.
* The first parameter should be the procedure name as a quoted string. This is declared
- * as a local string ("_Proc_name) so that it can be also used by the function exit macros below.
+ * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
*/
#define ACPI_FUNCTION_NAME(a) acpi_debug_print_info _dbg; \
@@ -427,7 +410,7 @@
* WARNING: These macros include a return statement. This is usually considered
* bad form, but having a separate exit macro is very ugly and difficult to maintain.
* One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
- * so that "_Proc_name" is defined.
+ * so that "_proc_name" is defined.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
@@ -572,8 +555,8 @@
/* Memory allocation */
-#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((ACPI_SIZE)(a),_COMPONENT,_THIS_MODULE,__LINE__)
-#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((ACPI_SIZE)(a), _COMPONENT,_THIS_MODULE,__LINE__)
+#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
+#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
#define ACPI_MEM_FREE(a) acpi_os_free(a)
#define ACPI_MEM_TRACKING(a)
@@ -582,8 +565,8 @@
/* Memory allocation */
-#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((ACPI_SIZE)(a),_COMPONENT,_THIS_MODULE,__LINE__)
-#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((ACPI_SIZE)(a), _COMPONENT,_THIS_MODULE,__LINE__)
+#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
+#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__)
#define ACPI_MEM_TRACKING(a) a
diff --git a/drivers/acpi/include/acnamesp.h b/drivers/acpi/include/acnamesp.h
index a708a366250a..64de3dbb9776 100644
--- a/drivers/acpi/include/acnamesp.h
+++ b/drivers/acpi/include/acnamesp.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
- * $Revision: 132 $
*
*****************************************************************************/
@@ -27,12 +26,12 @@
#define __ACNAMESP_H__
-/* To search the entire name space, pass this as Search_base */
+/* To search the entire name space, pass this as search_base */
#define ACPI_NS_ALL ((acpi_handle)0)
/*
- * Elements of Acpi_ns_properties are bit significant
+ * Elements of acpi_ns_properties are bit significant
* and should be one-to-one with values of acpi_object_type
*/
#define ACPI_NS_NORMAL 0
@@ -50,7 +49,7 @@
#define ACPI_NS_SYSTEM_BUS "_SB_"
-/* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */
+/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
#define ACPI_NS_NO_UPSEARCH 0
#define ACPI_NS_SEARCH_PARENT 0x01
@@ -304,7 +303,7 @@ acpi_ns_opens_scope (
void
acpi_ns_build_external_path (
acpi_namespace_node *node,
- ACPI_SIZE size,
+ acpi_size size,
char *name_buffer);
char *
@@ -332,7 +331,7 @@ acpi_ns_get_node_by_path (
u32 flags,
acpi_namespace_node **out_node);
-ACPI_SIZE
+acpi_size
acpi_ns_get_pathname_length (
acpi_namespace_node *node);
@@ -358,18 +357,18 @@ acpi_ns_get_secondary_object (
acpi_status
acpi_ns_attach_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void *data);
acpi_status
acpi_ns_detach_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler);
+ acpi_object_handler handler);
acpi_status
acpi_ns_get_attached_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void **data);
diff --git a/drivers/acpi/include/acobject.h b/drivers/acpi/include/acobject.h
index aca1c67bc082..16dad1171b1d 100644
--- a/drivers/acpi/include/acobject.h
+++ b/drivers/acpi/include/acobject.h
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Name: acobject.h - Definition of acpi_operand_object (Internal object only)
- * $Revision: 115 $
*
*****************************************************************************/
@@ -44,7 +43,7 @@
/*
* Common area for all objects.
*
- * Data_type is used to differentiate between internal descriptors, and MUST
+ * data_type is used to differentiate between internal descriptors, and MUST
* be the first byte in this structure.
*/
#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\
@@ -71,7 +70,7 @@
*/
#define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\
u8 field_flags; /* Access, update, and lock bits */\
- u8 attribute; /* From Access_as keyword */\
+ u8 attribute; /* From access_as keyword */\
u8 access_byte_width; /* Read/Write size in bytes */\
u32 bit_length; /* Length of field in bits */\
u32 base_byte_offset; /* Byte offset within containing object */\
@@ -109,7 +108,7 @@ typedef struct acpi_object_common
{
ACPI_OBJECT_COMMON_HEADER
-} ACPI_OBJECT_COMMON;
+} acpi_object_common;
typedef struct acpi_object_integer
@@ -118,7 +117,7 @@ typedef struct acpi_object_integer
acpi_integer value;
-} ACPI_OBJECT_INTEGER;
+} acpi_object_integer;
typedef struct acpi_object_string /* Null terminated, ASCII characters only */
@@ -127,7 +126,7 @@ typedef struct acpi_object_string /* Null terminated, ASCII ch
ACPI_COMMON_BUFFER_INFO
char *pointer; /* String in AML stream or allocated string */
-} ACPI_OBJECT_STRING;
+} acpi_object_string;
typedef struct acpi_object_buffer
@@ -139,7 +138,7 @@ typedef struct acpi_object_buffer
u8 *aml_start;
u32 aml_length;
-} ACPI_OBJECT_BUFFER;
+} acpi_object_buffer;
typedef struct acpi_object_package
@@ -150,9 +149,9 @@ typedef struct acpi_object_package
u32 aml_length;
u8 *aml_start;
acpi_namespace_node *node; /* Link back to parent node */
- union acpi_operand_obj **elements; /* Array of pointers to Acpi_objects */
+ union acpi_operand_obj **elements; /* Array of pointers to acpi_objects */
-} ACPI_OBJECT_PACKAGE;
+} acpi_object_package;
/******************************************************************************
@@ -166,7 +165,7 @@ typedef struct acpi_object_event
ACPI_OBJECT_COMMON_HEADER
void *semaphore;
-} ACPI_OBJECT_EVENT;
+} acpi_object_event;
#define INFINITE_CONCURRENCY 0xFF
@@ -186,7 +185,7 @@ typedef struct acpi_object_method
u8 thread_count;
acpi_owner_id owning_id;
-} ACPI_OBJECT_METHOD;
+} acpi_object_method;
typedef struct acpi_object_mutex
@@ -201,7 +200,7 @@ typedef struct acpi_object_mutex
union acpi_operand_obj *next; /* Link for list of acquired mutexes */
acpi_namespace_node *node; /* containing object */
-} ACPI_OBJECT_MUTEX;
+} acpi_object_mutex;
typedef struct acpi_object_region
@@ -214,14 +213,14 @@ typedef struct acpi_object_region
acpi_namespace_node *node; /* containing object */
union acpi_operand_obj *next;
u32 length;
- ACPI_PHYSICAL_ADDRESS address;
+ acpi_physical_address address;
-} ACPI_OBJECT_REGION;
+} acpi_object_region;
/******************************************************************************
*
- * Objects that can be notified. All share a common Notify_info area.
+ * Objects that can be notified. All share a common notify_info area.
*
*****************************************************************************/
@@ -230,7 +229,7 @@ typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER,
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
-} ACPI_OBJECT_NOTIFY_COMMON;
+} acpi_object_notify_common;
typedef struct acpi_object_device
@@ -238,7 +237,7 @@ typedef struct acpi_object_device
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
-} ACPI_OBJECT_DEVICE;
+} acpi_object_device;
typedef struct acpi_object_power_resource
@@ -249,7 +248,7 @@ typedef struct acpi_object_power_resource
u32 system_level;
u32 resource_order;
-} ACPI_OBJECT_POWER_RESOURCE;
+} acpi_object_power_resource;
typedef struct acpi_object_processor
@@ -259,9 +258,9 @@ typedef struct acpi_object_processor
u32 proc_id;
u32 length;
- ACPI_IO_ADDRESS address;
+ acpi_io_address address;
-} ACPI_OBJECT_PROCESSOR;
+} acpi_object_processor;
typedef struct acpi_object_thermal_zone
@@ -270,7 +269,7 @@ typedef struct acpi_object_thermal_zone
ACPI_COMMON_NOTIFY_INFO
-} ACPI_OBJECT_THERMAL_ZONE;
+} acpi_object_thermal_zone;
/******************************************************************************
@@ -285,16 +284,16 @@ typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER,
ACPI_COMMON_FIELD_INFO
union acpi_operand_obj *region_obj; /* Containing Operation Region object */
/* (REGION/BANK fields only) */
-} ACPI_OBJECT_FIELD_COMMON;
+} acpi_object_field_common;
typedef struct acpi_object_region_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
- union acpi_operand_obj *region_obj; /* Containing Op_region object */
+ union acpi_operand_obj *region_obj; /* Containing op_region object */
-} ACPI_OBJECT_REGION_FIELD;
+} acpi_object_region_field;
typedef struct acpi_object_bank_field
@@ -302,10 +301,10 @@ typedef struct acpi_object_bank_field
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
- union acpi_operand_obj *region_obj; /* Containing Op_region object */
- union acpi_operand_obj *bank_obj; /* Bank_select Register object */
+ union acpi_operand_obj *region_obj; /* Containing op_region object */
+ union acpi_operand_obj *bank_obj; /* bank_select Register object */
-} ACPI_OBJECT_BANK_FIELD;
+} acpi_object_bank_field;
typedef struct acpi_object_index_field
@@ -314,17 +313,17 @@ typedef struct acpi_object_index_field
ACPI_COMMON_FIELD_INFO
/*
- * No "Region_obj" pointer needed since the Index and Data registers
+ * No "region_obj" pointer needed since the Index and Data registers
* are each field definitions unto themselves.
*/
union acpi_operand_obj *index_obj; /* Index register */
union acpi_operand_obj *data_obj; /* Data register */
-} ACPI_OBJECT_INDEX_FIELD;
+} acpi_object_index_field;
-/* The Buffer_field is different in that it is part of a Buffer, not an Op_region */
+/* The buffer_field is different in that it is part of a Buffer, not an op_region */
typedef struct acpi_object_buffer_field
{
@@ -333,7 +332,7 @@ typedef struct acpi_object_buffer_field
union acpi_operand_obj *buffer_obj; /* Containing Buffer object */
-} ACPI_OBJECT_BUFFER_FIELD;
+} acpi_object_buffer_field;
/******************************************************************************
@@ -350,7 +349,7 @@ typedef struct acpi_object_notify_handler
acpi_notify_handler handler;
void *context;
-} ACPI_OBJECT_NOTIFY_HANDLER;
+} acpi_object_notify_handler;
/* Flags for address handler */
@@ -372,7 +371,7 @@ typedef struct acpi_object_addr_handler
union acpi_operand_obj *region_list; /* regions using this handler */
union acpi_operand_obj *next;
-} ACPI_OBJECT_ADDR_HANDLER;
+} acpi_object_addr_handler;
/******************************************************************************
@@ -383,29 +382,29 @@ typedef struct acpi_object_addr_handler
/*
* The Reference object type is used for these opcodes:
- * Arg[0-6], Local[0-7], Index_op, Name_op, Zero_op, One_op, Ones_op, Debug_op
+ * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op
*/
typedef struct acpi_object_reference
{
ACPI_OBJECT_COMMON_HEADER
- u8 target_type; /* Used for Index_op */
+ u8 target_type; /* Used for index_op */
u16 opcode;
- u32 offset; /* Used for Arg_op, Local_op, and Index_op */
+ u32 offset; /* Used for arg_op, local_op, and index_op */
- void *object; /* Name_op=>HANDLE to obj, Index_op=>acpi_operand_object */
+ void *object; /* name_op=>HANDLE to obj, index_op=>acpi_operand_object */
acpi_namespace_node *node;
union acpi_operand_obj **where;
-} ACPI_OBJECT_REFERENCE;
+} acpi_object_reference;
/*
* Extra object is used as additional storage for types that
- * have AML code in their declarations (Term_args) that must be
+ * have AML code in their declarations (term_args) that must be
* evaluated at run time.
*
- * Currently: Region and Field_unit types
+ * Currently: Region and field_unit types
*/
typedef struct acpi_object_extra
{
@@ -417,7 +416,7 @@ typedef struct acpi_object_extra
acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
void *region_context; /* Region-specific data */
-} ACPI_OBJECT_EXTRA;
+} acpi_object_extra;
/* Additional data that can be attached to namespace nodes */
@@ -425,10 +424,10 @@ typedef struct acpi_object_extra
typedef struct acpi_object_data
{
ACPI_OBJECT_COMMON_HEADER
- ACPI_OBJECT_HANDLER handler;
+ acpi_object_handler handler;
void *pointer;
-} ACPI_OBJECT_DATA;
+} acpi_object_data;
/* Structure used when objects are cached for reuse */
@@ -438,7 +437,7 @@ typedef struct acpi_object_cache_list
ACPI_OBJECT_COMMON_HEADER
union acpi_operand_obj *next; /* Link for object cache and internal lists*/
-} ACPI_OBJECT_CACHE_LIST;
+} acpi_object_cache_list;
/******************************************************************************
@@ -449,44 +448,44 @@ typedef struct acpi_object_cache_list
typedef union acpi_operand_obj
{
- ACPI_OBJECT_COMMON common;
-
- ACPI_OBJECT_INTEGER integer;
- ACPI_OBJECT_STRING string;
- ACPI_OBJECT_BUFFER buffer;
- ACPI_OBJECT_PACKAGE package;
-
- ACPI_OBJECT_EVENT event;
- ACPI_OBJECT_METHOD method;
- ACPI_OBJECT_MUTEX mutex;
- ACPI_OBJECT_REGION region;
-
- ACPI_OBJECT_NOTIFY_COMMON common_notify;
- ACPI_OBJECT_DEVICE device;
- ACPI_OBJECT_POWER_RESOURCE power_resource;
- ACPI_OBJECT_PROCESSOR processor;
- ACPI_OBJECT_THERMAL_ZONE thermal_zone;
-
- ACPI_OBJECT_FIELD_COMMON common_field;
- ACPI_OBJECT_REGION_FIELD field;
- ACPI_OBJECT_BUFFER_FIELD buffer_field;
- ACPI_OBJECT_BANK_FIELD bank_field;
- ACPI_OBJECT_INDEX_FIELD index_field;
-
- ACPI_OBJECT_NOTIFY_HANDLER notify_handler;
- ACPI_OBJECT_ADDR_HANDLER addr_handler;
-
- ACPI_OBJECT_REFERENCE reference;
- ACPI_OBJECT_EXTRA extra;
- ACPI_OBJECT_DATA data;
- ACPI_OBJECT_CACHE_LIST cache;
+ acpi_object_common common;
+
+ acpi_object_integer integer;
+ acpi_object_string string;
+ acpi_object_buffer buffer;
+ acpi_object_package package;
+
+ acpi_object_event event;
+ acpi_object_method method;
+ acpi_object_mutex mutex;
+ acpi_object_region region;
+
+ acpi_object_notify_common common_notify;
+ acpi_object_device device;
+ acpi_object_power_resource power_resource;
+ acpi_object_processor processor;
+ acpi_object_thermal_zone thermal_zone;
+
+ acpi_object_field_common common_field;
+ acpi_object_region_field field;
+ acpi_object_buffer_field buffer_field;
+ acpi_object_bank_field bank_field;
+ acpi_object_index_field index_field;
+
+ acpi_object_notify_handler notify_handler;
+ acpi_object_addr_handler addr_handler;
+
+ acpi_object_reference reference;
+ acpi_object_extra extra;
+ acpi_object_data data;
+ acpi_object_cache_list cache;
} acpi_operand_object;
/******************************************************************************
*
- * ACPI_DESCRIPTOR - objects that share a common descriptor identifier
+ * acpi_descriptor - objects that share a common descriptor identifier
*
*****************************************************************************/
@@ -517,7 +516,7 @@ typedef union acpi_desc
acpi_namespace_node node;
acpi_parse_object op;
-} ACPI_DESCRIPTOR;
+} acpi_descriptor;
#endif /* _ACOBJECT_H */
diff --git a/drivers/acpi/include/acoutput.h b/drivers/acpi/include/acoutput.h
index e41cb6955641..6a88c061d38a 100644
--- a/drivers/acpi/include/acoutput.h
+++ b/drivers/acpi/include/acoutput.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acoutput.h -- debug output
- * $Revision: 91 $
*
*****************************************************************************/
@@ -32,7 +31,7 @@
* component basis and a per-exception-type basis.
*/
-/* Component IDs are used in the global "Debug_layer" */
+/* Component IDs are used in the global "debug_layer" */
#define ACPI_UTILITIES 0x00000001
#define ACPI_HARDWARE 0x00000002
@@ -105,7 +104,7 @@
#define ACPI_LV_INTERRUPTS 0x08000000
#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2
-/* Exceptionally verbose output -- also used in the global "Debug_level" */
+/* Exceptionally verbose output -- also used in the global "debug_level" */
#define ACPI_LV_AML_DISASSEMBLE 0x10000000
#define ACPI_LV_VERBOSE_INFO 0x20000000
@@ -118,9 +117,9 @@
/*
* Debug level macros that are used in the DEBUG_PRINT macros
*/
-#define ACPI_DEBUG_LEVEL(dl) dl,__LINE__,&_dbg
+#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_dbg
-/* Exception level -- used in the global "Debug_level" */
+/* Exception level -- used in the global "debug_level" */
#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
@@ -130,7 +129,7 @@
#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
-/* Trace level -- also used in the global "Debug_level" */
+/* Trace level -- also used in the global "debug_level" */
#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
@@ -157,7 +156,7 @@
#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
-/* Defaults for Debug_level, debug and normal */
+/* Defaults for debug_level, debug and normal */
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
diff --git a/drivers/acpi/include/acparser.h b/drivers/acpi/include/acparser.h
index f0f7763a6ae5..d35af8818255 100644
--- a/drivers/acpi/include/acparser.h
+++ b/drivers/acpi/include/acparser.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
- * $Revision: 64 $
*
*****************************************************************************/
diff --git a/drivers/acpi/include/acpi.h b/drivers/acpi/include/acpi.h
index dd03d917633d..f415da65f17b 100644
--- a/drivers/acpi/include/acpi.h
+++ b/drivers/acpi/include/acpi.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acpi.h - Master include file, Publics and external data.
- * $Revision: 55 $
*
*****************************************************************************/
diff --git a/drivers/acpi/include/acpiosxf.h b/drivers/acpi/include/acpiosxf.h
index d9ac3d5c1f02..2326fda0e434 100644
--- a/drivers/acpi/include/acpiosxf.h
+++ b/drivers/acpi/include/acpiosxf.h
@@ -33,7 +33,7 @@
#include "actypes.h"
-/* Priorities for Acpi_os_queue_for_execution */
+/* Priorities for acpi_os_queue_for_execution */
#define OSD_PRIORITY_GPE 1
#define OSD_PRIORITY_HIGH 2
@@ -44,7 +44,7 @@
#define ACPI_MUTEX_SEM 1
-/* Functions for Acpi_os_signal */
+/* Functions for acpi_os_signal */
#define ACPI_SIGNAL_FATAL 0
#define ACPI_SIGNAL_BREAKPOINT 1
@@ -55,7 +55,7 @@ typedef struct acpi_fatal_info
u32 code;
u32 argument;
-} ACPI_SIGNAL_FATAL_INFO;
+} acpi_signal_fatal_info;
/*
@@ -91,7 +91,7 @@ acpi_os_terminate (
acpi_status
acpi_os_get_root_pointer (
u32 flags,
- ACPI_POINTER *address);
+ acpi_pointer *address);
acpi_status
acpi_os_table_override (
@@ -131,7 +131,7 @@ acpi_os_signal_semaphore (
void *
acpi_os_allocate (
- ACPI_SIZE size);
+ acpi_size size);
void
acpi_os_free (
@@ -139,19 +139,19 @@ acpi_os_free (
acpi_status
acpi_os_map_memory (
- ACPI_PHYSICAL_ADDRESS physical_address,
- ACPI_SIZE size,
+ acpi_physical_address physical_address,
+ acpi_size size,
void **logical_address);
void
acpi_os_unmap_memory (
void *logical_address,
- ACPI_SIZE size);
+ acpi_size size);
acpi_status
acpi_os_get_physical_address (
void *logical_address,
- ACPI_PHYSICAL_ADDRESS *physical_address);
+ acpi_physical_address *physical_address);
/*
@@ -200,13 +200,13 @@ acpi_os_stall (
acpi_status
acpi_os_read_port (
- ACPI_IO_ADDRESS address,
+ acpi_io_address address,
void *value,
u32 width);
acpi_status
acpi_os_write_port (
- ACPI_IO_ADDRESS address,
+ acpi_io_address address,
acpi_integer value,
u32 width);
@@ -217,13 +217,13 @@ acpi_os_write_port (
acpi_status
acpi_os_read_memory (
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
void *value,
u32 width);
acpi_status
acpi_os_write_memory (
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
acpi_integer value,
u32 width);
diff --git a/drivers/acpi/include/acpixf.h b/drivers/acpi/include/acpixf.h
index f6f5a8be6264..c7bea9467413 100644
--- a/drivers/acpi/include/acpixf.h
+++ b/drivers/acpi/include/acpixf.h
@@ -77,7 +77,7 @@ acpi_purge_cached_objects (
acpi_status
acpi_install_initialization_handler (
- ACPI_INIT_HANDLER handler,
+ acpi_init_handler handler,
u32 function);
/*
@@ -104,7 +104,7 @@ acpi_free (
acpi_status
acpi_find_root_pointer (
u32 flags,
- ACPI_POINTER *rsdp_address);
+ acpi_pointer *rsdp_address);
acpi_status
acpi_load_tables (
@@ -173,18 +173,18 @@ acpi_get_handle (
acpi_status
acpi_attach_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void *data);
acpi_status
acpi_detach_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler);
+ acpi_object_handler handler);
acpi_status
acpi_get_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void **data);
@@ -261,7 +261,7 @@ acpi_remove_notify_handler (
acpi_status
acpi_install_address_space_handler (
acpi_handle device,
- ACPI_ADR_SPACE_TYPE space_id,
+ acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup,
void *context);
@@ -269,7 +269,7 @@ acpi_install_address_space_handler (
acpi_status
acpi_remove_address_space_handler (
acpi_handle device,
- ACPI_ADR_SPACE_TYPE space_id,
+ acpi_adr_space_type space_id,
acpi_adr_space_handler handler);
acpi_status
@@ -359,11 +359,11 @@ acpi_set_register (
acpi_status
acpi_set_firmware_waking_vector (
- ACPI_PHYSICAL_ADDRESS physical_address);
+ acpi_physical_address physical_address);
acpi_status
acpi_get_firmware_waking_vector (
- ACPI_PHYSICAL_ADDRESS *physical_address);
+ acpi_physical_address *physical_address);
acpi_status
acpi_get_sleep_type_data (
diff --git a/drivers/acpi/include/acresrc.h b/drivers/acpi/include/acresrc.h
index 81ac94889252..e57e646c3905 100644
--- a/drivers/acpi/include/acresrc.h
+++ b/drivers/acpi/include/acresrc.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acresrc.h - Resource Manager function prototypes
- * $Revision: 34 $
*
*****************************************************************************/
@@ -69,7 +68,7 @@ acpi_rs_create_pci_routing_table (
/*
- * Function prototypes called from Acpi_rs_create*
+ * Function prototypes called from acpi_rs_create*
*/
void
acpi_rs_dump_irq (
@@ -141,17 +140,17 @@ acpi_status
acpi_rs_get_list_length (
u8 *byte_stream_buffer,
u32 byte_stream_buffer_length,
- ACPI_SIZE *size_needed);
+ acpi_size *size_needed);
acpi_status
acpi_rs_get_byte_stream_length (
acpi_resource *linked_list_buffer,
- ACPI_SIZE *size_needed);
+ acpi_size *size_needed);
acpi_status
acpi_rs_get_pci_routing_table_length (
acpi_operand_object *package_object,
- ACPI_SIZE *buffer_size_needed);
+ acpi_size *buffer_size_needed);
acpi_status
acpi_rs_byte_stream_to_list (
@@ -162,203 +161,203 @@ acpi_rs_byte_stream_to_list (
acpi_status
acpi_rs_list_to_byte_stream (
acpi_resource *linked_list,
- ACPI_SIZE byte_stream_size_needed,
+ acpi_size byte_stream_size_needed,
u8 *output_buffer);
acpi_status
acpi_rs_io_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_fixed_io_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_io_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_fixed_io_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_irq_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_irq_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_dma_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_dma_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_address16_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_address16_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_address32_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_address32_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_address64_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_address64_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_start_depend_fns_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_end_depend_fns_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_start_depend_fns_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_end_depend_fns_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_memory24_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_memory24_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_memory32_range_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_fixed_memory32_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_memory32_range_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_fixed_memory32_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_extended_irq_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_extended_irq_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_end_tag_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_end_tag_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
acpi_status
acpi_rs_vendor_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size);
+ acpi_size *structure_size);
acpi_status
acpi_rs_vendor_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed);
+ acpi_size *bytes_consumed);
u8
acpi_rs_get_resource_type (
diff --git a/drivers/acpi/include/acstruct.h b/drivers/acpi/include/acstruct.h
index c0e919abfe6a..92ee30f70593 100644
--- a/drivers/acpi/include/acstruct.h
+++ b/drivers/acpi/include/acstruct.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acstruct.h - Internal structs
- * $Revision: 22 $
*
*****************************************************************************/
@@ -54,7 +53,7 @@ typedef struct acpi_walk_state
acpi_owner_id owner_id; /* Owner of objects created during the walk */
u8 last_predicate; /* Result of last predicate */
u8 current_result; /* */
- u8 next_op_info; /* Info about Next_op */
+ u8 next_op_info; /* Info about next_op */
u8 num_operands; /* Stack pointer for Operands[] array */
u8 return_used;
u8 walk_type;
@@ -76,7 +75,7 @@ typedef struct acpi_walk_state
acpi_generic_state *control_state; /* List of control states (nested IFs) */
struct acpi_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
struct acpi_node *method_call_node; /* Called method Node*/
- acpi_parse_object *method_call_op; /* Method_call Op if running a method */
+ acpi_parse_object *method_call_op; /* method_call Op if running a method */
union acpi_operand_obj *method_desc; /* Method descriptor if running a method */
struct acpi_node *method_node; /* Method Node if running a method */
acpi_parse_object *op; /* Current parser op */
@@ -94,14 +93,14 @@ typedef struct acpi_walk_state
acpi_parse_object *next_op; /* next op to be processed */
acpi_parse_downwards descending_callback;
acpi_parse_upwards ascending_callback;
- ACPI_THREAD_STATE *thread;
- struct acpi_walk_state *next; /* Next Walk_state in list */
+ acpi_thread_state *thread;
+ struct acpi_walk_state *next; /* Next walk_state in list */
} acpi_walk_state;
-/* Info used by Acpi_ps_init_objects */
+/* Info used by acpi_ps_init_objects */
typedef struct acpi_init_walk_info
{
@@ -121,7 +120,7 @@ typedef struct acpi_init_walk_info
} acpi_init_walk_info;
-/* Info used by Acpi_ns_initialize_devices */
+/* Info used by acpi_ns_initialize_devices */
typedef struct acpi_device_walk_info
{
@@ -163,16 +162,16 @@ typedef union acpi_aml_operands
struct
{
- ACPI_OBJECT_INTEGER *type;
- ACPI_OBJECT_INTEGER *code;
- ACPI_OBJECT_INTEGER *argument;
+ acpi_object_integer *type;
+ acpi_object_integer *code;
+ acpi_object_integer *argument;
} fatal;
struct
{
acpi_operand_object *source;
- ACPI_OBJECT_INTEGER *index;
+ acpi_object_integer *index;
acpi_operand_object *target;
} index;
@@ -180,13 +179,13 @@ typedef union acpi_aml_operands
struct
{
acpi_operand_object *source;
- ACPI_OBJECT_INTEGER *index;
- ACPI_OBJECT_INTEGER *length;
+ acpi_object_integer *index;
+ acpi_object_integer *length;
acpi_operand_object *target;
} mid;
-} ACPI_AML_OPERANDS;
+} acpi_aml_operands;
#endif
diff --git a/drivers/acpi/include/actables.h b/drivers/acpi/include/actables.h
index a0c1a55304f9..f8a6eebbdd4e 100644
--- a/drivers/acpi/include/actables.h
+++ b/drivers/acpi/include/actables.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: actables.h - ACPI table management
- * $Revision: 43 $
*
*****************************************************************************/
@@ -27,7 +26,7 @@
#define __ACTABLES_H__
-/* Used in Acpi_tb_map_acpi_table for size parameter if table header is to be used */
+/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */
#define SIZE_IN_HEADER 0
@@ -55,7 +54,7 @@ acpi_tb_build_common_facs (
u32
acpi_tb_get_table_count (
- RSDP_DESCRIPTOR *RSDP,
+ rsdp_descriptor *RSDP,
acpi_table_header *RSDT);
/*
@@ -64,23 +63,23 @@ acpi_tb_get_table_count (
acpi_status
acpi_tb_get_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_desc *table_info);
acpi_status
acpi_tb_get_table_header (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *return_header);
acpi_status
acpi_tb_get_table_body (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *header,
acpi_table_desc *table_info);
acpi_status
acpi_tb_get_this_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *header,
acpi_table_desc *table_info);
@@ -97,11 +96,11 @@ acpi_tb_get_table_ptr (
acpi_status
acpi_tb_verify_rsdp (
- ACPI_POINTER *address);
+ acpi_pointer *address);
void
acpi_tb_get_rsdt_address (
- ACPI_POINTER *out_address);
+ acpi_pointer *out_address);
acpi_status
acpi_tb_validate_rsdt (
@@ -113,12 +112,12 @@ acpi_tb_get_required_tables (
acpi_status
acpi_tb_get_primary_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_desc *table_info);
acpi_status
acpi_tb_get_secondary_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_string signature,
acpi_table_desc *table_info);
diff --git a/drivers/acpi/include/actbl.h b/drivers/acpi/include/actbl.h
index 03a826e05528..2c3c69d0818a 100644
--- a/drivers/acpi/include/actbl.h
+++ b/drivers/acpi/include/actbl.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: actbl.h - Table data structures defined in ACPI specification
- * $Revision: 54 $
*
*****************************************************************************/
@@ -86,7 +85,7 @@ typedef struct /* Root System Descriptor Pointer */
u8 extended_checksum; /* Checksum of entire table */
char reserved [3]; /* Reserved field must be 0 */
-} RSDP_DESCRIPTOR;
+} rsdp_descriptor;
typedef struct /* ACPI common table header */
diff --git a/drivers/acpi/include/actbl1.h b/drivers/acpi/include/actbl1.h
index d4f2552c722e..2eb31e167d4e 100644
--- a/drivers/acpi/include/actbl1.h
+++ b/drivers/acpi/include/actbl1.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: actbl1.h - ACPI 1.0 tables
- * $Revision: 22 $
*
*****************************************************************************/
@@ -72,16 +71,16 @@ typedef struct
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
u8 reserved2; /* Reserved - must be zero */
- u32 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
- u32 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
+ u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
+ u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- u32 gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */
- u32 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */
- u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */
- u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */
+ u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
+ u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
+ u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
+ u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
diff --git a/drivers/acpi/include/actbl2.h b/drivers/acpi/include/actbl2.h
index b8f2dc910655..57e31da1983b 100644
--- a/drivers/acpi/include/actbl2.h
+++ b/drivers/acpi/include/actbl2.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
- * $Revision: 29 $
*
*****************************************************************************/
@@ -82,7 +81,7 @@ typedef struct
u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */
u32 reserved1 : 31; /* Must be 0 */
- u64 Xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
+ u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
u8 version; /* Version of this table */
u8 reserved3 [31]; /* Reserved - must be zero */
@@ -119,16 +118,16 @@ typedef struct
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
u8 pstate_cnt; /* Processor performance state control*/
- u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
- u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
+ u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
+ u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- u32 V1_gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */
- u32 V1_gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */
- u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */
- u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */
+ u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
+ u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
+ u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
+ u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
@@ -164,18 +163,18 @@ typedef struct
u32 reserved6 : 18; /* Reserved - must be zero */
acpi_generic_address reset_register; /* Reset register address in GAS format */
- u8 reset_value; /* Value to write to the Reset_register port to reset the system. */
+ u8 reset_value; /* Value to write to the reset_register port to reset the system. */
u8 reserved7[3]; /* These three bytes must be zero */
- u64 Xfirmware_ctrl; /* 64-bit physical address of FACS */
+ u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
- acpi_generic_address Xpm1a_evt_blk; /* Extended Power Mgt 1a Acpi_event Reg Blk address */
- acpi_generic_address Xpm1b_evt_blk; /* Extended Power Mgt 1b Acpi_event Reg Blk address */
- acpi_generic_address Xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
- acpi_generic_address Xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
- acpi_generic_address Xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
- acpi_generic_address Xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
- acpi_generic_address Xgpe0_blk; /* Extended General Purpose Acpi_event 0 Reg Blk address */
- acpi_generic_address Xgpe1_blk; /* Extended General Purpose Acpi_event 1 Reg Blk address */
+ acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
+ acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
+ acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
+ acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
+ acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
+ acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
+ acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
+ acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
} fadt_descriptor_rev2;
diff --git a/drivers/acpi/include/actbl71.h b/drivers/acpi/include/actbl71.h
index 97b098d2b9d0..0f2d084b01e1 100644
--- a/drivers/acpi/include/actbl71.h
+++ b/drivers/acpi/include/actbl71.h
@@ -3,7 +3,6 @@
* Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71
* This file includes tables specific to this
* specification revision.
- * $Revision: 12 $
*
*****************************************************************************/
@@ -29,7 +28,7 @@
#define __ACTBL71_H__
-/* 0.71 FADT Address_space data item bitmasks defines */
+/* 0.71 FADT address_space data item bitmasks defines */
/* If the associated bit is zero then it is in memory space else in io space */
#define SMI_CMD_ADDRESS_SPACE 0x01
@@ -105,16 +104,16 @@ typedef struct
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
u8 reserved2; /* reserved - must be zero */
u64 smi_cmd; /* Port address of SMI command port */
- u64 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */
- u64 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */
+ u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
+ u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
- u64 gpe0_blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */
- u64 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */
- u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */
- u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */
+ u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
+ u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
+ u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
+ u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
diff --git a/drivers/acpi/include/actypes.h b/drivers/acpi/include/actypes.h
index b4887ab9a085..71696454d00e 100644
--- a/drivers/acpi/include/actypes.h
+++ b/drivers/acpi/include/actypes.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
- * $Revision: 244 $
*
*****************************************************************************/
@@ -40,21 +39,34 @@
#define ACPI_ASCII_MAX 0x7F
+#ifdef DEFINE_ALTERNATE_TYPES
+/*
+ * Types used only in translated source, defined here to enable
+ * cross-platform compilation only.
+ */
+typedef int s32;
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+typedef COMPILER_DEPENDENT_UINT64 u64;
+
+#endif
+
/*
* Data types - Fixed across all compilation models (16/32/64)
*
- * BOOLEAN Logical Boolean.
- * INT8 8-bit (1 byte) signed value
- * UINT8 8-bit (1 byte) unsigned value
- * INT16 16-bit (2 byte) signed value
- * UINT16 16-bit (2 byte) unsigned value
- * INT32 32-bit (4 byte) signed value
- * UINT32 32-bit (4 byte) unsigned value
- * INT64 64-bit (8 byte) signed value
- * UINT64 64-bit (8 byte) unsigned value
- * NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value
- * NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
+ * BOOLEAN Logical Boolean.
+ * INT8 8-bit (1 byte) signed value
+ * UINT8 8-bit (1 byte) unsigned value
+ * INT16 16-bit (2 byte) signed value
+ * UINT16 16-bit (2 byte) unsigned value
+ * INT32 32-bit (4 byte) signed value
+ * UINT32 32-bit (4 byte) unsigned value
+ * INT64 64-bit (8 byte) signed value
+ * UINT64 64-bit (8 byte) unsigned value
+ * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value
+ * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
*/
#ifndef ACPI_MACHINE_WIDTH
@@ -62,6 +74,9 @@
#endif
#if ACPI_MACHINE_WIDTH == 64
+
+/*! [Begin] no source code translation (keep the typedefs) */
+
/*
* 64-bit type definitions
*/
@@ -73,16 +88,15 @@ typedef unsigned int UINT32;
typedef COMPILER_DEPENDENT_INT64 INT64;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
-typedef INT64 NATIVE_INT;
-typedef UINT64 NATIVE_UINT;
+/*! [End] no source code translation !*/
-typedef UINT32 NATIVE_UINT_MAX32;
-typedef UINT64 NATIVE_UINT_MIN32;
+typedef s64 acpi_native_int;
+typedef u64 acpi_native_uint;
-typedef UINT64 ACPI_TBLPTR;
-typedef UINT64 ACPI_IO_ADDRESS;
-typedef UINT64 ACPI_PHYSICAL_ADDRESS;
-typedef UINT64 ACPI_SIZE;
+typedef u64 acpi_table_ptr;
+typedef u64 acpi_io_address;
+typedef u64 acpi_physical_address;
+typedef u64 acpi_size;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
@@ -92,6 +106,8 @@ typedef UINT64 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 16
+/*! [Begin] no source code translation (keep the typedefs) */
+
/*
* 16-bit type definitions
*/
@@ -109,16 +125,15 @@ typedef struct
} UINT64;
-typedef UINT16 NATIVE_UINT;
-typedef INT16 NATIVE_INT;
+/*! [End] no source code translation !*/
-typedef UINT16 NATIVE_UINT_MAX32;
-typedef UINT32 NATIVE_UINT_MIN32;
+typedef u16 acpi_native_uint;
+typedef s16 acpi_native_int;
-typedef UINT32 ACPI_TBLPTR;
-typedef UINT32 ACPI_IO_ADDRESS;
-typedef char *ACPI_PHYSICAL_ADDRESS;
-typedef UINT16 ACPI_SIZE;
+typedef u32 acpi_table_ptr;
+typedef u32 acpi_io_address;
+typedef char *acpi_physical_address;
+typedef u16 acpi_size;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
#define _HW_ALIGNMENT_SUPPORT
@@ -135,6 +150,8 @@ typedef UINT16 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 32
+/*! [Begin] no source code translation (keep the typedefs) */
+
/*
* 32-bit type definitions (default)
*/
@@ -146,16 +163,15 @@ typedef unsigned int UINT32;
typedef COMPILER_DEPENDENT_INT64 INT64;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
-typedef INT32 NATIVE_INT;
-typedef UINT32 NATIVE_UINT;
+/*! [End] no source code translation !*/
-typedef UINT32 NATIVE_UINT_MAX32;
-typedef UINT32 NATIVE_UINT_MIN32;
+typedef s32 acpi_native_int;
+typedef u32 acpi_native_uint;
-typedef UINT64 ACPI_TBLPTR;
-typedef UINT32 ACPI_IO_ADDRESS;
-typedef UINT64 ACPI_PHYSICAL_ADDRESS;
-typedef UINT32 ACPI_SIZE;
+typedef u64 acpi_table_ptr;
+typedef u32 acpi_io_address;
+typedef u64 acpi_physical_address;
+typedef u32 acpi_size;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
#define _HW_ALIGNMENT_SUPPORT
@@ -170,24 +186,8 @@ typedef UINT32 ACPI_SIZE;
/*
* Miscellaneous common types
*/
-typedef UINT32 UINT32_BIT;
-typedef NATIVE_UINT ACPI_PTRDIFF;
-typedef char NATIVE_CHAR;
-
-
-#ifdef DEFINE_ALTERNATE_TYPES
-/*
- * Types used only in translated source, defined here to enable
- * cross-platform compilation only.
- */
-typedef INT32 s32;
-typedef UINT8 u8;
-typedef UINT16 u16;
-typedef UINT32 u32;
-typedef UINT64 u64;
-#endif
-/*! [End] no source code translation !*/
-
+typedef u32 UINT32_BIT;
+typedef acpi_native_uint ACPI_PTRDIFF;
/*
* Pointer overlays to avoid lots of typecasting for
@@ -195,20 +195,20 @@ typedef UINT64 u64;
*/
typedef union acpi_ptrs
{
- ACPI_PHYSICAL_ADDRESS physical;
+ acpi_physical_address physical;
void *logical;
- ACPI_TBLPTR value;
+ acpi_table_ptr value;
-} ACPI_POINTERS;
+} acpi_pointers;
typedef struct acpi_pointer
{
u32 pointer_type;
union acpi_ptrs pointer;
-} ACPI_POINTER;
+} acpi_pointer;
-/* Pointer_types for above */
+/* pointer_types for above */
#define ACPI_PHYSICAL_POINTER 0x01
#define ACPI_LOGICAL_POINTER 0x02
@@ -269,7 +269,7 @@ typedef struct
u32 lo;
u32 hi;
-} UINT32_STRUCT;
+} uint32_struct;
/*
@@ -400,11 +400,11 @@ typedef u32 acpi_table_type;
/*
* Types associated with ACPI names and objects. The first group of
* values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
- * of the ACPI Object_type() operator (See the ACPI Spec). Therefore,
+ * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
* only add to the first group if the spec changes.
*
- * Types must be kept in sync with the global Acpi_ns_properties
- * and Acpi_ns_type_names arrays.
+ * Types must be kept in sync with the global acpi_ns_properties
+ * and acpi_ns_type_names arrays.
*/
typedef u32 acpi_object_type;
@@ -412,15 +412,15 @@ typedef u32 acpi_object_type;
#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */
#define ACPI_TYPE_STRING 0x02
#define ACPI_TYPE_BUFFER 0x03
-#define ACPI_TYPE_PACKAGE 0x04 /* Byte_const, multiple Data_term/Constant/Super_name */
+#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */
#define ACPI_TYPE_FIELD_UNIT 0x05
#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */
#define ACPI_TYPE_EVENT 0x07
-#define ACPI_TYPE_METHOD 0x08 /* Name, Byte_const, multiple Code */
+#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */
#define ACPI_TYPE_MUTEX 0x09
#define ACPI_TYPE_REGION 0x0A
-#define ACPI_TYPE_POWER 0x0B /* Name,Byte_const,Word_const,multi Node */
-#define ACPI_TYPE_PROCESSOR 0x0C /* Name,Byte_const,DWord_const,Byte_const,multi Nm_o */
+#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */
+#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */
#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */
#define ACPI_TYPE_BUFFER_FIELD 0x0E
#define ACPI_TYPE_DDB_HANDLE 0x0F
@@ -430,7 +430,7 @@ typedef u32 acpi_object_type;
/*
* These are object types that do not map directly to the ACPI
- * Object_type() operator. They are used for various internal purposes only.
+ * object_type() operator. They are used for various internal purposes only.
* If new predefined ACPI_TYPEs are added (via the ACPI specification), these
* internal types must move upwards. (There is code that depends on these
* values being contiguous with the external types above.)
@@ -438,13 +438,13 @@ typedef u32 acpi_object_type;
#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13
-#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, Ref_of, Index */
+#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */
#define ACPI_TYPE_LOCAL_ALIAS 0x15
#define ACPI_TYPE_LOCAL_NOTIFY 0x16
#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x17
#define ACPI_TYPE_LOCAL_RESOURCE 0x18
#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x19
-#define ACPI_TYPE_LOCAL_SCOPE 0x1A /* 1 Name, multiple Object_list Nodes */
+#define ACPI_TYPE_LOCAL_SCOPE 0x1A /* 1 Name, multiple object_list Nodes */
#define ACPI_TYPE_NS_NODE_MAX 0x1A /* Last typecode used within a NS Node */
@@ -503,7 +503,7 @@ typedef u32 acpi_object_type;
/*
- * Acpi_event Types: Fixed & General Purpose
+ * acpi_event Types: Fixed & General Purpose
*/
typedef u32 acpi_event_type;
@@ -536,7 +536,7 @@ typedef u32 acpi_event_type;
/*
- * Acpi_event Status:
+ * acpi_event Status:
* -------------
* The encoding of acpi_event_status is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
@@ -569,20 +569,20 @@ typedef u32 acpi_event_status;
/* Address Space (Operation Region) Types */
-typedef u8 ACPI_ADR_SPACE_TYPE;
+typedef u8 acpi_adr_space_type;
-#define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0
-#define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1
-#define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2
-#define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3
-#define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4
-#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
-#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
-#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 7
+#define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0
+#define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1
+#define ACPI_ADR_SPACE_PCI_CONFIG (acpi_adr_space_type) 2
+#define ACPI_ADR_SPACE_EC (acpi_adr_space_type) 3
+#define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4
+#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5
+#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6
+#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7
/*
- * Bit_register IDs
+ * bit_register IDs
* These are bitfields defined within the full ACPI registers
*/
#define ACPI_BITREG_TIMER_STATUS 0x00
@@ -618,7 +618,7 @@ typedef u8 ACPI_ADR_SPACE_TYPE;
*/
typedef union acpi_obj
{
- acpi_object_type type; /* See definition of Acpi_ns_type for values */
+ acpi_object_type type; /* See definition of acpi_ns_type for values */
struct
{
acpi_object_type type;
@@ -657,7 +657,7 @@ typedef union acpi_obj
{
acpi_object_type type;
u32 proc_id;
- ACPI_IO_ADDRESS pblk_address;
+ acpi_io_address pblk_address;
u32 pblk_length;
} processor;
@@ -686,19 +686,19 @@ typedef struct acpi_obj_list
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
-#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
-#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
+#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1)
+#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2)
typedef struct
{
- ACPI_SIZE length; /* Length in bytes of the buffer */
+ acpi_size length; /* Length in bytes of the buffer */
void *pointer; /* pointer to buffer */
} acpi_buffer;
/*
- * Name_type for Acpi_get_name
+ * name_type for acpi_get_name
*/
#define ACPI_FULL_PATHNAME 0
#define ACPI_SINGLE_NAME 1
@@ -706,7 +706,7 @@ typedef struct
/*
- * Structure and flags for Acpi_get_system_info
+ * Structure and flags for acpi_get_system_info
*/
#define ACPI_SYS_MODE_UNKNOWN 0x0000
#define ACPI_SYS_MODE_ACPI 0x0001
@@ -725,7 +725,7 @@ typedef struct acpi_table_info
/*
- * System info returned by Acpi_get_system_info()
+ * System info returned by acpi_get_system_info()
*/
typedef struct _acpi_sys_info
{
@@ -760,13 +760,13 @@ void (*acpi_notify_handler) (
void *context);
typedef
-void (*ACPI_OBJECT_HANDLER) (
+void (*acpi_object_handler) (
acpi_handle object,
u32 function,
void *data);
typedef
-acpi_status (*ACPI_INIT_HANDLER) (
+acpi_status (*acpi_init_handler) (
acpi_handle object,
u32 function);
@@ -778,7 +778,7 @@ acpi_status (*ACPI_INIT_HANDLER) (
typedef
acpi_status (*acpi_adr_space_handler) (
u32 function,
- ACPI_PHYSICAL_ADDRESS address,
+ acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
@@ -811,7 +811,7 @@ acpi_status (*acpi_walk_callback) (
#define ACPI_INTERRUPT_HANDLED 0x01
-/* Structure and flags for Acpi_get_device_info */
+/* Structure and flags for acpi_get_device_info */
#define ACPI_VALID_HID 0x1
#define ACPI_VALID_UID 0x2
@@ -856,10 +856,10 @@ typedef struct
typedef struct
{
u32 length;
- ACPI_PHYSICAL_ADDRESS address;
- ACPI_PHYSICAL_ADDRESS mapped_physical_address;
+ acpi_physical_address address;
+ acpi_physical_address mapped_physical_address;
u8 *mapped_logical_address;
- ACPI_SIZE mapped_length;
+ acpi_size mapped_length;
} acpi_mem_space_context;
@@ -880,8 +880,8 @@ typedef struct
/*
* IO Attributes
- * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
- * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cD0-n_fFFh.
+ * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh.
+ * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh.
*/
#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
#define ACPI_ISA_ONLY_RANGES (u8) 0x02
@@ -1007,7 +1007,7 @@ typedef struct
{
u8 checksum;
-} ACPI_RESOURCE_END_TAG;
+} acpi_resource_end_tag;
typedef struct
{
@@ -1166,7 +1166,7 @@ typedef union
acpi_resource_io io;
acpi_resource_fixed_io fixed_io;
acpi_resource_vendor vendor_specific;
- ACPI_RESOURCE_END_TAG end_tag;
+ acpi_resource_end_tag end_tag;
acpi_resource_mem24 memory24;
acpi_resource_mem32 memory32;
acpi_resource_fixed_mem32 fixed_memory32;
diff --git a/drivers/acpi/include/acutils.h b/drivers/acpi/include/acutils.h
index 46beb89243f1..d63f158e0564 100644
--- a/drivers/acpi/include/acutils.h
+++ b/drivers/acpi/include/acutils.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 150 $
*
*****************************************************************************/
@@ -28,7 +27,7 @@
typedef
-acpi_status (*ACPI_PKG_CALLBACK) (
+acpi_status (*acpi_pkg_callback) (
u8 object_type,
acpi_operand_object *source_object,
acpi_generic_state *state,
@@ -39,14 +38,14 @@ acpi_status
acpi_ut_walk_package_tree (
acpi_operand_object *source_object,
void *target_object,
- ACPI_PKG_CALLBACK walk_callback,
+ acpi_pkg_callback walk_callback,
void *context);
typedef struct acpi_pkg_info
{
u8 *free_space;
- ACPI_SIZE length;
+ acpi_size length;
u32 object_space;
u32 num_packages;
} acpi_pkg_info;
@@ -55,7 +54,7 @@ typedef struct acpi_pkg_info
#define REF_DECREMENT (u16) 1
#define REF_FORCE_DELETE (u16) 2
-/* Acpi_ut_dump_buffer */
+/* acpi_ut_dump_buffer */
#define DB_BYTE_DISPLAY 1
#define DB_WORD_DISPLAY 2
@@ -75,7 +74,7 @@ acpi_ut_terminate (
/*
- * Ut_init - miscellaneous initialization and shutdown
+ * ut_init - miscellaneous initialization and shutdown
*/
acpi_status
@@ -91,7 +90,7 @@ acpi_ut_validate_fadt (
void);
/*
- * Ut_global - Global data structures and procedures
+ * ut_global - Global data structures and procedures
*/
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
@@ -133,12 +132,12 @@ acpi_ut_allocate_owner_id (
/*
- * Ut_clib - Local implementations of C library functions
+ * ut_clib - Local implementations of C library functions
*/
#ifndef ACPI_USE_SYSTEM_CLIBRARY
-ACPI_SIZE
+acpi_size
acpi_ut_strlen (
const char *string);
@@ -151,13 +150,13 @@ char *
acpi_ut_strncpy (
char *dst_string,
const char *src_string,
- ACPI_SIZE count);
+ acpi_size count);
int
acpi_ut_strncmp (
const char *string1,
const char *string2,
- ACPI_SIZE count);
+ acpi_size count);
int
acpi_ut_strcmp (
@@ -173,7 +172,7 @@ char *
acpi_ut_strncat (
char *dst_string,
const char *src_string,
- ACPI_SIZE count);
+ acpi_size count);
u32
acpi_ut_strtoul (
@@ -190,13 +189,13 @@ void *
acpi_ut_memcpy (
void *dest,
const void *src,
- ACPI_SIZE count);
+ acpi_size count);
void *
acpi_ut_memset (
void *dest,
- NATIVE_UINT value,
- ACPI_SIZE count);
+ acpi_native_uint value,
+ acpi_size count);
int
acpi_ut_to_upper (
@@ -231,7 +230,7 @@ extern const u8 _acpi_ctype[];
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
/*
- * Ut_copy - Object construction and conversion interfaces
+ * ut_copy - Object construction and conversion interfaces
*/
acpi_status
@@ -300,7 +299,7 @@ acpi_ut_copy_iobject_to_iobject (
/*
- * Ut_create - Object creation
+ * ut_create - Object creation
*/
acpi_status
@@ -310,7 +309,7 @@ acpi_ut_update_object_reference (
/*
- * Ut_debug - Debug interfaces
+ * ut_debug - Debug interfaces
*/
void
@@ -410,7 +409,7 @@ acpi_ut_debug_print_raw (
/*
- * Ut_delete - Object deletion
+ * ut_delete - Object deletion
*/
void
@@ -431,7 +430,7 @@ acpi_ut_delete_internal_object_list (
/*
- * Ut_eval - object evaluation
+ * ut_eval - object evaluation
*/
/* Method name strings */
@@ -482,7 +481,7 @@ acpi_ut_execute_UID (
/*
- * Ut_mutex - mutual exclusion interfaces
+ * ut_mutex - mutual exclusion interfaces
*/
acpi_status
@@ -495,23 +494,23 @@ acpi_ut_mutex_terminate (
acpi_status
acpi_ut_create_mutex (
- ACPI_MUTEX_HANDLE mutex_id);
+ acpi_mutex_handle mutex_id);
acpi_status
acpi_ut_delete_mutex (
- ACPI_MUTEX_HANDLE mutex_id);
+ acpi_mutex_handle mutex_id);
acpi_status
acpi_ut_acquire_mutex (
- ACPI_MUTEX_HANDLE mutex_id);
+ acpi_mutex_handle mutex_id);
acpi_status
acpi_ut_release_mutex (
- ACPI_MUTEX_HANDLE mutex_id);
+ acpi_mutex_handle mutex_id);
/*
- * Ut_object - internal object create/delete/cache routines
+ * ut_object - internal object create/delete/cache routines
*/
acpi_operand_object *
@@ -540,11 +539,11 @@ acpi_ut_valid_internal_object (
acpi_operand_object *
acpi_ut_create_buffer_object (
- ACPI_SIZE buffer_size);
+ acpi_size buffer_size);
/*
- * Ut_ref_cnt - Object reference count management
+ * ut_ref_cnt - Object reference count management
*/
void
@@ -556,23 +555,23 @@ acpi_ut_remove_reference (
acpi_operand_object *object);
/*
- * Ut_size - Object size routines
+ * ut_size - Object size routines
*/
acpi_status
acpi_ut_get_simple_object_size (
acpi_operand_object *obj,
- ACPI_SIZE *obj_length);
+ acpi_size *obj_length);
acpi_status
acpi_ut_get_package_object_size (
acpi_operand_object *obj,
- ACPI_SIZE *obj_length);
+ acpi_size *obj_length);
acpi_status
acpi_ut_get_object_size(
acpi_operand_object *obj,
- ACPI_SIZE *obj_length);
+ acpi_size *obj_length);
acpi_status
acpi_ut_get_element_length (
@@ -583,7 +582,7 @@ acpi_ut_get_element_length (
/*
- * Ut_state - Generic state creation/cache routines
+ * ut_state - Generic state creation/cache routines
*/
void
@@ -600,7 +599,7 @@ acpi_generic_state *
acpi_ut_create_generic_state (
void);
-ACPI_THREAD_STATE *
+acpi_thread_state *
acpi_ut_create_thread_state (
void);
@@ -736,21 +735,21 @@ acpi_ut_validate_buffer (
acpi_status
acpi_ut_initialize_buffer (
acpi_buffer *buffer,
- ACPI_SIZE required_length);
+ acpi_size required_length);
/* Memory allocation functions */
void *
acpi_ut_allocate (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line);
void *
acpi_ut_callocate (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line);
@@ -760,14 +759,14 @@ acpi_ut_callocate (
void *
acpi_ut_allocate_and_track (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line);
void *
acpi_ut_callocate_and_track (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line);
@@ -788,7 +787,7 @@ acpi_status
acpi_ut_track_allocation (
u32 list_id,
acpi_debug_mem_block *address,
- ACPI_SIZE size,
+ acpi_size size,
u8 alloc_type,
u32 component,
char *module,
diff --git a/drivers/acpi/include/amlcode.h b/drivers/acpi/include/amlcode.h
index 341108a44fb8..6af01b0a63da 100644
--- a/drivers/acpi/include/amlcode.h
+++ b/drivers/acpi/include/amlcode.h
@@ -3,7 +3,6 @@
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
- * $Revision: 71 $
*
*****************************************************************************/
@@ -191,7 +190,7 @@
/*
* Argument types for the AML Parser
- * Each field in the Arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
+ * Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types
*/
@@ -216,7 +215,7 @@
/*
* Resolved argument types for the AML Interpreter
- * Each field in the Arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
+ * Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types (0 is end-of-arg-list indicator)
*
* Note: If and when 5 bits becomes insufficient, it would probably be best
@@ -240,7 +239,7 @@
#define ARGI_ANYOBJECT 0x11
#define ARGI_ANYTYPE 0x12
#define ARGI_COMPUTEDATA 0x13 /* Buffer, String, or Integer */
-#define ARGI_DATAOBJECT 0x14 /* Buffer, String, package or reference to a Node - Used only by Size_of operator*/
+#define ARGI_DATAOBJECT 0x14 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/
#define ARGI_COMPLEXOBJ 0x15 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_INTEGER_REF 0x16
#define ARGI_OBJECT_REF 0x17
@@ -296,10 +295,10 @@
#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */
#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET
-#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Monadic2_r */
+#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */
#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */
#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */
-#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Dyadic2_r */
+#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */
#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS
#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
@@ -313,10 +312,10 @@
#define AML_TYPE_EXEC_1A_0T_0R 0x00 /* Monadic1 */
#define AML_TYPE_EXEC_1A_0T_1R 0x01 /* Monadic2 */
#define AML_TYPE_EXEC_1A_1T_0R 0x02
-#define AML_TYPE_EXEC_1A_1T_1R 0x03 /* Monadic2_r */
+#define AML_TYPE_EXEC_1A_1T_1R 0x03 /* monadic2_r */
#define AML_TYPE_EXEC_2A_0T_0R 0x04 /* Dyadic1 */
#define AML_TYPE_EXEC_2A_0T_1R 0x05 /* Dyadic2 */
-#define AML_TYPE_EXEC_2A_1T_1R 0x06 /* Dyadic2_r */
+#define AML_TYPE_EXEC_2A_1T_1R 0x06 /* dyadic2_r */
#define AML_TYPE_EXEC_2A_2T_1R 0x07
#define AML_TYPE_EXEC_3A_0T_0R 0x08
#define AML_TYPE_EXEC_3A_1T_1R 0x09
@@ -364,7 +363,7 @@
#define AML_CLASS_UNKNOWN 0x0A
-/* Predefined Operation Region Space_iDs */
+/* Predefined Operation Region space_iDs */
typedef enum
{
@@ -381,7 +380,7 @@ typedef enum
} AML_REGION_TYPES;
-/* Comparison operation codes for Match_op operator */
+/* Comparison operation codes for match_op operator */
typedef enum
{
@@ -398,7 +397,7 @@ typedef enum
/*
- * Field_flags
+ * field_flags
*
* This byte is extracted from the AML and includes three separate
* pieces of information about the field:
@@ -406,9 +405,9 @@ typedef enum
* 2) The field update rule
* 3) The lock rule for the field
*
- * Bits 00 - 03 : Access_type (Any_acc, Byte_acc, etc.)
- * 04 : Lock_rule (1 == Lock)
- * 05 - 06 : Update_rule
+ * Bits 00 - 03 : access_type (any_acc, byte_acc, etc.)
+ * 04 : lock_rule (1 == Lock)
+ * 05 - 06 : update_rule
*/
#define AML_FIELD_ACCESS_TYPE_MASK 0x0F
#define AML_FIELD_LOCK_RULE_MASK 0x10
@@ -453,7 +452,7 @@ typedef enum
/*
* Field Access Attributes.
* This byte is extracted from the AML via the
- * Access_as keyword
+ * access_as keyword
*/
typedef enum
{
@@ -468,7 +467,7 @@ typedef enum
} AML_ACCESS_ATTRIBUTE;
-/* bit fields in Method_flags byte */
+/* bit fields in method_flags byte */
#define METHOD_FLAGS_ARG_COUNT 0x07
#define METHOD_FLAGS_SERIALIZED 0x08
diff --git a/drivers/acpi/include/amlresrc.h b/drivers/acpi/include/amlresrc.h
index 22e738cdc658..099d174142a9 100644
--- a/drivers/acpi/include/amlresrc.h
+++ b/drivers/acpi/include/amlresrc.h
@@ -2,7 +2,6 @@
/******************************************************************************
*
* Module Name: amlresrc.h - AML resource descriptors
- * $Revision: 22 $
*
*****************************************************************************/
@@ -39,12 +38,12 @@
#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
#define ASL_RESNAME_GRANULARITY "_GRA"
#define ASL_RESNAME_INTERRUPT "_INT"
-#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* Active_lo(1), Active_hi(0) */
-#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), No_share(0) */
+#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
+#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
#define ASL_RESNAME_LENGTH "_LEN"
#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
-#define ASL_RESNAME_MEMTYPE "_MEM" /* Non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
+#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ASL_RESNAME_MAXADDR "_MAX"
#define ASL_RESNAME_MINADDR "_MIN"
#define ASL_RESNAME_MAXTYPE "_MAF"
@@ -52,11 +51,11 @@
#define ASL_RESNAME_REGISTERBITOFFSET "_RBO"
#define ASL_RESNAME_REGISTERBITWIDTH "_RBW"
#define ASL_RESNAME_RANGETYPE "_RNG"
-#define ASL_RESNAME_READWRITETYPE "_RW_" /* Read_only(0), Writeable (1) */
+#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
#define ASL_RESNAME_TRANSLATION "_TRA"
#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */
-#define ASL_RESNAME_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */
+#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */
/* Default sizes for "small" resource descriptors */
@@ -76,7 +75,7 @@ typedef struct asl_resource_node
void *buffer;
struct asl_resource_node *next;
-} ASL_RESOURCE_NODE;
+} asl_resource_node;
/*
@@ -93,7 +92,7 @@ typedef struct asl_irq_format_desc
u16 irq_mask;
u8 flags;
-} ASL_IRQ_FORMAT_DESC;
+} asl_irq_format_desc;
typedef struct asl_irq_noflags_desc
@@ -101,7 +100,7 @@ typedef struct asl_irq_noflags_desc
u8 descriptor_type;
u16 irq_mask;
-} ASL_IRQ_NOFLAGS_DESC;
+} asl_irq_noflags_desc;
typedef struct asl_dma_format_desc
@@ -110,7 +109,7 @@ typedef struct asl_dma_format_desc
u8 dma_channel_mask;
u8 flags;
-} ASL_DMA_FORMAT_DESC;
+} asl_dma_format_desc;
typedef struct asl_start_dependent_desc
@@ -118,21 +117,21 @@ typedef struct asl_start_dependent_desc
u8 descriptor_type;
u8 flags;
-} ASL_START_DEPENDENT_DESC;
+} asl_start_dependent_desc;
typedef struct asl_start_dependent_noprio_desc
{
u8 descriptor_type;
-} ASL_START_DEPENDENT_NOPRIO_DESC;
+} asl_start_dependent_noprio_desc;
typedef struct asl_end_dependent_desc
{
u8 descriptor_type;
-} ASL_END_DEPENDENT_DESC;
+} asl_end_dependent_desc;
typedef struct asl_io_port_desc
@@ -144,7 +143,7 @@ typedef struct asl_io_port_desc
u8 alignment;
u8 length;
-} ASL_IO_PORT_DESC;
+} asl_io_port_desc;
typedef struct asl_fixed_io_port_desc
@@ -153,7 +152,7 @@ typedef struct asl_fixed_io_port_desc
u16 base_address;
u8 length;
-} ASL_FIXED_IO_PORT_DESC;
+} asl_fixed_io_port_desc;
typedef struct asl_small_vendor_desc
@@ -161,7 +160,7 @@ typedef struct asl_small_vendor_desc
u8 descriptor_type;
u8 vendor_defined[7];
-} ASL_SMALL_VENDOR_DESC;
+} asl_small_vendor_desc;
typedef struct asl_end_tag_desc
@@ -169,7 +168,7 @@ typedef struct asl_end_tag_desc
u8 descriptor_type;
u8 checksum;
-} ASL_END_TAG_DESC;
+} asl_end_tag_desc;
/* LARGE descriptors */
@@ -184,7 +183,7 @@ typedef struct asl_memory_24_desc
u16 alignment;
u16 range_length;
-} ASL_MEMORY_24_DESC;
+} asl_memory_24_desc;
typedef struct asl_large_vendor_desc
@@ -193,7 +192,7 @@ typedef struct asl_large_vendor_desc
u16 length;
u8 vendor_defined[1];
-} ASL_LARGE_VENDOR_DESC;
+} asl_large_vendor_desc;
typedef struct asl_memory_32_desc
@@ -206,7 +205,7 @@ typedef struct asl_memory_32_desc
u32 alignment;
u32 range_length;
-} ASL_MEMORY_32_DESC;
+} asl_memory_32_desc;
typedef struct asl_fixed_memory_32_desc
@@ -217,7 +216,7 @@ typedef struct asl_fixed_memory_32_desc
u32 base_address;
u32 range_length;
-} ASL_FIXED_MEMORY_32_DESC;
+} asl_fixed_memory_32_desc;
typedef struct asl_qword_address_desc
@@ -234,7 +233,7 @@ typedef struct asl_qword_address_desc
u64 address_length;
u8 optional_fields[2];
-} ASL_QWORD_ADDRESS_DESC;
+} asl_qword_address_desc;
typedef struct asl_dword_address_desc
@@ -251,7 +250,7 @@ typedef struct asl_dword_address_desc
u32 address_length;
u8 optional_fields[2];
-} ASL_DWORD_ADDRESS_DESC;
+} asl_dword_address_desc;
typedef struct asl_word_address_desc
@@ -268,7 +267,7 @@ typedef struct asl_word_address_desc
u16 address_length;
u8 optional_fields[2];
-} ASL_WORD_ADDRESS_DESC;
+} asl_word_address_desc;
typedef struct asl_extended_xrupt_desc
@@ -278,9 +277,9 @@ typedef struct asl_extended_xrupt_desc
u8 flags;
u8 table_length;
u32 interrupt_number[1];
- /* Res_source_index, Res_source optional fields follow */
+ /* res_source_index, res_source optional fields follow */
-} ASL_EXTENDED_XRUPT_DESC;
+} asl_extended_xrupt_desc;
typedef struct asl_general_register_desc
@@ -293,7 +292,7 @@ typedef struct asl_general_register_desc
u8 reserved;
u64 address;
-} ASL_GENERAL_REGISTER_DESC;
+} asl_general_register_desc;
/* restore default alignment */
@@ -303,29 +302,29 @@ typedef struct asl_general_register_desc
typedef union asl_resource_desc
{
- ASL_IRQ_FORMAT_DESC irq;
- ASL_DMA_FORMAT_DESC dma;
- ASL_START_DEPENDENT_DESC std;
- ASL_END_DEPENDENT_DESC end;
- ASL_IO_PORT_DESC iop;
- ASL_FIXED_IO_PORT_DESC fio;
- ASL_SMALL_VENDOR_DESC smv;
- ASL_END_TAG_DESC et;
-
- ASL_MEMORY_24_DESC M24;
- ASL_LARGE_VENDOR_DESC lgv;
- ASL_MEMORY_32_DESC M32;
- ASL_FIXED_MEMORY_32_DESC F32;
- ASL_QWORD_ADDRESS_DESC qas;
- ASL_DWORD_ADDRESS_DESC das;
- ASL_WORD_ADDRESS_DESC was;
- ASL_EXTENDED_XRUPT_DESC exx;
- ASL_GENERAL_REGISTER_DESC grg;
- u32 U32_item;
- u16 U16_item;
+ asl_irq_format_desc irq;
+ asl_dma_format_desc dma;
+ asl_start_dependent_desc std;
+ asl_end_dependent_desc end;
+ asl_io_port_desc iop;
+ asl_fixed_io_port_desc fio;
+ asl_small_vendor_desc smv;
+ asl_end_tag_desc et;
+
+ asl_memory_24_desc M24;
+ asl_large_vendor_desc lgv;
+ asl_memory_32_desc M32;
+ asl_fixed_memory_32_desc F32;
+ asl_qword_address_desc qas;
+ asl_dword_address_desc das;
+ asl_word_address_desc was;
+ asl_extended_xrupt_desc exx;
+ asl_general_register_desc grg;
+ u32 u32_item;
+ u16 u16_item;
u8 U8item;
-} ASL_RESOURCE_DESC;
+} asl_resource_desc;
#endif
diff --git a/drivers/acpi/include/platform/acenv.h b/drivers/acpi/include/platform/acenv.h
index c560d975b888..82b278b34893 100644
--- a/drivers/acpi/include/platform/acenv.h
+++ b/drivers/acpi/include/platform/acenv.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acenv.h - Generation environment specific items
- * $Revision: 101 $
*
*****************************************************************************/
@@ -206,16 +205,16 @@
#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
-#define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s))
+#define ACPI_STRLEN(s) (acpi_size) strlen((s))
#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
-#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n))
+#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n))
+#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (acpi_size)(n))
#define ACPI_STRCMP(d,s) strcmp((d), (s))
#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
-#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
+#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n))
+#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n))
+#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
+#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
#define ACPI_TOUPPER toupper
#define ACPI_TOLOWER tolower
@@ -252,8 +251,8 @@ typedef char *va_list;
* Storage alignment properties
*/
-#define _AUPBND (sizeof (NATIVE_INT) - 1)
-#define _ADNBND (sizeof (NATIVE_INT) - 1)
+#define _AUPBND (sizeof (acpi_native_int) - 1)
+#define _ADNBND (sizeof (acpi_native_int) - 1)
/*
* Variable argument list macro definitions
@@ -269,16 +268,16 @@ typedef char *va_list;
#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
-#define ACPI_STRLEN(s) (ACPI_SIZE) acpi_ut_strlen ((s))
+#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s))
#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s))
-#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (ACPI_SIZE)(n))
+#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n))
+#define ACPI_STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (acpi_size)(n))
#define ACPI_STRCMP(d,s) acpi_ut_strcmp ((d), (s))
#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s))
-#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (ACPI_SIZE)(n))
-#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (ACPI_SIZE)(n))
+#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n))
+#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n))
+#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
+#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
#define ACPI_TOUPPER acpi_ut_to_upper
#define ACPI_TOLOWER acpi_ut_to_lower
diff --git a/drivers/acpi/include/platform/acgcc.h b/drivers/acpi/include/platform/acgcc.h
index 390f06a944be..5be853faf92d 100644
--- a/drivers/acpi/include/platform/acgcc.h
+++ b/drivers/acpi/include/platform/acgcc.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acgcc.h - GCC specific defines, etc.
- * $Revision: 24 $
*
*****************************************************************************/
diff --git a/drivers/acpi/include/platform/aclinux.h b/drivers/acpi/include/platform/aclinux.h
index 9d5b47e9eb86..b1e8e5fb3870 100644
--- a/drivers/acpi/include/platform/aclinux.h
+++ b/drivers/acpi/include/platform/aclinux.h
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: aclinux.h - OS specific defines, etc.
- * $Revision: 29 $
*
*****************************************************************************/
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index 275eede6592b..5a323c670051 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
- * $Revision: 167 $
*
******************************************************************************/
@@ -36,7 +35,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_root_initialize
+ * FUNCTION: acpi_ns_root_initialize
*
* PARAMETERS: None
*
@@ -57,7 +56,7 @@ acpi_ns_root_initialize (void)
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Ns_root_initialize");
+ ACPI_FUNCTION_TRACE ("ns_root_initialize");
status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
@@ -67,7 +66,7 @@ acpi_ns_root_initialize (void)
/*
* The global root ptr is initially NULL, so a non-NULL value indicates
- * that Acpi_ns_root_initialize() has already been called; just return.
+ * that acpi_ns_root_initialize() has already been called; just return.
*/
if (acpi_gbl_root_node) {
status = AE_OK;
@@ -97,7 +96,7 @@ acpi_ns_root_initialize (void)
/*
* Name entered successfully.
- * If entry in Pre_defined_names[] specifies an
+ * If entry in pre_defined_names[] specifies an
* initial value, create the initial value.
*/
if (init_val->val) {
@@ -124,7 +123,7 @@ acpi_ns_root_initialize (void)
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
- /* Compiler cheats by putting parameter count in the Owner_iD */
+ /* Compiler cheats by putting parameter count in the owner_iD */
new_node->owner_id = obj_desc->method.param_count;
#endif
@@ -210,16 +209,16 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_lookup
+ * FUNCTION: acpi_ns_lookup
*
- * PARAMETERS: Prefix_node - Search scope if name is not fully qualified
+ * PARAMETERS: prefix_node - Search scope if name is not fully qualified
* Pathname - Search pathname, in internal format
* (as represented in the AML stream)
* Type - Type associated with name
- * Interpreter_mode - IMODE_LOAD_PASS2 => add name if not found
+ * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found
* Flags - Flags describing the search restrictions
- * Walk_state - Current state of the walk
- * Return_node - Where the Node is placed (if found
+ * walk_state - Current state of the walk
+ * return_node - Where the Node is placed (if found
* or created successfully)
*
* RETURN: Status
@@ -256,7 +255,7 @@ acpi_ns_lookup (
ACPI_NS_SEARCH_PARENT);
- ACPI_FUNCTION_TRACE ("Ns_lookup");
+ ACPI_FUNCTION_TRACE ("ns_lookup");
if (!return_node) {
@@ -309,7 +308,7 @@ acpi_ns_lookup (
* Begin examination of the actual pathname
*/
if (!pathname) {
- /* A Null Name_path is allowed and refers to the root */
+ /* A Null name_path is allowed and refers to the root */
num_segments = 0;
this_node = acpi_gbl_root_node;
@@ -393,8 +392,8 @@ acpi_ns_lookup (
*
* The segment part consists of either:
* - A Null name segment (0)
- * - A Dual_name_prefix followed by two 4-byte name segments
- * - A Multi_name_prefix followed by a byte indicating the
+ * - A dual_name_prefix followed by two 4-byte name segments
+ * - A multi_name_prefix followed by a byte indicating the
* number of segments and the segments themselves.
* - A single 4-byte name segment
*
@@ -416,7 +415,7 @@ acpi_ns_lookup (
case AML_DUAL_NAME_PREFIX:
- /* More than one Name_seg, search rules do not apply */
+ /* More than one name_seg, search rules do not apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH;
@@ -431,7 +430,7 @@ acpi_ns_lookup (
case AML_MULTI_NAME_PREFIX_OP:
- /* More than one Name_seg, search rules do not apply */
+ /* More than one name_seg, search rules do not apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH;
@@ -482,7 +481,7 @@ acpi_ns_lookup (
/*
* Only allow automatic parent search (search rules) if the caller
- * requested it AND we have a single, non-fully-qualified Name_seg
+ * requested it AND we have a single, non-fully-qualified name_seg
*/
if ((search_parent_flag != ACPI_NS_NO_UPSEARCH) &&
(flags & ACPI_NS_SEARCH_PARENT)) {
@@ -521,7 +520,7 @@ acpi_ns_lookup (
/*
* Sanity typecheck of the target object:
*
- * If 1) This is the last segment (Num_segments == 0)
+ * If 1) This is the last segment (num_segments == 0)
* 2) And we are looking for a specific type
* (Not checking for TYPE_ANY)
* 3) Which is not an alias
@@ -540,7 +539,7 @@ acpi_ns_lookup (
/* Complain about a type mismatch */
ACPI_REPORT_WARNING (
- ("Ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n",
+ ("ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n",
(char *) &simple_name, acpi_ut_get_type_name (this_node->type),
acpi_ut_get_type_name (type_to_check_for)));
}
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index f871aa5a6a65..7d5894bf1f31 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
- * $Revision: 78 $
*
******************************************************************************/
@@ -34,9 +33,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_create_node
+ * FUNCTION: acpi_ns_create_node
*
- * PARAMETERS: Acpi_name - Name of the new node
+ * PARAMETERS: acpi_name - Name of the new node
*
* RETURN: None
*
@@ -51,7 +50,7 @@ acpi_ns_create_node (
acpi_namespace_node *node;
- ACPI_FUNCTION_TRACE ("Ns_create_node");
+ ACPI_FUNCTION_TRACE ("ns_create_node");
node = ACPI_MEM_CALLOCATE (sizeof (acpi_namespace_node));
@@ -71,7 +70,7 @@ acpi_ns_create_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_delete_node
+ * FUNCTION: acpi_ns_delete_node
*
* PARAMETERS: Node - Node to be deleted
*
@@ -90,7 +89,7 @@ acpi_ns_delete_node (
acpi_namespace_node *next_node;
- ACPI_FUNCTION_TRACE_PTR ("Ns_delete_node", node);
+ ACPI_FUNCTION_TRACE_PTR ("ns_delete_node", node);
parent_node = acpi_ns_get_parent_node (node);
@@ -128,7 +127,7 @@ acpi_ns_delete_node (
#ifdef ACPI_ALPHABETIC_NAMESPACE
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_compare_names
+ * FUNCTION: acpi_ns_compare_names
*
* PARAMETERS: Name1 - First name to compare
* Name2 - Second name to compare
@@ -178,10 +177,10 @@ acpi_ns_compare_names (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_install_node
+ * FUNCTION: acpi_ns_install_node
*
- * PARAMETERS: Walk_state - Current state of the walk
- * Parent_node - The parent of the new Node
+ * PARAMETERS: walk_state - Current state of the walk
+ * parent_node - The parent of the new Node
* Node - The new Node to install
* Type - ACPI object type of the new Node
*
@@ -212,7 +211,7 @@ acpi_ns_install_node (
#endif
- ACPI_FUNCTION_TRACE ("Ns_install_node");
+ ACPI_FUNCTION_TRACE ("ns_install_node");
/*
@@ -320,9 +319,9 @@ acpi_ns_install_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_delete_children
+ * FUNCTION: acpi_ns_delete_children
*
- * PARAMETERS: Parent_node - Delete this objects children
+ * PARAMETERS: parent_node - Delete this objects children
*
* RETURN: None.
*
@@ -340,7 +339,7 @@ acpi_ns_delete_children (
u8 flags;
- ACPI_FUNCTION_TRACE_PTR ("Ns_delete_children", parent_node);
+ ACPI_FUNCTION_TRACE_PTR ("ns_delete_children", parent_node);
if (!parent_node) {
@@ -400,9 +399,9 @@ acpi_ns_delete_children (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_delete_namespace_subtree
+ * FUNCTION: acpi_ns_delete_namespace_subtree
*
- * PARAMETERS: Parent_node - Root of the subtree to be deleted
+ * PARAMETERS: parent_node - Root of the subtree to be deleted
*
* RETURN: None.
*
@@ -419,7 +418,7 @@ acpi_ns_delete_namespace_subtree (
u32 level = 1;
- ACPI_FUNCTION_TRACE ("Ns_delete_namespace_subtree");
+ ACPI_FUNCTION_TRACE ("ns_delete_namespace_subtree");
if (!parent_node) {
@@ -481,7 +480,7 @@ acpi_ns_delete_namespace_subtree (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_remove_reference
+ * FUNCTION: acpi_ns_remove_reference
*
* PARAMETERS: Node - Named node whose reference count is to be
* decremented
@@ -535,9 +534,9 @@ acpi_ns_remove_reference (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_delete_namespace_by_owner
+ * FUNCTION: acpi_ns_delete_namespace_by_owner
*
- * PARAMETERS: Owner_id - All nodes with this owner will be deleted
+ * PARAMETERS: owner_id - All nodes with this owner will be deleted
*
* RETURN: Status
*
@@ -557,7 +556,7 @@ acpi_ns_delete_namespace_by_owner (
acpi_namespace_node *parent_node;
- ACPI_FUNCTION_TRACE_U32 ("Ns_delete_namespace_by_owner", owner_id);
+ ACPI_FUNCTION_TRACE_U32 ("ns_delete_namespace_by_owner", owner_id);
parent_node = acpi_gbl_root_node;
@@ -571,7 +570,7 @@ acpi_ns_delete_namespace_by_owner (
*/
while (level > 0) {
/*
- * Get the next child of this parent node. When Child_node is NULL,
+ * Get the next child of this parent node. When child_node is NULL,
* the first child of the parent is returned
*/
child_node = acpi_ns_get_next_node (ACPI_TYPE_ANY, parent_node, child_node);
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 6ffd0f78db28..6d8c32ec71df 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
- * $Revision: 150 $
*
*****************************************************************************/
@@ -37,9 +36,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_print_pathname
+ * FUNCTION: acpi_ns_print_pathname
*
- * PARAMETERS: Num_segment - Number of ACPI name segments
+ * PARAMETERS: num_segment - Number of ACPI name segments
* Pathname - The compressed (internal) path
*
* DESCRIPTION: Print an object's full namespace pathname
@@ -51,7 +50,7 @@ acpi_ns_print_pathname (
u32 num_segments,
char *pathname)
{
- ACPI_FUNCTION_NAME ("Ns_print_pathname");
+ ACPI_FUNCTION_NAME ("ns_print_pathname");
if (!(acpi_dbg_level & ACPI_LV_NAMES) || !(acpi_dbg_layer & ACPI_NAMESPACE)) {
@@ -78,7 +77,7 @@ acpi_ns_print_pathname (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_pathname
+ * FUNCTION: acpi_ns_dump_pathname
*
* PARAMETERS: Handle - Object
* Msg - Prefix message
@@ -98,7 +97,7 @@ acpi_ns_dump_pathname (
u32 component)
{
- ACPI_FUNCTION_TRACE ("Ns_dump_pathname");
+ ACPI_FUNCTION_TRACE ("ns_dump_pathname");
/* Do this only if the requested debug level and component are enabled */
@@ -117,14 +116,14 @@ acpi_ns_dump_pathname (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_one_object
+ * FUNCTION: acpi_ns_dump_one_object
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
- * Context - Passed into Walk_namespace
+ * Context - Passed into walk_namespace
*
* DESCRIPTION: Dump a single Node
- * This procedure is a User_function called by Acpi_ns_walk_namespace.
+ * This procedure is a user_function called by acpi_ns_walk_namespace.
*
******************************************************************************/
@@ -145,7 +144,7 @@ acpi_ns_dump_one_object (
u32 i;
- ACPI_FUNCTION_NAME ("Ns_dump_one_object");
+ ACPI_FUNCTION_NAME ("ns_dump_one_object");
/* Is output enabled? */
@@ -531,17 +530,17 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_objects
+ * FUNCTION: acpi_ns_dump_objects
*
* PARAMETERS: Type - Object type to be dumped
- * Max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
+ * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
* for an effectively unlimited depth.
- * Owner_id - Dump only objects owned by this ID. Use
+ * owner_id - Dump only objects owned by this ID. Use
* ACPI_UINT32_MAX to match all owners.
- * Start_handle - Where in namespace to start/end search
+ * start_handle - Where in namespace to start/end search
*
* DESCRIPTION: Dump typed objects within the loaded namespace.
- * Uses Acpi_ns_walk_namespace in conjunction with Acpi_ns_dump_one_object.
+ * Uses acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object.
*
******************************************************************************/
@@ -572,11 +571,11 @@ acpi_ns_dump_objects (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_tables
+ * FUNCTION: acpi_ns_dump_tables
*
- * PARAMETERS: Search_base - Root of subtree to be dumped, or
+ * PARAMETERS: search_base - Root of subtree to be dumped, or
* NS_ALL to dump the entire namespace
- * Max_depth - Maximum depth of dump. Use INT_MAX
+ * max_depth - Maximum depth of dump. Use INT_MAX
* for an effectively unlimited depth.
*
* DESCRIPTION: Dump the name space, or a portion of it.
@@ -591,7 +590,7 @@ acpi_ns_dump_tables (
acpi_handle search_handle = search_base;
- ACPI_FUNCTION_TRACE ("Ns_dump_tables");
+ ACPI_FUNCTION_TRACE ("ns_dump_tables");
if (!acpi_gbl_root_node) {
@@ -619,10 +618,10 @@ acpi_ns_dump_tables (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_entry
+ * FUNCTION: acpi_ns_dump_entry
*
* PARAMETERS: Handle - Node to be dumped
- * Debug_level - Output level
+ * debug_level - Output level
*
* DESCRIPTION: Dump a single Node
*
diff --git a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c
index 37619a5620a2..3485b4b7f28e 100644
--- a/drivers/acpi/namespace/nsdumpdv.c
+++ b/drivers/acpi/namespace/nsdumpdv.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
- * $Revision: 4 $
*
*****************************************************************************/
@@ -36,14 +35,14 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_one_device
+ * FUNCTION: acpi_ns_dump_one_device
*
* PARAMETERS: Handle - Node to be dumped
* Level - Nesting level of the handle
- * Context - Passed into Walk_namespace
+ * Context - Passed into walk_namespace
*
* DESCRIPTION: Dump a single Node that represents a device
- * This procedure is a User_function called by Acpi_ns_walk_namespace.
+ * This procedure is a user_function called by acpi_ns_walk_namespace.
*
******************************************************************************/
@@ -59,7 +58,7 @@ acpi_ns_dump_one_device (
u32 i;
- ACPI_FUNCTION_NAME ("Ns_dump_one_device");
+ ACPI_FUNCTION_NAME ("ns_dump_one_device");
status = acpi_ns_dump_one_object (obj_handle, level, context, return_value);
@@ -82,7 +81,7 @@ acpi_ns_dump_one_device (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_dump_root_devices
+ * FUNCTION: acpi_ns_dump_root_devices
*
* PARAMETERS: None
*
@@ -97,7 +96,7 @@ acpi_ns_dump_root_devices (void)
acpi_status status;
- ACPI_FUNCTION_NAME ("Ns_dump_root_devices");
+ ACPI_FUNCTION_NAME ("ns_dump_root_devices");
/* Only dump the table if tracing is enabled */
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
index c205f823ef7b..37bcdedb57be 100644
--- a/drivers/acpi/namespace/nseval.c
+++ b/drivers/acpi/namespace/nseval.c
@@ -2,7 +2,6 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
- * $Revision: 120 $
*
******************************************************************************/
@@ -37,7 +36,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_evaluate_relative
+ * FUNCTION: acpi_ns_evaluate_relative
*
* PARAMETERS: Handle - The relative containing object
* Pathname - Name of method to execute, If NULL, the
@@ -45,7 +44,7 @@
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
- * Return_object - Where to put method's return value (if
+ * return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
*
* RETURN: Status
@@ -71,7 +70,7 @@ acpi_ns_evaluate_relative (
acpi_generic_state scope_info;
- ACPI_FUNCTION_TRACE ("Ns_evaluate_relative");
+ ACPI_FUNCTION_TRACE ("ns_evaluate_relative");
/*
@@ -138,10 +137,10 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_evaluate_by_name
+ * FUNCTION: acpi_ns_evaluate_by_name
*
* PARAMETERS: Pathname - Fully qualified pathname to the object
- * Return_object - Where to put method's return value (if
+ * return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
@@ -167,7 +166,7 @@ acpi_ns_evaluate_by_name (
char *internal_path = NULL;
- ACPI_FUNCTION_TRACE ("Ns_evaluate_by_name");
+ ACPI_FUNCTION_TRACE ("ns_evaluate_by_name");
/* Build an internal name string for the method */
@@ -223,13 +222,13 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_evaluate_by_handle
+ * FUNCTION: acpi_ns_evaluate_by_handle
*
* PARAMETERS: Handle - Method Node to execute
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
- * Return_object - Where to put method's return value (if
+ * return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
*
* RETURN: Status
@@ -251,7 +250,7 @@ acpi_ns_evaluate_by_handle (
acpi_operand_object *local_return_object;
- ACPI_FUNCTION_TRACE ("Ns_evaluate_by_handle");
+ ACPI_FUNCTION_TRACE ("ns_evaluate_by_handle");
/* Check if namespace has been initialized */
@@ -292,7 +291,7 @@ acpi_ns_evaluate_by_handle (
* value
*
* In both cases, the namespace is unlocked by the
- * Acpi_ns* procedure
+ * acpi_ns* procedure
*/
if (acpi_ns_get_type (node) == ACPI_TYPE_METHOD) {
/*
@@ -334,7 +333,7 @@ acpi_ns_evaluate_by_handle (
}
/*
- * Namespace was unlocked by the handling Acpi_ns* function,
+ * Namespace was unlocked by the handling acpi_ns* function,
* so we just return
*/
return_ACPI_STATUS (status);
@@ -343,13 +342,13 @@ acpi_ns_evaluate_by_handle (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_execute_control_method
+ * FUNCTION: acpi_ns_execute_control_method
*
- * PARAMETERS: Method_node - The method to execute
+ * PARAMETERS: method_node - The method to execute
* Params - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
- * Return_obj_desc - List of result objects to be returned
+ * return_obj_desc - List of result objects to be returned
* from the method.
*
* RETURN: Status
@@ -370,7 +369,7 @@ acpi_ns_execute_control_method (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Ns_execute_control_method");
+ ACPI_FUNCTION_TRACE ("ns_execute_control_method");
/* Verify that there is a method associated with this object */
@@ -419,10 +418,10 @@ acpi_ns_execute_control_method (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_object_value
+ * FUNCTION: acpi_ns_get_object_value
*
* PARAMETERS: Node - The object
- * Return_obj_desc - Where the objects value is returned
+ * return_obj_desc - Where the objects value is returned
*
* RETURN: Status
*
@@ -441,7 +440,7 @@ acpi_ns_get_object_value (
acpi_namespace_node *resolved_node = node;
- ACPI_FUNCTION_TRACE ("Ns_get_object_value");
+ ACPI_FUNCTION_TRACE ("ns_get_object_value");
/*
@@ -451,13 +450,13 @@ acpi_ns_get_object_value (
*/
/*
- * Use Resolve_node_to_value() to get the associated value. This call
- * always deletes Obj_desc (allocated above).
+ * Use resolve_node_to_value() to get the associated value. This call
+ * always deletes obj_desc (allocated above).
*
* NOTE: we can get away with passing in NULL for a walk state
- * because Obj_desc is guaranteed to not be a reference to either
+ * because obj_desc is guaranteed to not be a reference to either
* a method local or a method argument (because this interface can only be
- * called from the Acpi_evaluate external interface, never called from
+ * called from the acpi_evaluate external interface, never called from
* a running control method.)
*
* Even though we do not directly invoke the interpreter
@@ -477,8 +476,8 @@ acpi_ns_get_object_value (
if (ACPI_SUCCESS (status)) {
status = acpi_ex_resolve_node_to_value (&resolved_node, NULL);
/*
- * If Acpi_ex_resolve_node_to_value() succeeded, the return value was
- * placed in Resolved_node.
+ * If acpi_ex_resolve_node_to_value() succeeded, the return value was
+ * placed in resolved_node.
*/
acpi_ex_exit_interpreter ();
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
index 9d534edabeb2..45b2e3f27c3a 100644
--- a/drivers/acpi/namespace/nsinit.c
+++ b/drivers/acpi/namespace/nsinit.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
- * $Revision: 54 $
*
*****************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_initialize_objects
+ * FUNCTION: acpi_ns_initialize_objects
*
* PARAMETERS: None
*
@@ -54,7 +53,7 @@ acpi_ns_initialize_objects (
acpi_init_walk_info info;
- ACPI_FUNCTION_TRACE ("Ns_initialize_objects");
+ ACPI_FUNCTION_TRACE ("ns_initialize_objects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@@ -71,7 +70,7 @@ acpi_ns_initialize_objects (
ACPI_UINT32_MAX, acpi_ns_init_one_object,
&info, NULL);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
acpi_format_exception (status)));
}
@@ -93,7 +92,7 @@ acpi_ns_initialize_objects (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_initialize_devices
+ * FUNCTION: acpi_ns_initialize_devices
*
* PARAMETERS: None
*
@@ -115,7 +114,7 @@ acpi_ns_initialize_devices (
acpi_device_walk_info info;
- ACPI_FUNCTION_TRACE ("Ns_initialize_devices");
+ ACPI_FUNCTION_TRACE ("ns_initialize_devices");
/* Init counters */
@@ -132,7 +131,7 @@ acpi_ns_initialize_devices (
ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
acpi_format_exception (status)));
}
@@ -146,16 +145,16 @@ acpi_ns_initialize_devices (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_init_one_object
+ * FUNCTION: acpi_ns_init_one_object
*
- * PARAMETERS: Obj_handle - Node
+ * PARAMETERS: obj_handle - Node
* Level - Current nesting level
* Context - Points to a init info struct
- * Return_value - Not used
+ * return_value - Not used
*
* RETURN: Status
*
- * DESCRIPTION: Callback from Acpi_walk_namespace. Invoked for every object
+ * DESCRIPTION: Callback from acpi_walk_namespace. Invoked for every object
* within the namespace.
*
* Currently, the only objects that require initialization are:
@@ -178,7 +177,7 @@ acpi_ns_init_one_object (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_NAME ("Ns_init_one_object");
+ ACPI_FUNCTION_NAME ("ns_init_one_object");
info->object_count++;
@@ -292,7 +291,7 @@ acpi_ns_init_one_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_init_one_device
+ * FUNCTION: acpi_ns_init_one_device
*
* PARAMETERS: acpi_walk_callback
*
@@ -317,7 +316,7 @@ acpi_ns_init_one_device (
acpi_device_walk_info *info = (acpi_device_walk_info *) context;
- ACPI_FUNCTION_TRACE ("Ns_init_one_device");
+ ACPI_FUNCTION_TRACE ("ns_init_one_device");
if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 6940d96e1958..885e67aa2f5c 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nsload - namespace loading/expanding/contracting procedures
- * $Revision: 61 $
*
*****************************************************************************/
@@ -26,7 +25,6 @@
#include "acpi.h"
#include "acnamesp.h"
-#include "acparser.h"
#include "acdispat.h"
@@ -38,9 +36,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_load_table
+ * FUNCTION: acpi_ns_load_table
*
- * PARAMETERS: Table_desc - Descriptor for table to be loaded
+ * PARAMETERS: table_desc - Descriptor for table to be loaded
* Node - Owning NS node
*
* RETURN: Status
@@ -57,7 +55,7 @@ acpi_ns_load_table (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ns_load_table");
+ ACPI_FUNCTION_TRACE ("ns_load_table");
/* Check if table contains valid AML (must be DSDT, PSDT, SSDT, etc.) */
@@ -125,9 +123,9 @@ acpi_ns_load_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_load_table_by_type
+ * FUNCTION: acpi_ns_load_table_by_type
*
- * PARAMETERS: Table_type - Id of the table type to load
+ * PARAMETERS: table_type - Id of the table type to load
*
* RETURN: Status
*
@@ -146,7 +144,7 @@ acpi_ns_load_table_by_type (
acpi_table_desc *table_desc;
- ACPI_FUNCTION_TRACE ("Ns_load_table_by_type");
+ ACPI_FUNCTION_TRACE ("ns_load_table_by_type");
status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES);
@@ -253,7 +251,7 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_load_namespace
+ * FUNCTION: acpi_load_namespace
*
* PARAMETERS: None
*
@@ -271,7 +269,7 @@ acpi_ns_load_namespace (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_load_name_space");
+ ACPI_FUNCTION_TRACE ("acpi_load_name_space");
/* There must be at least a DSDT installed */
@@ -305,9 +303,9 @@ acpi_ns_load_namespace (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_delete_subtree
+ * FUNCTION: acpi_ns_delete_subtree
*
- * PARAMETERS: Start_handle - Handle in namespace where search begins
+ * PARAMETERS: start_handle - Handle in namespace where search begins
*
* RETURNS Status
*
@@ -331,7 +329,7 @@ acpi_ns_delete_subtree (
u32 level;
- ACPI_FUNCTION_TRACE ("Ns_delete_subtree");
+ ACPI_FUNCTION_TRACE ("ns_delete_subtree");
parent_handle = start_handle;
@@ -395,7 +393,7 @@ acpi_ns_delete_subtree (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_unload_name_space
+ * FUNCTION: acpi_ns_unload_name_space
*
* PARAMETERS: Handle - Root of namespace subtree to be deleted
*
@@ -414,7 +412,7 @@ acpi_ns_unload_namespace (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ns_unload_name_space");
+ ACPI_FUNCTION_TRACE ("ns_unload_name_space");
/* Parameter validation */
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
index 76ed8183ed4f..3944d3b56e4a 100644
--- a/drivers/acpi/namespace/nsnames.c
+++ b/drivers/acpi/namespace/nsnames.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: nsnames - Name manipulation and search
- * $Revision: 81 $
*
******************************************************************************/
@@ -35,13 +34,13 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_build_external_path
+ * FUNCTION: acpi_ns_build_external_path
*
* PARAMETERS: Node - NS node whose pathname is needed
* Size - Size of the pathname
- * *Name_buffer - Where to return the pathname
+ * *name_buffer - Where to return the pathname
*
- * RETURN: Places the pathname into the Name_buffer, in external format
+ * RETURN: Places the pathname into the name_buffer, in external format
* (name segments separated by path separators)
*
* DESCRIPTION: Generate a full pathaname
@@ -51,14 +50,14 @@
void
acpi_ns_build_external_path (
acpi_namespace_node *node,
- ACPI_SIZE size,
+ acpi_size size,
char *name_buffer)
{
- ACPI_SIZE index;
+ acpi_size index;
acpi_namespace_node *parent_node;
- ACPI_FUNCTION_NAME ("Ns_build_external_path");
+ ACPI_FUNCTION_NAME ("ns_build_external_path");
/* Special case for root */
@@ -106,7 +105,7 @@ acpi_ns_build_external_path (
#ifdef ACPI_DEBUG_OUTPUT
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_external_pathname
+ * FUNCTION: acpi_ns_get_external_pathname
*
* PARAMETERS: Node - NS node whose pathname is needed
*
@@ -114,7 +113,7 @@ acpi_ns_build_external_path (
* the node, In external format (name segments separated by path
* separators.)
*
- * DESCRIPTION: Used for debug printing in Acpi_ns_search_table().
+ * DESCRIPTION: Used for debug printing in acpi_ns_search_table().
*
******************************************************************************/
@@ -123,10 +122,10 @@ acpi_ns_get_external_pathname (
acpi_namespace_node *node)
{
char *name_buffer;
- ACPI_SIZE size;
+ acpi_size size;
- ACPI_FUNCTION_TRACE_PTR ("Ns_get_external_pathname", node);
+ ACPI_FUNCTION_TRACE_PTR ("ns_get_external_pathname", node);
/* Calculate required buffer size based on depth below root */
@@ -137,7 +136,7 @@ acpi_ns_get_external_pathname (
name_buffer = ACPI_MEM_CALLOCATE (size);
if (!name_buffer) {
- ACPI_REPORT_ERROR (("Ns_get_table_pathname: allocation failure\n"));
+ ACPI_REPORT_ERROR (("ns_get_table_pathname: allocation failure\n"));
return_PTR (NULL);
}
@@ -151,7 +150,7 @@ acpi_ns_get_external_pathname (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_pathname_length
+ * FUNCTION: acpi_ns_get_pathname_length
*
* PARAMETERS: Node - Namespace node
*
@@ -161,11 +160,11 @@ acpi_ns_get_external_pathname (
*
******************************************************************************/
-ACPI_SIZE
+acpi_size
acpi_ns_get_pathname_length (
acpi_namespace_node *node)
{
- ACPI_SIZE size;
+ acpi_size size;
acpi_namespace_node *next_node;
@@ -190,9 +189,9 @@ acpi_ns_get_pathname_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_handle_to_pathname
+ * FUNCTION: acpi_ns_handle_to_pathname
*
- * PARAMETERS: Target_handle - Handle of named object whose name is
+ * PARAMETERS: target_handle - Handle of named object whose name is
* to be found
* Buffer - Where the pathname is returned
*
@@ -209,10 +208,10 @@ acpi_ns_handle_to_pathname (
{
acpi_status status;
acpi_namespace_node *node;
- ACPI_SIZE required_size;
+ acpi_size required_size;
- ACPI_FUNCTION_TRACE_PTR ("Ns_handle_to_pathname", target_handle);
+ ACPI_FUNCTION_TRACE_PTR ("ns_handle_to_pathname", target_handle);
node = acpi_ns_map_handle_to_node (target_handle);
diff --git a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c
index 611208e4a7ea..5912121e14e8 100644
--- a/drivers/acpi/namespace/nsobject.c
+++ b/drivers/acpi/namespace/nsobject.c
@@ -2,7 +2,6 @@
*
* Module Name: nsobject - Utilities for objects attached to namespace
* table entries
- * $Revision: 86 $
*
******************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_attach_object
+ * FUNCTION: acpi_ns_attach_object
*
* PARAMETERS: Node - Parent Node
* Object - Object to be attached
@@ -63,7 +62,7 @@ acpi_ns_attach_object (
acpi_object_type object_type = ACPI_TYPE_ANY;
- ACPI_FUNCTION_TRACE ("Ns_attach_object");
+ ACPI_FUNCTION_TRACE ("ns_attach_object");
/*
@@ -72,28 +71,28 @@ acpi_ns_attach_object (
if (!node) {
/* Invalid handle */
- ACPI_REPORT_ERROR (("Ns_attach_object: Null Named_obj handle\n"));
+ ACPI_REPORT_ERROR (("ns_attach_object: Null named_obj handle\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
if (!object && (ACPI_TYPE_ANY != type)) {
/* Null object */
- ACPI_REPORT_ERROR (("Ns_attach_object: Null object, but type not ACPI_TYPE_ANY\n"));
+ ACPI_REPORT_ERROR (("ns_attach_object: Null object, but type not ACPI_TYPE_ANY\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
/* Not a name handle */
- ACPI_REPORT_ERROR (("Ns_attach_object: Invalid handle\n"));
+ ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Check if this object is already attached */
if (node->object == object) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj %p already installed in Name_obj %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj %p already installed in name_obj %p\n",
object, node));
return_ACPI_STATUS (AE_OK);
@@ -171,7 +170,7 @@ acpi_ns_attach_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_detach_object
+ * FUNCTION: acpi_ns_detach_object
*
* PARAMETERS: Node - An node whose object will be detached
*
@@ -190,7 +189,7 @@ acpi_ns_detach_object (
acpi_operand_object *obj_desc;
- ACPI_FUNCTION_TRACE ("Ns_detach_object");
+ ACPI_FUNCTION_TRACE ("ns_detach_object");
obj_desc = node->object;
@@ -227,7 +226,7 @@ acpi_ns_detach_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_attached_object
+ * FUNCTION: acpi_ns_get_attached_object
*
* PARAMETERS: Node - Parent Node to be examined
*
@@ -242,7 +241,7 @@ acpi_operand_object *
acpi_ns_get_attached_object (
acpi_namespace_node *node)
{
- ACPI_FUNCTION_TRACE_PTR ("Ns_get_attached_object", node);
+ ACPI_FUNCTION_TRACE_PTR ("ns_get_attached_object", node);
if (!node) {
@@ -263,7 +262,7 @@ acpi_ns_get_attached_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_secondary_object
+ * FUNCTION: acpi_ns_get_secondary_object
*
* PARAMETERS: Node - Parent Node to be examined
*
@@ -278,7 +277,7 @@ acpi_operand_object *
acpi_ns_get_secondary_object (
acpi_operand_object *obj_desc)
{
- ACPI_FUNCTION_TRACE_PTR ("Ns_get_secondary_object", obj_desc);
+ ACPI_FUNCTION_TRACE_PTR ("ns_get_secondary_object", obj_desc);
if ((!obj_desc) ||
@@ -294,7 +293,7 @@ acpi_ns_get_secondary_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_attach_data
+ * FUNCTION: acpi_ns_attach_data
*
* PARAMETERS: Node - Namespace node
* Handler - Handler to be associated with the data
@@ -309,7 +308,7 @@ acpi_ns_get_secondary_object (
acpi_status
acpi_ns_attach_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void *data)
{
acpi_operand_object *prev_obj_desc;
@@ -356,7 +355,7 @@ acpi_ns_attach_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_detach_data
+ * FUNCTION: acpi_ns_detach_data
*
* PARAMETERS: Node - Namespace node
* Handler - Handler associated with the data
@@ -371,7 +370,7 @@ acpi_ns_attach_data (
acpi_status
acpi_ns_detach_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler)
+ acpi_object_handler handler)
{
acpi_operand_object *obj_desc;
acpi_operand_object *prev_obj_desc;
@@ -403,7 +402,7 @@ acpi_ns_detach_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_attached_data
+ * FUNCTION: acpi_ns_get_attached_data
*
* PARAMETERS: Node - Namespace node
* Handler - Handler associated with the data
@@ -419,7 +418,7 @@ acpi_ns_detach_data (
acpi_status
acpi_ns_get_attached_data (
acpi_namespace_node *node,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void **data)
{
acpi_operand_object *obj_desc;
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index a94a303e25d2..d6cc4bd633df 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nsparse - namespace interface to AML parser
- * $Revision: 2 $
*
*****************************************************************************/
@@ -36,10 +35,10 @@
/*******************************************************************************
*
- * FUNCTION: Ns_one_complete_parse
+ * FUNCTION: ns_one_complete_parse
*
- * PARAMETERS: Pass_number - 1 or 2
- * Table_desc - The table to be parsed.
+ * PARAMETERS: pass_number - 1 or 2
+ * table_desc - The table to be parsed.
*
* RETURN: Status
*
@@ -57,7 +56,7 @@ acpi_ns_one_complete_parse (
acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE ("Ns_one_complete_parse");
+ ACPI_FUNCTION_TRACE ("ns_one_complete_parse");
/* Create and init a Root Node */
@@ -96,10 +95,10 @@ acpi_ns_one_complete_parse (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_parse_table
+ * FUNCTION: acpi_ns_parse_table
*
- * PARAMETERS: Table_desc - An ACPI table descriptor for table to parse
- * Start_node - Where to enter the table into the namespace
+ * PARAMETERS: table_desc - An ACPI table descriptor for table to parse
+ * start_node - Where to enter the table into the namespace
*
* RETURN: Status
*
@@ -115,7 +114,7 @@ acpi_ns_parse_table (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ns_parse_table");
+ ACPI_FUNCTION_TRACE ("ns_parse_table");
/*
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
index 031f69f0ac44..bff2eab7a0f1 100644
--- a/drivers/acpi/namespace/nssearch.c
+++ b/drivers/acpi/namespace/nssearch.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
- * $Revision: 94 $
*
******************************************************************************/
@@ -34,12 +33,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_search_node
+ * FUNCTION: acpi_ns_search_node
*
- * PARAMETERS: *Target_name - Ascii ACPI name to search for
+ * PARAMETERS: *target_name - Ascii ACPI name to search for
* *Node - Starting node where search will begin
* Type - Object type to match
- * **Return_node - Where the matched Named obj is returned
+ * **return_node - Where the matched Named obj is returned
*
* RETURN: Status
*
@@ -69,7 +68,7 @@ acpi_ns_search_node (
acpi_namespace_node *next_node;
- ACPI_FUNCTION_TRACE ("Ns_search_node");
+ ACPI_FUNCTION_TRACE ("ns_search_node");
#ifdef ACPI_DEBUG_OUTPUT
@@ -132,18 +131,18 @@ acpi_ns_search_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_search_parent_tree
+ * FUNCTION: acpi_ns_search_parent_tree
*
- * PARAMETERS: *Target_name - Ascii ACPI name to search for
+ * PARAMETERS: *target_name - Ascii ACPI name to search for
* *Node - Starting node where search will begin
* Type - Object type to match
- * **Return_node - Where the matched Named Obj is returned
+ * **return_node - Where the matched Named Obj is returned
*
* RETURN: Status
*
* DESCRIPTION: Called when a name has not been found in the current namespace
* level. Before adding it or giving up, ACPI scope rules require
- * searching enclosing scopes in cases identified by Acpi_ns_local().
+ * searching enclosing scopes in cases identified by acpi_ns_local().
*
* "A name is located by finding the matching name in the current
* name space, and then in the parent name space. If the parent
@@ -166,7 +165,7 @@ acpi_ns_search_parent_tree (
acpi_namespace_node *parent_node;
- ACPI_FUNCTION_TRACE ("Ns_search_parent_tree");
+ ACPI_FUNCTION_TRACE ("ns_search_parent_tree");
parent_node = acpi_ns_get_parent_node (node);
@@ -223,16 +222,16 @@ acpi_ns_search_parent_tree (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_search_and_enter
+ * FUNCTION: acpi_ns_search_and_enter
*
- * PARAMETERS: Target_name - Ascii ACPI name to search for (4 chars)
- * Walk_state - Current state of the walk
+ * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars)
+ * walk_state - Current state of the walk
* *Node - Starting node where search will begin
- * Interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x.
+ * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x.
* Otherwise,search only.
* Type - Object type to match
* Flags - Flags describing the search restrictions
- * **Return_node - Where the Node is returned
+ * **return_node - Where the Node is returned
*
* RETURN: Status
*
@@ -260,23 +259,23 @@ acpi_ns_search_and_enter (
acpi_namespace_node *new_node;
- ACPI_FUNCTION_TRACE ("Ns_search_and_enter");
+ ACPI_FUNCTION_TRACE ("ns_search_and_enter");
/* Parameter validation */
if (!node || !target_name || !return_node) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param: Node %p Name %X Return_node %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param: Node %p Name %X return_node %p\n",
node, target_name, return_node));
- ACPI_REPORT_ERROR (("Ns_search_and_enter: Null parameter\n"));
+ ACPI_REPORT_ERROR (("ns_search_and_enter: Null parameter\n"));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Name must consist of printable characters */
if (!acpi_ut_valid_acpi_name (target_name)) {
- ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name: %X\n",
+ ACPI_REPORT_ERROR (("ns_search_and_enter: Bad character in ACPI Name: %X\n",
target_name));
return_ACPI_STATUS (AE_BAD_CHARACTER);
}
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
index 351cf108086b..4f3a025bc874 100644
--- a/drivers/acpi/namespace/nsutils.c
+++ b/drivers/acpi/namespace/nsutils.c
@@ -2,7 +2,6 @@
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
- * $Revision: 120 $
*
*****************************************************************************/
@@ -36,11 +35,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_report_error
+ * FUNCTION: acpi_ns_report_error
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
* Message - Error message to use on failure
*
* RETURN: None
@@ -88,11 +87,11 @@ acpi_ns_report_error (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_report_method_error
+ * FUNCTION: acpi_ns_report_method_error
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
* Message - Error message to use on failure
*
* RETURN: None
@@ -118,7 +117,7 @@ acpi_ns_report_method_error (
if (path) {
status = acpi_ns_get_node_by_path (path, prefix_node, ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_FAILURE (status)) {
- acpi_os_printf ("Report_method_error: Could not get node\n");
+ acpi_os_printf ("report_method_error: Could not get node\n");
return;
}
}
@@ -131,7 +130,7 @@ acpi_ns_report_method_error (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_print_node_pathname
+ * FUNCTION: acpi_ns_print_node_pathname
*
* PARAMETERS: Node - Object
* Msg - Prefix message
@@ -164,7 +163,7 @@ acpi_ns_print_node_pathname (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_valid_root_prefix
+ * FUNCTION: acpi_ns_valid_root_prefix
*
* PARAMETERS: Prefix - Character to be checked
*
@@ -185,7 +184,7 @@ acpi_ns_valid_root_prefix (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_valid_path_separator
+ * FUNCTION: acpi_ns_valid_path_separator
*
* PARAMETERS: Sep - Character to be checked
*
@@ -206,7 +205,7 @@ acpi_ns_valid_path_separator (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_type
+ * FUNCTION: acpi_ns_get_type
*
* PARAMETERS: Handle - Parent Node to be examined
*
@@ -218,11 +217,11 @@ acpi_object_type
acpi_ns_get_type (
acpi_namespace_node *node)
{
- ACPI_FUNCTION_TRACE ("Ns_get_type");
+ ACPI_FUNCTION_TRACE ("ns_get_type");
if (!node) {
- ACPI_REPORT_WARNING (("Ns_get_type: Null Node ptr"));
+ ACPI_REPORT_WARNING (("ns_get_type: Null Node ptr"));
return_VALUE (ACPI_TYPE_ANY);
}
@@ -232,7 +231,7 @@ acpi_ns_get_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_local
+ * FUNCTION: acpi_ns_local
*
* PARAMETERS: Type - A namespace object type
*
@@ -245,13 +244,13 @@ u32
acpi_ns_local (
acpi_object_type type)
{
- ACPI_FUNCTION_TRACE ("Ns_local");
+ ACPI_FUNCTION_TRACE ("ns_local");
if (!acpi_ut_valid_object_type (type)) {
/* Type code out of range */
- ACPI_REPORT_WARNING (("Ns_local: Invalid Object Type\n"));
+ ACPI_REPORT_WARNING (("ns_local: Invalid Object Type\n"));
return_VALUE (ACPI_NS_NORMAL);
}
@@ -261,7 +260,7 @@ acpi_ns_local (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_internal_name_length
+ * FUNCTION: acpi_ns_get_internal_name_length
*
* PARAMETERS: Info - Info struct initialized with the
* external name pointer.
@@ -291,11 +290,11 @@ acpi_ns_get_internal_name_length (
/*
* For the internal name, the required length is 4 bytes
- * per segment, plus 1 each for Root_prefix, Multi_name_prefix_op,
+ * per segment, plus 1 each for root_prefix, multi_name_prefix_op,
* segment count, trailing null (which is not really needed,
* but no there's harm in putting it there)
*
- * strlen() + 1 covers the first Name_seg, which has no
+ * strlen() + 1 covers the first name_seg, which has no
* path separator
*/
if (acpi_ns_valid_root_prefix (next_external_char[0])) {
@@ -336,7 +335,7 @@ acpi_ns_get_internal_name_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_build_internal_name
+ * FUNCTION: acpi_ns_build_internal_name
*
* PARAMETERS: Info - Info struct fully initialized
*
@@ -355,10 +354,10 @@ acpi_ns_build_internal_name (
char *internal_name = info->internal_name;
char *external_name = info->next_external_char;
char *result = NULL;
- NATIVE_UINT i;
+ acpi_native_uint i;
- ACPI_FUNCTION_TRACE ("Ns_build_internal_name");
+ ACPI_FUNCTION_TRACE ("ns_build_internal_name");
/* Setup the correct prefixes, counts, and pointers */
@@ -396,12 +395,12 @@ acpi_ns_build_internal_name (
}
else if (num_segments == 2) {
internal_name[i] = AML_DUAL_NAME_PREFIX;
- result = &internal_name[i+1];
+ result = &internal_name[(acpi_native_uint) (i+1)];
}
else {
internal_name[i] = AML_MULTI_NAME_PREFIX_OP;
- internal_name[i+1] = (char) num_segments;
- result = &internal_name[i+2];
+ internal_name[(acpi_native_uint) (i+1)] = (char) num_segments;
+ result = &internal_name[(acpi_native_uint) (i+2)];
}
}
@@ -455,9 +454,9 @@ acpi_ns_build_internal_name (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_internalize_name
+ * FUNCTION: acpi_ns_internalize_name
*
- * PARAMETERS: *External_name - External representation of name
+ * PARAMETERS: *external_name - External representation of name
* **Converted Name - Where to return the resulting
* internal represention of the name
*
@@ -478,7 +477,7 @@ acpi_ns_internalize_name (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ns_internalize_name");
+ ACPI_FUNCTION_TRACE ("ns_internalize_name");
if ((!external_name) ||
@@ -515,10 +514,10 @@ acpi_ns_internalize_name (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_externalize_name
+ * FUNCTION: acpi_ns_externalize_name
*
- * PARAMETERS: *Internal_name - Internal representation of name
- * **Converted_name - Where to return the resulting
+ * PARAMETERS: *internal_name - Internal representation of name
+ * **converted_name - Where to return the resulting
* external representation of name
*
* RETURN: Status
@@ -535,15 +534,15 @@ acpi_ns_externalize_name (
u32 *converted_name_length,
char **converted_name)
{
- NATIVE_UINT_MIN32 prefix_length = 0;
- NATIVE_UINT_MIN32 names_index = 0;
- NATIVE_UINT_MIN32 num_segments = 0;
- NATIVE_UINT_MIN32 i = 0;
- NATIVE_UINT_MIN32 j = 0;
- NATIVE_UINT_MIN32 required_length;
+ acpi_native_uint names_index = 0;
+ acpi_native_uint num_segments = 0;
+ acpi_native_uint required_length;
+ acpi_native_uint prefix_length = 0;
+ acpi_native_uint i = 0;
+ acpi_native_uint j = 0;
- ACPI_FUNCTION_TRACE ("Ns_externalize_name");
+ ACPI_FUNCTION_TRACE ("ns_externalize_name");
if (!internal_name_length ||
@@ -591,7 +590,7 @@ acpi_ns_externalize_name (
/* <count> 4-byte names */
names_index = prefix_length + 2;
- num_segments = (u32) (u8) internal_name[prefix_length + 1];
+ num_segments = (u32) (u8) internal_name[(acpi_native_uint) (prefix_length + 1)];
break;
case AML_DUAL_NAME_PREFIX:
@@ -604,7 +603,7 @@ acpi_ns_externalize_name (
case 0:
- /* Null_name */
+ /* null_name */
names_index = 0;
num_segments = 0;
@@ -621,7 +620,7 @@ acpi_ns_externalize_name (
}
/*
- * Calculate the length of Converted_name, which equals the length
+ * Calculate the length of converted_name, which equals the length
* of the prefix, length of all object names, length of any required
* punctuation ('.') between object names, plus the NULL terminator.
*/
@@ -630,15 +629,15 @@ acpi_ns_externalize_name (
/*
* Check to see if we're still in bounds. If not, there's a problem
- * with Internal_name (invalid format).
+ * with internal_name (invalid format).
*/
if (required_length > internal_name_length) {
- ACPI_REPORT_ERROR (("Ns_externalize_name: Invalid internal name\n"));
+ ACPI_REPORT_ERROR (("ns_externalize_name: Invalid internal name\n"));
return_ACPI_STATUS (AE_BAD_PATHNAME);
}
/*
- * Build Converted_name...
+ * Build converted_name...
*/
*converted_name = ACPI_MEM_CALLOCATE (required_length);
if (!(*converted_name)) {
@@ -674,7 +673,7 @@ acpi_ns_externalize_name (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_map_handle_to_node
+ * FUNCTION: acpi_ns_map_handle_to_node
*
* PARAMETERS: Handle - Handle to be converted to an Node
*
@@ -718,7 +717,7 @@ acpi_ns_map_handle_to_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_convert_entry_to_handle
+ * FUNCTION: acpi_ns_convert_entry_to_handle
*
* PARAMETERS: Node - Node to be converted to a Handle
*
@@ -747,7 +746,7 @@ acpi_ns_convert_entry_to_handle (
return (NULL);
}
- if (Node == Acpi_gbl_Root_node)
+ if (Node == acpi_gbl_root_node)
{
return (ACPI_ROOT_OBJECT);
}
@@ -760,7 +759,7 @@ acpi_ns_convert_entry_to_handle (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_terminate
+ * FUNCTION: acpi_ns_terminate
*
* PARAMETERS: none
*
@@ -777,7 +776,7 @@ acpi_ns_terminate (void)
acpi_namespace_node *this_node;
- ACPI_FUNCTION_TRACE ("Ns_terminate");
+ ACPI_FUNCTION_TRACE ("ns_terminate");
this_node = acpi_gbl_root_node;
@@ -814,7 +813,7 @@ acpi_ns_terminate (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_opens_scope
+ * FUNCTION: acpi_ns_opens_scope
*
* PARAMETERS: Type - A valid namespace type
*
@@ -827,13 +826,13 @@ u32
acpi_ns_opens_scope (
acpi_object_type type)
{
- ACPI_FUNCTION_TRACE_STR ("Ns_opens_scope", acpi_ut_get_type_name (type));
+ ACPI_FUNCTION_TRACE_STR ("ns_opens_scope", acpi_ut_get_type_name (type));
if (!acpi_ut_valid_object_type (type)) {
/* type code out of range */
- ACPI_REPORT_WARNING (("Ns_opens_scope: Invalid Object Type %X\n", type));
+ ACPI_REPORT_WARNING (("ns_opens_scope: Invalid Object Type %X\n", type));
return_VALUE (ACPI_NS_NORMAL);
}
@@ -843,18 +842,18 @@ acpi_ns_opens_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_node_by_path
+ * FUNCTION: acpi_ns_get_node_by_path
*
* PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The
* \ (backslash) and ^ (carat) prefixes, and the
* . (period) to separate segments are supported.
- * Start_node - Root of subtree to be searched, or NS_ALL for the
+ * start_node - Root of subtree to be searched, or NS_ALL for the
* root of the name space. If Name is fully
* qualified (first s8 is '\'), the passed value
* of Scope will not be accessed.
* Flags - Used to indicate whether to perform upsearch or
* not.
- * Return_node - Where the Node is returned
+ * return_node - Where the Node is returned
*
* DESCRIPTION: Look up a name relative to a given scope and return the
* corresponding Node. NOTE: Scope can be null.
@@ -875,7 +874,7 @@ acpi_ns_get_node_by_path (
char *internal_path = NULL;
- ACPI_FUNCTION_TRACE_PTR ("Ns_get_node_by_path", pathname);
+ ACPI_FUNCTION_TRACE_PTR ("ns_get_node_by_path", pathname);
if (pathname) {
@@ -922,9 +921,9 @@ acpi_ns_get_node_by_path (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_find_parent_name
+ * FUNCTION: acpi_ns_find_parent_name
*
- * PARAMETERS: *Child_node - Named Obj whose name is to be found
+ * PARAMETERS: *child_node - Named Obj whose name is to be found
*
* RETURN: The ACPI name
*
@@ -941,7 +940,7 @@ acpi_ns_find_parent_name (
acpi_namespace_node *parent_node;
- ACPI_FUNCTION_TRACE ("Ns_find_parent_name");
+ ACPI_FUNCTION_TRACE ("ns_find_parent_name");
if (child_node) {
@@ -968,7 +967,7 @@ acpi_ns_find_parent_name (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_parent_node
+ * FUNCTION: acpi_ns_get_parent_node
*
* PARAMETERS: Node - Current table entry
*
@@ -1008,7 +1007,7 @@ acpi_ns_get_parent_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_next_valid_node
+ * FUNCTION: acpi_ns_get_next_valid_node
*
* PARAMETERS: Node - Current table entry
*
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index a207136d9c64..80400f9e6b05 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: nswalk - Functions for walking the ACPI namespace
- * $Revision: 33 $
*
*****************************************************************************/
@@ -34,12 +33,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_next_node
+ * FUNCTION: acpi_ns_get_next_node
*
* PARAMETERS: Type - Type of node to be searched for
- * Parent_node - Parent node whose children we are
+ * parent_node - Parent node whose children we are
* getting
- * Child_node - Previous child that was found.
+ * child_node - Previous child that was found.
* The NEXT child will be returned
*
* RETURN: acpi_namespace_node - Pointer to the NEXT child or NULL if
@@ -80,7 +79,7 @@ acpi_ns_get_next_node (
/* If any type is OK, we are done */
if (type == ACPI_TYPE_ANY) {
- /* Next_node is NULL if we are at the end-of-list */
+ /* next_node is NULL if we are at the end-of-list */
return (next_node);
}
@@ -107,22 +106,22 @@ acpi_ns_get_next_node (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_walk_namespace
+ * FUNCTION: acpi_ns_walk_namespace
*
* PARAMETERS: Type - acpi_object_type to search for
- * Start_node - Handle in namespace where search begins
- * Max_depth - Depth to which search is to reach
- * Unlock_before_callback- Whether to unlock the NS before invoking
+ * start_node - Handle in namespace where search begins
+ * max_depth - Depth to which search is to reach
+ * unlock_before_callback- Whether to unlock the NS before invoking
* the callback routine
- * User_function - Called when an object of "Type" is found
+ * user_function - Called when an object of "Type" is found
* Context - Passed to user function
- * Return_value - from the User_function if terminated early.
+ * return_value - from the user_function if terminated early.
* Otherwise, returns NULL.
* RETURNS: Status
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
- * starting (and ending) at the node specified by Start_handle.
- * The User_function is called whenever a node that matches
+ * starting (and ending) at the node specified by start_handle.
+ * The user_function is called whenever a node that matches
* the type parameter is found. If the user function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
@@ -152,7 +151,7 @@ acpi_ns_walk_namespace (
u32 level;
- ACPI_FUNCTION_TRACE ("Ns_walk_namespace");
+ ACPI_FUNCTION_TRACE ("ns_walk_namespace");
/* Special case for the namespace Root Node */
@@ -171,7 +170,7 @@ acpi_ns_walk_namespace (
/*
* Traverse the tree of nodes until we bubble back up to where we
* started. When Level is zero, the loop is done because we have
- * bubbled up to (and passed) the original parent handle (Start_entry)
+ * bubbled up to (and passed) the original parent handle (start_entry)
*/
while (level > 0) {
/* Get the next node in this scope. Null if not found */
@@ -252,7 +251,7 @@ acpi_ns_walk_namespace (
}
else {
/*
- * No more children of this node (Acpi_ns_get_next_node
+ * No more children of this node (acpi_ns_get_next_node
* failed), go back upwards in the namespace tree to
* the node's parent.
*/
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index d9b6a3b7f93f..ad2d54aed397 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -2,7 +2,6 @@
*
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces
- * $Revision: 6 $
*
******************************************************************************/
@@ -35,16 +34,16 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_evaluate_object_typed
+ * FUNCTION: acpi_evaluate_object_typed
*
* PARAMETERS: Handle - Object handle (optional)
* *Pathname - Object pathname (optional)
- * **External_params - List of parameters to pass to method,
+ * **external_params - List of parameters to pass to method,
* terminated by NULL. May be NULL
* if no parameters are being passed.
- * *Return_buffer - Where to put method's return value (if
+ * *return_buffer - Where to put method's return value (if
* any). If NULL, no value is returned.
- * Return_type - Expected type of return object
+ * return_type - Expected type of return object
*
* RETURN: Status
*
@@ -66,7 +65,7 @@ acpi_evaluate_object_typed (
u8 must_free = FALSE;
- ACPI_FUNCTION_TRACE ("Acpi_evaluate_object_typed");
+ ACPI_FUNCTION_TRACE ("acpi_evaluate_object_typed");
/* Return buffer must be valid */
@@ -101,7 +100,7 @@ acpi_evaluate_object_typed (
return_ACPI_STATUS (AE_NULL_OBJECT);
}
- /* Examine the object type returned from Evaluate_object */
+ /* Examine the object type returned from evaluate_object */
if (((acpi_object *) return_buffer->pointer)->type == return_type) {
return_ACPI_STATUS (AE_OK);
@@ -128,14 +127,14 @@ acpi_evaluate_object_typed (
/*******************************************************************************
*
- * FUNCTION: Acpi_evaluate_object
+ * FUNCTION: acpi_evaluate_object
*
* PARAMETERS: Handle - Object handle (optional)
* *Pathname - Object pathname (optional)
- * **External_params - List of parameters to pass to method,
+ * **external_params - List of parameters to pass to method,
* terminated by NULL. May be NULL
* if no parameters are being passed.
- * *Return_buffer - Where to put method's return value (if
+ * *return_buffer - Where to put method's return value (if
* any). If NULL, no value is returned.
*
* RETURN: Status
@@ -156,11 +155,11 @@ acpi_evaluate_object (
acpi_status status;
acpi_operand_object **internal_params = NULL;
acpi_operand_object *internal_return_obj = NULL;
- ACPI_SIZE buffer_space_needed;
+ acpi_size buffer_space_needed;
u32 i;
- ACPI_FUNCTION_TRACE ("Acpi_evaluate_object");
+ ACPI_FUNCTION_TRACE ("acpi_evaluate_object");
/*
@@ -173,7 +172,7 @@ acpi_evaluate_object (
* Allocate a new parameter block for the internal objects
* Add 1 to count to allow for null terminated internal list
*/
- internal_params = ACPI_MEM_CALLOCATE (((ACPI_SIZE) external_params->count + 1) *
+ internal_params = ACPI_MEM_CALLOCATE (((acpi_size) external_params->count + 1) *
sizeof (void *));
if (!internal_params) {
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -328,22 +327,22 @@ acpi_evaluate_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_walk_namespace
+ * FUNCTION: acpi_walk_namespace
*
* PARAMETERS: Type - acpi_object_type to search for
- * Start_object - Handle in namespace where search begins
- * Max_depth - Depth to which search is to reach
- * User_function - Called when an object of "Type" is found
+ * start_object - Handle in namespace where search begins
+ * max_depth - Depth to which search is to reach
+ * user_function - Called when an object of "Type" is found
* Context - Passed to user function
- * Return_value - Location where return value of
- * User_function is put if terminated early
+ * return_value - Location where return value of
+ * user_function is put if terminated early
*
- * RETURNS Return value from the User_function if terminated early.
+ * RETURNS Return value from the user_function if terminated early.
* Otherwise, returns NULL.
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
- * starting (and ending) at the object specified by Start_handle.
- * The User_function is called whenever an object that matches
+ * starting (and ending) at the object specified by start_handle.
+ * The user_function is called whenever an object that matches
* the type parameter is found. If the user function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
@@ -368,7 +367,7 @@ acpi_walk_namespace (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_walk_namespace");
+ ACPI_FUNCTION_TRACE ("acpi_walk_namespace");
/* Parameter validation */
@@ -400,13 +399,13 @@ acpi_walk_namespace (
/*******************************************************************************
*
- * FUNCTION: Acpi_ns_get_device_callback
+ * FUNCTION: acpi_ns_get_device_callback
*
- * PARAMETERS: Callback from Acpi_get_device
+ * PARAMETERS: Callback from acpi_get_device
*
* RETURN: Status
*
- * DESCRIPTION: Takes callbacks from Walk_namespace and filters out all non-
+ * DESCRIPTION: Takes callbacks from walk_namespace and filters out all non-
* present devices, or if they specified a HID, it filters based
* on that.
*
@@ -493,26 +492,26 @@ acpi_ns_get_device_callback (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_devices
+ * FUNCTION: acpi_get_devices
*
* PARAMETERS: HID - HID to search for. Can be NULL.
- * User_function - Called when a matching object is found
+ * user_function - Called when a matching object is found
* Context - Passed to user function
- * Return_value - Location where return value of
- * User_function is put if terminated early
+ * return_value - Location where return value of
+ * user_function is put if terminated early
*
- * RETURNS Return value from the User_function if terminated early.
+ * RETURNS Return value from the user_function if terminated early.
* Otherwise, returns NULL.
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
- * starting (and ending) at the object specified by Start_handle.
- * The User_function is called whenever an object that matches
+ * starting (and ending) at the object specified by start_handle.
+ * The user_function is called whenever an object that matches
* the type parameter is found. If the user function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
*
- * This is a wrapper for Walk_namespace, but the callback performs
- * additional filtering. Please see Acpi_get_device_callback.
+ * This is a wrapper for walk_namespace, but the callback performs
+ * additional filtering. Please see acpi_get_device_callback.
*
******************************************************************************/
@@ -527,7 +526,7 @@ acpi_get_devices (
acpi_get_devices_info info;
- ACPI_FUNCTION_TRACE ("Acpi_get_devices");
+ ACPI_FUNCTION_TRACE ("acpi_get_devices");
/* Parameter validation */
@@ -568,9 +567,9 @@ acpi_get_devices (
/*******************************************************************************
*
- * FUNCTION: Acpi_attach_data
+ * FUNCTION: acpi_attach_data
*
- * PARAMETERS: Obj_handle - Namespace node
+ * PARAMETERS: obj_handle - Namespace node
* Handler - Handler for this attachment
* Data - Pointer to data to be attached
*
@@ -583,7 +582,7 @@ acpi_get_devices (
acpi_status
acpi_attach_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void *data)
{
acpi_namespace_node *node;
@@ -621,10 +620,10 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_detach_data
+ * FUNCTION: acpi_detach_data
*
- * PARAMETERS: Obj_handle - Namespace node handle
- * Handler - Handler used in call to Acpi_attach_data
+ * PARAMETERS: obj_handle - Namespace node handle
+ * Handler - Handler used in call to acpi_attach_data
*
* RETURN: Status
*
@@ -635,7 +634,7 @@ unlock_and_exit:
acpi_status
acpi_detach_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler)
+ acpi_object_handler handler)
{
acpi_namespace_node *node;
acpi_status status;
@@ -671,10 +670,10 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_get_data
+ * FUNCTION: acpi_get_data
*
- * PARAMETERS: Obj_handle - Namespace node
- * Handler - Handler used in call to Attach_data
+ * PARAMETERS: obj_handle - Namespace node
+ * Handler - Handler used in call to attach_data
* Data - Where the data is returned
*
* RETURN: Status
@@ -686,7 +685,7 @@ unlock_and_exit:
acpi_status
acpi_get_data (
acpi_handle obj_handle,
- ACPI_OBJECT_HANDLER handler,
+ acpi_object_handler handler,
void **data)
{
acpi_namespace_node *node;
diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c
index c680852d565f..82e66cea7402 100644
--- a/drivers/acpi/namespace/nsxfname.c
+++ b/drivers/acpi/namespace/nsxfname.c
@@ -2,7 +2,6 @@
*
* Module Name: nsxfname - Public interfaces to the ACPI subsystem
* ACPI Namespace oriented interfaces
- * $Revision: 93 $
*
*****************************************************************************/
@@ -35,12 +34,12 @@
/****************************************************************************
*
- * FUNCTION: Acpi_get_handle
+ * FUNCTION: acpi_get_handle
*
* PARAMETERS: Parent - Object to search under (search scope).
- * Path_name - Pointer to an asciiz string containing the
+ * path_name - Pointer to an asciiz string containing the
* name
- * Ret_handle - Where the return handle is placed
+ * ret_handle - Where the return handle is placed
*
* RETURN: Status
*
@@ -114,16 +113,16 @@ acpi_get_handle (
/****************************************************************************
*
- * FUNCTION: Acpi_get_name
+ * FUNCTION: acpi_get_name
*
* PARAMETERS: Handle - Handle to be converted to a pathname
- * Name_type - Full pathname or single segment
+ * name_type - Full pathname or single segment
* Buffer - Buffer for returned path
*
* RETURN: Pointer to a string containing the fully qualified Name.
*
* DESCRIPTION: This routine returns the fully qualified name associated with
- * the Handle parameter. This and the Acpi_pathname_to_handle are
+ * the Handle parameter. This and the acpi_pathname_to_handle are
* complementary functions.
*
******************************************************************************/
@@ -195,7 +194,7 @@ unlock_and_exit:
/****************************************************************************
*
- * FUNCTION: Acpi_get_object_info
+ * FUNCTION: acpi_get_object_info
*
* PARAMETERS: Handle - Object Handle
* Info - Where the info is returned
diff --git a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c
index d9e3ab77df00..1c803eefc285 100644
--- a/drivers/acpi/namespace/nsxfobj.c
+++ b/drivers/acpi/namespace/nsxfobj.c
@@ -2,7 +2,6 @@
*
* Module Name: nsxfobj - Public interfaces to the ACPI subsystem
* ACPI Object oriented interfaces
- * $Revision: 114 $
*
******************************************************************************/
@@ -34,10 +33,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_get_type
+ * FUNCTION: acpi_get_type
*
* PARAMETERS: Handle - Handle of object whose type is desired
- * *Ret_type - Where the type will be placed
+ * *ret_type - Where the type will be placed
*
* RETURN: Status
*
@@ -92,10 +91,10 @@ acpi_get_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_parent
+ * FUNCTION: acpi_get_parent
*
* PARAMETERS: Handle - Handle of object whose parent is desired
- * Ret_handle - Where the parent handle will be placed
+ * ret_handle - Where the parent handle will be placed
*
* RETURN: Status
*
@@ -157,13 +156,13 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_get_next_object
+ * FUNCTION: acpi_get_next_object
*
* PARAMETERS: Type - Type of object to be searched for
* Parent - Parent object whose children we are getting
- * Last_child - Previous child that was found.
+ * last_child - Previous child that was found.
* The NEXT child will be returned
- * Ret_handle - Where handle to the next object is placed
+ * ret_handle - Where handle to the next object is placed
*
* RETURN: Status
*
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 300e55c858c3..b51c45dbd3fe 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -61,7 +61,7 @@ typedef struct
#include <linux/kdb.h>
/* stuff for debugger support */
int acpi_in_debugger = 0;
-extern NATIVE_CHAR line_buf[80];
+extern char line_buf[80];
#endif /*ENABLE_DEBUGGER*/
static int acpi_irq_irq = 0;
@@ -99,7 +99,7 @@ acpi_os_terminate(void)
}
void
-acpi_os_printf(const NATIVE_CHAR *fmt,...)
+acpi_os_printf(const char *fmt,...)
{
va_list args;
va_start(args, fmt);
@@ -108,7 +108,7 @@ acpi_os_printf(const NATIVE_CHAR *fmt,...)
}
void
-acpi_os_vprintf(const NATIVE_CHAR *fmt, va_list args)
+acpi_os_vprintf(const char *fmt, va_list args)
{
static char buffer[512];
@@ -126,7 +126,7 @@ acpi_os_vprintf(const NATIVE_CHAR *fmt, va_list args)
}
void *
-acpi_os_allocate(ACPI_SIZE size)
+acpi_os_allocate(acpi_size size)
{
return kmalloc(size, GFP_KERNEL);
}
@@ -138,7 +138,7 @@ acpi_os_free(void *ptr)
}
acpi_status
-acpi_os_get_root_pointer(u32 flags, ACPI_POINTER *addr)
+acpi_os_get_root_pointer(u32 flags, acpi_pointer *addr)
{
#ifdef CONFIG_ACPI_EFI
addr->pointer_type = ACPI_PHYSICAL_POINTER;
@@ -161,7 +161,7 @@ acpi_os_get_root_pointer(u32 flags, ACPI_POINTER *addr)
}
acpi_status
-acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, ACPI_SIZE size, void **virt)
+acpi_os_map_memory(acpi_physical_address phys, acpi_size size, void **virt)
{
#ifdef CONFIG_ACPI_EFI
if (EFI_MEMORY_WB & efi_mem_attributes(phys)) {
@@ -187,13 +187,13 @@ acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, ACPI_SIZE size, void **virt)
}
void
-acpi_os_unmap_memory(void *virt, ACPI_SIZE size)
+acpi_os_unmap_memory(void *virt, acpi_size size)
{
iounmap(virt);
}
acpi_status
-acpi_os_get_physical_address(void *virt, ACPI_PHYSICAL_ADDRESS *phys)
+acpi_os_get_physical_address(void *virt, acpi_physical_address *phys)
{
if(!phys || !virt)
return AE_BAD_PARAMETER;
@@ -274,7 +274,7 @@ acpi_os_stall(u32 us)
acpi_status
acpi_os_read_port(
- ACPI_IO_ADDRESS port,
+ acpi_io_address port,
void *value,
u32 width)
{
@@ -303,7 +303,7 @@ acpi_os_read_port(
acpi_status
acpi_os_write_port(
- ACPI_IO_ADDRESS port,
+ acpi_io_address port,
acpi_integer value,
u32 width)
{
@@ -327,7 +327,7 @@ acpi_os_write_port(
acpi_status
acpi_os_read_memory(
- ACPI_PHYSICAL_ADDRESS phys_addr,
+ acpi_physical_address phys_addr,
void *value,
u32 width)
{
@@ -373,7 +373,7 @@ acpi_os_read_memory(
acpi_status
acpi_os_write_memory(
- ACPI_PHYSICAL_ADDRESS phys_addr,
+ acpi_physical_address phys_addr,
acpi_integer value,
u32 width)
{
@@ -843,7 +843,7 @@ acpi_os_signal_semaphore(
}
u32
-acpi_os_get_line(NATIVE_CHAR *buffer)
+acpi_os_get_line(char *buffer)
{
#ifdef ENABLE_DEBUGGER
diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
index da2462efe6ce..61f8b9de9ffc 100644
--- a/drivers/acpi/parser/psargs.c
+++ b/drivers/acpi/parser/psargs.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
- * $Revision: 67 $
*
*****************************************************************************/
@@ -35,9 +34,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_package_length
+ * FUNCTION: acpi_ps_get_next_package_length
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Decoded package length. On completion, the AML pointer points
* past the length byte or bytes.
@@ -54,7 +53,7 @@ acpi_ps_get_next_package_length (
u32 length = 0;
- ACPI_FUNCTION_TRACE ("Ps_get_next_package_length");
+ ACPI_FUNCTION_TRACE ("ps_get_next_package_length");
encoded_length = (u32) ACPI_GET8 (parser_state->aml);
@@ -106,9 +105,9 @@ acpi_ps_get_next_package_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_package_end
+ * FUNCTION: acpi_ps_get_next_package_end
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Pointer to end-of-package +1
*
@@ -122,15 +121,15 @@ acpi_ps_get_next_package_end (
acpi_parse_state *parser_state)
{
u8 *start = parser_state->aml;
- NATIVE_UINT length;
+ acpi_native_uint length;
- ACPI_FUNCTION_TRACE ("Ps_get_next_package_end");
+ ACPI_FUNCTION_TRACE ("ps_get_next_package_end");
- /* Function below changes Parser_state->Aml */
+ /* Function below changes parser_state->Aml */
- length = (NATIVE_UINT) acpi_ps_get_next_package_length (parser_state);
+ length = (acpi_native_uint) acpi_ps_get_next_package_length (parser_state);
return_PTR (start + length); /* end of package */
}
@@ -138,9 +137,9 @@ acpi_ps_get_next_package_end (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_namestring
+ * FUNCTION: acpi_ps_get_next_namestring
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Pointer to the start of the name string (pointer points into
* the AML.
@@ -159,7 +158,7 @@ acpi_ps_get_next_namestring (
u8 *end = parser_state->aml;
- ACPI_FUNCTION_TRACE ("Ps_get_next_namestring");
+ ACPI_FUNCTION_TRACE ("ps_get_next_namestring");
/* Handle multiple prefix characters */
@@ -175,7 +174,7 @@ acpi_ps_get_next_namestring (
switch (ACPI_GET8 (end)) {
case 0:
- /* Null_name */
+ /* null_name */
if (end == start) {
start = NULL;
@@ -194,7 +193,7 @@ acpi_ps_get_next_namestring (
/* Multiple name segments, 4 chars each */
- end += 2 + ((ACPI_SIZE) ACPI_GET8 (end + 1) * ACPI_NAME_SIZE);
+ end += 2 + ((acpi_size) ACPI_GET8 (end + 1) * ACPI_NAME_SIZE);
break;
default:
@@ -212,13 +211,13 @@ acpi_ps_get_next_namestring (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_namepath
+ * FUNCTION: acpi_ps_get_next_namepath
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
* Arg - Where the namepath will be stored
- * Arg_count - If the namepath points to a control method
+ * arg_count - If the namepath points to a control method
* the method's argument is returned here.
- * Method_call - Whether the namepath can possibly be the
+ * method_call - Whether the namepath can possibly be the
* start of a method call
*
* RETURN: Status
@@ -246,7 +245,7 @@ acpi_ps_get_next_namepath (
acpi_generic_state scope_info;
- ACPI_FUNCTION_TRACE ("Ps_get_next_namepath");
+ ACPI_FUNCTION_TRACE ("ps_get_next_namepath");
path = acpi_ps_get_next_namestring (parser_state);
@@ -324,7 +323,7 @@ acpi_ps_get_next_namepath (
/*
* 1) Any error other than NOT_FOUND is always severe
* 2) NOT_FOUND is only important if we are executing a method.
- * 3) If executing a Cond_ref_of opcode, NOT_FOUND is ok.
+ * 3) If executing a cond_ref_of opcode, NOT_FOUND is ok.
*/
if ((((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) &&
(status == AE_NOT_FOUND) &&
@@ -336,7 +335,7 @@ acpi_ps_get_next_namepath (
else {
/*
* We got a NOT_FOUND during table load or we encountered
- * a Cond_ref_of(x) where the target does not exist.
+ * a cond_ref_of(x) where the target does not exist.
* -- either case is ok
*/
status = AE_OK;
@@ -357,10 +356,10 @@ acpi_ps_get_next_namepath (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_simple_arg
+ * FUNCTION: acpi_ps_get_next_simple_arg
*
- * PARAMETERS: Parser_state - Current parser state object
- * Arg_type - The argument type (AML_*_ARG)
+ * PARAMETERS: parser_state - Current parser state object
+ * arg_type - The argument type (AML_*_ARG)
* Arg - Where the argument is returned
*
* RETURN: None
@@ -376,7 +375,7 @@ acpi_ps_get_next_simple_arg (
acpi_parse_object *arg)
{
- ACPI_FUNCTION_TRACE_U32 ("Ps_get_next_simple_arg", arg_type);
+ ACPI_FUNCTION_TRACE_U32 ("ps_get_next_simple_arg", arg_type);
switch (arg_type) {
@@ -443,7 +442,7 @@ acpi_ps_get_next_simple_arg (
default:
- ACPI_REPORT_ERROR (("Invalid Arg_type %X\n", arg_type));
+ ACPI_REPORT_ERROR (("Invalid arg_type %X\n", arg_type));
break;
}
@@ -453,13 +452,13 @@ acpi_ps_get_next_simple_arg (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_field
+ * FUNCTION: acpi_ps_get_next_field
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: A newly allocated FIELD op
*
- * DESCRIPTION: Get next field (Named_field, Reserved_field, or Access_field)
+ * DESCRIPTION: Get next field (named_field, reserved_field, or access_field)
*
******************************************************************************/
@@ -474,7 +473,7 @@ acpi_ps_get_next_field (
u32 name;
- ACPI_FUNCTION_TRACE ("Ps_get_next_field");
+ ACPI_FUNCTION_TRACE ("ps_get_next_field");
/* determine field type */
@@ -536,8 +535,8 @@ acpi_ps_get_next_field (
case AML_INT_ACCESSFIELD_OP:
/*
- * Get Access_type and Access_attrib and merge into the field Op
- * Access_type is first operand, Access_attribute is second
+ * Get access_type and access_attrib and merge into the field Op
+ * access_type is first operand, access_attribute is second
*/
field->common.value.integer32 = (ACPI_GET8 (parser_state->aml) << 8);
parser_state->aml++;
@@ -557,11 +556,11 @@ acpi_ps_get_next_field (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_arg
+ * FUNCTION: acpi_ps_get_next_arg
*
- * PARAMETERS: Parser_state - Current parser state object
- * Arg_type - The argument type (AML_*_ARG)
- * Arg_count - If the argument points to a control method
+ * PARAMETERS: parser_state - Current parser state object
+ * arg_type - The argument type (AML_*_ARG)
+ * arg_count - If the argument points to a control method
* the method's argument is returned here.
*
* RETURN: Status, and an op object containing the next argument.
@@ -585,7 +584,7 @@ acpi_ps_get_next_arg (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ps_get_next_arg", parser_state);
+ ACPI_FUNCTION_TRACE_PTR ("ps_get_next_arg", parser_state);
switch (arg_type) {
@@ -673,7 +672,7 @@ acpi_ps_get_next_arg (
if (subop == 0 ||
acpi_ps_is_leading_char (subop) ||
acpi_ps_is_prefix_char (subop)) {
- /* Null_name or Name_string */
+ /* null_name or name_string */
arg = acpi_ps_alloc_op (AML_INT_NAMEPATH_OP);
if (!arg) {
@@ -713,7 +712,7 @@ acpi_ps_get_next_arg (
default:
- ACPI_REPORT_ERROR (("Invalid Arg_type: %X\n", arg_type));
+ ACPI_REPORT_ERROR (("Invalid arg_type: %X\n", arg_type));
status = AE_AML_OPERAND_TYPE;
break;
}
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index f67e722e4b63..ce06d322d3a7 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psopcode - Parser/Interpreter opcode information table
- * $Revision: 75 $
*
*****************************************************************************/
@@ -52,7 +51,7 @@
/*******************************************************************************
*
- * NAME: Acpi_gbl_Aml_op_info
+ * NAME: acpi_gbl_aml_op_info
*
* DESCRIPTION: Opcode table. Each entry contains <opcode, type, name, operands>
* The name is a simple ascii string, the operand specifier is an
@@ -195,7 +194,7 @@
* All AML opcodes and the runtime arguments for each. Used by the AML interpreter Each list is compressed
* into a 32-bit number and stored in the master opcode table at the end of this file.
*
- * (Used by Prep_operands procedure and the ASL Compiler)
+ * (Used by prep_operands procedure and the ASL Compiler)
*/
@@ -664,7 +663,7 @@ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] =
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_opcode_info
+ * FUNCTION: acpi_ps_get_opcode_info
*
* PARAMETERS: Opcode - The AML opcode
*
@@ -680,7 +679,7 @@ const acpi_opcode_info *
acpi_ps_get_opcode_info (
u16 opcode)
{
- ACPI_FUNCTION_NAME ("Ps_get_opcode_info");
+ ACPI_FUNCTION_NAME ("ps_get_opcode_info");
/*
@@ -719,7 +718,7 @@ acpi_ps_get_opcode_info (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_opcode_name
+ * FUNCTION: acpi_ps_get_opcode_name
*
* PARAMETERS: Opcode - The AML opcode
*
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index e3feef96275c..45329040f40d 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
- * $Revision: 138 $
*
*****************************************************************************/
@@ -30,7 +29,7 @@
* generated parser to tightly constrain stack and dynamic memory
* usage. At the same time, parsing is kept flexible and the code
* fairly compact by parsing based on a list of AML opcode
- * templates in Aml_op_info[]
+ * templates in aml_op_info[]
*/
#include "acpi.h"
@@ -49,7 +48,7 @@ static u32 acpi_gbl_depth = 0;
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_opcode_size
+ * FUNCTION: acpi_ps_get_opcode_size
*
* PARAMETERS: Opcode - An AML opcode
*
@@ -78,9 +77,9 @@ acpi_ps_get_opcode_size (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_peek_opcode
+ * FUNCTION: acpi_ps_peek_opcode
*
- * PARAMETERS: Parser_state - A parser state object
+ * PARAMETERS: parser_state - A parser state object
*
* RETURN: Status
*
@@ -113,9 +112,9 @@ acpi_ps_peek_opcode (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_complete_this_op
+ * FUNCTION: acpi_ps_complete_this_op
*
- * PARAMETERS: Walk_state - Current State
+ * PARAMETERS: walk_state - Current State
* Op - Op to complete
*
* RETURN: None.
@@ -135,7 +134,7 @@ acpi_ps_complete_this_op (
acpi_parse_object *replacement_op = NULL;
- ACPI_FUNCTION_TRACE_PTR ("Ps_complete_this_op", op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_complete_this_op", op);
/* Check for null Op, can happen if AML code is corrupt */
@@ -164,7 +163,7 @@ acpi_ps_complete_this_op (
case AML_CLASS_CREATE:
/*
- * These opcodes contain Term_arg operands. The current
+ * These opcodes contain term_arg operands. The current
* op must be replaced by a placeholder return op
*/
replacement_op = acpi_ps_alloc_op (AML_INT_RETURN_VALUE_OP);
@@ -176,7 +175,7 @@ acpi_ps_complete_this_op (
case AML_CLASS_NAMED_OBJECT:
/*
- * These opcodes contain Term_arg operands. The current
+ * These opcodes contain term_arg operands. The current
* op must be replaced by a placeholder return op
*/
if ((op->common.parent->common.aml_opcode == AML_REGION_OP) ||
@@ -269,9 +268,9 @@ acpi_ps_complete_this_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_next_parse_state
+ * FUNCTION: acpi_ps_next_parse_state
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Status
*
@@ -290,7 +289,7 @@ acpi_ps_next_parse_state (
acpi_status status = AE_CTRL_PENDING;
- ACPI_FUNCTION_TRACE_PTR ("Ps_next_parse_state", op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_next_parse_state", op);
switch (callback_status) {
@@ -390,9 +389,9 @@ acpi_ps_next_parse_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_parse_loop
+ * FUNCTION: acpi_ps_parse_loop
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Status
*
@@ -413,7 +412,7 @@ acpi_ps_parse_loop (
u8 *aml_op_start = NULL;
- ACPI_FUNCTION_TRACE_PTR ("Ps_parse_loop", walk_state);
+ ACPI_FUNCTION_TRACE_PTR ("ps_parse_loop", walk_state);
if (walk_state->descending_callback == NULL) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -452,7 +451,7 @@ acpi_ps_parse_loop (
acpi_format_exception (status)));
}
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Get_predicate Failed, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "get_predicate Failed, %s\n",
acpi_format_exception (status)));
return_ACPI_STATUS (status);
}
@@ -591,10 +590,10 @@ acpi_ps_parse_loop (
if (op->common.aml_opcode == AML_REGION_OP) {
/*
- * Defer final parsing of an Operation_region body,
+ * Defer final parsing of an operation_region body,
* because we don't have enough info in the first pass
* to parse it correctly (i.e., there may be method
- * calls within the Term_arg elements of the body.)
+ * calls within the term_arg elements of the body.)
*
* However, we must continue parsing because
* the opregion is not a standalone package --
@@ -617,8 +616,8 @@ acpi_ps_parse_loop (
if (walk_state->op_info->flags & AML_CREATE) {
/*
- * Backup to beginning of Create_xXXfield declaration
- * Body_length is unknown until we parse the body
+ * Backup to beginning of create_xXXfield declaration
+ * body_length is unknown until we parse the body
*/
op->named.data = aml_op_start;
op->named.length = 0;
@@ -650,14 +649,14 @@ acpi_ps_parse_loop (
if (walk_state->op_info) {
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Opcode %4.4X [%s] Op %p Aml %p Aml_offset %5.5X\n",
+ "Opcode %4.4X [%s] Op %p Aml %p aml_offset %5.5X\n",
(u32) op->common.aml_opcode, walk_state->op_info->name,
op, parser_state->aml, op->common.aml_offset));
}
}
- /* Start Arg_count at zero because we don't know if there are any args yet */
+ /* Start arg_count at zero because we don't know if there are any args yet */
walk_state->arg_count = 0;
@@ -722,7 +721,7 @@ acpi_ps_parse_loop (
op->named.data = parser_state->aml;
op->named.length = (u32) (parser_state->pkg_end - parser_state->aml);
/*
- * Skip body of method. For Op_regions, we must continue
+ * Skip body of method. For op_regions, we must continue
* parsing because the opregion is not a standalone
* package (We don't know where the end is).
*/
@@ -795,7 +794,7 @@ acpi_ps_parse_loop (
* because we don't have enough info in the first pass
* to parse them correctly.
*
- * Completed parsing an Op_region declaration, we now
+ * Completed parsing an op_region declaration, we now
* know the length.
*/
op->named.length = (u32) (parser_state->aml - op->named.data);
@@ -804,10 +803,10 @@ acpi_ps_parse_loop (
if (walk_state->op_info->flags & AML_CREATE) {
/*
- * Backup to beginning of Create_xXXfield declaration (1 for
+ * Backup to beginning of create_xXXfield declaration (1 for
* Opcode)
*
- * Body_length is unknown until we parse the body
+ * body_length is unknown until we parse the body
*/
op->named.length = (u32) (parser_state->aml - op->named.data);
}
@@ -953,7 +952,7 @@ close_this_op:
op = NULL;
}
- } /* while Parser_state->Aml */
+ } /* while parser_state->Aml */
/*
@@ -1014,12 +1013,12 @@ close_this_op:
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_parse_aml
+ * FUNCTION: acpi_ps_parse_aml
*
- * PARAMETERS: Start_scope - The starting point of the parse. Becomes the
+ * PARAMETERS: start_scope - The starting point of the parse. Becomes the
* root of the parsed op tree.
* Aml - Pointer to the raw AML code to parse
- * Aml_size - Length of the AML to parse
+ * aml_size - Length of the AML to parse
*
*
* RETURN: Status
@@ -1034,14 +1033,14 @@ acpi_ps_parse_aml (
{
acpi_status status;
acpi_status terminate_status;
- ACPI_THREAD_STATE *thread;
- ACPI_THREAD_STATE *prev_walk_list = acpi_gbl_current_walk_list;
+ acpi_thread_state *thread;
+ acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list;
acpi_walk_state *previous_walk_state;
- ACPI_FUNCTION_TRACE ("Ps_parse_aml");
+ ACPI_FUNCTION_TRACE ("ps_parse_aml");
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with Walk_state=%p Aml=%p size=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Entered with walk_state=%p Aml=%p size=%X\n",
walk_state, walk_state->parser_state.aml, walk_state->parser_state.aml_size));
@@ -1071,7 +1070,7 @@ acpi_ps_parse_aml (
while (walk_state) {
if (ACPI_SUCCESS (status)) {
/*
- * The Parse_loop executes AML until the method terminates
+ * The parse_loop executes AML until the method terminates
* or calls another method.
*/
status = acpi_ps_parse_loop (walk_state);
@@ -1131,7 +1130,7 @@ acpi_ps_parse_aml (
previous_walk_state = walk_state;
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Return_value=%p, State=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "return_value=%p, State=%p\n",
walk_state->return_desc, walk_state));
/* Check if we have restarted a preempted walk */
diff --git a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c
index 900651c41813..9595daea94f0 100644
--- a/drivers/acpi/parser/psscope.c
+++ b/drivers/acpi/parser/psscope.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psscope - Parser scope stack management routines
- * $Revision: 35 $
*
*****************************************************************************/
@@ -33,9 +32,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_parent_scope
+ * FUNCTION: acpi_ps_get_parent_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Pointer to an Op object
*
@@ -53,9 +52,9 @@ acpi_ps_get_parent_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_has_completed_scope
+ * FUNCTION: acpi_ps_has_completed_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Boolean, TRUE = scope completed.
*
@@ -76,9 +75,9 @@ acpi_ps_has_completed_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_init_scope
+ * FUNCTION: acpi_ps_init_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
* Root - the Root Node of this new scope
*
* RETURN: Status
@@ -95,7 +94,7 @@ acpi_ps_init_scope (
acpi_generic_state *scope;
- ACPI_FUNCTION_TRACE_PTR ("Ps_init_scope", root_op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_init_scope", root_op);
scope = acpi_ut_create_generic_state ();
@@ -118,12 +117,12 @@ acpi_ps_init_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_push_scope
+ * FUNCTION: acpi_ps_push_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
* Op - Current op to be pushed
- * Remaining_args - List of args remaining
- * Arg_count - Fixed or variable number of args
+ * remaining_args - List of args remaining
+ * arg_count - Fixed or variable number of args
*
* RETURN: Status
*
@@ -141,7 +140,7 @@ acpi_ps_push_scope (
acpi_generic_state *scope;
- ACPI_FUNCTION_TRACE_PTR ("Ps_push_scope", op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_push_scope", op);
scope = acpi_ut_create_generic_state ();
@@ -179,13 +178,13 @@ acpi_ps_push_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_pop_scope
+ * FUNCTION: acpi_ps_pop_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
* Op - Where the popped op is returned
- * Arg_list - Where the popped "next argument" is
+ * arg_list - Where the popped "next argument" is
* returned
- * Arg_count - Count of objects in Arg_list
+ * arg_count - Count of objects in arg_list
*
* RETURN: Status
*
@@ -203,7 +202,7 @@ acpi_ps_pop_scope (
acpi_generic_state *scope = parser_state->scope;
- ACPI_FUNCTION_TRACE ("Ps_pop_scope");
+ ACPI_FUNCTION_TRACE ("ps_pop_scope");
/*
@@ -240,9 +239,9 @@ acpi_ps_pop_scope (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_cleanup_scope
+ * FUNCTION: acpi_ps_cleanup_scope
*
- * PARAMETERS: Parser_state - Current parser state object
+ * PARAMETERS: parser_state - Current parser state object
*
* RETURN: Status
*
@@ -257,7 +256,7 @@ acpi_ps_cleanup_scope (
{
acpi_generic_state *scope;
- ACPI_FUNCTION_TRACE_PTR ("Ps_cleanup_scope", parser_state);
+ ACPI_FUNCTION_TRACE_PTR ("ps_cleanup_scope", parser_state);
if (!parser_state) {
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c
index 77eecd05db5b..9d617381a5e1 100644
--- a/drivers/acpi/parser/pstree.c
+++ b/drivers/acpi/parser/pstree.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: pstree - Parser op tree manipulation/traversal/search
- * $Revision: 40 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_arg
+ * FUNCTION: acpi_ps_get_arg
*
* PARAMETERS: Op - Get an argument for this op
* Argn - Nth argument to get
@@ -88,7 +87,7 @@ acpi_ps_get_arg (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_append_arg
+ * FUNCTION: acpi_ps_append_arg
*
* PARAMETERS: Op - Append an argument to this Op.
* Arg - Argument Op to append
@@ -121,7 +120,7 @@ acpi_ps_append_arg (
if (op_info->class == AML_CLASS_UNKNOWN) {
/* Invalid opcode */
- ACPI_REPORT_ERROR (("Ps_append_arg: Invalid AML Opcode: 0x%2.2X\n",
+ ACPI_REPORT_ERROR (("ps_append_arg: Invalid AML Opcode: 0x%2.2X\n",
op->common.aml_opcode));
return;
}
@@ -165,7 +164,7 @@ acpi_ps_append_arg (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_child
+ * FUNCTION: acpi_ps_get_child
*
* PARAMETERS: Op - Get the child of this Op
*
@@ -232,7 +231,7 @@ acpi_ps_get_child (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_depth_next
+ * FUNCTION: acpi_ps_get_depth_next
*
* PARAMETERS: Origin - Root of subtree to search
* Op - Last (previous) Op that was found
diff --git a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c
index 7c8950786d35..ce445012ab46 100644
--- a/drivers/acpi/parser/psutils.c
+++ b/drivers/acpi/parser/psutils.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
- * $Revision: 54 $
*
*****************************************************************************/
@@ -35,11 +34,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_create_scope_op
+ * FUNCTION: acpi_ps_create_scope_op
*
* PARAMETERS: None
*
- * RETURN: Scope_op
+ * RETURN: scope_op
*
* DESCRIPTION: Create a Scope and associated namepath op with the root name
*
@@ -65,7 +64,7 @@ acpi_ps_create_scope_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_init_op
+ * FUNCTION: acpi_ps_init_op
*
* PARAMETERS: Op - A newly allocated Op object
* Opcode - Opcode to store in the Op
@@ -95,7 +94,7 @@ acpi_ps_init_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_alloc_op
+ * FUNCTION: acpi_ps_alloc_op
*
* PARAMETERS: Opcode - Opcode that will be stored in the new Op
*
@@ -125,23 +124,23 @@ acpi_ps_alloc_op (
/* Allocate the minimum required size object */
if (op_info->flags & AML_DEFER) {
- size = sizeof (ACPI_PARSE_OBJ_NAMED);
+ size = sizeof (acpi_parse_obj_named);
flags = ACPI_PARSEOP_DEFERRED;
}
else if (op_info->flags & AML_NAMED) {
- size = sizeof (ACPI_PARSE_OBJ_NAMED);
+ size = sizeof (acpi_parse_obj_named);
flags = ACPI_PARSEOP_NAMED;
}
else if (opcode == AML_INT_BYTELIST_OP) {
- size = sizeof (ACPI_PARSE_OBJ_NAMED);
+ size = sizeof (acpi_parse_obj_named);
flags = ACPI_PARSEOP_BYTELIST;
}
else {
- size = sizeof (ACPI_PARSE_OBJ_COMMON);
+ size = sizeof (acpi_parse_obj_common);
flags = ACPI_PARSEOP_GENERIC;
}
- if (size == sizeof (ACPI_PARSE_OBJ_COMMON)) {
+ if (size == sizeof (acpi_parse_obj_common)) {
/*
* The generic op is by far the most common (16 to 1)
*/
@@ -164,7 +163,7 @@ acpi_ps_alloc_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_free_op
+ * FUNCTION: acpi_ps_free_op
*
* PARAMETERS: Op - Op to be freed
*
@@ -179,7 +178,7 @@ void
acpi_ps_free_op (
acpi_parse_object *op)
{
- ACPI_FUNCTION_NAME ("Ps_free_op");
+ ACPI_FUNCTION_NAME ("ps_free_op");
if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
@@ -197,7 +196,7 @@ acpi_ps_free_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_delete_parse_cache
+ * FUNCTION: acpi_ps_delete_parse_cache
*
* PARAMETERS: None
*
@@ -211,7 +210,7 @@ void
acpi_ps_delete_parse_cache (
void)
{
- ACPI_FUNCTION_TRACE ("Ps_delete_parse_cache");
+ ACPI_FUNCTION_TRACE ("ps_delete_parse_cache");
acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE);
diff --git a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c
index 87819892523f..81766b1150ac 100644
--- a/drivers/acpi/parser/pswalk.c
+++ b/drivers/acpi/parser/pswalk.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: pswalk - Parser routines to walk parsed op tree(s)
- * $Revision: 67 $
*
*****************************************************************************/
@@ -34,11 +33,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_get_next_walk_op
+ * FUNCTION: acpi_ps_get_next_walk_op
*
- * PARAMETERS: Walk_state - Current state of the walk
+ * PARAMETERS: walk_state - Current state of the walk
* Op - Current Op to be walked
- * Ascending_callback - Procedure called when Op is complete
+ * ascending_callback - Procedure called when Op is complete
*
* RETURN: Status
*
@@ -58,7 +57,7 @@ acpi_ps_get_next_walk_op (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ps_get_next_walk_op", op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_get_next_walk_op", op);
/* Check for a argument only if we are descending in the tree */
@@ -194,15 +193,15 @@ acpi_ps_get_next_walk_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_delete_completed_op
+ * FUNCTION: acpi_ps_delete_completed_op
*
* PARAMETERS: State - Walk state
* Op - Completed op
*
* RETURN: AE_OK
*
- * DESCRIPTION: Callback function for Acpi_ps_get_next_walk_op(). Used during
- * Acpi_ps_delete_parse tree to delete Op objects when all sub-objects
+ * DESCRIPTION: Callback function for acpi_ps_get_next_walk_op(). Used during
+ * acpi_ps_delete_parse tree to delete Op objects when all sub-objects
* have been visited (and deleted.)
*
******************************************************************************/
@@ -219,9 +218,9 @@ acpi_ps_delete_completed_op (
/*******************************************************************************
*
- * FUNCTION: Acpi_ps_delete_parse_tree
+ * FUNCTION: acpi_ps_delete_parse_tree
*
- * PARAMETERS: Subtree_root - Root of tree (or subtree) to delete
+ * PARAMETERS: subtree_root - Root of tree (or subtree) to delete
*
* RETURN: None
*
@@ -234,11 +233,11 @@ acpi_ps_delete_parse_tree (
acpi_parse_object *subtree_root)
{
acpi_walk_state *walk_state;
- ACPI_THREAD_STATE *thread;
+ acpi_thread_state *thread;
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ps_delete_parse_tree", subtree_root);
+ ACPI_FUNCTION_TRACE_PTR ("ps_delete_parse_tree", subtree_root);
if (!subtree_root) {
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
index 1b3a78628aba..629072c4c461 100644
--- a/drivers/acpi/parser/psxface.c
+++ b/drivers/acpi/parser/psxface.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
- * $Revision: 66 $
*
*****************************************************************************/
@@ -37,14 +36,14 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_psx_execute
+ * FUNCTION: acpi_psx_execute
*
- * PARAMETERS: Method_node - A method object containing both the AML
+ * PARAMETERS: method_node - A method object containing both the AML
* address and length.
* **Params - List of parameters to pass to method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
- * **Return_obj_desc - Return object from execution of the
+ * **return_obj_desc - Return object from execution of the
* method.
*
* RETURN: Status
@@ -66,7 +65,7 @@ acpi_psx_execute (
acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE ("Psx_execute");
+ ACPI_FUNCTION_TRACE ("psx_execute");
/* Validate the Node and get the attached object */
@@ -113,7 +112,7 @@ acpi_psx_execute (
}
/*
- * Get a new Owner_id for objects created by this method. Namespace
+ * Get a new owner_id for objects created by this method. Namespace
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
@@ -193,7 +192,7 @@ acpi_psx_execute (
* a control exception code
*/
if (*return_obj_desc) {
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned Obj_desc=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned obj_desc=%p\n",
*return_obj_desc));
ACPI_DUMP_STACK_ENTRY (*return_obj_desc);
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 72df49e4dcb8..bbca62c3bb24 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -467,8 +467,10 @@ acpi_power_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/processor.c b/drivers/acpi/processor.c
index 8167bf258edf..800598d3ae5a 100644
--- a/drivers/acpi/processor.c
+++ b/drivers/acpi/processor.c
@@ -549,13 +549,13 @@ acpi_processor_idle (void)
case ACPI_STATE_C2:
/* Get start time (ticks) */
- t1 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t1 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Invoke C2 */
inb(pr->power.states[ACPI_STATE_C2].address);
/* Dummy op - must do something useless after P_LVL2 read */
- t2 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t2 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Get end time (ticks) */
- t2 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t2 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Re-enable interrupts */
local_irq_enable();
/* Compute time (ticks) that we were actually asleep */
@@ -566,13 +566,13 @@ acpi_processor_idle (void)
/* Disable bus master arbitration */
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
/* Get start time (ticks) */
- t1 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t1 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Invoke C3 */
inb(pr->power.states[ACPI_STATE_C3].address);
/* Dummy op - must do something useless after P_LVL3 read */
- t2 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t2 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Get end time (ticks) */
- t2 = inl(acpi_fadt.Xpm_tmr_blk.address);
+ t2 = inl(acpi_fadt.xpm_tmr_blk.address);
/* Enable bus master arbitration */
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_DO_NOT_LOCK);
/* Re-enable interrupts */
@@ -2348,8 +2348,10 @@ acpi_processor_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_processor_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
index ad3d92db7d8d..8fc0107f2417 100644
--- a/drivers/acpi/resources/rsaddr.c
+++ b/drivers/acpi/resources/rsaddr.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsaddr - Address resource descriptors (16/32/64)
- * $Revision: 27 $
*
******************************************************************************/
@@ -33,21 +32,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address16_resource
+ * FUNCTION: acpi_rs_address16_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -55,20 +54,20 @@
acpi_status
acpi_rs_address16_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u8 *temp_ptr;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address16);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address16);
u32 index;
u16 temp16;
u8 temp8;
- ACPI_FUNCTION_TRACE ("Rs_address16_resource");
+ ACPI_FUNCTION_TRACE ("rs_address16_resource");
/*
* Point past the Descriptor to get the number of bytes consumed
@@ -133,7 +132,7 @@ acpi_rs_address16_resource (
(u16) (temp8 & 0x03);
}
else {
- /* BUS_NUMBER_RANGE == Address16.Data->Resource_type */
+ /* BUS_NUMBER_RANGE == Address16.Data->resource_type */
/* Nothing needs to be filled in */
}
}
@@ -146,28 +145,28 @@ acpi_rs_address16_resource (
buffer);
/*
- * Get Min_address_range (Bytes 8-9)
+ * Get min_address_range (Bytes 8-9)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.min_address_range,
buffer);
/*
- * Get Max_address_range (Bytes 10-11)
+ * Get max_address_range (Bytes 10-11)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.max_address_range,
buffer);
/*
- * Get Address_translation_offset (Bytes 12-13)
+ * Get address_translation_offset (Bytes 12-13)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_translation_offset,
buffer);
/*
- * Get Address_length (Bytes 14-15)
+ * Get address_length (Bytes 14-15)
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&output_struct->data.address16.address_length,
@@ -222,12 +221,12 @@ acpi_rs_address16_resource (
output_struct->data.address16.resource_source.string_length = index + 1;
/*
- * In order for the Struct_size to fall on a 32-bit boundary,
+ * In order for the struct_size to fall on a 32-bit boundary,
* calculate the length of the string and expand the
- * Struct_size to the next 32-bit boundary.
+ * struct_size to the next 32-bit boundary.
*/
temp8 = (u8) (index + 1);
- struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
}
else {
output_struct->data.address16.resource_source.index = 0x00;
@@ -250,12 +249,12 @@ acpi_rs_address16_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address16_stream
+ * FUNCTION: acpi_rs_address16_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -268,16 +267,16 @@ acpi_status
acpi_rs_address16_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u8 *length_field;
u8 temp8;
char *temp_pointer = NULL;
- ACPI_SIZE actual_bytes;
+ acpi_size actual_bytes;
- ACPI_FUNCTION_TRACE ("Rs_address16_stream");
+ ACPI_FUNCTION_TRACE ("rs_address16_stream");
/*
@@ -293,7 +292,7 @@ acpi_rs_address16_stream (
buffer += 2;
/*
- * Set the Resource Type (Memory, Io, Bus_number)
+ * Set the Resource Type (Memory, Io, bus_number)
*/
temp8 = (u8) (linked_list->data.address16.resource_type & 0x03);
*buffer = temp8;
@@ -411,21 +410,21 @@ acpi_rs_address16_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address32_resource
+ * FUNCTION: acpi_rs_address32_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -433,20 +432,20 @@ acpi_rs_address16_stream (
acpi_status
acpi_rs_address32_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer;
acpi_resource *output_struct= (void *) *output_buffer;
u16 temp16;
u8 temp8;
u8 *temp_ptr;
- ACPI_SIZE struct_size;
+ acpi_size struct_size;
u32 index;
- ACPI_FUNCTION_TRACE ("Rs_address32_resource");
+ ACPI_FUNCTION_TRACE ("rs_address32_resource");
buffer = byte_stream_buffer;
@@ -519,7 +518,7 @@ acpi_rs_address32_resource (
(u16) (temp8 & 0x03);
}
else {
- /* BUS_NUMBER_RANGE == Output_struct->Data.Address32.Resource_type */
+ /* BUS_NUMBER_RANGE == output_struct->Data.Address32.resource_type */
/* Nothing needs to be filled in */
}
}
@@ -532,28 +531,28 @@ acpi_rs_address32_resource (
buffer);
/*
- * Get Min_address_range (Bytes 10-13)
+ * Get min_address_range (Bytes 10-13)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.min_address_range,
buffer);
/*
- * Get Max_address_range (Bytes 14-17)
+ * Get max_address_range (Bytes 14-17)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.max_address_range,
buffer);
/*
- * Get Address_translation_offset (Bytes 18-21)
+ * Get address_translation_offset (Bytes 18-21)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_translation_offset,
buffer);
/*
- * Get Address_length (Bytes 22-25)
+ * Get address_length (Bytes 22-25)
*/
buffer += 4;
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.address32.address_length,
@@ -605,12 +604,12 @@ acpi_rs_address32_resource (
output_struct->data.address32.resource_source.string_length = index + 1;
/*
- * In order for the Struct_size to fall on a 32-bit boundary,
+ * In order for the struct_size to fall on a 32-bit boundary,
* calculate the length of the string and expand the
- * Struct_size to the next 32-bit boundary.
+ * struct_size to the next 32-bit boundary.
*/
temp8 = (u8) (index + 1);
- struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
}
else {
output_struct->data.address32.resource_source.index = 0x00;
@@ -633,12 +632,12 @@ acpi_rs_address32_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address32_stream
+ * FUNCTION: acpi_rs_address32_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -651,7 +650,7 @@ acpi_status
acpi_rs_address32_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer;
u16 *length_field;
@@ -659,7 +658,7 @@ acpi_rs_address32_stream (
char *temp_pointer;
- ACPI_FUNCTION_TRACE ("Rs_address32_stream");
+ ACPI_FUNCTION_TRACE ("rs_address32_stream");
buffer = *output_buffer;
@@ -677,7 +676,7 @@ acpi_rs_address32_stream (
buffer += 2;
/*
- * Set the Resource Type (Memory, Io, Bus_number)
+ * Set the Resource Type (Memory, Io, bus_number)
*/
temp8 = (u8) (linked_list->data.address32.resource_type & 0x03);
@@ -793,21 +792,21 @@ acpi_rs_address32_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address64_resource
+ * FUNCTION: acpi_rs_address64_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -815,20 +814,20 @@ acpi_rs_address32_stream (
acpi_status
acpi_rs_address64_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16;
u8 temp8;
u8 *temp_ptr;
- ACPI_SIZE struct_size;
+ acpi_size struct_size;
u32 index;
- ACPI_FUNCTION_TRACE ("Rs_address64_resource");
+ ACPI_FUNCTION_TRACE ("rs_address64_resource");
buffer = byte_stream_buffer;
@@ -902,7 +901,7 @@ acpi_rs_address64_resource (
(u16) (temp8 & 0x03);
}
else {
- /* BUS_NUMBER_RANGE == Output_struct->Data.Address64.Resource_type */
+ /* BUS_NUMBER_RANGE == output_struct->Data.Address64.resource_type */
/* Nothing needs to be filled in */
}
}
@@ -915,28 +914,28 @@ acpi_rs_address64_resource (
buffer);
/*
- * Get Min_address_range (Bytes 14-21)
+ * Get min_address_range (Bytes 14-21)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.min_address_range,
buffer);
/*
- * Get Max_address_range (Bytes 22-29)
+ * Get max_address_range (Bytes 22-29)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.max_address_range,
buffer);
/*
- * Get Address_translation_offset (Bytes 30-37)
+ * Get address_translation_offset (Bytes 30-37)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_translation_offset,
buffer);
/*
- * Get Address_length (Bytes 38-45)
+ * Get address_length (Bytes 38-45)
*/
buffer += 8;
ACPI_MOVE_UNALIGNED64_TO_64 (&output_struct->data.address64.address_length,
@@ -991,12 +990,12 @@ acpi_rs_address64_resource (
output_struct->data.address64.resource_source.string_length = index + 1;
/*
- * In order for the Struct_size to fall on a 32-bit boundary,
+ * In order for the struct_size to fall on a 32-bit boundary,
* calculate the length of the string and expand the
- * Struct_size to the next 32-bit boundary.
+ * struct_size to the next 32-bit boundary.
*/
temp8 = (u8) (index + 1);
- struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
}
else {
output_struct->data.address64.resource_source.index = 0x00;
@@ -1019,12 +1018,12 @@ acpi_rs_address64_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_address64_stream
+ * FUNCTION: acpi_rs_address64_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -1037,7 +1036,7 @@ acpi_status
acpi_rs_address64_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer;
u16 *length_field;
@@ -1045,7 +1044,7 @@ acpi_rs_address64_stream (
char *temp_pointer;
- ACPI_FUNCTION_TRACE ("Rs_address64_stream");
+ ACPI_FUNCTION_TRACE ("rs_address64_stream");
buffer = *output_buffer;
@@ -1064,7 +1063,7 @@ acpi_rs_address64_stream (
buffer += 2;
/*
- * Set the Resource Type (Memory, Io, Bus_number)
+ * Set the Resource Type (Memory, Io, bus_number)
*/
temp8 = (u8) (linked_list->data.address64.resource_type & 0x03);
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 57a731a93a00..c43f629ba263 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rscalc - Calculate stream and list lengths
- * $Revision: 45 $
*
******************************************************************************/
@@ -35,10 +34,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_byte_stream_length
+ * FUNCTION: acpi_rs_get_byte_stream_length
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Size_needed - u32 pointer of the size buffer needed
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * size_needed - u32 pointer of the size buffer needed
* to properly return the parsed data
*
* RETURN: Status
@@ -52,15 +51,15 @@
acpi_status
acpi_rs_get_byte_stream_length (
acpi_resource *linked_list,
- ACPI_SIZE *size_needed)
+ acpi_size *size_needed)
{
- ACPI_SIZE byte_stream_size_needed = 0;
- ACPI_SIZE segment_size;
+ acpi_size byte_stream_size_needed = 0;
+ acpi_size segment_size;
acpi_resource_ext_irq *ex_irq = NULL;
u8 done = FALSE;
- ACPI_FUNCTION_TRACE ("Rs_get_byte_stream_length");
+ ACPI_FUNCTION_TRACE ("rs_get_byte_stream_length");
while (!done) {
@@ -90,7 +89,7 @@ acpi_rs_get_byte_stream_length (
case ACPI_RSTYPE_START_DPF:
/*
* Start Dependent Functions Resource
- * For a Start_dependent_functions Resource, Byte 1,
+ * For a start_dependent_functions Resource, Byte 1,
* although optional, will always be created.
*/
segment_size = 2;
@@ -229,7 +228,7 @@ acpi_rs_get_byte_stream_length (
* Resource Source + 1 for the null.
*/
segment_size = 9 +
- (((ACPI_SIZE) linked_list->data.extended_irq.number_of_interrupts - 1) * 4);
+ (((acpi_size) linked_list->data.extended_irq.number_of_interrupts - 1) * 4);
if (ex_irq && ex_irq->resource_source.string_ptr) {
segment_size += linked_list->data.extended_irq.resource_source.string_length;
@@ -244,7 +243,7 @@ acpi_rs_get_byte_stream_length (
*/
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
- } /* switch (Linked_list->Id) */
+ } /* switch (linked_list->Id) */
/*
* Update the total
@@ -268,11 +267,11 @@ acpi_rs_get_byte_stream_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_list_length
+ * FUNCTION: acpi_rs_get_list_length
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource byte stream
- * Byte_stream_buffer_length - Size of Byte_stream_buffer
- * Size_needed - u32 pointer of the size buffer
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
+ * byte_stream_buffer_length - Size of byte_stream_buffer
+ * size_needed - u32 pointer of the size buffer
* needed to properly return the
* parsed data
*
@@ -288,7 +287,7 @@ acpi_status
acpi_rs_get_list_length (
u8 *byte_stream_buffer,
u32 byte_stream_buffer_length,
- ACPI_SIZE *size_needed)
+ acpi_size *size_needed)
{
u32 buffer_size = 0;
u32 bytes_parsed = 0;
@@ -304,7 +303,7 @@ acpi_rs_get_list_length (
u8 additional_bytes;
- ACPI_FUNCTION_TRACE ("Rs_get_list_length");
+ ACPI_FUNCTION_TRACE ("rs_get_list_length");
while (bytes_parsed < byte_stream_buffer_length) {
@@ -337,7 +336,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 32-bit boundary for the structure
*/
- temp16 = (u16) ACPI_ROUND_UP_TO_32_bITS (temp16);
+ temp16 = (u16) ACPI_ROUND_UP_to_32_bITS (temp16);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor) +
(temp16 * sizeof (u8));
@@ -396,7 +395,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 64-bit boundary for the structure
*/
- temp8 = (u8) ACPI_ROUND_UP_TO_64_bITS (temp8);
+ temp8 = (u8) ACPI_ROUND_UP_to_64_bITS (temp8);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address64) +
(temp8 * sizeof (u8));
@@ -434,7 +433,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 32-bit boundary for the structure
*/
- temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8);
+ temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address32) +
(temp8 * sizeof (u8));
@@ -472,7 +471,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 32-bit boundary for the structure
*/
- temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8);
+ temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_address16) +
(temp8 * sizeof (u8));
@@ -524,7 +523,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 32-bit boundary for the structure
*/
- temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8);
+ temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_ext_irq) +
(additional_bytes * sizeof (u8)) +
@@ -659,7 +658,7 @@ acpi_rs_get_list_length (
/*
* Ensure a 32-bit boundary for the structure
*/
- temp8 = (u8) ACPI_ROUND_UP_TO_32_bITS (temp8);
+ temp8 = (u8) ACPI_ROUND_UP_to_32_bITS (temp8);
structure_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor) +
(temp8 * sizeof (u8));
break;
@@ -705,10 +704,10 @@ acpi_rs_get_list_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_pci_routing_table_length
+ * FUNCTION: acpi_rs_get_pci_routing_table_length
*
- * PARAMETERS: Package_object - Pointer to the package object
- * Buffer_size_needed - u32 pointer of the size buffer
+ * PARAMETERS: package_object - Pointer to the package object
+ * buffer_size_needed - u32 pointer of the size buffer
* needed to properly return the
* parsed data
*
@@ -723,10 +722,10 @@ acpi_rs_get_list_length (
acpi_status
acpi_rs_get_pci_routing_table_length (
acpi_operand_object *package_object,
- ACPI_SIZE *buffer_size_needed)
+ acpi_size *buffer_size_needed)
{
u32 number_of_elements;
- ACPI_SIZE temp_size_needed = 0;
+ acpi_size temp_size_needed = 0;
acpi_operand_object **top_object_list;
u32 index;
acpi_operand_object *package_element;
@@ -735,7 +734,7 @@ acpi_rs_get_pci_routing_table_length (
u32 table_index;
- ACPI_FUNCTION_TRACE ("Rs_get_pci_routing_table_length");
+ ACPI_FUNCTION_TRACE ("rs_get_pci_routing_table_length");
number_of_elements = package_object->package.count;
@@ -759,13 +758,13 @@ acpi_rs_get_pci_routing_table_length (
package_element = *top_object_list;
/*
- * The Sub_object_list will now point to an array of the
- * four IRQ elements: Address, Pin, Source and Source_index
+ * The sub_object_list will now point to an array of the
+ * four IRQ elements: Address, Pin, Source and source_index
*/
sub_object_list = package_element->package.elements;
/*
- * Scan the Irq_table_elements for the Source Name String
+ * Scan the irq_table_elements for the Source Name String
*/
name_found = FALSE;
@@ -811,7 +810,7 @@ acpi_rs_get_pci_routing_table_length (
/* Round up the size since each element must be aligned */
- temp_size_needed = ACPI_ROUND_UP_TO_64_bITS (temp_size_needed);
+ temp_size_needed = ACPI_ROUND_UP_to_64_bITS (temp_size_needed);
/*
* Point to the next acpi_operand_object
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index a21d4b4cc217..a8a0a34169a0 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rscreate - Create resource lists/tables
- * $Revision: 63 $
*
******************************************************************************/
@@ -35,15 +34,15 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_create_resource_list
+ * FUNCTION: acpi_rs_create_resource_list
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource byte stream
- * Output_buffer - Pointer to the user's buffer
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
+ * output_buffer - Pointer to the user's buffer
*
* RETURN: Status - AE_OK if okay, else a valid acpi_status code
- * If Output_buffer is not large enough, Output_buffer_length
- * indicates how large Output_buffer should be, else it
- * indicates how may u8 elements of Output_buffer are valid.
+ * If output_buffer is not large enough, output_buffer_length
+ * indicates how large output_buffer should be, else it
+ * indicates how may u8 elements of output_buffer are valid.
*
* DESCRIPTION: Takes the byte stream returned from a _CRS, _PRS control method
* execution and parses the stream to create a linked list
@@ -59,14 +58,14 @@ acpi_rs_create_resource_list (
acpi_status status;
u8 *byte_stream_start;
- ACPI_SIZE list_size_needed = 0;
+ acpi_size list_size_needed = 0;
u32 byte_stream_buffer_length;
- ACPI_FUNCTION_TRACE ("Rs_create_resource_list");
+ ACPI_FUNCTION_TRACE ("rs_create_resource_list");
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_buffer = %p\n",
byte_stream_buffer));
/*
@@ -76,13 +75,13 @@ acpi_rs_create_resource_list (
byte_stream_start = byte_stream_buffer->buffer.pointer;
/*
- * Pass the Byte_stream_buffer into a module that can calculate
+ * Pass the byte_stream_buffer into a module that can calculate
* the buffer size needed for the linked list
*/
status = acpi_rs_get_list_length (byte_stream_start, byte_stream_buffer_length,
&list_size_needed);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status=%X List_size_needed=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Status=%X list_size_needed=%X\n",
status, (u32) list_size_needed));
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
@@ -103,7 +102,7 @@ acpi_rs_create_resource_list (
return_ACPI_STATUS (status);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "output_buffer %p Length %X\n",
output_buffer->pointer, (u32) output_buffer->length));
return_ACPI_STATUS (AE_OK);
}
@@ -111,15 +110,15 @@ acpi_rs_create_resource_list (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_create_pci_routing_table
+ * FUNCTION: acpi_rs_create_pci_routing_table
*
- * PARAMETERS: Package_object - Pointer to an acpi_operand_object
+ * PARAMETERS: package_object - Pointer to an acpi_operand_object
* package
- * Output_buffer - Pointer to the user's buffer
+ * output_buffer - Pointer to the user's buffer
*
* RETURN: Status AE_OK if okay, else a valid acpi_status code.
- * If the Output_buffer is too small, the error will be
- * AE_BUFFER_OVERFLOW and Output_buffer->Length will point
+ * If the output_buffer is too small, the error will be
+ * AE_BUFFER_OVERFLOW and output_buffer->Length will point
* to the size buffer needed.
*
* DESCRIPTION: Takes the acpi_operand_object package and creates a
@@ -139,7 +138,7 @@ acpi_rs_create_pci_routing_table (
acpi_operand_object **top_object_list;
acpi_operand_object **sub_object_list;
acpi_operand_object *obj_desc;
- ACPI_SIZE buffer_size_needed = 0;
+ acpi_size buffer_size_needed = 0;
u32 number_of_elements;
u32 index;
acpi_pci_routing_table *user_prt;
@@ -148,7 +147,7 @@ acpi_rs_create_pci_routing_table (
acpi_buffer path_buffer;
- ACPI_FUNCTION_TRACE ("Rs_create_pci_routing_table");
+ ACPI_FUNCTION_TRACE ("rs_create_pci_routing_table");
/* Params already validated, so we don't re-validate here */
@@ -162,7 +161,7 @@ acpi_rs_create_pci_routing_table (
return_ACPI_STATUS (status);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "buffer_size_needed = %X\n",
(u32) buffer_size_needed));
/* Validate/Allocate/Clear caller buffer */
@@ -175,7 +174,7 @@ acpi_rs_create_pci_routing_table (
/*
* Loop through the ACPI_INTERNAL_OBJECTS - Each object
* should be a package that in turn contains an
- * acpi_integer Address, a u8 Pin, a Name and a u8 Source_index.
+ * acpi_integer Address, a u8 Pin, a Name and a u8 source_index.
*/
top_object_list = package_object->package.elements;
number_of_elements = package_object->package.count;
@@ -184,9 +183,9 @@ acpi_rs_create_pci_routing_table (
for (index = 0; index < number_of_elements; index++) {
/*
- * Point User_prt past this current structure
+ * Point user_prt past this current structure
*
- * NOTE: On the first iteration, User_prt->Length will
+ * NOTE: On the first iteration, user_prt->Length will
* be zero because we cleared the return buffer earlier
*/
buffer += user_prt->length;
@@ -220,8 +219,8 @@ acpi_rs_create_pci_routing_table (
/*
* Dereference the sub-package.
- * The Sub_object_list will now point to an array of the four IRQ
- * elements: [Address, Pin, Source, Source_index]
+ * The sub_object_list will now point to an array of the four IRQ
+ * elements: [Address, Pin, Source, source_index]
*/
sub_object_list = (*top_object_list)->package.elements;
@@ -254,7 +253,7 @@ acpi_rs_create_pci_routing_table (
}
/*
- * 3) Third subobject: Dereference the PRT.Source_name
+ * 3) Third subobject: Dereference the PRT.source_name
*/
obj_desc = sub_object_list[2];
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
@@ -313,10 +312,10 @@ acpi_rs_create_pci_routing_table (
/* Now align the current length */
- user_prt->length = ACPI_ROUND_UP_TO_64_bITS (user_prt->length);
+ user_prt->length = ACPI_ROUND_UP_to_64_bITS (user_prt->length);
/*
- * 4) Fourth subobject: Dereference the PRT.Source_index
+ * 4) Fourth subobject: Dereference the PRT.source_index
*/
obj_desc = sub_object_list[3];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
@@ -324,7 +323,7 @@ acpi_rs_create_pci_routing_table (
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "(PRT[%X].Source_index) Need Integer, found %s\n",
+ "(PRT[%X].source_index) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -334,7 +333,7 @@ acpi_rs_create_pci_routing_table (
top_object_list++;
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "output_buffer %p Length %X\n",
output_buffer->pointer, (u32) output_buffer->length));
return_ACPI_STATUS (AE_OK);
}
@@ -342,14 +341,14 @@ acpi_rs_create_pci_routing_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_create_byte_stream
+ * FUNCTION: acpi_rs_create_byte_stream
*
- * PARAMETERS: Linked_list_buffer - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's buffer
+ * PARAMETERS: linked_list_buffer - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's buffer
*
* RETURN: Status AE_OK if okay, else a valid acpi_status code.
- * If the Output_buffer is too small, the error will be
- * AE_BUFFER_OVERFLOW and Output_buffer->Length will point
+ * If the output_buffer is too small, the error will be
+ * AE_BUFFER_OVERFLOW and output_buffer->Length will point
* to the size buffer needed.
*
* DESCRIPTION: Takes the linked list of device resources and
@@ -364,25 +363,25 @@ acpi_rs_create_byte_stream (
acpi_buffer *output_buffer)
{
acpi_status status;
- ACPI_SIZE byte_stream_size_needed = 0;
+ acpi_size byte_stream_size_needed = 0;
- ACPI_FUNCTION_TRACE ("Rs_create_byte_stream");
+ ACPI_FUNCTION_TRACE ("rs_create_byte_stream");
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "linked_list_buffer = %p\n",
linked_list_buffer));
/*
* Params already validated, so we don't re-validate here
*
- * Pass the Linked_list_buffer into a module that calculates
+ * Pass the linked_list_buffer into a module that calculates
* the buffer size needed for the byte stream.
*/
status = acpi_rs_get_byte_stream_length (linked_list_buffer,
&byte_stream_size_needed);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_size_needed=%X, %s\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "byte_stream_size_needed=%X, %s\n",
(u32) byte_stream_size_needed, acpi_format_exception (status)));
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
@@ -403,7 +402,7 @@ acpi_rs_create_byte_stream (
return_ACPI_STATUS (status);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Output_buffer %p Length %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "output_buffer %p Length %X\n",
output_buffer->pointer, (u32) output_buffer->length));
return_ACPI_STATUS (AE_OK);
}
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 82b3682ca44c..37fe98207f6a 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
- * $Revision: 34 $
*
******************************************************************************/
@@ -35,7 +34,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_irq
+ * FUNCTION: acpi_rs_dump_irq
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -80,7 +79,7 @@ acpi_rs_dump_irq (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_dma
+ * FUNCTION: acpi_rs_dump_dma
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -160,7 +159,7 @@ acpi_rs_dump_dma (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_start_depend_fns
+ * FUNCTION: acpi_rs_dump_start_depend_fns
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -225,7 +224,7 @@ acpi_rs_dump_start_depend_fns (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_io
+ * FUNCTION: acpi_rs_dump_io
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -268,7 +267,7 @@ acpi_rs_dump_io (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_fixed_io
+ * FUNCTION: acpi_rs_dump_fixed_io
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -301,7 +300,7 @@ acpi_rs_dump_fixed_io (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_vendor_specific
+ * FUNCTION: acpi_rs_dump_vendor_specific
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -337,7 +336,7 @@ acpi_rs_dump_vendor_specific (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_memory24
+ * FUNCTION: acpi_rs_dump_memory24
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -382,7 +381,7 @@ acpi_rs_dump_memory24 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_memory32
+ * FUNCTION: acpi_rs_dump_memory32
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -427,7 +426,7 @@ acpi_rs_dump_memory32 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_fixed_memory32
+ * FUNCTION: acpi_rs_dump_fixed_memory32
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -466,7 +465,7 @@ acpi_rs_dump_fixed_memory32 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_address16
+ * FUNCTION: acpi_rs_dump_address16
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -609,7 +608,7 @@ acpi_rs_dump_address16 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_address32
+ * FUNCTION: acpi_rs_dump_address32
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -751,7 +750,7 @@ acpi_rs_dump_address32 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_address64
+ * FUNCTION: acpi_rs_dump_address64
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -898,7 +897,7 @@ acpi_rs_dump_address64 (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_extended_irq
+ * FUNCTION: acpi_rs_dump_extended_irq
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -959,7 +958,7 @@ acpi_rs_dump_extended_irq (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_resource_list
+ * FUNCTION: acpi_rs_dump_resource_list
*
* PARAMETERS: Data - pointer to the resource structure to dump.
*
@@ -998,8 +997,8 @@ acpi_rs_dump_resource_list (
break;
case ACPI_RSTYPE_END_DPF:
- acpi_os_printf ("End_dependent_functions Resource\n");
- /* Acpi_rs_dump_end_dependent_functions (Resource->Data);*/
+ acpi_os_printf ("end_dependent_functions Resource\n");
+ /* acpi_rs_dump_end_dependent_functions (Resource->Data);*/
break;
case ACPI_RSTYPE_IO:
@@ -1015,8 +1014,8 @@ acpi_rs_dump_resource_list (
break;
case ACPI_RSTYPE_END_TAG:
- /*Rs_dump_end_tag (Resource->Data);*/
- acpi_os_printf ("End_tag Resource\n");
+ /*rs_dump_end_tag (Resource->Data);*/
+ acpi_os_printf ("end_tag Resource\n");
done = TRUE;
break;
@@ -1063,7 +1062,7 @@ acpi_rs_dump_resource_list (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dump_irq_list
+ * FUNCTION: acpi_rs_dump_irq_list
*
* PARAMETERS: Data - pointer to the routing table to dump.
*
@@ -1100,7 +1099,7 @@ acpi_rs_dump_irq_list (
acpi_os_printf (" Source: %s\n", prt_element->source);
- acpi_os_printf (" Source_index: %X\n",
+ acpi_os_printf (" source_index: %X\n",
prt_element->source_index);
buffer += prt_element->length;
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index 3eda881b5ca0..89365a5bfc46 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsio - IO and DMA resource descriptors
- * $Revision: 22 $
*
******************************************************************************/
@@ -33,21 +32,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_io_resource
+ * FUNCTION: acpi_rs_io_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -55,18 +54,18 @@
acpi_status
acpi_rs_io_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_io);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_io);
- ACPI_FUNCTION_TRACE ("Rs_io_resource");
+ ACPI_FUNCTION_TRACE ("rs_io_resource");
/*
@@ -85,7 +84,7 @@ acpi_rs_io_resource (
output_struct->data.io.io_decode = temp8 & 0x01;
/*
- * Check Min_base Address
+ * Check min_base Address
*/
buffer += 1;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
@@ -93,7 +92,7 @@ acpi_rs_io_resource (
output_struct->data.io.min_base_address = temp16;
/*
- * Check Max_base Address
+ * Check max_base Address
*/
buffer += 2;
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
@@ -109,7 +108,7 @@ acpi_rs_io_resource (
output_struct->data.io.alignment = temp8;
/*
- * Check Range_length
+ * Check range_length
*/
buffer += 1;
temp8 = *buffer;
@@ -131,21 +130,21 @@ acpi_rs_io_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_fixed_io_resource
+ * FUNCTION: acpi_rs_fixed_io_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -153,18 +152,18 @@ acpi_rs_io_resource (
acpi_status
acpi_rs_fixed_io_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_io);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_io);
- ACPI_FUNCTION_TRACE ("Rs_fixed_io_resource");
+ ACPI_FUNCTION_TRACE ("rs_fixed_io_resource");
/*
@@ -183,7 +182,7 @@ acpi_rs_fixed_io_resource (
output_struct->data.fixed_io.base_address = temp16;
/*
- * Check Range_length
+ * Check range_length
*/
buffer += 2;
temp8 = *buffer;
@@ -205,12 +204,12 @@ acpi_rs_fixed_io_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_io_stream
+ * FUNCTION: acpi_rs_io_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -223,14 +222,14 @@ acpi_status
acpi_rs_io_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_io_stream");
+ ACPI_FUNCTION_TRACE ("rs_io_stream");
/*
@@ -289,12 +288,12 @@ acpi_rs_io_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_fixed_io_stream
+ * FUNCTION: acpi_rs_fixed_io_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -307,14 +306,14 @@ acpi_status
acpi_rs_fixed_io_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_fixed_io_stream");
+ ACPI_FUNCTION_TRACE ("rs_fixed_io_stream");
/*
@@ -350,21 +349,21 @@ acpi_rs_fixed_io_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dma_resource
+ * FUNCTION: acpi_rs_dma_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -372,19 +371,19 @@ acpi_rs_fixed_io_stream (
acpi_status
acpi_rs_dma_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u8 temp8 = 0;
u8 index;
u8 i;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_dma);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_dma);
- ACPI_FUNCTION_TRACE ("Rs_dma_resource");
+ ACPI_FUNCTION_TRACE ("rs_dma_resource");
/*
@@ -415,7 +414,7 @@ acpi_rs_dma_resource (
/*
* Calculate the structure size based upon the number of interrupts
*/
- struct_size += ((ACPI_SIZE) i - 1) * 4;
+ struct_size += ((acpi_size) i - 1) * 4;
}
/*
@@ -459,12 +458,12 @@ acpi_rs_dma_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_dma_stream
+ * FUNCTION: acpi_rs_dma_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -477,7 +476,7 @@ acpi_status
acpi_rs_dma_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
@@ -485,7 +484,7 @@ acpi_rs_dma_stream (
u8 index;
- ACPI_FUNCTION_TRACE ("Rs_dma_stream");
+ ACPI_FUNCTION_TRACE ("rs_dma_stream");
/*
diff --git a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
index bb6e8c062fef..e76dc52ba002 100644
--- a/drivers/acpi/resources/rsirq.c
+++ b/drivers/acpi/resources/rsirq.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsirq - IRQ resource descriptors
- * $Revision: 31 $
*
******************************************************************************/
@@ -33,21 +32,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_irq_resource
+ * FUNCTION: acpi_rs_irq_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -55,9 +54,9 @@
acpi_status
acpi_rs_irq_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
@@ -65,10 +64,10 @@ acpi_rs_irq_resource (
u8 temp8 = 0;
u8 index;
u8 i;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_irq);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_irq);
- ACPI_FUNCTION_TRACE ("Rs_irq_resource");
+ ACPI_FUNCTION_TRACE ("rs_irq_resource");
/*
@@ -103,7 +102,7 @@ acpi_rs_irq_resource (
/*
* Calculate the structure size based upon the number of interrupts
*/
- struct_size += ((ACPI_SIZE) i - 1) * 4;
+ struct_size += ((acpi_size) i - 1) * 4;
}
/*
@@ -166,12 +165,12 @@ acpi_rs_irq_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_irq_stream
+ * FUNCTION: acpi_rs_irq_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -184,16 +183,16 @@ acpi_status
acpi_rs_irq_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
u8 index;
- u8 IRQinfo_byte_needed;
+ u8 IRqinfo_byte_needed;
- ACPI_FUNCTION_TRACE ("Rs_irq_stream");
+ ACPI_FUNCTION_TRACE ("rs_irq_stream");
/*
@@ -204,11 +203,11 @@ acpi_rs_irq_stream (
ACPI_ACTIVE_HIGH == linked_list->data.irq.active_high_low &&
ACPI_EXCLUSIVE == linked_list->data.irq.shared_exclusive) {
*buffer = 0x22;
- IRQinfo_byte_needed = FALSE;
+ IRqinfo_byte_needed = FALSE;
}
else {
*buffer = 0x23;
- IRQinfo_byte_needed = TRUE;
+ IRqinfo_byte_needed = TRUE;
}
buffer += 1;
@@ -230,7 +229,7 @@ acpi_rs_irq_stream (
/*
* Set the IRQ Info byte if needed.
*/
- if (IRQinfo_byte_needed) {
+ if (IRqinfo_byte_needed) {
temp8 = 0;
temp8 = (u8) ((linked_list->data.irq.shared_exclusive &
0x01) << 4);
@@ -257,21 +256,21 @@ acpi_rs_irq_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_extended_irq_resource
+ * FUNCTION: acpi_rs_extended_irq_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -279,9 +278,9 @@ acpi_rs_irq_stream (
acpi_status
acpi_rs_extended_irq_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
@@ -289,10 +288,10 @@ acpi_rs_extended_irq_resource (
u8 temp8 = 0;
u8 *temp_ptr;
u8 index;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_ext_irq);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_ext_irq);
- ACPI_FUNCTION_TRACE ("Rs_extended_irq_resource");
+ ACPI_FUNCTION_TRACE ("rs_extended_irq_resource");
/*
@@ -372,7 +371,7 @@ acpi_rs_extended_irq_resource (
* stream that are default.
*/
if (*bytes_consumed >
- ((ACPI_SIZE) output_struct->data.extended_irq.number_of_interrupts * 4) + 5) {
+ ((acpi_size) output_struct->data.extended_irq.number_of_interrupts * 4) + 5) {
/* Dereference the Index */
temp8 = *buffer;
@@ -408,12 +407,12 @@ acpi_rs_extended_irq_resource (
output_struct->data.extended_irq.resource_source.string_length = index + 1;
/*
- * In order for the Struct_size to fall on a 32-bit boundary,
+ * In order for the struct_size to fall on a 32-bit boundary,
* calculate the length of the string and expand the
- * Struct_size to the next 32-bit boundary.
+ * struct_size to the next 32-bit boundary.
*/
temp8 = (u8) (index + 1);
- struct_size += ACPI_ROUND_UP_TO_32_bITS (temp8);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
}
else {
output_struct->data.extended_irq.resource_source.index = 0x00;
@@ -436,12 +435,12 @@ acpi_rs_extended_irq_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_extended_irq_stream
+ * FUNCTION: acpi_rs_extended_irq_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -454,7 +453,7 @@ acpi_status
acpi_rs_extended_irq_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 *length_field;
@@ -463,7 +462,7 @@ acpi_rs_extended_irq_stream (
char *temp_pointer = NULL;
- ACPI_FUNCTION_TRACE ("Rs_extended_irq_stream");
+ ACPI_FUNCTION_TRACE ("rs_extended_irq_stream");
/*
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index 6617ee0984ca..adf2be725509 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rslist - Linked list utilities
- * $Revision: 31 $
*
******************************************************************************/
@@ -33,9 +32,9 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_resource_type
+ * FUNCTION: acpi_rs_get_resource_type
*
- * PARAMETERS: Resource_start_byte - Byte 0 of a resource descriptor
+ * PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor
*
* RETURN: The Resource Type (Name) with no extraneous bits
*
@@ -83,11 +82,11 @@ acpi_rs_get_resource_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_byte_stream_to_list
+ * FUNCTION: acpi_rs_byte_stream_to_list
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource byte stream
- * Byte_stream_buffer_length - Length of Byte_stream_buffer
- * Output_buffer - Pointer to the buffer that will
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
+ * byte_stream_buffer_length - Length of byte_stream_buffer
+ * output_buffer - Pointer to the buffer that will
* contain the output structures
*
* RETURN: Status
@@ -104,15 +103,15 @@ acpi_rs_byte_stream_to_list (
u8 *output_buffer)
{
acpi_status status;
- ACPI_SIZE bytes_parsed = 0;
+ acpi_size bytes_parsed = 0;
u8 resource_type = 0;
- ACPI_SIZE bytes_consumed = 0;
+ acpi_size bytes_consumed = 0;
u8 *buffer = output_buffer;
- ACPI_SIZE structure_size = 0;
+ acpi_size structure_size = 0;
u8 end_tag_processed = FALSE;
acpi_resource *resource;
- ACPI_FUNCTION_TRACE ("Rs_byte_stream_to_list");
+ ACPI_FUNCTION_TRACE ("rs_byte_stream_to_list");
while (bytes_parsed < byte_stream_buffer_length &&
@@ -312,16 +311,16 @@ acpi_rs_byte_stream_to_list (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_list_to_byte_stream
+ * FUNCTION: acpi_rs_list_to_byte_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Byte_steam_size_needed - Calculated size of the byte stream
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * byte_steam_size_needed - Calculated size of the byte stream
* needed from calling
- * Acpi_rs_get_byte_stream_length()
- * The size of the Output_buffer is
+ * acpi_rs_get_byte_stream_length()
+ * The size of the output_buffer is
* guaranteed to be >=
- * Byte_stream_size_needed
- * Output_buffer - Pointer to the buffer that will
+ * byte_stream_size_needed
+ * output_buffer - Pointer to the buffer that will
* contain the byte stream
*
* RETURN: Status
@@ -334,16 +333,16 @@ acpi_rs_byte_stream_to_list (
acpi_status
acpi_rs_list_to_byte_stream (
acpi_resource *linked_list,
- ACPI_SIZE byte_stream_size_needed,
+ acpi_size byte_stream_size_needed,
u8 *output_buffer)
{
acpi_status status;
u8 *buffer = output_buffer;
- ACPI_SIZE bytes_consumed = 0;
+ acpi_size bytes_consumed = 0;
u8 done = FALSE;
- ACPI_FUNCTION_TRACE ("Rs_list_to_byte_stream");
+ ACPI_FUNCTION_TRACE ("rs_list_to_byte_stream");
while (!done) {
@@ -476,7 +475,7 @@ acpi_rs_list_to_byte_stream (
status = AE_BAD_DATA;
break;
- } /* switch (Linked_list->Id) */
+ } /* switch (linked_list->Id) */
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
diff --git a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c
index 092cc52c149b..9503cabab01a 100644
--- a/drivers/acpi/resources/rsmemory.c
+++ b/drivers/acpi/resources/rsmemory.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsmem24 - Memory resource descriptors
- * $Revision: 20 $
*
******************************************************************************/
@@ -33,21 +32,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_memory24_resource
+ * FUNCTION: acpi_rs_memory24_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -55,18 +54,18 @@
acpi_status
acpi_rs_memory24_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem24);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem24);
- ACPI_FUNCTION_TRACE ("Rs_memory24_resource");
+ ACPI_FUNCTION_TRACE ("rs_memory24_resource");
/*
@@ -76,7 +75,7 @@ acpi_rs_memory24_resource (
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
buffer += 2;
- *bytes_consumed = (ACPI_SIZE) temp16 + 3;
+ *bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_MEM24;
/*
@@ -87,14 +86,14 @@ acpi_rs_memory24_resource (
output_struct->data.memory24.read_write_attribute = temp8 & 0x01;
/*
- * Get Min_base_address (Bytes 4-5)
+ * Get min_base_address (Bytes 4-5)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
buffer += 2;
output_struct->data.memory24.min_base_address = temp16;
/*
- * Get Max_base_address (Bytes 6-7)
+ * Get max_base_address (Bytes 6-7)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
buffer += 2;
@@ -108,7 +107,7 @@ acpi_rs_memory24_resource (
output_struct->data.memory24.alignment = temp16;
/*
- * Get Range_length (Bytes 10-11)
+ * Get range_length (Bytes 10-11)
*/
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
output_struct->data.memory24.range_length = temp16;
@@ -128,12 +127,12 @@ acpi_rs_memory24_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_memory24_stream
+ * FUNCTION: acpi_rs_memory24_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -146,14 +145,14 @@ acpi_status
acpi_rs_memory24_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_memory24_stream");
+ ACPI_FUNCTION_TRACE ("rs_memory24_stream");
/*
@@ -210,21 +209,21 @@ acpi_rs_memory24_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_memory32_range_resource
+ * FUNCTION: acpi_rs_memory32_range_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -232,18 +231,18 @@ acpi_rs_memory24_stream (
acpi_status
acpi_rs_memory32_range_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem32);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_mem32);
- ACPI_FUNCTION_TRACE ("Rs_memory32_range_resource");
+ ACPI_FUNCTION_TRACE ("rs_memory32_range_resource");
/*
@@ -253,7 +252,7 @@ acpi_rs_memory32_range_resource (
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
buffer += 2;
- *bytes_consumed = (ACPI_SIZE) temp16 + 3;
+ *bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_MEM32;
@@ -263,7 +262,7 @@ acpi_rs_memory32_range_resource (
* 1. Set the RESOURCE_DATA * Data to point to it's own address, then
* 2. Set the pointer to the next address.
*
- * NOTE: Output_struct->Data is cast to u8, otherwise, this addition adds
+ * NOTE: output_struct->Data is cast to u8, otherwise, this addition adds
* 4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(u8)
*/
@@ -276,14 +275,14 @@ acpi_rs_memory32_range_resource (
output_struct->data.memory32.read_write_attribute = temp8 & 0x01;
/*
- * Get Min_base_address (Bytes 4-7)
+ * Get min_base_address (Bytes 4-7)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.min_base_address,
buffer);
buffer += 4;
/*
- * Get Max_base_address (Bytes 8-11)
+ * Get max_base_address (Bytes 8-11)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.max_base_address,
buffer);
@@ -296,7 +295,7 @@ acpi_rs_memory32_range_resource (
buffer += 4;
/*
- * Get Range_length (Bytes 16-19)
+ * Get range_length (Bytes 16-19)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.memory32.range_length, buffer);
@@ -315,21 +314,21 @@ acpi_rs_memory32_range_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_fixed_memory32_resource
+ * FUNCTION: acpi_rs_fixed_memory32_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -337,18 +336,18 @@ acpi_rs_memory32_range_resource (
acpi_status
acpi_rs_fixed_memory32_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_mem32);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_fixed_mem32);
- ACPI_FUNCTION_TRACE ("Rs_fixed_memory32_resource");
+ ACPI_FUNCTION_TRACE ("rs_fixed_memory32_resource");
/*
@@ -358,7 +357,7 @@ acpi_rs_fixed_memory32_resource (
ACPI_MOVE_UNALIGNED16_TO_16 (&temp16, buffer);
buffer += 2;
- *bytes_consumed = (ACPI_SIZE) temp16 + 3;
+ *bytes_consumed = (acpi_size) temp16 + 3;
output_struct->id = ACPI_RSTYPE_FIXED_MEM32;
@@ -370,14 +369,14 @@ acpi_rs_fixed_memory32_resource (
output_struct->data.fixed_memory32.read_write_attribute = temp8 & 0x01;
/*
- * Get Range_base_address (Bytes 4-7)
+ * Get range_base_address (Bytes 4-7)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_base_address,
buffer);
buffer += 4;
/*
- * Get Range_length (Bytes 8-11)
+ * Get range_length (Bytes 8-11)
*/
ACPI_MOVE_UNALIGNED32_TO_32 (&output_struct->data.fixed_memory32.range_length,
buffer);
@@ -397,12 +396,12 @@ acpi_rs_fixed_memory32_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_memory32_range_stream
+ * FUNCTION: acpi_rs_memory32_range_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -415,14 +414,14 @@ acpi_status
acpi_rs_memory32_range_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_memory32_range_stream");
+ ACPI_FUNCTION_TRACE ("rs_memory32_range_stream");
/*
@@ -480,12 +479,12 @@ acpi_rs_memory32_range_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_fixed_memory32_stream
+ * FUNCTION: acpi_rs_fixed_memory32_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -498,14 +497,14 @@ acpi_status
acpi_rs_fixed_memory32_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_fixed_memory32_stream");
+ ACPI_FUNCTION_TRACE ("rs_fixed_memory32_stream");
/*
diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
index 4736517fea04..6b77d2bc1097 100644
--- a/drivers/acpi/resources/rsmisc.c
+++ b/drivers/acpi/resources/rsmisc.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsmisc - Miscellaneous resource descriptors
- * $Revision: 24 $
*
******************************************************************************/
@@ -33,21 +32,21 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_end_tag_resource
+ * FUNCTION: acpi_rs_end_tag_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -55,15 +54,15 @@
acpi_status
acpi_rs_end_tag_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
acpi_resource *output_struct = (void *) *output_buffer;
- ACPI_SIZE struct_size = ACPI_RESOURCE_LENGTH;
+ acpi_size struct_size = ACPI_RESOURCE_LENGTH;
- ACPI_FUNCTION_TRACE ("Rs_end_tag_resource");
+ ACPI_FUNCTION_TRACE ("rs_end_tag_resource");
/*
@@ -91,12 +90,12 @@ acpi_rs_end_tag_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_end_tag_stream
+ * FUNCTION: acpi_rs_end_tag_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -109,13 +108,13 @@ acpi_status
acpi_rs_end_tag_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_end_tag_stream");
+ ACPI_FUNCTION_TRACE ("rs_end_tag_stream");
/*
@@ -143,21 +142,21 @@ acpi_rs_end_tag_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_vendor_resource
+ * FUNCTION: acpi_rs_vendor_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -165,19 +164,19 @@ acpi_rs_end_tag_stream (
acpi_status
acpi_rs_vendor_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16 = 0;
u8 temp8 = 0;
u8 index;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_vendor);
- ACPI_FUNCTION_TRACE ("Rs_vendor_resource");
+ ACPI_FUNCTION_TRACE ("rs_vendor_resource");
/*
@@ -197,7 +196,7 @@ acpi_rs_vendor_resource (
/* Calculate bytes consumed */
- *bytes_consumed = (ACPI_SIZE) temp16 + 3;
+ *bytes_consumed = (acpi_size) temp16 + 3;
/* Point to the first vendor byte */
@@ -211,7 +210,7 @@ acpi_rs_vendor_resource (
/* Calculate bytes consumed */
- *bytes_consumed = (ACPI_SIZE) temp16 + 1;
+ *bytes_consumed = (acpi_size) temp16 + 1;
/* Point to the first vendor byte */
@@ -227,11 +226,11 @@ acpi_rs_vendor_resource (
}
/*
- * In order for the Struct_size to fall on a 32-bit boundary,
+ * In order for the struct_size to fall on a 32-bit boundary,
* calculate the length of the vendor string and expand the
- * Struct_size to the next 32-bit boundary.
+ * struct_size to the next 32-bit boundary.
*/
- struct_size += ACPI_ROUND_UP_TO_32_bITS (temp16);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp16);
/*
* Set the Length parameter
@@ -248,12 +247,12 @@ acpi_rs_vendor_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_vendor_stream
+ * FUNCTION: acpi_rs_vendor_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -266,7 +265,7 @@ acpi_status
acpi_rs_vendor_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u16 temp16 = 0;
@@ -274,7 +273,7 @@ acpi_rs_vendor_stream (
u8 index;
- ACPI_FUNCTION_TRACE ("Rs_vendor_stream");
+ ACPI_FUNCTION_TRACE ("rs_vendor_stream");
/*
@@ -323,21 +322,21 @@ acpi_rs_vendor_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_start_depend_fns_resource
+ * FUNCTION: acpi_rs_start_depend_fns_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -345,17 +344,17 @@ acpi_rs_vendor_stream (
acpi_status
acpi_rs_start_depend_fns_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
u8 *buffer = byte_stream_buffer;
acpi_resource *output_struct = (void *) *output_buffer;
u8 temp8 = 0;
- ACPI_SIZE struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_start_dpf);
+ acpi_size struct_size = ACPI_SIZEOF_RESOURCE (acpi_resource_start_dpf);
- ACPI_FUNCTION_TRACE ("Rs_start_depend_fns_resource");
+ ACPI_FUNCTION_TRACE ("rs_start_depend_fns_resource");
/*
@@ -415,21 +414,21 @@ acpi_rs_start_depend_fns_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_end_depend_fns_resource
+ * FUNCTION: acpi_rs_end_depend_fns_resource
*
- * PARAMETERS: Byte_stream_buffer - Pointer to the resource input byte
+ * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
* stream
- * Bytes_consumed - Pointer to where the number of bytes
- * consumed the Byte_stream_buffer is
+ * bytes_consumed - Pointer to where the number of bytes
+ * consumed the byte_stream_buffer is
* returned
- * Output_buffer - Pointer to the return data buffer
- * Structure_size - Pointer to where the number of bytes
+ * output_buffer - Pointer to the return data buffer
+ * structure_size - Pointer to where the number of bytes
* in the return data struct is returned
*
* RETURN: Status
*
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
- * structure pointed to by the Output_buffer. Return the
+ * structure pointed to by the output_buffer. Return the
* number of bytes consumed from the byte stream.
*
******************************************************************************/
@@ -437,15 +436,15 @@ acpi_rs_start_depend_fns_resource (
acpi_status
acpi_rs_end_depend_fns_resource (
u8 *byte_stream_buffer,
- ACPI_SIZE *bytes_consumed,
+ acpi_size *bytes_consumed,
u8 **output_buffer,
- ACPI_SIZE *structure_size)
+ acpi_size *structure_size)
{
acpi_resource *output_struct = (void *) *output_buffer;
- ACPI_SIZE struct_size = ACPI_RESOURCE_LENGTH;
+ acpi_size struct_size = ACPI_RESOURCE_LENGTH;
- ACPI_FUNCTION_TRACE ("Rs_end_depend_fns_resource");
+ ACPI_FUNCTION_TRACE ("rs_end_depend_fns_resource");
/*
@@ -473,13 +472,13 @@ acpi_rs_end_depend_fns_resource (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_start_depend_fns_stream
+ * FUNCTION: acpi_rs_start_depend_fns_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - u32 pointer that is filled with
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - u32 pointer that is filled with
* the number of bytes of the
- * Output_buffer used
+ * output_buffer used
*
* RETURN: Status
*
@@ -492,13 +491,13 @@ acpi_status
acpi_rs_start_depend_fns_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
u8 temp8 = 0;
- ACPI_FUNCTION_TRACE ("Rs_start_depend_fns_stream");
+ ACPI_FUNCTION_TRACE ("rs_start_depend_fns_stream");
/*
@@ -538,12 +537,12 @@ acpi_rs_start_depend_fns_stream (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_end_depend_fns_stream
+ * FUNCTION: acpi_rs_end_depend_fns_stream
*
- * PARAMETERS: Linked_list - Pointer to the resource linked list
- * Output_buffer - Pointer to the user's return buffer
- * Bytes_consumed - Pointer to where the number of bytes
- * used in the Output_buffer is returned
+ * PARAMETERS: linked_list - Pointer to the resource linked list
+ * output_buffer - Pointer to the user's return buffer
+ * bytes_consumed - Pointer to where the number of bytes
+ * used in the output_buffer is returned
*
* RETURN: Status
*
@@ -556,12 +555,12 @@ acpi_status
acpi_rs_end_depend_fns_stream (
acpi_resource *linked_list,
u8 **output_buffer,
- ACPI_SIZE *bytes_consumed)
+ acpi_size *bytes_consumed)
{
u8 *buffer = *output_buffer;
- ACPI_FUNCTION_TRACE ("Rs_end_depend_fns_stream");
+ ACPI_FUNCTION_TRACE ("rs_end_depend_fns_stream");
/*
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
index 3c1e4eb5ed17..5460d64cfa9c 100644
--- a/drivers/acpi/resources/rsutils.c
+++ b/drivers/acpi/resources/rsutils.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsutils - Utilities for the resource manager
- * $Revision: 34 $
*
******************************************************************************/
@@ -35,10 +34,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_prt_method_data
+ * FUNCTION: acpi_rs_get_prt_method_data
*
* PARAMETERS: Handle - a handle to the containing object
- * Ret_buffer - a pointer to a buffer structure for the
+ * ret_buffer - a pointer to a buffer structure for the
* results
*
* RETURN: Status
@@ -60,7 +59,7 @@ acpi_rs_get_prt_method_data (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Rs_get_prt_method_data");
+ ACPI_FUNCTION_TRACE ("rs_get_prt_method_data");
/* Parameters guaranteed valid by caller */
@@ -79,7 +78,7 @@ acpi_rs_get_prt_method_data (
*/
status = acpi_rs_create_pci_routing_table (obj_desc, ret_buffer);
- /* On exit, we must delete the object returned by Evaluate_object */
+ /* On exit, we must delete the object returned by evaluate_object */
acpi_ut_remove_reference (obj_desc);
return_ACPI_STATUS (status);
@@ -88,10 +87,10 @@ acpi_rs_get_prt_method_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_crs_method_data
+ * FUNCTION: acpi_rs_get_crs_method_data
*
* PARAMETERS: Handle - a handle to the containing object
- * Ret_buffer - a pointer to a buffer structure for the
+ * ret_buffer - a pointer to a buffer structure for the
* results
*
* RETURN: Status
@@ -113,7 +112,7 @@ acpi_rs_get_crs_method_data (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Rs_get_crs_method_data");
+ ACPI_FUNCTION_TRACE ("rs_get_crs_method_data");
/* Parameters guaranteed valid by caller */
@@ -133,7 +132,7 @@ acpi_rs_get_crs_method_data (
*/
status = acpi_rs_create_resource_list (obj_desc, ret_buffer);
- /* On exit, we must delete the object returned by evaluate_object */
+ /* on exit, we must delete the object returned by evaluate_object */
acpi_ut_remove_reference (obj_desc);
return_ACPI_STATUS (status);
@@ -142,10 +141,10 @@ acpi_rs_get_crs_method_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_get_prs_method_data
+ * FUNCTION: acpi_rs_get_prs_method_data
*
* PARAMETERS: Handle - a handle to the containing object
- * Ret_buffer - a pointer to a buffer structure for the
+ * ret_buffer - a pointer to a buffer structure for the
* results
*
* RETURN: Status
@@ -167,7 +166,7 @@ acpi_rs_get_prs_method_data (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Rs_get_prs_method_data");
+ ACPI_FUNCTION_TRACE ("rs_get_prs_method_data");
/* Parameters guaranteed valid by caller */
@@ -187,7 +186,7 @@ acpi_rs_get_prs_method_data (
*/
status = acpi_rs_create_resource_list (obj_desc, ret_buffer);
- /* On exit, we must delete the object returned by evaluate_object */
+ /* on exit, we must delete the object returned by evaluate_object */
acpi_ut_remove_reference (obj_desc);
return_ACPI_STATUS (status);
@@ -196,10 +195,10 @@ acpi_rs_get_prs_method_data (
/*******************************************************************************
*
- * FUNCTION: Acpi_rs_set_srs_method_data
+ * FUNCTION: acpi_rs_set_srs_method_data
*
* PARAMETERS: Handle - a handle to the containing object
- * In_buffer - a pointer to a buffer structure of the
+ * in_buffer - a pointer to a buffer structure of the
* parameter
*
* RETURN: Status
@@ -222,13 +221,13 @@ acpi_rs_set_srs_method_data (
acpi_buffer buffer;
- ACPI_FUNCTION_TRACE ("Rs_set_srs_method_data");
+ ACPI_FUNCTION_TRACE ("rs_set_srs_method_data");
/* Parameters guaranteed valid by caller */
/*
- * The In_buffer parameter will point to a linked list of
+ * The in_buffer parameter will point to a linked list of
* resource parameters. It needs to be formatted into a
* byte stream to be sent in as an input parameter to _SRS
*
@@ -263,7 +262,7 @@ acpi_rs_set_srs_method_data (
status = acpi_ns_evaluate_relative (handle, "_SRS", params, NULL);
/*
- * Clean up and return the status from Acpi_ns_evaluate_relative
+ * Clean up and return the status from acpi_ns_evaluate_relative
*/
acpi_ut_remove_reference (params[0]);
return_ACPI_STATUS (status);
diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c
index e59889dd6b0d..34243f1a1685 100644
--- a/drivers/acpi/resources/rsxface.c
+++ b/drivers/acpi/resources/rsxface.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: rsxface - Public interfaces to the resource manager
- * $Revision: 19 $
*
******************************************************************************/
@@ -33,10 +32,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_get_irq_routing_table
+ * FUNCTION: acpi_get_irq_routing_table
*
- * PARAMETERS: Device_handle - a handle to the Bus device we are querying
- * Ret_buffer - a pointer to a buffer to receive the
+ * PARAMETERS: device_handle - a handle to the Bus device we are querying
+ * ret_buffer - a pointer to a buffer to receive the
* current resources for the device
*
* RETURN: Status
@@ -44,13 +43,13 @@
* DESCRIPTION: This function is called to get the IRQ routing table for a
* specific bus. The caller must first acquire a handle for the
* desired bus. The routine table is placed in the buffer pointed
- * to by the Ret_buffer variable parameter.
+ * to by the ret_buffer variable parameter.
*
* If the function fails an appropriate status will be returned
- * and the value of Ret_buffer is undefined.
+ * and the value of ret_buffer is undefined.
*
* This function attempts to execute the _PRT method contained in
- * the object indicated by the passed Device_handle.
+ * the object indicated by the passed device_handle.
*
******************************************************************************/
@@ -62,7 +61,7 @@ acpi_get_irq_routing_table (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_irq_routing_table ");
+ ACPI_FUNCTION_TRACE ("acpi_get_irq_routing_table ");
/*
@@ -87,11 +86,11 @@ acpi_get_irq_routing_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_current_resources
+ * FUNCTION: acpi_get_current_resources
*
- * PARAMETERS: Device_handle - a handle to the device object for the
+ * PARAMETERS: device_handle - a handle to the device object for the
* device we are querying
- * Ret_buffer - a pointer to a buffer to receive the
+ * ret_buffer - a pointer to a buffer to receive the
* current resources for the device
*
* RETURN: Status
@@ -99,13 +98,13 @@ acpi_get_irq_routing_table (
* DESCRIPTION: This function is called to get the current resources for a
* specific device. The caller must first acquire a handle for
* the desired device. The resource data is placed in the buffer
- * pointed to by the Ret_buffer variable parameter.
+ * pointed to by the ret_buffer variable parameter.
*
* If the function fails an appropriate status will be returned
- * and the value of Ret_buffer is undefined.
+ * and the value of ret_buffer is undefined.
*
* This function attempts to execute the _CRS method contained in
- * the object indicated by the passed Device_handle.
+ * the object indicated by the passed device_handle.
*
******************************************************************************/
@@ -117,7 +116,7 @@ acpi_get_current_resources (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_current_resources");
+ ACPI_FUNCTION_TRACE ("acpi_get_current_resources");
/*
@@ -142,11 +141,11 @@ acpi_get_current_resources (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_possible_resources
+ * FUNCTION: acpi_get_possible_resources
*
- * PARAMETERS: Device_handle - a handle to the device object for the
+ * PARAMETERS: device_handle - a handle to the device object for the
* device we are querying
- * Ret_buffer - a pointer to a buffer to receive the
+ * ret_buffer - a pointer to a buffer to receive the
* resources for the device
*
* RETURN: Status
@@ -154,10 +153,10 @@ acpi_get_current_resources (
* DESCRIPTION: This function is called to get a list of the possible resources
* for a specific device. The caller must first acquire a handle
* for the desired device. The resource data is placed in the
- * buffer pointed to by the Ret_buffer variable.
+ * buffer pointed to by the ret_buffer variable.
*
* If the function fails an appropriate status will be returned
- * and the value of Ret_buffer is undefined.
+ * and the value of ret_buffer is undefined.
*
******************************************************************************/
@@ -169,7 +168,7 @@ acpi_get_possible_resources (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_possible_resources");
+ ACPI_FUNCTION_TRACE ("acpi_get_possible_resources");
/*
@@ -194,11 +193,11 @@ acpi_get_possible_resources (
/*******************************************************************************
*
- * FUNCTION: Acpi_set_current_resources
+ * FUNCTION: acpi_set_current_resources
*
- * PARAMETERS: Device_handle - a handle to the device object for the
+ * PARAMETERS: device_handle - a handle to the device object for the
* device we are changing the resources of
- * In_buffer - a pointer to a buffer containing the
+ * in_buffer - a pointer to a buffer containing the
* resources to be set for the device
*
* RETURN: Status
@@ -206,7 +205,7 @@ acpi_get_possible_resources (
* DESCRIPTION: This function is called to set the current resources for a
* specific device. The caller must first acquire a handle for
* the desired device. The resource data is passed to the routine
- * the buffer pointed to by the In_buffer variable.
+ * the buffer pointed to by the in_buffer variable.
*
******************************************************************************/
@@ -218,7 +217,7 @@ acpi_set_current_resources (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_set_current_resources");
+ ACPI_FUNCTION_TRACE ("acpi_set_current_resources");
/*
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 22307dc2c6e5..e84ceeb85eeb 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -256,7 +256,7 @@ acpi_suspend (
if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) {
if (!acpi_wakeup_address)
return AE_ERROR;
- acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) acpi_wakeup_address);
+ acpi_set_firmware_waking_vector((acpi_physical_address) acpi_wakeup_address);
}
acpi_enter_sleep_state_prep(state);
@@ -283,7 +283,7 @@ acpi_suspend (
ACPI_ENABLE_IRQS();
/* reset firmware waking vector */
- acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0);
+ acpi_set_firmware_waking_vector((acpi_physical_address) 0);
thaw_processes();
return status;
diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c
index c0098d6bca2c..b5e829436be8 100644
--- a/drivers/acpi/tables/tbconvrt.c
+++ b/drivers/acpi/tables/tbconvrt.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbconvrt - ACPI Table conversion utilities
- * $Revision: 45 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table_count
+ * FUNCTION: acpi_tb_get_table_count
*
* PARAMETERS: RSDP - Pointer to the RSDP
* RSDT - Pointer to the RSDT/XSDT
@@ -48,7 +47,7 @@
u32
acpi_tb_get_table_count (
- RSDP_DESCRIPTOR *RSDP,
+ rsdp_descriptor *RSDP,
acpi_table_header *RSDT)
{
u32 pointer_size;
@@ -80,9 +79,9 @@ acpi_tb_get_table_count (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_convert_to_xsdt
+ * FUNCTION: acpi_tb_convert_to_xsdt
*
- * PARAMETERS: Table_info - Info about the RSDT
+ * PARAMETERS: table_info - Info about the RSDT
*
* RETURN: Status
*
@@ -94,7 +93,7 @@ acpi_status
acpi_tb_convert_to_xsdt (
acpi_table_desc *table_info)
{
- ACPI_SIZE table_size;
+ acpi_size table_size;
u32 i;
xsdt_descriptor *new_table;
@@ -104,7 +103,7 @@ acpi_tb_convert_to_xsdt (
/* Compute size of the converted XSDT */
- table_size = ((ACPI_SIZE) acpi_gbl_rsdt_table_count * sizeof (u64)) +
+ table_size = ((acpi_size) acpi_gbl_rsdt_table_count * sizeof (u64)) +
sizeof (acpi_table_header);
/* Allocate an XSDT */
@@ -148,12 +147,12 @@ acpi_tb_convert_to_xsdt (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_convert_fadt1
+ * FUNCTION: acpi_tb_convert_fadt1
*
- * PARAMETERS: Local_fadt - Pointer to new FADT
- * Original_fadt - Pointer to old FADT
+ * PARAMETERS: local_fadt - Pointer to new FADT
+ * original_fadt - Pointer to old FADT
*
- * RETURN: Populates Local_fadt
+ * RETURN: Populates local_fadt
*
* DESCRIPTION: Convert an ACPI 1.0 FADT to common internal format
*
@@ -179,11 +178,11 @@ acpi_tb_convert_fadt1 (
/* Convert table pointers to 64-bit fields */
- ACPI_STORE_ADDRESS (local_fadt->Xfirmware_ctrl, local_fadt->V1_firmware_ctrl);
+ ACPI_STORE_ADDRESS (local_fadt->xfirmware_ctrl, local_fadt->V1_firmware_ctrl);
ACPI_STORE_ADDRESS (local_fadt->Xdsdt, local_fadt->V1_dsdt);
/*
- * System Interrupt Model isn't used in ACPI 2.0 (Local_fadt->Reserved1 = 0;)
+ * System Interrupt Model isn't used in ACPI 2.0 (local_fadt->Reserved1 = 0;)
*/
/*
@@ -215,26 +214,26 @@ acpi_tb_convert_fadt1 (
/*
* Convert the V1.0 block addresses to V2.0 GAS structures
*/
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1a_evt_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1b_evt_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1a_cnt_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1b_cnt_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm2_cnt_blk, local_fadt->pm2_cnt_len, local_fadt->V1_pm2_cnt_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm_tmr_blk, local_fadt->pm_tm_len, local_fadt->V1_pm_tmr_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe0_blk, local_fadt->gpe0_blk_len, local_fadt->V1_gpe0_blk);
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe1_blk, local_fadt->gpe1_blk_len, local_fadt->V1_gpe1_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1a_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1a_evt_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1b_evt_blk, local_fadt->pm1_evt_len, local_fadt->V1_pm1b_evt_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1a_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1a_cnt_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1b_cnt_blk, local_fadt->pm1_cnt_len, local_fadt->V1_pm1b_cnt_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm2_cnt_blk, local_fadt->pm2_cnt_len, local_fadt->V1_pm2_cnt_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm_tmr_blk, local_fadt->pm_tm_len, local_fadt->V1_pm_tmr_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xgpe0_blk, local_fadt->gpe0_blk_len, local_fadt->V1_gpe0_blk);
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xgpe1_blk, local_fadt->gpe1_blk_len, local_fadt->V1_gpe1_blk);
}
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_convert_fadt2
+ * FUNCTION: acpi_tb_convert_fadt2
*
- * PARAMETERS: Local_fadt - Pointer to new FADT
- * Original_fadt - Pointer to old FADT
+ * PARAMETERS: local_fadt - Pointer to new FADT
+ * original_fadt - Pointer to old FADT
*
- * RETURN: Populates Local_fadt
+ * RETURN: Populates local_fadt
*
* DESCRIPTION: Convert an ACPI 2.0 FADT to common internal format.
* Handles optional "X" fields.
@@ -256,58 +255,58 @@ acpi_tb_convert_fadt2 (
* we must selectively expand V1.0 fields if the corresponding X field
* is zero.
*/
- if (!(local_fadt->Xfirmware_ctrl)) {
- ACPI_STORE_ADDRESS (local_fadt->Xfirmware_ctrl, local_fadt->V1_firmware_ctrl);
+ if (!(local_fadt->xfirmware_ctrl)) {
+ ACPI_STORE_ADDRESS (local_fadt->xfirmware_ctrl, local_fadt->V1_firmware_ctrl);
}
if (!(local_fadt->Xdsdt)) {
ACPI_STORE_ADDRESS (local_fadt->Xdsdt, local_fadt->V1_dsdt);
}
- if (!(local_fadt->Xpm1a_evt_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_evt_blk,
+ if (!(local_fadt->xpm1a_evt_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1a_evt_blk,
local_fadt->pm1_evt_len, local_fadt->V1_pm1a_evt_blk);
}
- if (!(local_fadt->Xpm1b_evt_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_evt_blk,
+ if (!(local_fadt->xpm1b_evt_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1b_evt_blk,
local_fadt->pm1_evt_len, local_fadt->V1_pm1b_evt_blk);
}
- if (!(local_fadt->Xpm1a_cnt_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1a_cnt_blk,
+ if (!(local_fadt->xpm1a_cnt_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1a_cnt_blk,
local_fadt->pm1_cnt_len, local_fadt->V1_pm1a_cnt_blk);
}
- if (!(local_fadt->Xpm1b_cnt_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm1b_cnt_blk,
+ if (!(local_fadt->xpm1b_cnt_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm1b_cnt_blk,
local_fadt->pm1_cnt_len, local_fadt->V1_pm1b_cnt_blk);
}
- if (!(local_fadt->Xpm2_cnt_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm2_cnt_blk,
+ if (!(local_fadt->xpm2_cnt_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm2_cnt_blk,
local_fadt->pm2_cnt_len, local_fadt->V1_pm2_cnt_blk);
}
- if (!(local_fadt->Xpm_tmr_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xpm_tmr_blk,
+ if (!(local_fadt->xpm_tmr_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xpm_tmr_blk,
local_fadt->pm_tm_len, local_fadt->V1_pm_tmr_blk);
}
- if (!(local_fadt->Xgpe0_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe0_blk,
+ if (!(local_fadt->xgpe0_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xgpe0_blk,
local_fadt->gpe0_blk_len, local_fadt->V1_gpe0_blk);
}
- if (!(local_fadt->Xgpe1_blk.address)) {
- ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->Xgpe1_blk,
+ if (!(local_fadt->xgpe1_blk.address)) {
+ ASL_BUILD_GAS_FROM_V1_ENTRY (local_fadt->xgpe1_blk,
local_fadt->gpe1_blk_len, local_fadt->V1_gpe1_blk);
}
}
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_convert_table_fadt
+ * FUNCTION: acpi_tb_convert_table_fadt
*
* PARAMETERS: None
*
@@ -328,11 +327,11 @@ acpi_tb_convert_table_fadt (void)
acpi_table_desc *table_desc;
- ACPI_FUNCTION_TRACE ("Tb_convert_table_fadt");
+ ACPI_FUNCTION_TRACE ("tb_convert_table_fadt");
/*
- * Acpi_gbl_FADT is valid
+ * acpi_gbl_FADT is valid
* Allocate and zero the 2.0 FADT buffer
*/
local_fadt = ACPI_MEM_CALLOCATE (sizeof (fadt_descriptor_rev2));
@@ -400,9 +399,9 @@ acpi_tb_convert_table_fadt (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_convert_table_facs
+ * FUNCTION: acpi_tb_convert_table_facs
*
- * PARAMETERS: Table_info - Info for currently installad FACS
+ * PARAMETERS: table_info - Info for currently installad FACS
*
* RETURN: Status
*
@@ -416,7 +415,7 @@ acpi_tb_build_common_facs (
acpi_table_desc *table_info)
{
- ACPI_FUNCTION_TRACE ("Tb_build_common_facs");
+ ACPI_FUNCTION_TRACE ("tb_build_common_facs");
/* Absolute minimum length is 24, but the ACPI spec says 64 */
@@ -437,7 +436,7 @@ acpi_tb_build_common_facs (
if ((acpi_gbl_RSDP->revision < 2) ||
(acpi_gbl_FACS->length < 32) ||
- (!(acpi_gbl_FACS->Xfirmware_waking_vector))) {
+ (!(acpi_gbl_FACS->xfirmware_waking_vector))) {
/* ACPI 1.0 FACS or short table or optional X_ field is zero */
acpi_gbl_common_fACS.firmware_waking_vector = ACPI_CAST_PTR (u64, &(acpi_gbl_FACS->firmware_waking_vector));
@@ -446,7 +445,7 @@ acpi_tb_build_common_facs (
else {
/* ACPI 2.0 FACS with valid X_ field */
- acpi_gbl_common_fACS.firmware_waking_vector = &acpi_gbl_FACS->Xfirmware_waking_vector;
+ acpi_gbl_common_fACS.firmware_waking_vector = &acpi_gbl_FACS->xfirmware_waking_vector;
acpi_gbl_common_fACS.vector_width = 64;
}
diff --git a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c
index 9843d39d8881..7fac9e90e5ca 100644
--- a/drivers/acpi/tables/tbget.c
+++ b/drivers/acpi/tables/tbget.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
- * $Revision: 82 $
*
*****************************************************************************/
@@ -34,11 +33,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table
+ * FUNCTION: acpi_tb_get_table
*
* PARAMETERS: Address - Address of table to retrieve. Can be
* Logical or Physical
- * Table_info - Where table info is returned
+ * table_info - Where table info is returned
*
* RETURN: None
*
@@ -48,14 +47,14 @@
acpi_status
acpi_tb_get_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_desc *table_info)
{
acpi_status status;
acpi_table_header header;
- ACPI_FUNCTION_TRACE ("Tb_get_table");
+ ACPI_FUNCTION_TRACE ("tb_get_table");
/*
@@ -81,11 +80,11 @@ acpi_tb_get_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table_header
+ * FUNCTION: acpi_tb_get_table_header
*
* PARAMETERS: Address - Address of table to retrieve. Can be
* Logical or Physical
- * Return_header - Where the table header is returned
+ * return_header - Where the table header is returned
*
* RETURN: Status
*
@@ -98,19 +97,19 @@ acpi_tb_get_table (
acpi_status
acpi_tb_get_table_header (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *return_header)
{
acpi_status status = AE_OK;
acpi_table_header *header = NULL;
- ACPI_FUNCTION_TRACE ("Tb_get_table_header");
+ ACPI_FUNCTION_TRACE ("tb_get_table_header");
/*
* Flags contains the current processor mode (Virtual or Physical addressing)
- * The Pointer_type is either Logical or Physical
+ * The pointer_type is either Logical or Physical
*/
switch (address->pointer_type) {
case ACPI_PHYSMODE_PHYSPTR:
@@ -156,12 +155,12 @@ acpi_tb_get_table_header (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table_body
+ * FUNCTION: acpi_tb_get_table_body
*
* PARAMETERS: Address - Address of table to retrieve. Can be
* Logical or Physical
* Header - Header of the table to retrieve
- * Table_info - Where the table info is returned
+ * table_info - Where the table info is returned
*
* RETURN: Status
*
@@ -176,14 +175,14 @@ acpi_tb_get_table_header (
acpi_status
acpi_tb_get_table_body (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *header,
acpi_table_desc *table_info)
{
acpi_status status;
- ACPI_FUNCTION_TRACE ("Tb_get_table_body");
+ ACPI_FUNCTION_TRACE ("tb_get_table_body");
if (!table_info || !address) {
@@ -209,10 +208,10 @@ acpi_tb_get_table_body (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_table_override
+ * FUNCTION: acpi_tb_table_override
*
* PARAMETERS: Header - Pointer to table header
- * Table_info - Return info if table is overridden
+ * table_info - Return info if table is overridden
*
* RETURN: None
*
@@ -228,15 +227,15 @@ acpi_tb_table_override (
{
acpi_table_header *new_table;
acpi_status status;
- ACPI_POINTER address;
+ acpi_pointer address;
- ACPI_FUNCTION_TRACE ("Tb_table_override");
+ ACPI_FUNCTION_TRACE ("tb_table_override");
/*
* The OSL will examine the header and decide whether to override this
- * table. If it decides to override, a table will be returned in New_table,
+ * table. If it decides to override, a table will be returned in new_table,
* which we will then copy.
*/
status = acpi_os_table_override (header, &new_table);
@@ -279,12 +278,12 @@ acpi_tb_table_override (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_this_table
+ * FUNCTION: acpi_tb_get_this_table
*
* PARAMETERS: Address - Address of table to retrieve. Can be
* Logical or Physical
* Header - Header of the table to retrieve
- * Table_info - Where the table info is returned
+ * table_info - Where the table info is returned
*
* RETURN: Status
*
@@ -297,7 +296,7 @@ acpi_tb_table_override (
acpi_status
acpi_tb_get_this_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_header *header,
acpi_table_desc *table_info)
{
@@ -306,12 +305,12 @@ acpi_tb_get_this_table (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Tb_get_this_table");
+ ACPI_FUNCTION_TRACE ("tb_get_this_table");
/*
* Flags contains the current processor mode (Virtual or Physical addressing)
- * The Pointer_type is either Logical or Physical
+ * The pointer_type is either Logical or Physical
*/
switch (address->pointer_type) {
case ACPI_PHYSMODE_PHYSPTR:
@@ -342,7 +341,7 @@ acpi_tb_get_this_table (
* Just map the table's physical memory
* into our address space.
*/
- status = acpi_os_map_memory (address->pointer.physical, (ACPI_SIZE) header->length,
+ status = acpi_os_map_memory (address->pointer.physical, (acpi_size) header->length,
(void **) &full_table);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
@@ -384,7 +383,7 @@ acpi_tb_get_this_table (
/* Return values */
table_info->pointer = full_table;
- table_info->length = (ACPI_SIZE) header->length;
+ table_info->length = (acpi_size) header->length;
table_info->allocation = allocation;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
@@ -399,11 +398,11 @@ acpi_tb_get_this_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table_ptr
+ * FUNCTION: acpi_tb_get_table_ptr
*
- * PARAMETERS: Table_type - one of the defined table types
+ * PARAMETERS: table_type - one of the defined table types
* Instance - Which table of this type
- * Table_ptr_loc - pointer to location to place the pointer for
+ * table_ptr_loc - pointer to location to place the pointer for
* return
*
* RETURN: Status
@@ -422,7 +421,7 @@ acpi_tb_get_table_ptr (
u32 i;
- ACPI_FUNCTION_TRACE ("Tb_get_table_ptr");
+ ACPI_FUNCTION_TRACE ("tb_get_table_ptr");
if (!acpi_gbl_DSDT) {
@@ -455,7 +454,7 @@ acpi_tb_get_table_ptr (
/* Walk the list to get the desired table
* Since the if (Instance == 1) check above checked for the
- * first table, setting Table_desc equal to the .Next member
+ * first table, setting table_desc equal to the .Next member
* is actually pointing to the second table. Therefore, we
* need to walk from the 2nd table until we reach the Instance
* that the user is looking for and return its table pointer.
diff --git a/drivers/acpi/tables/tbgetall.c b/drivers/acpi/tables/tbgetall.c
index a5fdf760d416..6f4e494d575f 100644
--- a/drivers/acpi/tables/tbgetall.c
+++ b/drivers/acpi/tables/tbgetall.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbgetall - Get all required ACPI tables
- * $Revision: 4 $
*
*****************************************************************************/
@@ -34,10 +33,10 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_primary_table
+ * FUNCTION: acpi_tb_get_primary_table
*
* PARAMETERS: Address - Physical address of table to retrieve
- * *Table_info - Where the table info is returned
+ * *table_info - Where the table info is returned
*
* RETURN: Status
*
@@ -47,14 +46,14 @@
acpi_status
acpi_tb_get_primary_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_table_desc *table_info)
{
acpi_status status;
acpi_table_header header;
- ACPI_FUNCTION_TRACE ("Tb_get_primary_table");
+ ACPI_FUNCTION_TRACE ("tb_get_primary_table");
/* Ignore a NULL address in the RSDT */
@@ -71,7 +70,7 @@ acpi_tb_get_primary_table (
return_ACPI_STATUS (status);
}
- /* Clear the Table_info */
+ /* Clear the table_info */
ACPI_MEMSET (table_info, 0, sizeof (acpi_table_desc));
@@ -101,10 +100,10 @@ acpi_tb_get_primary_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_secondary_table
+ * FUNCTION: acpi_tb_get_secondary_table
*
* PARAMETERS: Address - Physical address of table to retrieve
- * *Table_info - Where the table info is returned
+ * *table_info - Where the table info is returned
*
* RETURN: Status
*
@@ -114,7 +113,7 @@ acpi_tb_get_primary_table (
acpi_status
acpi_tb_get_secondary_table (
- ACPI_POINTER *address,
+ acpi_pointer *address,
acpi_string signature,
acpi_table_desc *table_info)
{
@@ -122,7 +121,7 @@ acpi_tb_get_secondary_table (
acpi_table_header header;
- ACPI_FUNCTION_TRACE_STR ("Tb_get_secondary_table", signature);
+ ACPI_FUNCTION_TRACE_STR ("tb_get_secondary_table", signature);
/* Get the header in order to match the signature */
@@ -166,7 +165,7 @@ acpi_tb_get_secondary_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_required_tables
+ * FUNCTION: acpi_tb_get_required_tables
*
* PARAMETERS: None
*
@@ -190,10 +189,10 @@ acpi_tb_get_required_tables (
acpi_status status = AE_OK;
u32 i;
acpi_table_desc table_info;
- ACPI_POINTER address;
+ acpi_pointer address;
- ACPI_FUNCTION_TRACE ("Tb_get_required_tables");
+ ACPI_FUNCTION_TRACE ("tb_get_required_tables");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%d ACPI tables in RSDT\n",
acpi_gbl_rsdt_table_count));
@@ -247,7 +246,7 @@ acpi_tb_get_required_tables (
/*
* Get the FACS (Pointed to by the FADT)
*/
- address.pointer.value = acpi_gbl_FADT->Xfirmware_ctrl;
+ address.pointer.value = acpi_gbl_FADT->xfirmware_ctrl;
status = acpi_tb_get_secondary_table (&address, FACS_SIG, &table_info);
if (ACPI_FAILURE (status)) {
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 11b1f930eef5..e59ba8ca1d50 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
- * $Revision: 65 $
*
*****************************************************************************/
@@ -34,15 +33,15 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_match_signature
+ * FUNCTION: acpi_tb_match_signature
*
* PARAMETERS: Signature - Table signature to match
- * Table_info - Return data
+ * table_info - Return data
*
* RETURN: Status
*
* DESCRIPTION: Compare signature against the list of "ACPI-subsystem-owned"
- * tables (DSDT/FADT/SSDT, etc.) Returns the Table_type_iD on match.
+ * tables (DSDT/FADT/SSDT, etc.) Returns the table_type_iD on match.
*
******************************************************************************/
@@ -52,10 +51,10 @@ acpi_tb_match_signature (
acpi_table_desc *table_info,
u8 search_type)
{
- NATIVE_UINT i;
+ acpi_native_uint i;
- ACPI_FUNCTION_TRACE ("Tb_match_signature");
+ ACPI_FUNCTION_TRACE ("tb_match_signature");
/*
@@ -92,9 +91,9 @@ acpi_tb_match_signature (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_install_table
+ * FUNCTION: acpi_tb_install_table
*
- * PARAMETERS: Table_info - Return value from Acpi_tb_get_table_body
+ * PARAMETERS: table_info - Return value from acpi_tb_get_table_body
*
* RETURN: Status
*
@@ -110,7 +109,7 @@ acpi_tb_install_table (
{
acpi_status status;
- ACPI_FUNCTION_TRACE ("Tb_install_table");
+ ACPI_FUNCTION_TRACE ("tb_install_table");
/* Lock tables while installing */
@@ -140,9 +139,9 @@ acpi_tb_install_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_recognize_table
+ * FUNCTION: acpi_tb_recognize_table
*
- * PARAMETERS: Table_info - Return value from Acpi_tb_get_table_body
+ * PARAMETERS: table_info - Return value from acpi_tb_get_table_body
*
* RETURN: Status
*
@@ -167,7 +166,7 @@ acpi_tb_recognize_table (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Tb_recognize_table");
+ ACPI_FUNCTION_TRACE ("tb_recognize_table");
/* Ensure that we have a valid table pointer */
@@ -197,7 +196,7 @@ acpi_tb_recognize_table (
/* Return the table type and length via the info struct */
- table_info->length = (ACPI_SIZE) table_header->length;
+ table_info->length = (acpi_size) table_header->length;
return_ACPI_STATUS (status);
}
@@ -205,10 +204,10 @@ acpi_tb_recognize_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_init_table_descriptor
+ * FUNCTION: acpi_tb_init_table_descriptor
*
- * PARAMETERS: Table_type - The type of the table
- * Table_info - A table info struct
+ * PARAMETERS: table_type - The type of the table
+ * table_info - A table info struct
*
* RETURN: None.
*
@@ -225,7 +224,7 @@ acpi_tb_init_table_descriptor (
acpi_table_desc *table_desc;
- ACPI_FUNCTION_TRACE_U32 ("Tb_init_table_descriptor", table_type);
+ ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
/*
* Install the table into the global data structure
@@ -313,7 +312,7 @@ acpi_tb_init_table_descriptor (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_delete_acpi_tables
+ * FUNCTION: acpi_tb_delete_acpi_tables
*
* PARAMETERS: None.
*
@@ -341,7 +340,7 @@ acpi_tb_delete_acpi_tables (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_delete_acpi_table
+ * FUNCTION: acpi_tb_delete_acpi_table
*
* PARAMETERS: Type - The table type to be deleted
*
@@ -357,7 +356,7 @@ acpi_tb_delete_acpi_table (
acpi_table_type type)
{
- ACPI_FUNCTION_TRACE_U32 ("Tb_delete_acpi_table", type);
+ ACPI_FUNCTION_TRACE_U32 ("tb_delete_acpi_table", type);
if (type > ACPI_TABLE_MAX) {
@@ -408,9 +407,9 @@ acpi_tb_delete_acpi_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_free_acpi_tables_of_type
+ * FUNCTION: acpi_tb_free_acpi_tables_of_type
*
- * PARAMETERS: Table_info - A table info struct
+ * PARAMETERS: table_info - A table info struct
*
* RETURN: None.
*
@@ -428,7 +427,7 @@ acpi_tb_free_acpi_tables_of_type (
u32 i;
- ACPI_FUNCTION_TRACE_PTR ("Tb_free_acpi_tables_of_type", list_head);
+ ACPI_FUNCTION_TRACE_PTR ("tb_free_acpi_tables_of_type", list_head);
/* Get the head of the list */
@@ -450,9 +449,9 @@ acpi_tb_free_acpi_tables_of_type (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_delete_single_table
+ * FUNCTION: acpi_tb_delete_single_table
*
- * PARAMETERS: Table_info - A table info struct
+ * PARAMETERS: table_info - A table info struct
*
* RETURN: None.
*
@@ -496,9 +495,9 @@ acpi_tb_delete_single_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_uninstall_table
+ * FUNCTION: acpi_tb_uninstall_table
*
- * PARAMETERS: Table_info - A table info struct
+ * PARAMETERS: table_info - A table info struct
*
* RETURN: Pointer to the next table in the list (of same type)
*
@@ -515,7 +514,7 @@ acpi_tb_uninstall_table (
acpi_table_desc *next_desc;
- ACPI_FUNCTION_TRACE_PTR ("Acpi_tb_uninstall_table", table_desc);
+ ACPI_FUNCTION_TRACE_PTR ("acpi_tb_uninstall_table", table_desc);
if (!table_desc) {
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index dff7aabdef1f..d93af66cdf2b 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbrsdt - ACPI RSDT table utilities
- * $Revision: 5 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_verify_rsdp
+ * FUNCTION: acpi_tb_verify_rsdp
*
* PARAMETERS: Address - RSDP (Pointer to RSDT)
*
@@ -46,14 +45,14 @@
acpi_status
acpi_tb_verify_rsdp (
- ACPI_POINTER *address)
+ acpi_pointer *address)
{
acpi_table_desc table_info;
acpi_status status;
- RSDP_DESCRIPTOR *rsdp;
+ rsdp_descriptor *rsdp;
- ACPI_FUNCTION_TRACE ("Tb_verify_rsdp");
+ ACPI_FUNCTION_TRACE ("tb_verify_rsdp");
switch (address->pointer_type) {
@@ -66,7 +65,7 @@ acpi_tb_verify_rsdp (
/*
* Obtain access to the RSDP structure
*/
- status = acpi_os_map_memory (address->pointer.physical, sizeof (RSDP_DESCRIPTOR),
+ status = acpi_os_map_memory (address->pointer.physical, sizeof (rsdp_descriptor),
(void **) &rsdp);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
@@ -106,7 +105,7 @@ acpi_tb_verify_rsdp (
/* The RSDP supplied is OK */
table_info.pointer = ACPI_CAST_PTR (acpi_table_header, rsdp);
- table_info.length = sizeof (RSDP_DESCRIPTOR);
+ table_info.length = sizeof (rsdp_descriptor);
table_info.allocation = ACPI_MEM_MAPPED;
/* Save the table pointers and allocation info */
@@ -118,7 +117,7 @@ acpi_tb_verify_rsdp (
/* Save the RSDP in a global for easy access */
- acpi_gbl_RSDP = ACPI_CAST_PTR (RSDP_DESCRIPTOR, table_info.pointer);
+ acpi_gbl_RSDP = ACPI_CAST_PTR (rsdp_descriptor, table_info.pointer);
return_ACPI_STATUS (status);
@@ -126,7 +125,7 @@ acpi_tb_verify_rsdp (
cleanup:
if (acpi_gbl_table_flags & ACPI_PHYSICAL_POINTER) {
- acpi_os_unmap_memory (rsdp, sizeof (RSDP_DESCRIPTOR));
+ acpi_os_unmap_memory (rsdp, sizeof (rsdp_descriptor));
}
return_ACPI_STATUS (status);
}
@@ -134,7 +133,7 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_rsdt_address
+ * FUNCTION: acpi_tb_get_rsdt_address
*
* PARAMETERS: None
*
@@ -147,7 +146,7 @@ cleanup:
void
acpi_tb_get_rsdt_address (
- ACPI_POINTER *out_address)
+ acpi_pointer *out_address)
{
ACPI_FUNCTION_ENTRY ();
@@ -170,9 +169,9 @@ acpi_tb_get_rsdt_address (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_validate_rsdt
+ * FUNCTION: acpi_tb_validate_rsdt
*
- * PARAMETERS: Table_ptr - Addressable pointer to the RSDT.
+ * PARAMETERS: table_ptr - Addressable pointer to the RSDT.
*
* RETURN: Status
*
@@ -187,7 +186,7 @@ acpi_tb_validate_rsdt (
int no_match;
- ACPI_FUNCTION_NAME ("Tb_validate_rsdt");
+ ACPI_FUNCTION_NAME ("tb_validate_rsdt");
/*
@@ -213,7 +212,7 @@ acpi_tb_validate_rsdt (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR,
"RSDT/XSDT signature at %X (%p) is invalid\n",
acpi_gbl_RSDP->rsdt_physical_address,
- (void *) (NATIVE_UINT) acpi_gbl_RSDP->rsdt_physical_address));
+ (void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address));
return (AE_BAD_SIGNATURE);
}
@@ -224,7 +223,7 @@ acpi_tb_validate_rsdt (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_get_table_rsdt
+ * FUNCTION: acpi_tb_get_table_rsdt
*
* PARAMETERS: None
*
@@ -240,10 +239,10 @@ acpi_tb_get_table_rsdt (
{
acpi_table_desc table_info;
acpi_status status;
- ACPI_POINTER address;
+ acpi_pointer address;
- ACPI_FUNCTION_TRACE ("Tb_get_table_rsdt");
+ ACPI_FUNCTION_TRACE ("tb_get_table_rsdt");
/* Get the RSDT/XSDT via the RSDP */
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index e60517151999..3e17a4f867ef 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
- * $Revision: 57 $
*
*****************************************************************************/
@@ -34,13 +33,13 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_handle_to_object
+ * FUNCTION: acpi_tb_handle_to_object
*
- * PARAMETERS: Table_id - Id for which the function is searching
- * Table_desc - Pointer to return the matching table
+ * PARAMETERS: table_id - Id for which the function is searching
+ * table_desc - Pointer to return the matching table
* descriptor.
*
- * RETURN: Search the tables to find one with a matching Table_id and
+ * RETURN: Search the tables to find one with a matching table_id and
* return a pointer to that table descriptor.
*
******************************************************************************/
@@ -54,7 +53,7 @@ acpi_tb_handle_to_object (
acpi_table_desc *list_head;
- ACPI_FUNCTION_NAME ("Tb_handle_to_object");
+ ACPI_FUNCTION_NAME ("tb_handle_to_object");
for (i = 0; i < ACPI_TABLE_MAX; i++) {
@@ -70,16 +69,16 @@ acpi_tb_handle_to_object (
} while (list_head != &acpi_gbl_acpi_tables[i]);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table_id=%X does not exist\n", table_id));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id));
return (AE_BAD_PARAMETER);
}
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_validate_table_header
+ * FUNCTION: acpi_tb_validate_table_header
*
- * PARAMETERS: Table_header - Logical pointer to the table
+ * PARAMETERS: table_header - Logical pointer to the table
*
* RETURN: Status
*
@@ -102,7 +101,7 @@ acpi_tb_validate_table_header (
acpi_name signature;
- ACPI_FUNCTION_NAME ("Tb_validate_table_header");
+ ACPI_FUNCTION_NAME ("tb_validate_table_header");
/* Verify that this is a valid address */
@@ -146,9 +145,9 @@ acpi_tb_validate_table_header (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_verify_table_checksum
+ * FUNCTION: acpi_tb_verify_table_checksum
*
- * PARAMETERS: *Table_header - ACPI table to verify
+ * PARAMETERS: *table_header - ACPI table to verify
*
* RETURN: 8 bit checksum of table
*
@@ -165,7 +164,7 @@ acpi_tb_verify_table_checksum (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Tb_verify_table_checksum");
+ ACPI_FUNCTION_TRACE ("tb_verify_table_checksum");
/* Compute the checksum on the table */
@@ -186,7 +185,7 @@ acpi_tb_verify_table_checksum (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_checksum
+ * FUNCTION: acpi_tb_checksum
*
* PARAMETERS: Buffer - Buffer to checksum
* Length - Size of the buffer
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 99336a9ea1f0..572f948c3bee 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -2,7 +2,6 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
- * $Revision: 60 $
*
*****************************************************************************/
@@ -36,7 +35,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_load_tables
+ * FUNCTION: acpi_load_tables
*
* PARAMETERS: None
*
@@ -50,11 +49,11 @@
acpi_status
acpi_load_tables (void)
{
- ACPI_POINTER rsdp_address;
+ acpi_pointer rsdp_address;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_load_tables");
+ ACPI_FUNCTION_TRACE ("acpi_load_tables");
/* Get the RSDP */
@@ -62,7 +61,7 @@ acpi_load_tables (void)
status = acpi_os_get_root_pointer (ACPI_LOGICAL_ADDRESSING,
&rsdp_address);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_load_tables: Could not get RSDP, %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: Could not get RSDP, %s\n",
acpi_format_exception (status)));
goto error_exit;
}
@@ -73,7 +72,7 @@ acpi_load_tables (void)
status = acpi_tb_verify_rsdp (&rsdp_address);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_load_tables: RSDP Failed validation: %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: RSDP Failed validation: %s\n",
acpi_format_exception (status)));
goto error_exit;
}
@@ -82,7 +81,7 @@ acpi_load_tables (void)
status = acpi_tb_get_table_rsdt ();
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load RSDT: %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: Could not load RSDT: %s\n",
acpi_format_exception (status)));
goto error_exit;
}
@@ -91,7 +90,7 @@ acpi_load_tables (void)
status = acpi_tb_get_required_tables ();
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_load_tables: Error getting required tables (DSDT/FADT/FACS): %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: Error getting required tables (DSDT/FADT/FACS): %s\n",
acpi_format_exception (status)));
goto error_exit;
}
@@ -103,7 +102,7 @@ acpi_load_tables (void)
status = acpi_ns_load_namespace ();
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load namespace: %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: Could not load namespace: %s\n",
acpi_format_exception (status)));
goto error_exit;
}
@@ -112,7 +111,7 @@ acpi_load_tables (void)
error_exit:
- ACPI_REPORT_ERROR (("Acpi_load_tables: Could not load tables: %s\n",
+ ACPI_REPORT_ERROR (("acpi_load_tables: Could not load tables: %s\n",
acpi_format_exception (status)));
return_ACPI_STATUS (status);
@@ -121,9 +120,9 @@ error_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_load_table
+ * FUNCTION: acpi_load_table
*
- * PARAMETERS: Table_ptr - pointer to a buffer containing the entire
+ * PARAMETERS: table_ptr - pointer to a buffer containing the entire
* table to be loaded
*
* RETURN: Status
@@ -141,10 +140,10 @@ acpi_load_table (
{
acpi_status status;
acpi_table_desc table_info;
- ACPI_POINTER address;
+ acpi_pointer address;
- ACPI_FUNCTION_TRACE ("Acpi_load_table");
+ ACPI_FUNCTION_TRACE ("acpi_load_table");
if (!table_ptr) {
@@ -165,7 +164,7 @@ acpi_load_table (
status = acpi_tb_install_table (&table_info);
if (ACPI_FAILURE (status)) {
- /* Free table allocated by Acpi_tb_get_table_body */
+ /* Free table allocated by acpi_tb_get_table_body */
acpi_tb_delete_single_table (&table_info);
return_ACPI_STATUS (status);
@@ -203,9 +202,9 @@ acpi_load_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_unload_table
+ * FUNCTION: acpi_unload_table
*
- * PARAMETERS: Table_type - Type of table to be unloaded
+ * PARAMETERS: table_type - Type of table to be unloaded
*
* RETURN: Status
*
@@ -220,7 +219,7 @@ acpi_unload_table (
acpi_table_desc *list_head;
- ACPI_FUNCTION_TRACE ("Acpi_unload_table");
+ ACPI_FUNCTION_TRACE ("acpi_unload_table");
/* Parameter validation */
@@ -254,13 +253,13 @@ acpi_unload_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_table_header
+ * FUNCTION: acpi_get_table_header
*
- * PARAMETERS: Table_type - one of the defined table types
+ * PARAMETERS: table_type - one of the defined table types
* Instance - the non zero instance of the table, allows
* support for multiple tables of the same type
- * see Acpi_gbl_Acpi_table_flag
- * Out_table_header - pointer to the acpi_table_header if successful
+ * see acpi_gbl_acpi_table_flag
+ * out_table_header - pointer to the acpi_table_header if successful
*
* DESCRIPTION: This function is called to get an ACPI table header. The caller
* supplies an pointer to a data area sufficient to contain an ACPI
@@ -283,7 +282,7 @@ acpi_get_table_header (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_table_header");
+ ACPI_FUNCTION_TRACE ("acpi_get_table_header");
if ((instance == 0) ||
@@ -327,23 +326,23 @@ acpi_get_table_header (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_table
+ * FUNCTION: acpi_get_table
*
- * PARAMETERS: Table_type - one of the defined table types
+ * PARAMETERS: table_type - one of the defined table types
* Instance - the non zero instance of the table, allows
* support for multiple tables of the same type
- * see Acpi_gbl_Acpi_table_flag
- * Ret_buffer - pointer to a structure containing a buffer to
+ * see acpi_gbl_acpi_table_flag
+ * ret_buffer - pointer to a structure containing a buffer to
* receive the table
*
* RETURN: Status
*
* DESCRIPTION: This function is called to get an ACPI table. The caller
- * supplies an Out_buffer large enough to contain the entire ACPI
- * table. The caller should call the Acpi_get_table_header function
+ * supplies an out_buffer large enough to contain the entire ACPI
+ * table. The caller should call the acpi_get_table_header function
* first to determine the buffer size needed. Upon completion
- * the Out_buffer->Length field will indicate the number of bytes
- * copied into the Out_buffer->Buf_ptr buffer. This table will be
+ * the out_buffer->Length field will indicate the number of bytes
+ * copied into the out_buffer->buf_ptr buffer. This table will be
* a complete table including the header.
*
******************************************************************************/
@@ -356,10 +355,10 @@ acpi_get_table (
{
acpi_table_header *tbl_ptr;
acpi_status status;
- ACPI_SIZE table_length;
+ acpi_size table_length;
- ACPI_FUNCTION_TRACE ("Acpi_get_table");
+ ACPI_FUNCTION_TRACE ("acpi_get_table");
/* Parameter validation */
@@ -390,7 +389,7 @@ acpi_get_table (
}
/*
- * Acpi_tb_get_table_ptr will return a NULL pointer if the
+ * acpi_tb_get_table_ptr will return a NULL pointer if the
* table is not loaded.
*/
if (tbl_ptr == NULL) {
@@ -403,10 +402,10 @@ acpi_get_table (
/*
* RSD PTR is the only "table" without a header
*/
- table_length = sizeof (RSDP_DESCRIPTOR);
+ table_length = sizeof (rsdp_descriptor);
}
else {
- table_length = (ACPI_SIZE) tbl_ptr->length;
+ table_length = (acpi_size) tbl_ptr->length;
}
/* Validate/Allocate/Clear caller buffer */
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index 53ef206d43e3..fac93852cdd8 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: tbxfroot - Find the root ACPI table (RSDT)
- * $Revision: 67 $
*
*****************************************************************************/
@@ -34,11 +33,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_find_table
+ * FUNCTION: acpi_tb_find_table
*
* PARAMETERS: Signature - String with ACPI table signature
- * Oem_id - String with the table OEM ID
- * Oem_table_id - String with the OEM Table ID.
+ * oem_id - String with the table OEM ID
+ * oem_table_id - String with the OEM Table ID.
*
* RETURN: Status
*
@@ -58,7 +57,7 @@ acpi_tb_find_table (
acpi_table_header *table;
- ACPI_FUNCTION_TRACE ("Tb_find_table");
+ ACPI_FUNCTION_TRACE ("tb_find_table");
/* Validate string lengths */
@@ -77,7 +76,7 @@ acpi_tb_find_table (
return_ACPI_STATUS (status);
}
- /* Check Oem_id and Oem_table_id */
+ /* Check oem_id and oem_table_id */
if ((oem_id[0] && ACPI_STRCMP (oem_id, table->oem_id)) ||
(oem_table_id[0] && ACPI_STRCMP (oem_table_id, table->oem_table_id))) {
@@ -91,22 +90,22 @@ acpi_tb_find_table (
/*******************************************************************************
*
- * FUNCTION: Acpi_get_firmware_table
+ * FUNCTION: acpi_get_firmware_table
*
* PARAMETERS: Signature - Any ACPI table signature
* Instance - the non zero instance of the table, allows
* support for multiple tables of the same type
* Flags - Physical/Virtual support
- * Ret_buffer - pointer to a structure containing a buffer to
+ * ret_buffer - pointer to a structure containing a buffer to
* receive the table
*
* RETURN: Status
*
* DESCRIPTION: This function is called to get an ACPI table. The caller
- * supplies an Out_buffer large enough to contain the entire ACPI
+ * supplies an out_buffer large enough to contain the entire ACPI
* table. Upon completion
- * the Out_buffer->Length field will indicate the number of bytes
- * copied into the Out_buffer->Buf_ptr buffer. This table will be
+ * the out_buffer->Length field will indicate the number of bytes
+ * copied into the out_buffer->buf_ptr buffer. This table will be
* a complete table including the header.
*
******************************************************************************/
@@ -118,8 +117,8 @@ acpi_get_firmware_table (
u32 flags,
acpi_table_header **table_pointer)
{
- ACPI_POINTER rsdp_address;
- ACPI_POINTER address;
+ acpi_pointer rsdp_address;
+ acpi_pointer address;
acpi_status status;
acpi_table_header header;
acpi_table_desc table_info;
@@ -129,7 +128,7 @@ acpi_get_firmware_table (
u32 j;
- ACPI_FUNCTION_TRACE ("Acpi_get_firmware_table");
+ ACPI_FUNCTION_TRACE ("acpi_get_firmware_table");
/*
@@ -160,7 +159,7 @@ acpi_get_firmware_table (
/* Map and validate the RSDP */
if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
- status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (RSDP_DESCRIPTOR),
+ status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (rsdp_descriptor),
(void **) &acpi_gbl_RSDP);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
@@ -196,7 +195,7 @@ acpi_get_firmware_table (
ACPI_HIDWORD (address.pointer.value),
ACPI_LODWORD (address.pointer.value)));
- /* Insert Processor_mode flags */
+ /* Insert processor_mode flags */
address.pointer_type |= flags;
@@ -264,7 +263,7 @@ acpi_get_firmware_table (
cleanup:
- acpi_os_unmap_memory (rsdt_info.pointer, (ACPI_SIZE) rsdt_info.pointer->length);
+ acpi_os_unmap_memory (rsdt_info.pointer, (acpi_size) rsdt_info.pointer->length);
return_ACPI_STATUS (status);
}
@@ -275,9 +274,9 @@ cleanup:
/*******************************************************************************
*
- * FUNCTION: Acpi_find_root_pointer
+ * FUNCTION: acpi_find_root_pointer
*
- * PARAMETERS: **Rsdp_address - Where to place the RSDP address
+ * PARAMETERS: **rsdp_address - Where to place the RSDP address
* Flags - Logical/Physical addressing
*
* RETURN: Status, Physical address of the RSDP
@@ -289,13 +288,13 @@ cleanup:
acpi_status
acpi_find_root_pointer (
u32 flags,
- ACPI_POINTER *rsdp_address)
+ acpi_pointer *rsdp_address)
{
acpi_table_desc table_info;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_find_root_pointer");
+ ACPI_FUNCTION_TRACE ("acpi_find_root_pointer");
/* Get the RSDP */
@@ -315,9 +314,9 @@ acpi_find_root_pointer (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_scan_memory_for_rsdp
+ * FUNCTION: acpi_tb_scan_memory_for_rsdp
*
- * PARAMETERS: Start_address - Starting pointer for search
+ * PARAMETERS: start_address - Starting pointer for search
* Length - Maximum length to search
*
* RETURN: Pointer to the RSDP if found, otherwise NULL.
@@ -335,7 +334,7 @@ acpi_tb_scan_memory_for_rsdp (
u8 *mem_rover;
- ACPI_FUNCTION_TRACE ("Tb_scan_memory_for_rsdp");
+ ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp");
/* Search from given start addr for the requested length */
@@ -366,18 +365,18 @@ acpi_tb_scan_memory_for_rsdp (
/*******************************************************************************
*
- * FUNCTION: Acpi_tb_find_rsdp
+ * FUNCTION: acpi_tb_find_rsdp
*
- * PARAMETERS: *Table_info - Where the table info is returned
+ * PARAMETERS: *table_info - Where the table info is returned
* Flags - Current memory mode (logical vs.
* physical addressing)
*
* RETURN: Status
*
- * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor
+ * DESCRIPTION: search lower 1_mbyte of memory for the root system descriptor
* pointer structure. If it is found, set *RSDP to point to it.
*
- * NOTE: The RSDP must be either in the first 1_k of the Extended
+ * NOTE: The RSDp must be either in the first 1_k of the Extended
* BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section
* 5.2.2; assertion #421).
*
@@ -394,7 +393,7 @@ acpi_tb_find_rsdp (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Tb_find_rsdp");
+ ACPI_FUNCTION_TRACE ("tb_find_rsdp");
/*
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 80f3785c640b..536d8aa20a89 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1123,8 +1123,10 @@ acpi_thermal_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
- if (acpi_device_dir(device))
+ if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir);
+ acpi_device_dir(device) = NULL;
+ }
return_VALUE(0);
}
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 59c72cb04e44..918e4f969d8e 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utalloc - local cache and memory allocation routines
- * $Revision: 130 $
*
*****************************************************************************/
@@ -32,9 +31,9 @@
/******************************************************************************
*
- * FUNCTION: Acpi_ut_release_to_cache
+ * FUNCTION: acpi_ut_release_to_cache
*
- * PARAMETERS: List_id - Memory list/cache ID
+ * PARAMETERS: list_id - Memory list/cache ID
* Object - The object to be released
*
* RETURN: None
@@ -49,7 +48,7 @@ acpi_ut_release_to_cache (
u32 list_id,
void *object)
{
- ACPI_MEMORY_LIST *cache_info;
+ acpi_memory_list *cache_info;
ACPI_FUNCTION_ENTRY ();
@@ -88,9 +87,9 @@ acpi_ut_release_to_cache (
/******************************************************************************
*
- * FUNCTION: Acpi_ut_acquire_from_cache
+ * FUNCTION: acpi_ut_acquire_from_cache
*
- * PARAMETERS: List_id - Memory list ID
+ * PARAMETERS: list_id - Memory list ID
*
* RETURN: A requested object. NULL if the object could not be
* allocated.
@@ -104,11 +103,11 @@ void *
acpi_ut_acquire_from_cache (
u32 list_id)
{
- ACPI_MEMORY_LIST *cache_info;
+ acpi_memory_list *cache_info;
void *object;
- ACPI_FUNCTION_NAME ("Ut_acquire_from_cache");
+ ACPI_FUNCTION_NAME ("ut_acquire_from_cache");
cache_info = &acpi_gbl_memory_lists[list_id];
@@ -162,9 +161,9 @@ acpi_ut_acquire_from_cache (
/******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_generic_cache
+ * FUNCTION: acpi_ut_delete_generic_cache
*
- * PARAMETERS: List_id - Memory list ID
+ * PARAMETERS: list_id - Memory list ID
*
* RETURN: None
*
@@ -176,7 +175,7 @@ void
acpi_ut_delete_generic_cache (
u32 list_id)
{
- ACPI_MEMORY_LIST *cache_info;
+ acpi_memory_list *cache_info;
char *next;
@@ -198,7 +197,7 @@ acpi_ut_delete_generic_cache (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_validate_buffer
+ * FUNCTION: acpi_ut_validate_buffer
*
* PARAMETERS: Buffer - Buffer descriptor to be validated
*
@@ -239,9 +238,9 @@ acpi_ut_validate_buffer (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_initialize_buffer
+ * FUNCTION: acpi_ut_initialize_buffer
*
- * PARAMETERS: Required_length - Length needed
+ * PARAMETERS: required_length - Length needed
* Buffer - Buffer to be validated
*
* RETURN: Status
@@ -254,7 +253,7 @@ acpi_ut_validate_buffer (
acpi_status
acpi_ut_initialize_buffer (
acpi_buffer *buffer,
- ACPI_SIZE required_length)
+ acpi_size required_length)
{
acpi_status status = AE_OK;
@@ -315,7 +314,7 @@ acpi_ut_initialize_buffer (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_allocate
+ * FUNCTION: acpi_ut_allocate
*
* PARAMETERS: Size - Size of the allocation
* Component - Component type of caller
@@ -330,7 +329,7 @@ acpi_ut_initialize_buffer (
void *
acpi_ut_allocate (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line)
@@ -338,14 +337,14 @@ acpi_ut_allocate (
void *allocation;
- ACPI_FUNCTION_TRACE_U32 ("Ut_allocate", size);
+ ACPI_FUNCTION_TRACE_U32 ("ut_allocate", size);
/* Check for an inadvertent size of zero bytes */
if (!size) {
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_allocate: Attempt to allocate zero bytes\n"));
+ ("ut_allocate: Attempt to allocate zero bytes\n"));
size = 1;
}
@@ -354,7 +353,7 @@ acpi_ut_allocate (
/* Report allocation error */
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_allocate: Could not allocate size %X\n", (u32) size));
+ ("ut_allocate: Could not allocate size %X\n", (u32) size));
return_PTR (NULL);
}
@@ -365,7 +364,7 @@ acpi_ut_allocate (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_callocate
+ * FUNCTION: acpi_ut_callocate
*
* PARAMETERS: Size - Size of the allocation
* Component - Component type of caller
@@ -380,7 +379,7 @@ acpi_ut_allocate (
void *
acpi_ut_callocate (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line)
@@ -388,14 +387,14 @@ acpi_ut_callocate (
void *allocation;
- ACPI_FUNCTION_TRACE_U32 ("Ut_callocate", size);
+ ACPI_FUNCTION_TRACE_U32 ("ut_callocate", size);
/* Check for an inadvertent size of zero bytes */
if (!size) {
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_callocate: Attempt to allocate zero bytes\n"));
+ ("ut_callocate: Attempt to allocate zero bytes\n"));
return_PTR (NULL);
}
@@ -404,7 +403,7 @@ acpi_ut_callocate (
/* Report allocation error */
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_callocate: Could not allocate size %X\n", (u32) size));
+ ("ut_callocate: Could not allocate size %X\n", (u32) size));
return_PTR (NULL);
}
@@ -422,15 +421,15 @@ acpi_ut_callocate (
*
* Each memory allocation is tracked via a doubly linked list. Each
* element contains the caller's component, module name, function name, and
- * line number. Acpi_ut_allocate and Acpi_ut_callocate call
- * Acpi_ut_track_allocation to add an element to the list; deletion
- * occurs in the body of Acpi_ut_free.
+ * line number. acpi_ut_allocate and acpi_ut_callocate call
+ * acpi_ut_track_allocation to add an element to the list; deletion
+ * occurs in the body of acpi_ut_free.
*/
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_allocate_and_track
+ * FUNCTION: acpi_ut_allocate_and_track
*
* PARAMETERS: Size - Size of the allocation
* Component - Component type of caller
@@ -445,7 +444,7 @@ acpi_ut_callocate (
void *
acpi_ut_allocate_and_track (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line)
@@ -476,7 +475,7 @@ acpi_ut_allocate_and_track (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_callocate_and_track
+ * FUNCTION: acpi_ut_callocate_and_track
*
* PARAMETERS: Size - Size of the allocation
* Component - Component type of caller
@@ -491,7 +490,7 @@ acpi_ut_allocate_and_track (
void *
acpi_ut_callocate_and_track (
- ACPI_SIZE size,
+ acpi_size size,
u32 component,
char *module,
u32 line)
@@ -506,7 +505,7 @@ acpi_ut_callocate_and_track (
/* Report allocation error */
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_callocate: Could not allocate size %X\n", (u32) size));
+ ("ut_callocate: Could not allocate size %X\n", (u32) size));
return (NULL);
}
@@ -526,7 +525,7 @@ acpi_ut_callocate_and_track (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_free_and_track
+ * FUNCTION: acpi_ut_free_and_track
*
* PARAMETERS: Allocation - Address of the memory to deallocate
* Component - Component type of caller
@@ -550,12 +549,12 @@ acpi_ut_free_and_track (
acpi_status status;
- ACPI_FUNCTION_TRACE_PTR ("Ut_free", allocation);
+ ACPI_FUNCTION_TRACE_PTR ("ut_free", allocation);
if (NULL == allocation) {
_ACPI_REPORT_ERROR (module, line, component,
- ("Acpi_ut_free: Attempt to delete a NULL address\n"));
+ ("acpi_ut_free: Attempt to delete a NULL address\n"));
return_VOID;
}
@@ -583,7 +582,7 @@ acpi_ut_free_and_track (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_find_allocation
+ * FUNCTION: acpi_ut_find_allocation
*
* PARAMETERS: Allocation - Address of allocated memory
*
@@ -626,11 +625,11 @@ acpi_ut_find_allocation (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_track_allocation
+ * FUNCTION: acpi_ut_track_allocation
*
* PARAMETERS: Allocation - Address of allocated memory
* Size - Size of the allocation
- * Alloc_type - MEM_MALLOC or MEM_CALLOC
+ * alloc_type - MEM_MALLOC or MEM_CALLOC
* Component - Component type of caller
* Module - Source file name of caller
* Line - Line number of caller
@@ -645,18 +644,18 @@ acpi_status
acpi_ut_track_allocation (
u32 list_id,
acpi_debug_mem_block *allocation,
- ACPI_SIZE size,
+ acpi_size size,
u8 alloc_type,
u32 component,
char *module,
u32 line)
{
- ACPI_MEMORY_LIST *mem_list;
+ acpi_memory_list *mem_list;
acpi_debug_mem_block *element;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ut_track_allocation", allocation);
+ ACPI_FUNCTION_TRACE_PTR ("ut_track_allocation", allocation);
if (list_id > ACPI_MEM_LIST_MAX) {
@@ -676,7 +675,7 @@ acpi_ut_track_allocation (
element = acpi_ut_find_allocation (list_id, allocation);
if (element) {
- ACPI_REPORT_ERROR (("Ut_track_allocation: Allocation already present in list! (%p)\n",
+ ACPI_REPORT_ERROR (("ut_track_allocation: Allocation already present in list! (%p)\n",
allocation));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, allocation));
@@ -713,7 +712,7 @@ unlock_and_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_remove_allocation
+ * FUNCTION: acpi_ut_remove_allocation
*
* PARAMETERS: Allocation - Address of allocated memory
* Component - Component type of caller
@@ -734,11 +733,11 @@ acpi_ut_remove_allocation (
char *module,
u32 line)
{
- ACPI_MEMORY_LIST *mem_list;
+ acpi_memory_list *mem_list;
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_remove_allocation");
+ ACPI_FUNCTION_TRACE ("ut_remove_allocation");
if (list_id > ACPI_MEM_LIST_MAX) {
@@ -750,7 +749,7 @@ acpi_ut_remove_allocation (
/* No allocations! */
_ACPI_REPORT_ERROR (module, line, component,
- ("Ut_remove_allocation: Empty allocation list, nothing to free!\n"));
+ ("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
return_ACPI_STATUS (AE_OK);
}
@@ -786,7 +785,7 @@ acpi_ut_remove_allocation (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_dump_allocation_info
+ * FUNCTION: acpi_ut_dump_allocation_info
*
* PARAMETERS:
*
@@ -801,43 +800,43 @@ acpi_ut_dump_allocation_info (
void)
{
/*
- ACPI_MEMORY_LIST *Mem_list;
+ acpi_memory_list *mem_list;
*/
- ACPI_FUNCTION_TRACE ("Ut_dump_allocation_info");
+ ACPI_FUNCTION_TRACE ("ut_dump_allocation_info");
/*
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current allocations",
- Mem_list->Current_count,
- ROUND_UP_TO_1K (Mem_list->Current_size)));
+ mem_list->current_count,
+ ROUND_UP_TO_1K (mem_list->current_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
- Mem_list->Max_concurrent_count,
- ROUND_UP_TO_1K (Mem_list->Max_concurrent_size)));
+ mem_list->max_concurrent_count,
+ ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
- Running_object_count,
- ROUND_UP_TO_1K (Running_object_size)));
+ running_object_count,
+ ROUND_UP_TO_1K (running_object_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
- Running_alloc_count,
- ROUND_UP_TO_1K (Running_alloc_size)));
+ running_alloc_count,
+ ROUND_UP_TO_1K (running_alloc_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current Nodes",
- Acpi_gbl_Current_node_count,
- ROUND_UP_TO_1K (Acpi_gbl_Current_node_size)));
+ acpi_gbl_current_node_count,
+ ROUND_UP_TO_1K (acpi_gbl_current_node_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max Nodes",
- Acpi_gbl_Max_concurrent_node_count,
- ROUND_UP_TO_1K ((Acpi_gbl_Max_concurrent_node_count * sizeof (acpi_namespace_node)))));
+ acpi_gbl_max_concurrent_node_count,
+ ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count * sizeof (acpi_namespace_node)))));
*/
return_VOID;
}
@@ -845,7 +844,7 @@ acpi_ut_dump_allocation_info (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_dump_allocations
+ * FUNCTION: acpi_ut_dump_allocations
*
* PARAMETERS: Component - Component(s) to dump info for.
* Module - Module to dump info for. NULL means all.
@@ -862,11 +861,11 @@ acpi_ut_dump_allocations (
char *module)
{
acpi_debug_mem_block *element;
- ACPI_DESCRIPTOR *descriptor;
+ acpi_descriptor *descriptor;
u32 num_outstanding = 0;
- ACPI_FUNCTION_TRACE ("Ut_dump_allocations");
+ ACPI_FUNCTION_TRACE ("ut_dump_allocations");
/*
@@ -882,7 +881,7 @@ acpi_ut_dump_allocations (
((module == NULL) || (0 == ACPI_STRCMP (module, element->module)))) {
/* Ignore allocated objects that are in a cache */
- descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &element->user_space);
+ descriptor = ACPI_CAST_PTR (acpi_descriptor, &element->user_space);
if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
acpi_os_printf ("%p Len %04X %9.9s-%d ",
descriptor, element->size, element->module,
@@ -892,13 +891,13 @@ acpi_ut_dump_allocations (
switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
case ACPI_DESC_TYPE_OPERAND:
- acpi_os_printf ("Obj_type %12.12s R%hd",
+ acpi_os_printf ("obj_type %12.12s R%hd",
acpi_ut_get_type_name (descriptor->object.common.type),
descriptor->object.common.reference_count);
break;
case ACPI_DESC_TYPE_PARSER:
- acpi_os_printf ("Parse_obj Aml_opcode %04hX",
+ acpi_os_printf ("parse_obj aml_opcode %04hX",
descriptor->op.asl.aml_opcode);
break;
@@ -908,43 +907,43 @@ acpi_ut_dump_allocations (
break;
case ACPI_DESC_TYPE_STATE:
- acpi_os_printf ("Untyped State_obj");
+ acpi_os_printf ("Untyped state_obj");
break;
case ACPI_DESC_TYPE_STATE_UPDATE:
- acpi_os_printf ("UPDATE State_obj");
+ acpi_os_printf ("UPDATE state_obj");
break;
case ACPI_DESC_TYPE_STATE_PACKAGE:
- acpi_os_printf ("PACKAGE State_obj");
+ acpi_os_printf ("PACKAGE state_obj");
break;
case ACPI_DESC_TYPE_STATE_CONTROL:
- acpi_os_printf ("CONTROL State_obj");
+ acpi_os_printf ("CONTROL state_obj");
break;
case ACPI_DESC_TYPE_STATE_RPSCOPE:
- acpi_os_printf ("ROOT-PARSE-SCOPE State_obj");
+ acpi_os_printf ("ROOT-PARSE-SCOPE state_obj");
break;
case ACPI_DESC_TYPE_STATE_PSCOPE:
- acpi_os_printf ("PARSE-SCOPE State_obj");
+ acpi_os_printf ("PARSE-SCOPE state_obj");
break;
case ACPI_DESC_TYPE_STATE_WSCOPE:
- acpi_os_printf ("WALK-SCOPE State_obj");
+ acpi_os_printf ("WALK-SCOPE state_obj");
break;
case ACPI_DESC_TYPE_STATE_RESULT:
- acpi_os_printf ("RESULT State_obj");
+ acpi_os_printf ("RESULT state_obj");
break;
case ACPI_DESC_TYPE_STATE_NOTIFY:
- acpi_os_printf ("NOTIFY State_obj");
+ acpi_os_printf ("NOTIFY state_obj");
break;
case ACPI_DESC_TYPE_STATE_THREAD:
- acpi_os_printf ("THREAD State_obj");
+ acpi_os_printf ("THREAD state_obj");
break;
default:
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index fc2ed6197a01..c31b087904bb 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
- * $Revision: 109 $
*
*****************************************************************************/
@@ -34,11 +33,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_isimple_to_esimple
+ * FUNCTION: acpi_ut_copy_isimple_to_esimple
*
- * PARAMETERS: *Internal_object - Pointer to the object we are examining
+ * PARAMETERS: *internal_object - Pointer to the object we are examining
* *Buffer - Where the object is returned
- * *Space_used - Where the data length is returned
+ * *space_used - Where the data length is returned
*
* RETURN: Status
*
@@ -54,12 +53,12 @@ acpi_ut_copy_isimple_to_esimple (
acpi_operand_object *internal_object,
acpi_object *external_object,
u8 *data_space,
- ACPI_SIZE *buffer_space_used)
+ acpi_size *buffer_space_used)
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ut_copy_isimple_to_esimple");
+ ACPI_FUNCTION_TRACE ("ut_copy_isimple_to_esimple");
*buffer_space_used = 0;
@@ -89,10 +88,10 @@ acpi_ut_copy_isimple_to_esimple (
external_object->string.pointer = (char *) data_space;
external_object->string.length = internal_object->string.length;
- *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD ((ACPI_SIZE) internal_object->string.length + 1);
+ *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD ((acpi_size) internal_object->string.length + 1);
ACPI_MEMCPY ((void *) data_space, (void *) internal_object->string.pointer,
- (ACPI_SIZE) internal_object->string.length + 1);
+ (acpi_size) internal_object->string.length + 1);
break;
@@ -166,9 +165,9 @@ acpi_ut_copy_isimple_to_esimple (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_ielement_to_eelement
+ * FUNCTION: acpi_ut_copy_ielement_to_eelement
*
- * PARAMETERS: ACPI_PKG_CALLBACK
+ * PARAMETERS: acpi_pkg_callback
*
* RETURN: Status
*
@@ -185,7 +184,7 @@ acpi_ut_copy_ielement_to_eelement (
{
acpi_status status = AE_OK;
acpi_pkg_info *info = (acpi_pkg_info *) context;
- ACPI_SIZE object_space;
+ acpi_size object_space;
u32 this_index;
acpi_object *target_object;
@@ -230,7 +229,7 @@ acpi_ut_copy_ielement_to_eelement (
* update the buffer length counter
*/
object_space = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (ACPI_SIZE) target_object->package.count * sizeof (acpi_object));
+ (acpi_size) target_object->package.count * sizeof (acpi_object));
break;
@@ -246,11 +245,11 @@ acpi_ut_copy_ielement_to_eelement (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_ipackage_to_epackage
+ * FUNCTION: acpi_ut_copy_ipackage_to_epackage
*
- * PARAMETERS: *Internal_object - Pointer to the object we are returning
+ * PARAMETERS: *internal_object - Pointer to the object we are returning
* *Buffer - Where the object is returned
- * *Space_used - Where the object length is returned
+ * *space_used - Where the object length is returned
*
* RETURN: Status
*
@@ -259,7 +258,7 @@ acpi_ut_copy_ielement_to_eelement (
*
* The buffer is assumed to have sufficient space for the object.
* The caller must have verified the buffer length needed using the
- * Acpi_ut_get_object_size function before calling this function.
+ * acpi_ut_get_object_size function before calling this function.
*
******************************************************************************/
@@ -267,14 +266,14 @@ static acpi_status
acpi_ut_copy_ipackage_to_epackage (
acpi_operand_object *internal_object,
u8 *buffer,
- ACPI_SIZE *space_used)
+ acpi_size *space_used)
{
acpi_object *external_object;
acpi_status status;
acpi_pkg_info info;
- ACPI_FUNCTION_TRACE ("Ut_copy_ipackage_to_epackage");
+ ACPI_FUNCTION_TRACE ("ut_copy_ipackage_to_epackage");
/*
@@ -298,7 +297,7 @@ acpi_ut_copy_ipackage_to_epackage (
* Leave room for an array of ACPI_OBJECTS in the buffer
* and move the free space past it
*/
- info.length += (ACPI_SIZE) external_object->package.count *
+ info.length += (acpi_size) external_object->package.count *
ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object));
info.free_space += external_object->package.count *
ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object));
@@ -313,10 +312,10 @@ acpi_ut_copy_ipackage_to_epackage (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_iobject_to_eobject
+ * FUNCTION: acpi_ut_copy_iobject_to_eobject
*
- * PARAMETERS: *Internal_object - The internal object to be converted
- * *Buffer_ptr - Where the object is returned
+ * PARAMETERS: *internal_object - The internal object to be converted
+ * *buffer_ptr - Where the object is returned
*
* RETURN: Status
*
@@ -333,7 +332,7 @@ acpi_ut_copy_iobject_to_eobject (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_copy_iobject_to_eobject");
+ ACPI_FUNCTION_TRACE ("ut_copy_iobject_to_eobject");
if (ACPI_GET_OBJECT_TYPE (internal_object) == ACPI_TYPE_PACKAGE) {
@@ -366,10 +365,10 @@ acpi_ut_copy_iobject_to_eobject (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_esimple_to_isimple
+ * FUNCTION: acpi_ut_copy_esimple_to_isimple
*
- * PARAMETERS: *External_object - The external object to be converted
- * *Internal_object - Where the internal object is returned
+ * PARAMETERS: *external_object - The external object to be converted
+ * *internal_object - Where the internal object is returned
*
* RETURN: Status
*
@@ -388,7 +387,7 @@ acpi_ut_copy_esimple_to_isimple (
acpi_operand_object *internal_object;
- ACPI_FUNCTION_TRACE ("Ut_copy_esimple_to_isimple");
+ ACPI_FUNCTION_TRACE ("ut_copy_esimple_to_isimple");
/*
@@ -420,7 +419,7 @@ acpi_ut_copy_esimple_to_isimple (
case ACPI_TYPE_STRING:
internal_object->string.pointer =
- ACPI_MEM_CALLOCATE ((ACPI_SIZE) external_object->string.length + 1);
+ ACPI_MEM_CALLOCATE ((acpi_size) external_object->string.length + 1);
if (!internal_object->string.pointer) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -470,11 +469,11 @@ acpi_ut_copy_esimple_to_isimple (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_epackage_to_ipackage
+ * FUNCTION: acpi_ut_copy_epackage_to_ipackage
*
- * PARAMETERS: *Internal_object - Pointer to the object we are returning
+ * PARAMETERS: *internal_object - Pointer to the object we are returning
* *Buffer - Where the object is returned
- * *Space_used - Where the length of the object is returned
+ * *space_used - Where the length of the object is returned
*
* RETURN: Status
*
@@ -483,7 +482,7 @@ acpi_ut_copy_esimple_to_isimple (
*
* The buffer is assumed to have sufficient space for the object.
* The caller must have verified the buffer length needed using the
- * Acpi_ut_get_object_size function before calling this function.
+ * acpi_ut_get_object_size function before calling this function.
*
******************************************************************************/
@@ -502,7 +501,7 @@ acpi_ut_copy_epackage_to_ipackage (
acpi_object *this_external_obj;
- ACPI_FUNCTION_TRACE ("Ut_copy_epackage_to_ipackage");
+ ACPI_FUNCTION_TRACE ("ut_copy_epackage_to_ipackage");
/*
@@ -527,7 +526,7 @@ acpi_ut_copy_epackage_to_ipackage (
free_space += external_object->package.count * sizeof(acpi_object);
- /* Call Walk_package */
+ /* Call walk_package */
}
@@ -536,10 +535,10 @@ acpi_ut_copy_epackage_to_ipackage (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_eobject_to_iobject
+ * FUNCTION: acpi_ut_copy_eobject_to_iobject
*
- * PARAMETERS: *Internal_object - The external object to be converted
- * *Buffer_ptr - Where the internal object is returned
+ * PARAMETERS: *internal_object - The external object to be converted
+ * *buffer_ptr - Where the internal object is returned
*
* RETURN: Status - the status of the call
*
@@ -555,7 +554,7 @@ acpi_ut_copy_eobject_to_iobject (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_copy_eobject_to_iobject");
+ ACPI_FUNCTION_TRACE ("ut_copy_eobject_to_iobject");
if (external_object->type == ACPI_TYPE_PACKAGE) {
@@ -581,10 +580,10 @@ acpi_ut_copy_eobject_to_iobject (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_simple_object
+ * FUNCTION: acpi_ut_copy_simple_object
*
- * PARAMETERS: Source_desc - The internal object to be copied
- * Dest_desc - New target object
+ * PARAMETERS: source_desc - The internal object to be copied
+ * dest_desc - New target object
*
* RETURN: Status
*
@@ -674,9 +673,9 @@ acpi_ut_copy_simple_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_ielement_to_ielement
+ * FUNCTION: acpi_ut_copy_ielement_to_ielement
*
- * PARAMETERS: ACPI_PKG_CALLBACK
+ * PARAMETERS: acpi_pkg_callback
*
* RETURN: Status
*
@@ -752,7 +751,7 @@ acpi_ut_copy_ielement_to_ielement (
* Create the object array
*/
target_object->package.elements =
- ACPI_MEM_CALLOCATE (((ACPI_SIZE) source_object->package.count + 1) *
+ ACPI_MEM_CALLOCATE (((acpi_size) source_object->package.count + 1) *
sizeof (void *));
if (!target_object->package.elements) {
ACPI_MEM_FREE (target_object);
@@ -781,10 +780,10 @@ acpi_ut_copy_ielement_to_ielement (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_ipackage_to_ipackage
+ * FUNCTION: acpi_ut_copy_ipackage_to_ipackage
*
- * PARAMETERS: *Source_obj - Pointer to the source package object
- * *Dest_obj - Where the internal object is returned
+ * PARAMETERS: *source_obj - Pointer to the source package object
+ * *dest_obj - Where the internal object is returned
*
* RETURN: Status - the status of the call
*
@@ -802,7 +801,7 @@ acpi_ut_copy_ipackage_to_ipackage (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ut_copy_ipackage_to_ipackage");
+ ACPI_FUNCTION_TRACE ("ut_copy_ipackage_to_ipackage");
dest_obj->common.type = ACPI_GET_OBJECT_TYPE (source_obj);
@@ -813,11 +812,11 @@ acpi_ut_copy_ipackage_to_ipackage (
* Create the object array and walk the source package tree
*/
dest_obj->package.elements = ACPI_MEM_CALLOCATE (
- ((ACPI_SIZE) source_obj->package.count + 1) *
+ ((acpi_size) source_obj->package.count + 1) *
sizeof (void *));
if (!dest_obj->package.elements) {
ACPI_REPORT_ERROR (
- ("Aml_build_copy_internal_package_object: Package allocation failure\n"));
+ ("aml_build_copy_internal_package_object: Package allocation failure\n"));
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -839,11 +838,11 @@ acpi_ut_copy_ipackage_to_ipackage (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_copy_iobject_to_iobject
+ * FUNCTION: acpi_ut_copy_iobject_to_iobject
*
- * PARAMETERS: Walk_state - Current walk state
- * Source_desc - The internal object to be copied
- * Dest_desc - Where the copied object is returned
+ * PARAMETERS: walk_state - Current walk state
+ * source_desc - The internal object to be copied
+ * dest_desc - Where the copied object is returned
*
* RETURN: Status
*
@@ -860,7 +859,7 @@ acpi_ut_copy_iobject_to_iobject (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Ut_copy_iobject_to_iobject");
+ ACPI_FUNCTION_TRACE ("ut_copy_iobject_to_iobject");
/* Create the top level object */
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 46ab426a9526..8beff26c5fe2 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utdebug - Debug print routines
- * $Revision: 106 $
*
*****************************************************************************/
@@ -39,7 +38,7 @@ static char *acpi_gbl_fn_exit_str = "----Exit-";
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_init_stack_ptr_trace
+ * FUNCTION: acpi_ut_init_stack_ptr_trace
*
* PARAMETERS: None
*
@@ -62,7 +61,7 @@ acpi_ut_init_stack_ptr_trace (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_track_stack_ptr
+ * FUNCTION: acpi_ut_track_stack_ptr
*
* PARAMETERS: None
*
@@ -76,7 +75,7 @@ void
acpi_ut_track_stack_ptr (
void)
{
- ACPI_SIZE current_sp;
+ acpi_size current_sp;
current_sp = ACPI_PTR_DIFF (&current_sp, NULL);
@@ -93,13 +92,13 @@ acpi_ut_track_stack_ptr (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_debug_print
+ * FUNCTION: acpi_ut_debug_print
*
- * PARAMETERS: Debug_level - Requested debug print level
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: debug_level - Requested debug print level
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
*
* Format - Printf format field
* ... - Optional printf arguments
@@ -164,21 +163,21 @@ acpi_ut_debug_print (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_debug_print_raw
+ * FUNCTION: acpi_ut_debug_print_raw
*
- * PARAMETERS: Requested_debug_level - Requested debug print level
- * Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: requested_debug_level - Requested debug print level
+ * line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Format - Printf format field
* ... - Optional printf arguments
*
* RETURN: None
*
* DESCRIPTION: Print message with no headers. Has same interface as
- * Debug_print so that the same macros can be used.
+ * debug_print so that the same macros can be used.
*
****************************************************************************/
@@ -205,18 +204,18 @@ acpi_ut_debug_print_raw (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_trace
+ * FUNCTION: acpi_ut_trace
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level
+ * set in debug_level
*
****************************************************************************/
@@ -236,19 +235,19 @@ acpi_ut_trace (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_trace_ptr
+ * FUNCTION: acpi_ut_trace_ptr
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Pointer - Pointer to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level
+ * set in debug_level
*
****************************************************************************/
@@ -268,19 +267,19 @@ acpi_ut_trace_ptr (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_trace_str
+ * FUNCTION: acpi_ut_trace_str
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* String - Additional string to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level
+ * set in debug_level
*
****************************************************************************/
@@ -301,19 +300,19 @@ acpi_ut_trace_str (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_trace_u32
+ * FUNCTION: acpi_ut_trace_u32
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Integer - Integer to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level
+ * set in debug_level
*
****************************************************************************/
@@ -334,18 +333,18 @@ acpi_ut_trace_u32 (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_exit
+ * FUNCTION: acpi_ut_exit
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level
+ * set in debug_level
*
****************************************************************************/
@@ -364,19 +363,19 @@ acpi_ut_exit (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_status_exit
+ * FUNCTION: acpi_ut_status_exit
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Status - Exit status code
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level. Prints exit status also.
+ * set in debug_level. Prints exit status also.
*
****************************************************************************/
@@ -404,19 +403,19 @@ acpi_ut_status_exit (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_value_exit
+ * FUNCTION: acpi_ut_value_exit
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level. Prints exit value also.
+ * set in debug_level. Prints exit value also.
*
****************************************************************************/
@@ -437,19 +436,19 @@ acpi_ut_value_exit (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_ptr_exit
+ * FUNCTION: acpi_ut_ptr_exit
*
- * PARAMETERS: Line_number - Caller's line number
- * Dbg_info - Contains:
- * Proc_name - Caller's procedure name
- * Module_name - Caller's module name
- * Component_id - Caller's component ID
+ * PARAMETERS: line_number - Caller's line number
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
- * set in Debug_level. Prints exit value also.
+ * set in debug_level. Prints exit value also.
*
****************************************************************************/
@@ -471,12 +470,12 @@ acpi_ut_ptr_exit (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_dump_buffer
+ * FUNCTION: acpi_ut_dump_buffer
*
* PARAMETERS: Buffer - Buffer to dump
* Count - Amount to dump, in bytes
* Display - BYTE, WORD, DWORD, or QWORD display
- * Component_iD - Caller's component ID
+ * component_iD - Caller's component ID
*
* RETURN: None
*
@@ -491,8 +490,8 @@ acpi_ut_dump_buffer (
u32 display,
u32 component_id)
{
- NATIVE_UINT i = 0;
- NATIVE_UINT j;
+ acpi_native_uint i = 0;
+ acpi_native_uint j;
u32 temp32;
u8 buf_char;
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 10b2797dc39e..22a5aa788528 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: utdelete - object deletion and reference count utilities
- * $Revision: 94 $
*
******************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_internal_obj
+ * FUNCTION: acpi_ut_delete_internal_obj
*
* PARAMETERS: *Object - Pointer to the list to be deleted
*
@@ -54,7 +53,7 @@ acpi_ut_delete_internal_obj (
acpi_operand_object *second_desc;
- ACPI_FUNCTION_TRACE_PTR ("Ut_delete_internal_obj", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_delete_internal_obj", object);
if (!object) {
@@ -152,7 +151,7 @@ acpi_ut_delete_internal_obj (
second_desc = acpi_ns_get_secondary_object (object);
if (second_desc) {
/*
- * Free the Region_context if and only if the handler is one of the
+ * Free the region_context if and only if the handler is one of the
* default handlers -- and therefore, we created the context object
* locally, it was not created by an external caller.
*/
@@ -205,9 +204,9 @@ acpi_ut_delete_internal_obj (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_internal_object_list
+ * FUNCTION: acpi_ut_delete_internal_object_list
*
- * PARAMETERS: *Obj_list - Pointer to the list to be deleted
+ * PARAMETERS: *obj_list - Pointer to the list to be deleted
*
* RETURN: None
*
@@ -223,7 +222,7 @@ acpi_ut_delete_internal_object_list (
acpi_operand_object **internal_obj;
- ACPI_FUNCTION_TRACE ("Ut_delete_internal_object_list");
+ ACPI_FUNCTION_TRACE ("ut_delete_internal_object_list");
/* Walk the null-terminated internal list */
@@ -241,7 +240,7 @@ acpi_ut_delete_internal_object_list (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_update_ref_count
+ * FUNCTION: acpi_ut_update_ref_count
*
* PARAMETERS: *Object - Object whose ref count is to be updated
* Action - What to do
@@ -261,7 +260,7 @@ acpi_ut_update_ref_count (
u16 new_count;
- ACPI_FUNCTION_NAME ("Ut_update_ref_count");
+ ACPI_FUNCTION_NAME ("ut_update_ref_count");
if (!object) {
@@ -348,7 +347,7 @@ acpi_ut_update_ref_count (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_update_object_reference
+ * FUNCTION: acpi_ut_update_object_reference
*
* PARAMETERS: *Object - Increment ref count for this object
* and all sub-objects
@@ -381,7 +380,7 @@ acpi_ut_update_object_reference (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE_PTR ("Ut_update_object_reference", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
/* Ignore a null object ptr */
@@ -544,7 +543,7 @@ error_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_add_reference
+ * FUNCTION: acpi_ut_add_reference
*
* PARAMETERS: *Object - Object whose reference count is to be
* incremented
@@ -560,7 +559,7 @@ acpi_ut_add_reference (
acpi_operand_object *object)
{
- ACPI_FUNCTION_TRACE_PTR ("Ut_add_reference", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_add_reference", object);
/*
@@ -580,7 +579,7 @@ acpi_ut_add_reference (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_remove_reference
+ * FUNCTION: acpi_ut_remove_reference
*
* PARAMETERS: *Object - Object whose ref count will be decremented
*
@@ -595,7 +594,7 @@ acpi_ut_remove_reference (
acpi_operand_object *object)
{
- ACPI_FUNCTION_TRACE_PTR ("Ut_remove_reference", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_remove_reference", object);
/*
* Allow a NULL pointer to be passed in, just ignore it. This saves
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index c86d6a25d158..11716dc3bd2a 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: uteval - Object evaluation
- * $Revision: 44 $
*
*****************************************************************************/
@@ -35,12 +34,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_evaluate_object
+ * FUNCTION: acpi_ut_evaluate_object
*
- * PARAMETERS: Prefix_node - Starting node
+ * PARAMETERS: prefix_node - Starting node
* Path - Path to object from starting node
- * Expected_return_types - Bitmap of allowed return types
- * Return_desc - Where a return value is stored
+ * expected_return_types - Bitmap of allowed return types
+ * return_desc - Where a return value is stored
*
* RETURN: Status
*
@@ -64,7 +63,7 @@ acpi_ut_evaluate_object (
u32 return_btype;
- ACPI_FUNCTION_TRACE ("Ut_evaluate_object");
+ ACPI_FUNCTION_TRACE ("ut_evaluate_object");
/* Evaluate the object/method */
@@ -145,10 +144,10 @@ acpi_ut_evaluate_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_evaluate_numeric_object
+ * FUNCTION: acpi_ut_evaluate_numeric_object
*
- * PARAMETERS: *Object_name - Object name to be evaluated
- * Device_node - Node for the device
+ * PARAMETERS: *object_name - Object name to be evaluated
+ * device_node - Node for the device
* *Address - Where the value is returned
*
* RETURN: Status
@@ -170,7 +169,7 @@ acpi_ut_evaluate_numeric_object (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_evaluate_numeric_object");
+ ACPI_FUNCTION_TRACE ("ut_evaluate_numeric_object");
status = acpi_ut_evaluate_object (device_node, object_name,
@@ -192,9 +191,9 @@ acpi_ut_evaluate_numeric_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_execute_HID
+ * FUNCTION: acpi_ut_execute_HID
*
- * PARAMETERS: Device_node - Node for the device
+ * PARAMETERS: device_node - Node for the device
* *Hid - Where the HID is returned
*
* RETURN: Status
@@ -215,7 +214,7 @@ acpi_ut_execute_HID (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_execute_HID");
+ ACPI_FUNCTION_TRACE ("ut_execute_HID");
status = acpi_ut_evaluate_object (device_node, METHOD_NAME__HID,
@@ -244,9 +243,9 @@ acpi_ut_execute_HID (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_execute_CID
+ * FUNCTION: acpi_ut_execute_CID
*
- * PARAMETERS: Device_node - Node for the device
+ * PARAMETERS: device_node - Node for the device
* *Cid - Where the CID is returned
*
* RETURN: Status
@@ -267,7 +266,7 @@ acpi_ut_execute_CID (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_execute_CID");
+ ACPI_FUNCTION_TRACE ("ut_execute_CID");
status = acpi_ut_evaluate_object (device_node, METHOD_NAME__CID,
@@ -318,9 +317,9 @@ acpi_ut_execute_CID (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_execute_UID
+ * FUNCTION: acpi_ut_execute_UID
*
- * PARAMETERS: Device_node - Node for the device
+ * PARAMETERS: device_node - Node for the device
* *Uid - Where the UID is returned
*
* RETURN: Status
@@ -341,7 +340,7 @@ acpi_ut_execute_UID (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_execute_UID");
+ ACPI_FUNCTION_TRACE ("ut_execute_UID");
status = acpi_ut_evaluate_object (device_node, METHOD_NAME__UID,
@@ -370,9 +369,9 @@ acpi_ut_execute_UID (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_execute_STA
+ * FUNCTION: acpi_ut_execute_STA
*
- * PARAMETERS: Device_node - Node for the device
+ * PARAMETERS: device_node - Node for the device
* *Flags - Where the status flags are returned
*
* RETURN: Status
@@ -393,7 +392,7 @@ acpi_ut_execute_STA (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_execute_STA");
+ ACPI_FUNCTION_TRACE ("ut_execute_STA");
status = acpi_ut_evaluate_object (device_node, METHOD_NAME__STA,
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 8c41980bab79..fe6941745cbe 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 177 $
*
*****************************************************************************/
@@ -34,7 +33,7 @@
/******************************************************************************
*
- * FUNCTION: Acpi_format_exception
+ * FUNCTION: acpi_format_exception
*
* PARAMETERS: Status - The acpi_status code to be formatted
*
@@ -52,7 +51,7 @@ acpi_format_exception (
acpi_status sub_status;
- ACPI_FUNCTION_NAME ("Format_exception");
+ ACPI_FUNCTION_NAME ("format_exception");
sub_status = (status & ~AE_CODE_MASK);
@@ -209,7 +208,7 @@ const u8 acpi_gbl_ns_properties[] =
ACPI_NS_NORMAL, /* 02 String */
ACPI_NS_NORMAL, /* 03 Buffer */
ACPI_NS_NORMAL, /* 04 Package */
- ACPI_NS_NORMAL, /* 05 Field_unit */
+ ACPI_NS_NORMAL, /* 05 field_unit */
ACPI_NS_NEWSCOPE, /* 06 Device */
ACPI_NS_NORMAL, /* 07 Event */
ACPI_NS_NEWSCOPE, /* 08 Method */
@@ -218,12 +217,12 @@ const u8 acpi_gbl_ns_properties[] =
ACPI_NS_NEWSCOPE, /* 11 Power */
ACPI_NS_NEWSCOPE, /* 12 Processor */
ACPI_NS_NEWSCOPE, /* 13 Thermal */
- ACPI_NS_NORMAL, /* 14 Buffer_field */
- ACPI_NS_NORMAL, /* 15 Ddb_handle */
+ ACPI_NS_NORMAL, /* 14 buffer_field */
+ ACPI_NS_NORMAL, /* 15 ddb_handle */
ACPI_NS_NORMAL, /* 16 Debug Object */
- ACPI_NS_NORMAL, /* 17 Def_field */
- ACPI_NS_NORMAL, /* 18 Bank_field */
- ACPI_NS_NORMAL, /* 19 Index_field */
+ ACPI_NS_NORMAL, /* 17 def_field */
+ ACPI_NS_NORMAL, /* 18 bank_field */
+ ACPI_NS_NORMAL, /* 19 index_field */
ACPI_NS_NORMAL, /* 20 Reference */
ACPI_NS_NORMAL, /* 21 Alias */
ACPI_NS_NORMAL, /* 22 Notify */
@@ -245,7 +244,7 @@ static const char acpi_gbl_hex_to_ascii[] =
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_hex_to_ascii_char
+ * FUNCTION: acpi_ut_hex_to_ascii_char
*
* PARAMETERS: Integer - Contains the hex digit
* Position - bit position of the digit within the
@@ -304,7 +303,7 @@ ACPI_TABLE_SUPPORT acpi_gbl_acpi_table_data[NUM_ACPI_TABLES] =
*
******************************************************************************/
-ACPI_BIT_REGISTER_INFO acpi_gbl_bit_register_info[ACPI_NUM_BITREG] =
+acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] =
{
/* Name Parent Register Register Bit Position Register Bit Mask */
@@ -345,7 +344,7 @@ acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_get_region_name
+ * FUNCTION: acpi_ut_get_region_name
*
* PARAMETERS: None.
*
@@ -359,14 +358,14 @@ acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] =
{
- "System_memory",
- "System_iO",
+ "system_memory",
+ "system_iO",
"PCI_Config",
- "Embedded_control",
+ "embedded_control",
"SMBus",
"CMOS",
"PCIBARTarget",
- "Data_table",
+ "data_table",
};
@@ -377,12 +376,12 @@ acpi_ut_get_region_name (
if (space_id >= ACPI_USER_REGION_BEGIN)
{
- return ("User_defined_region");
+ return ("user_defined_region");
}
else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS)
{
- return ("Invalid_space_iD");
+ return ("invalid_space_iD");
}
return ((char *) acpi_gbl_region_types[space_id]);
@@ -391,7 +390,7 @@ acpi_ut_get_region_name (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_get_event_name
+ * FUNCTION: acpi_ut_get_event_name
*
* PARAMETERS: None.
*
@@ -406,10 +405,10 @@ acpi_ut_get_region_name (
static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] =
{
"PM_Timer",
- "Global_lock",
- "Power_button",
- "Sleep_button",
- "Real_time_clock",
+ "global_lock",
+ "power_button",
+ "sleep_button",
+ "real_time_clock",
};
@@ -420,7 +419,7 @@ acpi_ut_get_event_name (
if (event_id > ACPI_EVENT_MAX)
{
- return ("Invalid_event_iD");
+ return ("invalid_event_iD");
}
return ((char *) acpi_gbl_event_types[event_id]);
@@ -429,7 +428,7 @@ acpi_ut_get_event_name (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_get_type_name
+ * FUNCTION: acpi_ut_get_type_name
*
* PARAMETERS: None.
*
@@ -440,7 +439,7 @@ acpi_ut_get_event_name (
****************************************************************************/
/*
- * Elements of Acpi_gbl_Ns_type_names below must match
+ * Elements of acpi_gbl_ns_type_names below must match
* one-to-one with values of acpi_object_type
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when
@@ -458,7 +457,7 @@ static const char *acpi_gbl_ns_type_names[] = /* printable names of AC
/* 02 */ "String",
/* 03 */ "Buffer",
/* 04 */ "Package",
- /* 05 */ "Field_unit",
+ /* 05 */ "field_unit",
/* 06 */ "Device",
/* 07 */ "Event",
/* 08 */ "Method",
@@ -467,18 +466,18 @@ static const char *acpi_gbl_ns_type_names[] = /* printable names of AC
/* 11 */ "Power",
/* 12 */ "Processor",
/* 13 */ "Thermal",
- /* 14 */ "Buffer_field",
- /* 15 */ "Ddb_handle",
- /* 16 */ "Debug_object",
- /* 17 */ "Region_field",
- /* 18 */ "Bank_field",
- /* 19 */ "Index_field",
+ /* 14 */ "buffer_field",
+ /* 15 */ "ddb_handle",
+ /* 16 */ "debug_object",
+ /* 17 */ "region_field",
+ /* 18 */ "bank_field",
+ /* 19 */ "index_field",
/* 20 */ "Reference",
/* 21 */ "Alias",
/* 22 */ "Notify",
- /* 23 */ "Addr_handler",
- /* 24 */ "Resource_desc",
- /* 25 */ "Resource_fld",
+ /* 23 */ "addr_handler",
+ /* 24 */ "resource_desc",
+ /* 25 */ "resource_fld",
/* 26 */ "Scope",
/* 27 */ "Extra",
/* 28 */ "Data",
@@ -523,7 +522,7 @@ acpi_ut_get_object_type_name (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_get_mutex_name
+ * FUNCTION: acpi_ut_get_mutex_name
*
* PARAMETERS: None.
*
@@ -552,7 +551,7 @@ acpi_ut_get_mutex_name (
/*****************************************************************************
*
- * FUNCTION: Acpi_ut_valid_object_type
+ * FUNCTION: acpi_ut_valid_object_type
*
* PARAMETERS: Type - Object type to be validated
*
@@ -580,9 +579,9 @@ acpi_ut_valid_object_type (
/****************************************************************************
*
- * FUNCTION: Acpi_ut_allocate_owner_id
+ * FUNCTION: acpi_ut_allocate_owner_id
*
- * PARAMETERS: Id_type - Type of ID (method or table)
+ * PARAMETERS: id_type - Type of ID (method or table)
*
* DESCRIPTION: Allocate a table or method owner id
*
@@ -595,7 +594,7 @@ acpi_ut_allocate_owner_id (
acpi_owner_id owner_id = 0xFFFF;
- ACPI_FUNCTION_TRACE ("Ut_allocate_owner_id");
+ ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES)))
@@ -639,7 +638,7 @@ acpi_ut_allocate_owner_id (
/****************************************************************************
*
- * FUNCTION: Acpi_ut_init_globals
+ * FUNCTION: acpi_ut_init_globals
*
* PARAMETERS: none
*
@@ -655,11 +654,11 @@ acpi_ut_init_globals (
u32 i;
- ACPI_FUNCTION_TRACE ("Ut_init_globals");
+ ACPI_FUNCTION_TRACE ("ut_init_globals");
/* Memory allocation and cache lists */
- ACPI_MEMSET (acpi_gbl_memory_lists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS);
+ ACPI_MEMSET (acpi_gbl_memory_lists, 0, sizeof (acpi_memory_list) * ACPI_NUM_MEM_LISTS);
acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_generic_state *) NULL)->common.next), NULL);
acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].link_offset = (u16) ACPI_PTR_DIFF (&(((acpi_parse_object *) NULL)->common.next), NULL);
@@ -669,8 +668,8 @@ acpi_ut_init_globals (
acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].object_size = sizeof (acpi_namespace_node);
acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].object_size = sizeof (acpi_generic_state);
- acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].object_size = sizeof (ACPI_PARSE_OBJ_COMMON);
- acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].object_size = sizeof (ACPI_PARSE_OBJ_NAMED);
+ acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].object_size = sizeof (acpi_parse_obj_common);
+ acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].object_size = sizeof (acpi_parse_obj_named);
acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].object_size = sizeof (acpi_operand_object);
acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].object_size = sizeof (acpi_walk_state);
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index 11262490b3b4..def29800cf5e 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utinit - Common ACPI subsystem initialization
- * $Revision: 115 $
*
*****************************************************************************/
@@ -34,12 +33,12 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_fadt_register_error
+ * FUNCTION: acpi_ut_fadt_register_error
*
- * PARAMETERS: *Register_name - Pointer to string identifying register
+ * PARAMETERS: *register_name - Pointer to string identifying register
* Value - Actual register contents value
- * Acpi_test_spec_section - TDS section containing assertion
- * Acpi_assertion - Assertion number being tested
+ * acpi_test_spec_section - TDS section containing assertion
+ * acpi_assertion - Assertion number being tested
*
* RETURN: AE_BAD_VALUE
*
@@ -51,7 +50,7 @@ static void
acpi_ut_fadt_register_error (
char *register_name,
u32 value,
- ACPI_SIZE offset)
+ acpi_size offset)
{
ACPI_REPORT_WARNING (
@@ -62,7 +61,7 @@ acpi_ut_fadt_register_error (
/******************************************************************************
*
- * FUNCTION: Acpi_ut_validate_fadt
+ * FUNCTION: acpi_ut_validate_fadt
*
* PARAMETERS: None
*
@@ -92,22 +91,22 @@ acpi_ut_validate_fadt (
ACPI_FADT_OFFSET (pm1_cnt_len));
}
- if (!acpi_gbl_FADT->Xpm1a_evt_blk.address) {
+ if (!acpi_gbl_FADT->xpm1a_evt_blk.address) {
acpi_ut_fadt_register_error ("X_PM1a_EVT_BLK", 0,
- ACPI_FADT_OFFSET (Xpm1a_evt_blk.address));
+ ACPI_FADT_OFFSET (xpm1a_evt_blk.address));
}
- if (!acpi_gbl_FADT->Xpm1a_cnt_blk.address) {
+ if (!acpi_gbl_FADT->xpm1a_cnt_blk.address) {
acpi_ut_fadt_register_error ("X_PM1a_CNT_BLK", 0,
- ACPI_FADT_OFFSET (Xpm1a_cnt_blk.address));
+ ACPI_FADT_OFFSET (xpm1a_cnt_blk.address));
}
- if (!acpi_gbl_FADT->Xpm_tmr_blk.address) {
+ if (!acpi_gbl_FADT->xpm_tmr_blk.address) {
acpi_ut_fadt_register_error ("X_PM_TMR_BLK", 0,
- ACPI_FADT_OFFSET (Xpm_tmr_blk.address));
+ ACPI_FADT_OFFSET (xpm_tmr_blk.address));
}
- if ((acpi_gbl_FADT->Xpm2_cnt_blk.address &&
+ if ((acpi_gbl_FADT->xpm2_cnt_blk.address &&
!acpi_gbl_FADT->pm2_cnt_len)) {
acpi_ut_fadt_register_error ("PM2_CNT_LEN",
(u32) acpi_gbl_FADT->pm2_cnt_len,
@@ -122,14 +121,14 @@ acpi_ut_validate_fadt (
/* Length of GPE blocks must be a multiple of 2 */
- if (acpi_gbl_FADT->Xgpe0_blk.address &&
+ if (acpi_gbl_FADT->xgpe0_blk.address &&
(acpi_gbl_FADT->gpe0_blk_len & 1)) {
acpi_ut_fadt_register_error ("(x)GPE0_BLK_LEN",
(u32) acpi_gbl_FADT->gpe0_blk_len,
ACPI_FADT_OFFSET (gpe0_blk_len));
}
- if (acpi_gbl_FADT->Xgpe1_blk.address &&
+ if (acpi_gbl_FADT->xgpe1_blk.address &&
(acpi_gbl_FADT->gpe1_blk_len & 1)) {
acpi_ut_fadt_register_error ("(x)GPE1_BLK_LEN",
(u32) acpi_gbl_FADT->gpe1_blk_len,
@@ -142,7 +141,7 @@ acpi_ut_validate_fadt (
/******************************************************************************
*
- * FUNCTION: Acpi_ut_terminate
+ * FUNCTION: acpi_ut_terminate
*
* PARAMETERS: none
*
@@ -156,7 +155,7 @@ void
acpi_ut_terminate (void)
{
- ACPI_FUNCTION_TRACE ("Ut_terminate");
+ ACPI_FUNCTION_TRACE ("ut_terminate");
/* Free global tables, etc. */
@@ -169,7 +168,7 @@ acpi_ut_terminate (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_subsystem_shutdown
+ * FUNCTION: acpi_ut_subsystem_shutdown
*
* PARAMETERS: none
*
@@ -184,7 +183,7 @@ void
acpi_ut_subsystem_shutdown (void)
{
- ACPI_FUNCTION_TRACE ("Ut_subsystem_shutdown");
+ ACPI_FUNCTION_TRACE ("ut_subsystem_shutdown");
/* Just exit if subsystem is already shutdown */
@@ -198,7 +197,7 @@ acpi_ut_subsystem_shutdown (void)
acpi_gbl_shutdown = TRUE;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n"));
- /* Close the Acpi_event Handling */
+ /* Close the acpi_event Handling */
acpi_ev_terminate ();
diff --git a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c
index 708564435aba..aff2c6b1c21f 100644
--- a/drivers/acpi/utilities/utmath.c
+++ b/drivers/acpi/utilities/utmath.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: utmath - Integer math support routines
- * $Revision: 11 $
*
******************************************************************************/
@@ -39,12 +38,12 @@
#ifndef ACPI_USE_NATIVE_DIVIDE
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_short_divide
+ * FUNCTION: acpi_ut_short_divide
*
- * PARAMETERS: In_dividend - Pointer to the dividend
+ * PARAMETERS: in_dividend - Pointer to the dividend
* Divisor - 32-bit divisor
- * Out_quotient - Pointer to where the quotient is returned
- * Out_remainder - Pointer to where the remainder is returned
+ * out_quotient - Pointer to where the quotient is returned
+ * out_remainder - Pointer to where the remainder is returned
*
* RETURN: Status (Checks for divide-by-zero)
*
@@ -66,14 +65,14 @@ acpi_ut_short_divide (
u32 remainder32;
- ACPI_FUNCTION_TRACE ("Ut_short_divide");
+ ACPI_FUNCTION_TRACE ("ut_short_divide");
dividend.full = *in_dividend;
/* Always check for a zero divisor */
if (divisor == 0) {
- ACPI_REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n"));
+ ACPI_REPORT_ERROR (("acpi_ut_short_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
@@ -101,12 +100,12 @@ acpi_ut_short_divide (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_divide
+ * FUNCTION: acpi_ut_divide
*
- * PARAMETERS: In_dividend - Pointer to the dividend
- * In_divisor - Pointer to the divisor
- * Out_quotient - Pointer to where the quotient is returned
- * Out_remainder - Pointer to where the remainder is returned
+ * PARAMETERS: in_dividend - Pointer to the dividend
+ * in_divisor - Pointer to the divisor
+ * out_quotient - Pointer to where the quotient is returned
+ * out_remainder - Pointer to where the remainder is returned
*
* RETURN: Status (Checks for divide-by-zero)
*
@@ -132,13 +131,13 @@ acpi_ut_divide (
uint64_overlay partial3;
- ACPI_FUNCTION_TRACE ("Ut_divide");
+ ACPI_FUNCTION_TRACE ("ut_divide");
/* Always check for a zero divisor */
if (*in_divisor == 0) {
- ACPI_REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n"));
+ ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
@@ -238,9 +237,9 @@ acpi_ut_divide (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_short_divide, Acpi_ut_divide
+ * FUNCTION: acpi_ut_short_divide, acpi_ut_divide
*
- * DESCRIPTION: Native versions of the Ut_divide functions. Use these if either
+ * DESCRIPTION: Native versions of the ut_divide functions. Use these if either
* 1) The target is a 64-bit platform and therefore 64-bit
* integer math is supported directly by the machine.
* 2) The target is a 32-bit or 16-bit platform, and the
@@ -257,13 +256,13 @@ acpi_ut_short_divide (
u32 *out_remainder)
{
- ACPI_FUNCTION_TRACE ("Ut_short_divide");
+ ACPI_FUNCTION_TRACE ("ut_short_divide");
/* Always check for a zero divisor */
if (divisor == 0) {
- ACPI_REPORT_ERROR (("Acpi_ut_short_divide: Divide by zero\n"));
+ ACPI_REPORT_ERROR (("acpi_ut_short_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
@@ -286,13 +285,13 @@ acpi_ut_divide (
acpi_integer *out_quotient,
acpi_integer *out_remainder)
{
- ACPI_FUNCTION_TRACE ("Ut_divide");
+ ACPI_FUNCTION_TRACE ("ut_divide");
/* Always check for a zero divisor */
if (*in_divisor == 0) {
- ACPI_REPORT_ERROR (("Acpi_ut_divide: Divide by zero\n"));
+ ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index ca9c443317cd..003aa4b03f8d 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -1,7 +1,6 @@
/*******************************************************************************
*
* Module Name: utmisc - common utility procedures
- * $Revision: 92 $
*
******************************************************************************/
@@ -34,7 +33,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_print_string
+ * FUNCTION: acpi_ut_print_string
*
* PARAMETERS: String - Null terminated ASCII string
*
@@ -126,7 +125,7 @@ acpi_ut_print_string (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_dword_byte_swap
+ * FUNCTION: acpi_ut_dword_byte_swap
*
* PARAMETERS: Value - Value to be converted
*
@@ -165,7 +164,7 @@ acpi_ut_dword_byte_swap (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_set_integer_width
+ * FUNCTION: acpi_ut_set_integer_width
*
* PARAMETERS: Revision From DSDT header
*
@@ -197,9 +196,9 @@ acpi_ut_set_integer_width (
#ifdef ACPI_DEBUG_OUTPUT
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_display_init_pathname
+ * FUNCTION: acpi_ut_display_init_pathname
*
- * PARAMETERS: Obj_handle - Handle whose pathname will be displayed
+ * PARAMETERS: obj_handle - Handle whose pathname will be displayed
* Path - Additional path string to be appended.
* (NULL if no extra path)
*
@@ -266,7 +265,7 @@ acpi_ut_display_init_pathname (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_valid_acpi_name
+ * FUNCTION: acpi_ut_valid_acpi_name
*
* PARAMETERS: Character - The character to be examined
*
@@ -304,7 +303,7 @@ acpi_ut_valid_acpi_name (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_valid_acpi_character
+ * FUNCTION: acpi_ut_valid_acpi_character
*
* PARAMETERS: Character - The character to be examined
*
@@ -329,7 +328,7 @@ acpi_ut_valid_acpi_character (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_strtoul64
+ * FUNCTION: acpi_ut_strtoul64
*
* PARAMETERS: String - Null terminated string
* Terminater - Where a pointer to the terminating byte is returned
@@ -475,11 +474,11 @@ error_exit:
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_strupr
+ * FUNCTION: acpi_ut_strupr
*
- * PARAMETERS: Src_string - The source string to convert to
+ * PARAMETERS: src_string - The source string to convert to
*
- * RETURN: Src_string
+ * RETURN: src_string
*
* DESCRIPTION: Convert string to uppercase
*
@@ -507,7 +506,7 @@ acpi_ut_strupr (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_mutex_initialize
+ * FUNCTION: acpi_ut_mutex_initialize
*
* PARAMETERS: None.
*
@@ -525,7 +524,7 @@ acpi_ut_mutex_initialize (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Ut_mutex_initialize");
+ ACPI_FUNCTION_TRACE ("ut_mutex_initialize");
/*
@@ -544,7 +543,7 @@ acpi_ut_mutex_initialize (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_mutex_terminate
+ * FUNCTION: acpi_ut_mutex_terminate
*
* PARAMETERS: None.
*
@@ -561,7 +560,7 @@ acpi_ut_mutex_terminate (
u32 i;
- ACPI_FUNCTION_TRACE ("Ut_mutex_terminate");
+ ACPI_FUNCTION_TRACE ("ut_mutex_terminate");
/*
@@ -577,9 +576,9 @@ acpi_ut_mutex_terminate (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_mutex
+ * FUNCTION: acpi_ut_create_mutex
*
- * PARAMETERS: Mutex_iD - ID of the mutex to be created
+ * PARAMETERS: mutex_iD - ID of the mutex to be created
*
* RETURN: Status
*
@@ -589,12 +588,12 @@ acpi_ut_mutex_terminate (
acpi_status
acpi_ut_create_mutex (
- ACPI_MUTEX_HANDLE mutex_id)
+ acpi_mutex_handle mutex_id)
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_U32 ("Ut_create_mutex", mutex_id);
+ ACPI_FUNCTION_TRACE_U32 ("ut_create_mutex", mutex_id);
if (mutex_id > MAX_MTX) {
@@ -614,9 +613,9 @@ acpi_ut_create_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_mutex
+ * FUNCTION: acpi_ut_delete_mutex
*
- * PARAMETERS: Mutex_iD - ID of the mutex to be deleted
+ * PARAMETERS: mutex_iD - ID of the mutex to be deleted
*
* RETURN: Status
*
@@ -626,12 +625,12 @@ acpi_ut_create_mutex (
acpi_status
acpi_ut_delete_mutex (
- ACPI_MUTEX_HANDLE mutex_id)
+ acpi_mutex_handle mutex_id)
{
acpi_status status;
- ACPI_FUNCTION_TRACE_U32 ("Ut_delete_mutex", mutex_id);
+ ACPI_FUNCTION_TRACE_U32 ("ut_delete_mutex", mutex_id);
if (mutex_id > MAX_MTX) {
@@ -649,9 +648,9 @@ acpi_ut_delete_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_acquire_mutex
+ * FUNCTION: acpi_ut_acquire_mutex
*
- * PARAMETERS: Mutex_iD - ID of the mutex to be acquired
+ * PARAMETERS: mutex_iD - ID of the mutex to be acquired
*
* RETURN: Status
*
@@ -661,14 +660,14 @@ acpi_ut_delete_mutex (
acpi_status
acpi_ut_acquire_mutex (
- ACPI_MUTEX_HANDLE mutex_id)
+ acpi_mutex_handle mutex_id)
{
acpi_status status;
u32 i;
u32 this_thread_id;
- ACPI_FUNCTION_NAME ("Ut_acquire_mutex");
+ ACPI_FUNCTION_NAME ("ut_acquire_mutex");
if (mutex_id > MAX_MTX) {
@@ -727,9 +726,9 @@ acpi_ut_acquire_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_release_mutex
+ * FUNCTION: acpi_ut_release_mutex
*
- * PARAMETERS: Mutex_iD - ID of the mutex to be released
+ * PARAMETERS: mutex_iD - ID of the mutex to be released
*
* RETURN: Status
*
@@ -739,14 +738,14 @@ acpi_ut_acquire_mutex (
acpi_status
acpi_ut_release_mutex (
- ACPI_MUTEX_HANDLE mutex_id)
+ acpi_mutex_handle mutex_id)
{
acpi_status status;
u32 i;
u32 this_thread_id;
- ACPI_FUNCTION_NAME ("Ut_release_mutex");
+ ACPI_FUNCTION_NAME ("ut_release_mutex");
this_thread_id = acpi_os_get_thread_id ();
@@ -811,11 +810,11 @@ acpi_ut_release_mutex (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_update_state_and_push
+ * FUNCTION: acpi_ut_create_update_state_and_push
*
* PARAMETERS: *Object - Object to be added to the new state
* Action - Increment/Decrement
- * State_list - List the state will be added to
+ * state_list - List the state will be added to
*
* RETURN: None
*
@@ -853,11 +852,11 @@ acpi_ut_create_update_state_and_push (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_pkg_state_and_push
+ * FUNCTION: acpi_ut_create_pkg_state_and_push
*
* PARAMETERS: *Object - Object to be added to the new state
* Action - Increment/Decrement
- * State_list - List the state will be added to
+ * state_list - List the state will be added to
*
* RETURN: None
*
@@ -890,9 +889,9 @@ acpi_ut_create_pkg_state_and_push (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_push_generic_state
+ * FUNCTION: acpi_ut_push_generic_state
*
- * PARAMETERS: List_head - Head of the state stack
+ * PARAMETERS: list_head - Head of the state stack
* State - State object to push
*
* RETURN: Status
@@ -906,7 +905,7 @@ acpi_ut_push_generic_state (
acpi_generic_state **list_head,
acpi_generic_state *state)
{
- ACPI_FUNCTION_TRACE ("Ut_push_generic_state");
+ ACPI_FUNCTION_TRACE ("ut_push_generic_state");
/* Push the state object onto the front of the list (stack) */
@@ -920,9 +919,9 @@ acpi_ut_push_generic_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_pop_generic_state
+ * FUNCTION: acpi_ut_pop_generic_state
*
- * PARAMETERS: List_head - Head of the state stack
+ * PARAMETERS: list_head - Head of the state stack
*
* RETURN: Status
*
@@ -937,7 +936,7 @@ acpi_ut_pop_generic_state (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE ("Ut_pop_generic_state");
+ ACPI_FUNCTION_TRACE ("ut_pop_generic_state");
/* Remove the state object at the head of the list (stack) */
@@ -955,7 +954,7 @@ acpi_ut_pop_generic_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_generic_state
+ * FUNCTION: acpi_ut_create_generic_state
*
* PARAMETERS: None
*
@@ -989,7 +988,7 @@ acpi_ut_create_generic_state (void)
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_thread_state
+ * FUNCTION: acpi_ut_create_thread_state
*
* PARAMETERS: None
*
@@ -1000,14 +999,14 @@ acpi_ut_create_generic_state (void)
*
******************************************************************************/
-ACPI_THREAD_STATE *
+acpi_thread_state *
acpi_ut_create_thread_state (
void)
{
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE ("Ut_create_thread_state");
+ ACPI_FUNCTION_TRACE ("ut_create_thread_state");
/* Create the generic state object */
@@ -1022,13 +1021,13 @@ acpi_ut_create_thread_state (
state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD;
state->thread.thread_id = acpi_os_get_thread_id ();
- return_PTR ((ACPI_THREAD_STATE *) state);
+ return_PTR ((acpi_thread_state *) state);
}
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_update_state
+ * FUNCTION: acpi_ut_create_update_state
*
* PARAMETERS: Object - Initial Object to be installed in the
* state
@@ -1050,7 +1049,7 @@ acpi_ut_create_update_state (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE_PTR ("Ut_create_update_state", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_create_update_state", object);
/* Create the generic state object */
@@ -1072,7 +1071,7 @@ acpi_ut_create_update_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_pkg_state
+ * FUNCTION: acpi_ut_create_pkg_state
*
* PARAMETERS: Object - Initial Object to be installed in the
* state
@@ -1093,7 +1092,7 @@ acpi_ut_create_pkg_state (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE_PTR ("Ut_create_pkg_state", internal_object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_create_pkg_state", internal_object);
/* Create the generic state object */
@@ -1117,7 +1116,7 @@ acpi_ut_create_pkg_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_control_state
+ * FUNCTION: acpi_ut_create_control_state
*
* PARAMETERS: None
*
@@ -1135,7 +1134,7 @@ acpi_ut_create_control_state (
acpi_generic_state *state;
- ACPI_FUNCTION_TRACE ("Ut_create_control_state");
+ ACPI_FUNCTION_TRACE ("ut_create_control_state");
/* Create the generic state object */
@@ -1156,7 +1155,7 @@ acpi_ut_create_control_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_generic_state
+ * FUNCTION: acpi_ut_delete_generic_state
*
* PARAMETERS: State - The state object to be deleted
*
@@ -1171,7 +1170,7 @@ void
acpi_ut_delete_generic_state (
acpi_generic_state *state)
{
- ACPI_FUNCTION_TRACE ("Ut_delete_generic_state");
+ ACPI_FUNCTION_TRACE ("ut_delete_generic_state");
acpi_ut_release_to_cache (ACPI_MEM_LIST_STATE, state);
@@ -1181,7 +1180,7 @@ acpi_ut_delete_generic_state (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_generic_state_cache
+ * FUNCTION: acpi_ut_delete_generic_state_cache
*
* PARAMETERS: None
*
@@ -1196,7 +1195,7 @@ void
acpi_ut_delete_generic_state_cache (
void)
{
- ACPI_FUNCTION_TRACE ("Ut_delete_generic_state_cache");
+ ACPI_FUNCTION_TRACE ("ut_delete_generic_state_cache");
acpi_ut_delete_generic_cache (ACPI_MEM_LIST_STATE);
@@ -1206,9 +1205,9 @@ acpi_ut_delete_generic_state_cache (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_walk_package_tree
+ * FUNCTION: acpi_ut_walk_package_tree
*
- * PARAMETERS: Obj_desc - The Package object on which to resolve refs
+ * PARAMETERS: obj_desc - The Package object on which to resolve refs
*
* RETURN: Status
*
@@ -1220,7 +1219,7 @@ acpi_status
acpi_ut_walk_package_tree (
acpi_operand_object *source_object,
void *target_object,
- ACPI_PKG_CALLBACK walk_callback,
+ acpi_pkg_callback walk_callback,
void *context)
{
acpi_status status = AE_OK;
@@ -1230,7 +1229,7 @@ acpi_ut_walk_package_tree (
acpi_operand_object *this_source_obj;
- ACPI_FUNCTION_TRACE ("Ut_walk_package_tree");
+ ACPI_FUNCTION_TRACE ("ut_walk_package_tree");
state = acpi_ut_create_pkg_state (source_object, target_object, 0);
@@ -1322,7 +1321,7 @@ acpi_ut_walk_package_tree (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_generate_checksum
+ * FUNCTION: acpi_ut_generate_checksum
*
* PARAMETERS: Buffer - Buffer to be scanned
* Length - number of bytes to examine
@@ -1352,9 +1351,9 @@ acpi_ut_generate_checksum (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_get_resource_end_tag
+ * FUNCTION: acpi_ut_get_resource_end_tag
*
- * PARAMETERS: Obj_desc - The resource template buffer object
+ * PARAMETERS: obj_desc - The resource template buffer object
*
* RETURN: Pointer to the end tag
*
@@ -1405,11 +1404,11 @@ acpi_ut_get_resource_end_tag (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_report_error
+ * FUNCTION: acpi_ut_report_error
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
* Message - Error message to use on failure
*
* RETURN: None
@@ -1432,11 +1431,11 @@ acpi_ut_report_error (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_report_warning
+ * FUNCTION: acpi_ut_report_warning
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
* Message - Error message to use on failure
*
* RETURN: None
@@ -1458,11 +1457,11 @@ acpi_ut_report_warning (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_report_info
+ * FUNCTION: acpi_ut_report_info
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
* Message - Error message to use on failure
*
* RETURN: None
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 2d2f847e4d5f..dab3f6a0e584 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
- * $Revision: 81 $
*
*****************************************************************************/
@@ -35,11 +34,11 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_internal_object_dbg
+ * FUNCTION: acpi_ut_create_internal_object_dbg
*
- * PARAMETERS: Module_name - Source file name of caller
- * Line_number - Line number of caller
- * Component_id - Component type of caller
+ * PARAMETERS: module_name - Source file name of caller
+ * line_number - Line number of caller
+ * component_id - Component type of caller
* Type - ACPI Type of the new object
*
* RETURN: Object - The new object. Null on failure
@@ -65,7 +64,7 @@ acpi_ut_create_internal_object_dbg (
acpi_operand_object *second_object;
- ACPI_FUNCTION_TRACE_STR ("Ut_create_internal_object_dbg", acpi_ut_get_type_name (type));
+ ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg", acpi_ut_get_type_name (type));
/* Allocate the raw object descriptor */
@@ -116,9 +115,9 @@ acpi_ut_create_internal_object_dbg (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_create_buffer_object
+ * FUNCTION: acpi_ut_create_buffer_object
*
- * PARAMETERS: Buffer_size - Size of buffer to be created
+ * PARAMETERS: buffer_size - Size of buffer to be created
*
* RETURN: Pointer to a new Buffer object
*
@@ -128,13 +127,13 @@ acpi_ut_create_internal_object_dbg (
acpi_operand_object *
acpi_ut_create_buffer_object (
- ACPI_SIZE buffer_size)
+ acpi_size buffer_size)
{
acpi_operand_object *buffer_desc;
u8 *buffer;
- ACPI_FUNCTION_TRACE_U32 ("Ut_create_buffer_object", buffer_size);
+ ACPI_FUNCTION_TRACE_U32 ("ut_create_buffer_object", buffer_size);
/*
@@ -149,7 +148,7 @@ acpi_ut_create_buffer_object (
buffer = ACPI_MEM_CALLOCATE (buffer_size);
if (!buffer) {
- ACPI_REPORT_ERROR (("Create_buffer: could not allocate size %X\n",
+ ACPI_REPORT_ERROR (("create_buffer: could not allocate size %X\n",
(u32) buffer_size));
acpi_ut_remove_reference (buffer_desc);
return_PTR (NULL);
@@ -169,7 +168,7 @@ acpi_ut_create_buffer_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_valid_internal_object
+ * FUNCTION: acpi_ut_valid_internal_object
*
* PARAMETERS: Object - Object to be validated
*
@@ -182,7 +181,7 @@ acpi_ut_valid_internal_object (
void *object)
{
- ACPI_FUNCTION_NAME ("Ut_valid_internal_object");
+ ACPI_FUNCTION_NAME ("ut_valid_internal_object");
/* Check for a null pointer */
@@ -233,11 +232,11 @@ acpi_ut_valid_internal_object (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_allocate_object_desc_dbg
+ * FUNCTION: acpi_ut_allocate_object_desc_dbg
*
- * PARAMETERS: Module_name - Caller's module name (for error output)
- * Line_number - Caller's line number (for error output)
- * Component_id - Caller's component ID (for error output)
+ * PARAMETERS: module_name - Caller's module name (for error output)
+ * line_number - Caller's line number (for error output)
+ * component_id - Caller's component ID (for error output)
*
* RETURN: Pointer to newly allocated object descriptor. Null on error
*
@@ -255,7 +254,7 @@ acpi_ut_allocate_object_desc_dbg (
acpi_operand_object *object;
- ACPI_FUNCTION_TRACE ("Ut_allocate_object_desc_dbg");
+ ACPI_FUNCTION_TRACE ("ut_allocate_object_desc_dbg");
object = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_OPERAND);
@@ -279,7 +278,7 @@ acpi_ut_allocate_object_desc_dbg (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_object_desc
+ * FUNCTION: acpi_ut_delete_object_desc
*
* PARAMETERS: Object - An Acpi internal object to be deleted
*
@@ -293,7 +292,7 @@ void
acpi_ut_delete_object_desc (
acpi_operand_object *object)
{
- ACPI_FUNCTION_TRACE_PTR ("Ut_delete_object_desc", object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_delete_object_desc", object);
/* Object must be an acpi_operand_object */
@@ -312,7 +311,7 @@ acpi_ut_delete_object_desc (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_delete_object_cache
+ * FUNCTION: acpi_ut_delete_object_cache
*
* PARAMETERS: None
*
@@ -327,7 +326,7 @@ void
acpi_ut_delete_object_cache (
void)
{
- ACPI_FUNCTION_TRACE ("Ut_delete_object_cache");
+ ACPI_FUNCTION_TRACE ("ut_delete_object_cache");
acpi_ut_delete_generic_cache (ACPI_MEM_LIST_OPERAND);
@@ -337,10 +336,10 @@ acpi_ut_delete_object_cache (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_get_simple_object_size
+ * FUNCTION: acpi_ut_get_simple_object_size
*
- * PARAMETERS: *Internal_object - Pointer to the object we are examining
- * *Obj_length - Where the length is returned
+ * PARAMETERS: *internal_object - Pointer to the object we are examining
+ * *obj_length - Where the length is returned
*
* RETURN: Status
*
@@ -355,13 +354,13 @@ acpi_ut_delete_object_cache (
acpi_status
acpi_ut_get_simple_object_size (
acpi_operand_object *internal_object,
- ACPI_SIZE *obj_length)
+ acpi_size *obj_length)
{
- ACPI_SIZE length;
+ acpi_size length;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR ("Ut_get_simple_object_size", internal_object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object);
/* Handle a null object (Could be a uninitialized package element -- which is legal) */
@@ -391,13 +390,13 @@ acpi_ut_get_simple_object_size (
switch (ACPI_GET_OBJECT_TYPE (internal_object)) {
case ACPI_TYPE_STRING:
- length += (ACPI_SIZE) internal_object->string.length + 1;
+ length += (acpi_size) internal_object->string.length + 1;
break;
case ACPI_TYPE_BUFFER:
- length += (ACPI_SIZE) internal_object->buffer.length;
+ length += (acpi_size) internal_object->buffer.length;
break;
@@ -460,9 +459,9 @@ acpi_ut_get_simple_object_size (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_get_element_length
+ * FUNCTION: acpi_ut_get_element_length
*
- * PARAMETERS: ACPI_PKG_CALLBACK
+ * PARAMETERS: acpi_pkg_callback
*
* RETURN: Status
*
@@ -479,7 +478,7 @@ acpi_ut_get_element_length (
{
acpi_status status = AE_OK;
acpi_pkg_info *info = (acpi_pkg_info *) context;
- ACPI_SIZE object_space;
+ acpi_size object_space;
switch (object_type) {
@@ -520,10 +519,10 @@ acpi_ut_get_element_length (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_get_package_object_size
+ * FUNCTION: acpi_ut_get_package_object_size
*
- * PARAMETERS: *Internal_object - Pointer to the object we are examining
- * *Obj_length - Where the length is returned
+ * PARAMETERS: *internal_object - Pointer to the object we are examining
+ * *obj_length - Where the length is returned
*
* RETURN: Status
*
@@ -538,13 +537,13 @@ acpi_ut_get_element_length (
acpi_status
acpi_ut_get_package_object_size (
acpi_operand_object *internal_object,
- ACPI_SIZE *obj_length)
+ acpi_size *obj_length)
{
acpi_status status;
acpi_pkg_info info;
- ACPI_FUNCTION_TRACE_PTR ("Ut_get_package_object_size", internal_object);
+ ACPI_FUNCTION_TRACE_PTR ("ut_get_package_object_size", internal_object);
info.length = 0;
@@ -563,7 +562,7 @@ acpi_ut_get_package_object_size (
* Round up to the next machine word.
*/
info.length += ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (acpi_object)) *
- (ACPI_SIZE) info.num_packages;
+ (acpi_size) info.num_packages;
/* Return the total package length */
@@ -574,10 +573,10 @@ acpi_ut_get_package_object_size (
/*******************************************************************************
*
- * FUNCTION: Acpi_ut_get_object_size
+ * FUNCTION: acpi_ut_get_object_size
*
- * PARAMETERS: *Internal_object - Pointer to the object we are examining
- * *Obj_length - Where the length will be returned
+ * PARAMETERS: *internal_object - Pointer to the object we are examining
+ * *obj_length - Where the length will be returned
*
* RETURN: Status
*
@@ -589,7 +588,7 @@ acpi_ut_get_package_object_size (
acpi_status
acpi_ut_get_object_size(
acpi_operand_object *internal_object,
- ACPI_SIZE *obj_length)
+ acpi_size *obj_length)
{
acpi_status status;
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index dd120e990aab..04d20ca06988 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Module Name: utxface - External interfaces for "global" ACPI functions
- * $Revision: 100 $
*
*****************************************************************************/
@@ -37,7 +36,7 @@
/*******************************************************************************
*
- * FUNCTION: Acpi_initialize_subsystem
+ * FUNCTION: acpi_initialize_subsystem
*
* PARAMETERS: None
*
@@ -54,7 +53,7 @@ acpi_initialize_subsystem (
{
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_initialize_subsystem");
+ ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem");
ACPI_DEBUG_EXEC (acpi_ut_init_stack_ptr_trace ());
@@ -105,7 +104,7 @@ acpi_initialize_subsystem (
/*******************************************************************************
*
- * FUNCTION: Acpi_enable_subsystem
+ * FUNCTION: acpi_enable_subsystem
*
* PARAMETERS: Flags - Init/enable Options
*
@@ -123,13 +122,13 @@ acpi_enable_subsystem (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_enable_subsystem");
+ ACPI_FUNCTION_TRACE ("acpi_enable_subsystem");
/*
- * Install the default Op_region handlers. These are installed unless
+ * Install the default op_region handlers. These are installed unless
* other handlers have already been installed via the
- * Install_address_space_handler interface
+ * install_address_space_handler interface
*/
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n"));
@@ -163,7 +162,7 @@ acpi_enable_subsystem (
status = acpi_enable ();
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_enable failed.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "acpi_enable failed.\n"));
return_ACPI_STATUS (status);
}
}
@@ -199,7 +198,7 @@ acpi_enable_subsystem (
/*******************************************************************************
*
- * FUNCTION: Acpi_initialize_objects
+ * FUNCTION: acpi_initialize_objects
*
* PARAMETERS: Flags - Init/enable Options
*
@@ -217,7 +216,7 @@ acpi_initialize_objects (
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE ("Acpi_initialize_objects");
+ ACPI_FUNCTION_TRACE ("acpi_initialize_objects");
/*
* Initialize all device objects in the namespace
@@ -234,7 +233,7 @@ acpi_initialize_objects (
/*
* Initialize the objects that remain uninitialized. This
- * runs the executable AML that is part of the declaration of Op_regions
+ * runs the executable AML that is part of the declaration of op_regions
* and Fields.
*/
if (!(flags & ACPI_NO_OBJECT_INIT)) {
@@ -260,7 +259,7 @@ acpi_initialize_objects (
/*******************************************************************************
*
- * FUNCTION: Acpi_terminate
+ * FUNCTION: acpi_terminate
*
* PARAMETERS: None
*
@@ -276,7 +275,7 @@ acpi_terminate (void)
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_terminate");
+ ACPI_FUNCTION_TRACE ("acpi_terminate");
/* Terminate the AML Debugger if present */
@@ -309,7 +308,7 @@ acpi_terminate (void)
/*****************************************************************************
*
- * FUNCTION: Acpi_subsystem_status
+ * FUNCTION: acpi_subsystem_status
*
* PARAMETERS: None
*
@@ -335,20 +334,20 @@ acpi_subsystem_status (void)
/******************************************************************************
*
- * FUNCTION: Acpi_get_system_info
+ * FUNCTION: acpi_get_system_info
*
- * PARAMETERS: Out_buffer - a pointer to a buffer to receive the
+ * PARAMETERS: out_buffer - a pointer to a buffer to receive the
* resources for the device
- * Buffer_length - the number of bytes available in the buffer
+ * buffer_length - the number of bytes available in the buffer
*
* RETURN: Status - the status of the call
*
* DESCRIPTION: This function is called to get information about the current
* state of the ACPI subsystem. It will return system information
- * in the Out_buffer.
+ * in the out_buffer.
*
* If the function fails an appropriate status will be returned
- * and the value of Out_buffer is undefined.
+ * and the value of out_buffer is undefined.
*
******************************************************************************/
@@ -361,7 +360,7 @@ acpi_get_system_info (
acpi_status status;
- ACPI_FUNCTION_TRACE ("Acpi_get_system_info");
+ ACPI_FUNCTION_TRACE ("acpi_get_system_info");
/* Parameter validation */
@@ -424,7 +423,7 @@ acpi_get_system_info (
/*****************************************************************************
*
- * FUNCTION: Acpi_install_initialization_handler
+ * FUNCTION: acpi_install_initialization_handler
*
* PARAMETERS: Handler - Callback procedure
*
@@ -438,7 +437,7 @@ acpi_get_system_info (
acpi_status
acpi_install_initialization_handler (
- ACPI_INIT_HANDLER handler,
+ acpi_init_handler handler,
u32 function)
{
@@ -457,7 +456,7 @@ acpi_install_initialization_handler (
/*****************************************************************************
*
- * FUNCTION: Acpi_purge_cached_objects
+ * FUNCTION: acpi_purge_cached_objects
*
* PARAMETERS: None
*
@@ -470,7 +469,7 @@ acpi_install_initialization_handler (
acpi_status
acpi_purge_cached_objects (void)
{
- ACPI_FUNCTION_TRACE ("Acpi_purge_cached_objects");
+ ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects");
acpi_ut_delete_generic_state_cache ();
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index f26d4442820f..d1d669437fe0 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -346,17 +346,30 @@ typedef struct drm_irq_busid {
} drm_irq_busid_t;
typedef enum {
- _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
- _DRM_VBLANK_RELATIVE = 0x1 /* Wait for given number of vblanks */
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */
} drm_vblank_seq_type_t;
-typedef struct drm_radeon_vbl_wait {
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
drm_vblank_seq_type_t type;
unsigned int sequence;
long tval_sec;
long tval_usec;
-} drm_wait_vblank_t;
+};
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
typedef struct drm_agp_mode {
unsigned long mode;
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 3588e4b886bc..22a4f1fb4c8f 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -487,7 +487,6 @@ typedef struct drm_agp_mem {
typedef struct drm_agp_head {
agp_kern_info agp_info;
- const char *chipset;
drm_agp_mem_t *memory;
unsigned long mode;
int enabled;
@@ -517,6 +516,17 @@ typedef struct drm_map_list {
drm_map_t *map;
} drm_map_list_t;
+#if __HAVE_VBL_IRQ
+
+typedef struct drm_vbl_sig {
+ struct list_head head;
+ unsigned int sequence;
+ struct siginfo info;
+ struct task_struct *task;
+} drm_vbl_sig_t;
+
+#endif
+
typedef struct drm_device {
const char *name; /* Simple driver name */
char *unique; /* Unique identifier: e.g., busid */
@@ -579,6 +589,8 @@ typedef struct drm_device {
#if __HAVE_VBL_IRQ
wait_queue_head_t vbl_queue;
atomic_t vbl_received;
+ spinlock_t vbl_lock;
+ drm_vbl_sig_t vbl_sigs;
#endif
cycles_t ctx_start;
cycles_t lck_start;
@@ -819,6 +831,7 @@ extern void DRM(driver_irq_uninstall)( drm_device_t *dev );
extern int DRM(wait_vblank)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __HAVE_DMA_IRQ_BH
extern void DRM(dma_immediate_bh)( void *dev );
diff --git a/drivers/char/drm/drm_agpsupport.h b/drivers/char/drm/drm_agpsupport.h
index ae14e95354c5..6d6b5911f303 100644
--- a/drivers/char/drm/drm_agpsupport.h
+++ b/drivers/char/drm/drm_agpsupport.h
@@ -260,64 +260,6 @@ drm_agp_head_t *DRM(agp_init)(void)
return NULL;
}
head->memory = NULL;
- switch (head->agp_info.chipset) {
- case INTEL_GENERIC: head->chipset = "Intel"; break;
- case INTEL_LX: head->chipset = "Intel 440LX"; break;
- case INTEL_BX: head->chipset = "Intel 440BX"; break;
- case INTEL_GX: head->chipset = "Intel 440GX"; break;
- case INTEL_I810: head->chipset = "Intel i810"; break;
-
- case INTEL_I815: head->chipset = "Intel i815"; break;
-#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
- case INTEL_I820: head->chipset = "Intel i820"; break;
-#endif
- case INTEL_I840: head->chipset = "Intel i840"; break;
-#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
- case INTEL_I845: head->chipset = "Intel i845"; break;
-#endif
- case INTEL_I850: head->chipset = "Intel i850"; break;
- case INTEL_460GX: head->chipset = "Intel 460GX"; break;
-
- case VIA_GENERIC: head->chipset = "VIA"; break;
- case VIA_VP3: head->chipset = "VIA VP3"; break;
- case VIA_MVP3: head->chipset = "VIA MVP3"; break;
- case VIA_MVP4: head->chipset = "VIA MVP4"; break;
- case VIA_APOLLO_KX133: head->chipset = "VIA Apollo KX133";
- break;
- case VIA_APOLLO_KT133: head->chipset = "VIA Apollo KT133";
- break;
-
- case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro";
- break;
- case SIS_GENERIC: head->chipset = "SiS"; break;
- case AMD_GENERIC: head->chipset = "AMD"; break;
- case AMD_IRONGATE: head->chipset = "AMD Irongate"; break;
- case ALI_GENERIC: head->chipset = "ALi"; break;
- case ALI_M1541: head->chipset = "ALi M1541"; break;
-
-#if LINUX_VERSION_CODE >= 0x020402
- case ALI_M1621: head->chipset = "ALi M1621"; break;
- case ALI_M1631: head->chipset = "ALi M1631"; break;
- case ALI_M1632: head->chipset = "ALi M1632"; break;
- case ALI_M1641: head->chipset = "ALi M1641"; break;
- case ALI_M1644: head->chipset = "ALi M1644"; break;
- case ALI_M1647: head->chipset = "ALi M1647"; break;
- case ALI_M1651: head->chipset = "ALi M1651"; break;
-#endif
-
-#if LINUX_VERSION_CODE >= 0x020406
- case SVWRKS_HE: head->chipset = "Serverworks HE";
- break;
- case SVWRKS_LE: head->chipset = "Serverworks LE";
- break;
- case SVWRKS_GENERIC: head->chipset = "Serverworks Generic";
- break;
-#endif
-
- case HP_ZX1: head->chipset = "HP ZX1"; break;
-
- default: head->chipset = "Unknown"; break;
- }
#if LINUX_VERSION_CODE <= 0x020408
head->cant_use_aperture = 0;
head->page_mask = ~(0xfff);
@@ -325,13 +267,12 @@ drm_agp_head_t *DRM(agp_init)(void)
head->cant_use_aperture = head->agp_info.cant_use_aperture;
head->page_mask = head->agp_info.page_mask;
#endif
-
- DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n",
- head->agp_info.version.major,
- head->agp_info.version.minor,
- head->chipset,
- head->agp_info.aper_base,
- head->agp_info.aper_size);
+
+ DRM_DEBUG("AGP %d.%d, aperture @ 0x%08lx %ZuMB\n",
+ head->agp_info.version.major,
+ head->agp_info.version.minor,
+ head->agp_info.aper_base,
+ head->agp_info.aper_size);
}
return head;
}
diff --git a/drivers/char/drm/drm_dma.h b/drivers/char/drm/drm_dma.h
index 1bbed275744e..d424ddb22714 100644
--- a/drivers/char/drm/drm_dma.h
+++ b/drivers/char/drm/drm_dma.h
@@ -537,6 +537,10 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
#if __HAVE_VBL_IRQ
init_waitqueue_head(&dev->vbl_queue);
+
+ spin_lock_init( &dev->vbl_lock );
+
+ INIT_LIST_HEAD( &dev->vbl_sigs.head );
#endif
/* Before installing handler */
@@ -607,7 +611,8 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
drm_device_t *dev = priv->dev;
drm_wait_vblank_t vblwait;
struct timeval now;
- int ret;
+ int ret = 0;
+ unsigned int flags;
if (!dev->irq)
return -EINVAL;
@@ -615,15 +620,45 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
sizeof(vblwait) );
- if ( vblwait.type == _DRM_VBLANK_RELATIVE ) {
- vblwait.sequence += atomic_read( &dev->vbl_received );
+ switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+ case _DRM_VBLANK_RELATIVE:
+ vblwait.request.sequence += atomic_read( &dev->vbl_received );
+ case _DRM_VBLANK_ABSOLUTE:
+ break;
+ default:
+ return -EINVAL;
}
- ret = DRM(vblank_wait)( dev, &vblwait.sequence );
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+
+ if ( flags & _DRM_VBLANK_SIGNAL ) {
+ unsigned long irqflags;
+ drm_vbl_sig_t *vbl_sig = DRM_MALLOC( sizeof( drm_vbl_sig_t ) );
+
+ if ( !vbl_sig )
+ return -ENOMEM;
+
+ memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
- do_gettimeofday( &now );
- vblwait.tval_sec = now.tv_sec;
- vblwait.tval_usec = now.tv_usec;
+ vbl_sig->sequence = vblwait.request.sequence;
+ vbl_sig->info.si_signo = vblwait.request.signal;
+ vbl_sig->task = current;
+
+ vblwait.reply.sequence = atomic_read( &dev->vbl_received );
+
+ /* Hook signal entry into list */
+ spin_lock_irqsave( &dev->vbl_lock, irqflags );
+
+ list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
+
+ spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
+ } else {
+ ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
+
+ do_gettimeofday( &now );
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+ }
DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
sizeof(vblwait) );
@@ -631,6 +666,33 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
return ret;
}
+void DRM(vbl_send_signals)( drm_device_t *dev )
+{
+ struct list_head *entry, *tmp;
+ drm_vbl_sig_t *vbl_sig;
+ unsigned int vbl_seq = atomic_read( &dev->vbl_received );
+ unsigned long flags;
+
+ spin_lock_irqsave( &dev->vbl_lock, flags );
+
+ list_for_each_safe( entry, tmp, &dev->vbl_sigs.head ) {
+
+ vbl_sig = (drm_vbl_sig_t *) entry;
+
+ if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
+
+ vbl_sig->info.si_code = atomic_read( &dev->vbl_received );
+ send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
+
+ list_del( entry );
+
+ DRM_FREE( entry );
+ }
+ }
+
+ spin_unlock_irqrestore( &dev->vbl_lock, flags );
+}
+
#endif /* __HAVE_VBL_IRQ */
#else
diff --git a/drivers/char/drm/drm_vm.h b/drivers/char/drm/drm_vm.h
index f6e7ddc01d86..683c085716d2 100644
--- a/drivers/char/drm/drm_vm.h
+++ b/drivers/char/drm/drm_vm.h
@@ -408,7 +408,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
vma->vm_flags &= VM_MAYWRITE;
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
#else
/* Ye gads this is ugly. With more thought
@@ -435,7 +435,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
case _DRM_FRAME_BUFFER:
case _DRM_REGISTERS:
if (VM_OFFSET(vma) >= __pa(high_memory)) {
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;
diff --git a/drivers/char/drm/mga_irq.c b/drivers/char/drm/mga_irq.c
index 568d193ff5b6..28e9a262dabf 100644
--- a/drivers/char/drm/mga_irq.c
+++ b/drivers/char/drm/mga_irq.c
@@ -50,6 +50,7 @@ void mga_dma_service( DRM_IRQ_ARGS )
MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
}
}
@@ -64,7 +65,7 @@ int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
*/
DRM_WAIT_ON( ret, dev->vbl_queue, 3*DRM_HZ,
( ( ( cur_vblank = atomic_read(&dev->vbl_received ) )
- + ~*sequence + 1 ) <= (1<<23) ) );
+ - *sequence ) <= (1<<23) ) );
*sequence = cur_vblank;
diff --git a/drivers/char/drm/r128.h b/drivers/char/drm/r128.h
index cdf18ffbf067..29b26cd2dee3 100644
--- a/drivers/char/drm/r128.h
+++ b/drivers/char/drm/r128.h
@@ -71,7 +71,7 @@
[DRM_IOCTL_NR(DRM_IOCTL_R128_DEPTH)] = { r128_cce_depth, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_R128_STIPPLE)] = { r128_cce_stipple, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_R128_INDIRECT)] = { r128_cce_indirect, 1, 1 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_R128_GETPARAM)] = { r128_getparam, 1, 1 },
+ [DRM_IOCTL_NR(DRM_IOCTL_R128_GETPARAM)] = { r128_getparam, 1, 0 },
/* Driver customization:
*/
diff --git a/drivers/char/drm/r128_irq.c b/drivers/char/drm/r128_irq.c
index a29a81b52b42..bfc30405d4fd 100644
--- a/drivers/char/drm/r128_irq.c
+++ b/drivers/char/drm/r128_irq.c
@@ -50,6 +50,7 @@ void r128_dma_service( DRM_IRQ_ARGS )
R128_WRITE( R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
}
}
@@ -64,7 +65,7 @@ int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
*/
DRM_WAIT_ON( ret, dev->vbl_queue, 3*DRM_HZ,
( ( ( cur_vblank = atomic_read(&dev->vbl_received ) )
- + ~*sequence + 1 ) <= (1<<23) ) );
+ - *sequence ) <= (1<<23) ) );
*sequence = cur_vblank;
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index c0fb63ef1812..7c869c02980e 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1497,7 +1497,7 @@ drm_buf_t *radeon_freelist_get( drm_device_t *dev )
}
}
- DRM_ERROR( "returning NULL!\n" );
+ DRM_DEBUG( "returning NULL!\n" );
return NULL;
}
#if 0
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index 54702bee63ac..c5cd61c5bd22 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -70,13 +70,12 @@ void DRM(dma_service)( DRM_IRQ_ARGS )
DRM_WAKEUP( &dev_priv->swi_queue );
}
-#if __HAVE_VBL_IRQ
/* VBLANK interrupt */
if (stat & RADEON_CRTC_VBLANK_STAT) {
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
}
-#endif
/* Acknowledge all the bits in GEN_INT_STATUS -- seem to get
* more than we asked for...
@@ -138,7 +137,6 @@ int radeon_emit_and_wait_irq(drm_device_t *dev)
}
-#if __HAVE_VBL_IRQ
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
{
drm_radeon_private_t *dev_priv =
@@ -161,13 +159,12 @@ int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
*/
DRM_WAIT_ON( ret, dev->vbl_queue, 3*DRM_HZ,
( ( ( cur_vblank = atomic_read(&dev->vbl_received ) )
- + ~*sequence + 1 ) <= (1<<23) ) );
+ - *sequence ) <= (1<<23) ) );
*sequence = cur_vblank;
return ret;
}
-#endif
/* Needs the lock as it touches the ring.
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 7b480a7e9125..1fe007b30bd7 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -1074,19 +1074,30 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
const u8 *data;
int size, dwords, tex_width, blit_width;
u32 y, height;
- int ret = 0, i;
+ int i;
RING_LOCALS;
dev_priv->stats.boxes |= RADEON_BOX_TEXTURE_LOAD;
- /* FIXME: Be smarter about this...
+ /* Flush the pixel cache. This ensures no pixel data gets mixed
+ * up with the texture data from the host data blit, otherwise
+ * part of the texture image may be corrupted.
*/
- buf = radeon_freelist_get( dev );
- if ( !buf ) return DRM_ERR(EAGAIN);
+ BEGIN_RING( 4 );
+ RADEON_FLUSH_CACHE();
+ RADEON_WAIT_UNTIL_IDLE();
+ ADVANCE_RING();
+
+#ifdef __BIG_ENDIAN
+ /* The Mesa texture functions provide the data in little endian as the
+ * chip wants it, but we need to compensate for the fact that the CP
+ * ring gets byte-swapped
+ */
+ BEGIN_RING( 2 );
+ OUT_RING_REG( RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_32BIT );
+ ADVANCE_RING();
+#endif
- DRM_DEBUG( "tex: ofs=0x%x p=%d f=%d x=%hd y=%hd w=%hd h=%hd\n",
- tex->offset >> 10, tex->pitch, tex->format,
- image->x, image->y, image->width, image->height );
/* The compiler won't optimize away a division by a variable,
* even if the only legal values are powers of two. Thus, we'll
@@ -1120,127 +1131,113 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
return DRM_ERR(EINVAL);
}
- DRM_DEBUG( " tex=%dx%d blit=%d\n",
- tex_width, tex->height, blit_width );
-
- /* Flush the pixel cache. This ensures no pixel data gets mixed
- * up with the texture data from the host data blit, otherwise
- * part of the texture image may be corrupted.
- */
- BEGIN_RING( 4 );
-
- RADEON_FLUSH_CACHE();
- RADEON_WAIT_UNTIL_IDLE();
-
- ADVANCE_RING();
-
-#ifdef __BIG_ENDIAN
- /* The Mesa texture functions provide the data in little endian as the
- * chip wants it, but we need to compensate for the fact that the CP
- * ring gets byte-swapped
- */
- BEGIN_RING( 2 );
- OUT_RING_REG( RADEON_RBBM_GUICNTL, RADEON_HOST_DATA_SWAP_32BIT );
- ADVANCE_RING();
-#endif
-
- /* Make a copy of the parameters in case we have to update them
- * for a multi-pass texture blit.
- */
- y = image->y;
- height = image->height;
- data = (const u8 *)image->data;
-
- size = height * blit_width;
+ DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width );
- if ( size > RADEON_MAX_TEXTURE_SIZE ) {
- /* Texture image is too large, do a multipass upload */
- ret = DRM_ERR(EAGAIN);
+ do {
+ DRM_DEBUG( "tex: ofs=0x%x p=%d f=%d x=%hd y=%hd w=%hd h=%hd\n",
+ tex->offset >> 10, tex->pitch, tex->format,
+ image->x, image->y, image->width, image->height );
- /* Adjust the blit size to fit the indirect buffer */
- height = RADEON_MAX_TEXTURE_SIZE / blit_width;
+ /* Make a copy of the parameters in case we have to
+ * update them for a multi-pass texture blit.
+ */
+ y = image->y;
+ height = image->height;
+ data = (const u8 *)image->data;
+
size = height * blit_width;
+ if ( size > RADEON_MAX_TEXTURE_SIZE ) {
+ height = RADEON_MAX_TEXTURE_SIZE / blit_width;
+ size = height * blit_width;
+ } else if ( size < 4 && size > 0 ) {
+ size = 4;
+ } else if ( size == 0 ) {
+ return 0;
+ }
+
/* Update the input parameters for next time */
image->y += height;
image->height -= height;
- image->data = (const char *)image->data + size;
+ image->data += size;
- if ( DRM_COPY_TO_USER( tex->image, image, sizeof(*image) ) ) {
- DRM_ERROR( "EFAULT on tex->image\n" );
- return DRM_ERR(EFAULT);
+ buf = radeon_freelist_get( dev );
+ if ( 0 && !buf ) {
+ radeon_do_cp_idle( dev_priv );
+ buf = radeon_freelist_get( dev );
+ }
+ if ( !buf ) {
+ DRM_DEBUG("radeon_cp_dispatch_texture: EAGAIN\n");
+ DRM_COPY_TO_USER( tex->image, image, sizeof(*image) );
+ return DRM_ERR(EAGAIN);
}
- } else if ( size < 4 && size > 0 ) {
- size = 4;
- }
- dwords = size / 4;
- /* Dispatch the indirect buffer.
- */
- buffer = (u32 *)((char *)dev_priv->buffers->handle + buf->offset);
-
- buffer[0] = CP_PACKET3( RADEON_CNTL_HOSTDATA_BLT, dwords + 6 );
- buffer[1] = (RADEON_GMC_DST_PITCH_OFFSET_CNTL |
- RADEON_GMC_BRUSH_NONE |
- (format << 8) |
- RADEON_GMC_SRC_DATATYPE_COLOR |
- RADEON_ROP3_S |
- RADEON_DP_SRC_SOURCE_HOST_DATA |
- RADEON_GMC_CLR_CMP_CNTL_DIS |
- RADEON_GMC_WR_MSK_DIS);
-
- buffer[2] = (tex->pitch << 22) | (tex->offset >> 10);
- buffer[3] = 0xffffffff;
- buffer[4] = 0xffffffff;
- buffer[5] = (y << 16) | image->x;
- buffer[6] = (height << 16) | image->width;
- buffer[7] = dwords;
-
- buffer += 8;
-
- if ( tex_width >= 32 ) {
- /* Texture image width is larger than the minimum, so we
- * can upload it directly.
- */
- if ( DRM_COPY_FROM_USER( buffer, data, dwords * sizeof(u32) ) ) {
- DRM_ERROR( "EFAULT on data, %d dwords\n", dwords );
- return DRM_ERR(EFAULT);
- }
- } else {
- /* Texture image width is less than the minimum, so we
- * need to pad out each image scanline to the minimum
- * width.
+ /* Dispatch the indirect buffer.
*/
- for ( i = 0 ; i < tex->height ; i++ ) {
- if ( DRM_COPY_FROM_USER( buffer, data, tex_width ) ) {
- DRM_ERROR( "EFAULT on pad, %d bytes\n",
- tex_width );
+ buffer = (u32*)((char*)dev_priv->buffers->handle + buf->offset);
+ dwords = size / 4;
+ buffer[0] = CP_PACKET3( RADEON_CNTL_HOSTDATA_BLT, dwords + 6 );
+ buffer[1] = (RADEON_GMC_DST_PITCH_OFFSET_CNTL |
+ RADEON_GMC_BRUSH_NONE |
+ (format << 8) |
+ RADEON_GMC_SRC_DATATYPE_COLOR |
+ RADEON_ROP3_S |
+ RADEON_DP_SRC_SOURCE_HOST_DATA |
+ RADEON_GMC_CLR_CMP_CNTL_DIS |
+ RADEON_GMC_WR_MSK_DIS);
+
+ buffer[2] = (tex->pitch << 22) | (tex->offset >> 10);
+ buffer[3] = 0xffffffff;
+ buffer[4] = 0xffffffff;
+ buffer[5] = (y << 16) | image->x;
+ buffer[6] = (height << 16) | image->width;
+ buffer[7] = dwords;
+ buffer += 8;
+
+ if ( tex_width >= 32 ) {
+ /* Texture image width is larger than the minimum, so we
+ * can upload it directly.
+ */
+ if ( DRM_COPY_FROM_USER( buffer, data,
+ dwords * sizeof(u32) ) ) {
+ DRM_ERROR( "EFAULT on data, %d dwords\n",
+ dwords );
return DRM_ERR(EFAULT);
}
- buffer += 8;
- data += tex_width;
+ } else {
+ /* Texture image width is less than the minimum, so we
+ * need to pad out each image scanline to the minimum
+ * width.
+ */
+ for ( i = 0 ; i < tex->height ; i++ ) {
+ if ( DRM_COPY_FROM_USER( buffer, data,
+ tex_width ) ) {
+ DRM_ERROR( "EFAULT on pad, %d bytes\n",
+ tex_width );
+ return DRM_ERR(EFAULT);
+ }
+ buffer += 8;
+ data += tex_width;
+ }
}
- }
- buf->pid = DRM_CURRENTPID;
- buf->used = (dwords + 8) * sizeof(u32);
+ buf->pid = DRM_CURRENTPID;
+ buf->used = (dwords + 8) * sizeof(u32);
+ radeon_cp_dispatch_indirect( dev, buf, 0, buf->used );
+ radeon_cp_discard_buffer( dev, buf );
- radeon_cp_dispatch_indirect( dev, buf, 0, buf->used );
- radeon_cp_discard_buffer( dev, buf );
+ } while (image->height > 0);
/* Flush the pixel cache after the blit completes. This ensures
* the texture data is written out to memory before rendering
* continues.
*/
BEGIN_RING( 4 );
-
RADEON_FLUSH_CACHE();
RADEON_WAIT_UNTIL_2D_IDLE();
-
ADVANCE_RING();
-
- return ret;
+ return 0;
}
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index a4c30177e7b2..2bd8b4d7b63a 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -117,7 +117,6 @@
#include <asm/bitops.h>
#include <asm/io.h>
-#define LINUX_2_1
typedef struct net_device_stats hp100_stats_t;
#include "hp100.h"
@@ -285,7 +284,6 @@ static struct hp100_pci_id hp100_pci_ids[] = {
#define HP100_PCI_IDS_SIZE (sizeof(hp100_pci_ids)/sizeof(struct hp100_pci_id))
-#if LINUX_VERSION_CODE >= 0x20400
static struct pci_device_id hp100_pci_tbl[] __initdata = {
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
@@ -294,7 +292,6 @@ static struct pci_device_id hp100_pci_tbl[] __initdata = {
{} /* Terminating entry */
};
MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
-#endif /* LINUX_VERSION_CODE >= 0x20400 */
static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
@@ -356,8 +353,8 @@ static void hp100_RegisterDump(struct net_device *dev);
* address - Jean II */
static inline dma_addr_t virt_to_whatever(struct net_device *dev, u32 * ptr)
{
- return ((u_long) ptr) +
- ((struct hp100_private *) (dev->priv))->whatever_offset;
+ return ((u_long) ptr) +
+ ((struct hp100_private *) (dev->priv))->whatever_offset;
}
/* TODO: This function should not really be needed in a good design... */
@@ -376,9 +373,7 @@ int __init hp100_probe(struct net_device *dev)
{
int base_addr = dev ? dev->base_addr : 0;
int ioaddr = 0;
-#ifdef CONFIG_PCI
int pci_start_index = 0;
-#endif
#ifdef HP100_DEBUG_B
hp100_outw(0x4200, TRACE);
@@ -854,7 +849,10 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
printk("100Mb/s Voice Grade AnyLAN network.\n");
break;
case HP100_LAN_10:
- printk("10Mb/s network.\n");
+ printk("10Mb/s network (10baseT).\n");
+ break;
+ case HP100_LAN_COAX:
+ printk("10Mb/s network (coax).\n");
break;
default:
printk("Warning! Link down.\n");
@@ -889,7 +887,7 @@ static void hp100_hwinit(struct net_device *dev)
wait();
} else {
hp100_outw(HP100_INT_EN | HP100_RESET_LB, OPTION_LSW);
- hp100_cascade_reset(dev, TRUE);
+ hp100_cascade_reset(dev, 1);
hp100_page(MAC_CTRL);
hp100_andb(~(HP100_RX_EN | HP100_TX_EN), MAC_CFG_1);
}
@@ -900,7 +898,7 @@ static void hp100_hwinit(struct net_device *dev)
wait();
/* Go into reset again. */
- hp100_cascade_reset(dev, TRUE);
+ hp100_cascade_reset(dev, 1);
/* Set Option Registers to a safe state */
hp100_outw(HP100_DEBUG_EN |
@@ -943,13 +941,13 @@ static void hp100_hwinit(struct net_device *dev)
wait(); /* TODO: Do we really need this? */
/* Enable Hardware (e.g. unreset) */
- hp100_cascade_reset(dev, FALSE);
+ hp100_cascade_reset(dev, 0);
/* ------- initialisation complete ----------- */
/* Finally try to log in the Hub if there may be a VG connection. */
- if (lp->lan_type != HP100_LAN_10)
- hp100_login_to_vg_hub(dev, FALSE); /* relogin */
+ if ((lp->lan_type == HP100_LAN_100) || (lp->lan_type == HP100_LAN_ERR))
+ hp100_login_to_vg_hub(dev, 0); /* relogin */
}
@@ -1191,7 +1189,7 @@ static int hp100_close(struct net_device *dev)
hp100_stop_interface(dev);
if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
netif_stop_queue(dev);
@@ -1508,13 +1506,31 @@ static void hp100_BM_shutdown(struct net_device *dev)
hp100_andb(~HP100_BM_MASTER, BM);
} /* end of shutdown procedure for non-etr parts */
- hp100_cascade_reset(dev, TRUE);
+ hp100_cascade_reset(dev, 1);
}
hp100_page(PERFORMANCE);
/* hp100_outw( HP100_BM_READ | HP100_BM_WRITE | HP100_RESET_HB, OPTION_LSW ); */
/* Busmaster mode should be shut down now. */
}
+static int hp100_check_lan(struct net_device *dev)
+{
+ struct hp100_private *lp = (struct hp100_private *) dev->priv;
+
+ if (lp->lan_type < 0) { /* no LAN type detected yet? */
+ hp100_stop_interface(dev);
+ if ((lp->lan_type = hp100_sense_lan(dev)) < 0) {
+ printk("hp100: %s: no connection found - check wire\n", dev->name);
+ hp100_start_interface(dev); /* 10Mb/s RX packets maybe handled */
+ return -EIO;
+ }
+ if (lp->lan_type == HP100_LAN_100)
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0); /* relogin */
+ hp100_start_interface(dev);
+ }
+ return 0;
+}
+
/*
* transmit functions
*/
@@ -1550,23 +1566,14 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
if (jiffies - dev->trans_start < HZ)
return -EAGAIN;
- if (lp->lan_type < 0) { /* no LAN type detected yet? */
- hp100_stop_interface(dev);
- if ((lp->lan_type = hp100_sense_lan(dev)) < 0) {
- printk("hp100: %s: no connection found - check wire\n", dev->name);
- hp100_start_interface(dev); /* 10Mb/s RX pkts maybe handled */
- return -EIO;
- }
- if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE); /* relogin */
- hp100_start_interface(dev);
- }
+ if (hp100_check_lan(dev))
+ return -EIO;
if (lp->lan_type == HP100_LAN_100 && lp->hub_status < 0) {
/* we have a 100Mb/s adapter but it isn't connected to hub */
printk("hp100: %s: login to 100Mb/s hub retry\n", dev->name);
hp100_stop_interface(dev);
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
} else {
spin_lock_irqsave(&lp->lock, flags);
@@ -1577,18 +1584,18 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
if (i == HP100_LAN_ERR)
printk("hp100: %s: link down detected\n", dev->name);
else if (lp->lan_type != i) { /* cable change! */
- /* it's very hard - all network setting must be changed!!! */
+ /* it's very hard - all network settings must be changed!!! */
printk("hp100: %s: cable change 10Mb/s <-> 100Mb/s detected\n", dev->name);
lp->lan_type = i;
hp100_stop_interface(dev);
if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
} else {
printk("hp100: %s: interface reset\n", dev->name);
hp100_stop_interface(dev);
if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
}
}
@@ -1699,17 +1706,8 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->len <= 0)
return 0;
- if (lp->lan_type < 0) { /* no LAN type detected yet? */
- hp100_stop_interface(dev);
- if ((lp->lan_type = hp100_sense_lan(dev)) < 0) {
- printk("hp100: %s: no connection found - check wire\n", dev->name);
- hp100_start_interface(dev); /* 10Mb/s RX packets maybe handled */
- return -EIO;
- }
- if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE); /* relogin */
- hp100_start_interface(dev);
- }
+ if (hp100_check_lan(dev))
+ return -EIO;
/* If there is not enough free memory on the card... */
i = hp100_inl(TX_MEM_FREE) & 0x7fffffff;
@@ -1729,7 +1727,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* we have a 100Mb/s adapter but it isn't connected to hub */
printk("hp100: %s: login to 100Mb/s hub retry\n", dev->name);
hp100_stop_interface(dev);
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
} else {
spin_lock_irqsave(&lp->lock, flags);
@@ -1745,13 +1743,13 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
lp->lan_type = i;
hp100_stop_interface(dev);
if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
} else {
printk("hp100: %s: interface reset\n", dev->name);
hp100_stop_interface(dev);
if (lp->lan_type == HP100_LAN_100)
- lp->hub_status = hp100_login_to_vg_hub(dev, FALSE);
+ lp->hub_status = hp100_login_to_vg_hub(dev, 0);
hp100_start_interface(dev);
mdelay(1);
}
@@ -2093,6 +2091,9 @@ static void hp100_update_stats(struct net_device *dev)
static void hp100_misc_interrupt(struct net_device *dev)
{
+#ifdef HP100_DEBUG_B
+ int ioaddr = dev->base_addr;
+#endif
struct hp100_private *lp = (struct hp100_private *) dev->priv;
#ifdef HP100_DEBUG_B
@@ -2220,7 +2221,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
#ifdef HP100_DEBUG
printk("hp100: %s: 100VG MAC settings have changed - relogin.\n", dev->name);
#endif
- lp->hub_status = hp100_login_to_vg_hub(dev, TRUE); /* force a relogin to the hub */
+ lp->hub_status = hp100_login_to_vg_hub(dev, 1); /* force a relogin to the hub */
}
} else {
int i;
@@ -2245,7 +2246,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
#ifdef HP100_DEBUG
printk("hp100: %s: 100VG MAC settings have changed - relogin.\n", dev->name);
#endif
- lp->hub_status = hp100_login_to_vg_hub(dev, TRUE); /* force a relogin to the hub */
+ lp->hub_status = hp100_login_to_vg_hub(dev, 1); /* force a relogin to the hub */
}
}
}
@@ -2539,7 +2540,7 @@ static int hp100_sense_lan(struct net_device *dev)
hp100_page(MAC_CTRL);
hp100_outb(val_10, 10_LAN_CFG_1);
hp100_page(PERFORMANCE);
- return HP100_LAN_10;
+ return HP100_LAN_COAX;
}
if ((lp->id->id == 0x02019F022) ||
@@ -2685,7 +2686,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
*/
hp100_page(MAC_CTRL);
startst = hp100_inb(VG_LAN_CFG_1);
- if ((force_relogin == TRUE) || (hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST)) {
+ if ((force_relogin == 1) || (hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST)) {
#ifdef HP100_DEBUG_TRAINING
printk("hp100: %s: Start training\n", dev->name);
#endif
@@ -2847,7 +2848,7 @@ static void hp100_cascade_reset(struct net_device *dev, u_short enable)
printk("hp100: %s: cascade_reset\n", dev->name);
#endif
- if (enable == TRUE) {
+ if (enable) {
hp100_outw(HP100_HW_RST | HP100_RESET_LB, OPTION_LSW);
if (lp->chip == HP100_CHIPID_LASSEN) {
/* Lassen requires a PCI transmit fifo reset */
diff --git a/drivers/net/hp100.h b/drivers/net/hp100.h
index 9bc2de4c14e5..236d945987af 100644
--- a/drivers/net/hp100.h
+++ b/drivers/net/hp100.h
@@ -518,12 +518,9 @@
*/
#define HP100_LAN_100 100 /* lan_type value for VG */
#define HP100_LAN_10 10 /* lan_type value for 10BaseT */
+#define HP100_LAN_COAX 9 /* lan_type value for Coax */
#define HP100_LAN_ERR (-1) /* lan_type value for link down */
-#define TRUE 1
-#define FALSE 0
-
-
/*
* Bus Master Data Structures ----------------------------------------------
*/
diff --git a/drivers/scsi/eata_pio_proc.c b/drivers/scsi/eata_pio_proc.c
index 7a07638b2225..4d55ddd14ae1 100644
--- a/drivers/scsi/eata_pio_proc.c
+++ b/drivers/scsi/eata_pio_proc.c
@@ -85,7 +85,7 @@ int eata_pio_proc_info(char *buffer, char **start, off_t offset, int length,
len += size;
pos = begin + len;
- list_for_each_entry(scd, &HBA_ptr->my_devices; siblings) {
+ list_for_each_entry(scd, &HBA_ptr->my_devices, siblings) {
proc_print_scsidevice(scd, buffer, &size, len);
len += size;
pos = begin + len;
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index c46d12ff1eee..99de02bb455e 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -485,13 +485,6 @@ int scsi_register_host(Scsi_Host_Template *shost_tp)
BUG_ON(!shost_tp->detect);
- if (!shost_tp->max_sectors) {
- printk(KERN_WARNING
- "scsi HBA driver %s didn't set max_sectors, "
- "please fix the template\n", shost_tp->name);
- shost_tp->max_sectors = 1024;
- }
-
if (!shost_tp->release) {
printk(KERN_WARNING
"scsi HBA driver %s didn't set a release method, "
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 085aa15fed80..27bee295b157 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -24,7 +24,7 @@
*/
static const char * cvsid = "$Id: osst.c,v 1.65 2001/11/11 20:38:56 riede Exp $";
-const char * osst_version = "0.99.0p3";
+const char * osst_version = "0.99.0p5";
/* The "failure to reconnect" firmware bug */
#define OSST_FW_NEED_POLL_MIN 10601 /*(107A)*/
@@ -60,7 +60,6 @@ const char * osst_version = "0.99.0p3";
in the drivers are more widely classified, this may be changed to KERN_DEBUG. */
#define OSST_DEB_MSG KERN_NOTICE
-
#include "scsi.h"
#include "hosts.h"
#include <scsi/scsi_ioctl.h>
@@ -85,7 +84,7 @@ MODULE_PARM(max_dev, "i");
MODULE_PARM_DESC(max_dev, "Maximum number of OnStream Tape Drives to attach (4)");
MODULE_PARM(write_threshold_kbs, "i");
-MODULE_PARM_DESC(write_threshold_kbs, "Asynchronous write threshold (KB; 30)");
+MODULE_PARM_DESC(write_threshold_kbs, "Asynchronous write threshold (KB; 32)");
MODULE_PARM(max_sg_segs, "i");
MODULE_PARM_DESC(max_sg_segs, "Maximum number of scatter/gather segments to use (9)");
@@ -170,8 +169,8 @@ struct Scsi_Device_Template osst_template =
.attach = osst_attach,
.detach = osst_detach,
.scsi_driverfs_driver = {
- .name = "osst",
- },
+ .name = "osst",
+ }
};
static int osst_int_ioctl(OS_Scsi_Tape *STp, Scsi_Request ** aSRpnt, unsigned int cmd_in,unsigned long arg);
@@ -221,7 +220,7 @@ static int osst_chk_result(OS_Scsi_Tape * STp, Scsi_Request * SRpnt)
if (scode) printk(OSST_DEB_MSG "%s:D: Sense: %02x, ASC: %02x, ASCQ: %02x\n",
name, scode, sense[12], sense[13]);
if (driver_byte(result) & DRIVER_SENSE)
- print_req_sense("osst", SRpnt);
+ print_req_sense("osst ", SRpnt);
}
// else
#endif
@@ -543,8 +542,6 @@ static int osst_verify_frame(OS_Scsi_Tape * STp, int frame_seq_number, int quiet
STp->first_frame_position);
goto err_out;
}
-// STp->frame_in_buffer = 1;
-
if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) {
if (!quiet)
#if DEBUG
@@ -749,7 +746,7 @@ static int osst_flush_drive_buffer(OS_Scsi_Tape * STp, Scsi_Request ** aSRpnt)
Scsi_Request * SRpnt;
int result = 0;
- int delay = OSST_WAIT_LONG_WRITE_COMPLETE;
+ int delay = OSST_WAIT_WRITE_COMPLETE;
#if DEBUG
char *name = tape_name(STp);
@@ -763,17 +760,14 @@ static int osst_flush_drive_buffer(OS_Scsi_Tape * STp, Scsi_Request ** aSRpnt)
SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_WRITE_RETRIES, TRUE);
*aSRpnt = SRpnt;
if (!SRpnt) return (-EBUSY);
-//printk(OSST_DEB_MSG "%s:X: Write filemark returned %x:%02x:%02x:%02x\n",dev,STp->buffer->syscall_result,SRpnt->sr_sense_buffer[2] & 0x0f,SRpnt->sr_sense_buffer[12],SRpnt->sr_sense_buffer[13]);
if (STp->buffer->syscall_result) {
if ((SRpnt->sr_sense_buffer[2] & 0x0f) == 2 && SRpnt->sr_sense_buffer[12] == 4) {
if (SRpnt->sr_sense_buffer[13] == 8) {
-//printk(OSST_DEB_MSG "%s:X: Long initial delay\n", dev);
delay = OSST_WAIT_LONG_WRITE_COMPLETE;
}
} else
result = osst_write_error_recovery(STp, aSRpnt, 0);
}
-//printk(OSST_DEB_MSG "%s:X: Entering wait ready (%d)\n",dev,delay);
result |= osst_wait_ready(STp, aSRpnt, 5 * 60, delay);
STp->ps[STp->partition].rw = OS_WRITING_COMPLETE;
@@ -1708,12 +1702,7 @@ static int osst_space_over_filemarks_backward(OS_Scsi_Tape * STp, Scsi_Request *
name, last_mark_ppos);
return (-EIO);
}
- if (mt_op == MTBSFM) {
- STp->frame_seq_number++;
- STp->frame_in_buffer = 0;
- STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
- }
- return 0;
+ goto found;
}
#if DEBUG
printk(OSST_DEB_MSG "%s:D: Reverting to scan filemark backwards\n", name);
@@ -1741,10 +1730,13 @@ static int osst_space_over_filemarks_backward(OS_Scsi_Tape * STp, Scsi_Request *
return (-EIO);
}
}
+found:
if (mt_op == MTBSFM) {
STp->frame_seq_number++;
- STp->frame_in_buffer = 0;
- STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
+ STp->frame_in_buffer = 0;
+ STp->buffer->buffer_bytes = 0;
+ STp->buffer->read_pointer = 0;
+ STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
}
return 0;
}
@@ -1797,8 +1789,10 @@ static int osst_space_over_filemarks_forward_slow(OS_Scsi_Tape * STp, Scsi_Reque
}
if (mt_op == MTFSF) {
STp->frame_seq_number++;
- STp->frame_in_buffer = 0;
- STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
+ STp->frame_in_buffer = 0;
+ STp->buffer->buffer_bytes = 0;
+ STp->buffer->read_pointer = 0;
+ STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
}
return 0;
}
@@ -1944,9 +1938,10 @@ static int osst_space_over_filemarks_forward_fast(OS_Scsi_Tape * STp, Scsi_Reque
}
if (mt_op == MTFSF) {
STp->frame_seq_number++;
- STp->frame_in_buffer = 0;
+ STp->frame_in_buffer = 0;
+ STp->buffer->buffer_bytes = 0;
STp->buffer->read_pointer = 0;
- STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
+ STp->logical_blk_num += ntohs(STp->buffer->aux->dat.dat_list[0].blk_cnt);
}
return 0;
}
@@ -3215,8 +3210,8 @@ static ssize_t osst_write(struct file * filp, const char * buf, size_t count, lo
/* Write must be integral number of blocks */
if (STp->block_size != 0 && (count % STp->block_size) != 0) {
- printk(KERN_ERR "%s:E: Write (%ld bytes) not multiple of tape block size (%d%c).\n",
- name, (unsigned long)count, STp->block_size<1024?
+ printk(KERN_ERR "%s:E: Write (%Zd bytes) not multiple of tape block size (%d%c).\n",
+ name, count, STp->block_size<1024?
STp->block_size:STp->block_size/1024, STp->block_size<1024?'b':'k');
retval = (-EINVAL);
goto out;
@@ -4140,8 +4135,14 @@ os_bypass:
if (cmd_in == MTEOM)
STps->eof = ST_EOD;
- else if ((cmd_in == MTFSFM || cmd_in == MTBSF) && STps->eof == ST_FM_HIT)
- ioctl_result = osst_seek_logical_blk(STp, &SRpnt, STp->logical_blk_num - 1);
+ else if ((cmd_in == MTFSFM || cmd_in == MTBSF) && STps->eof == ST_FM_HIT) {
+ ioctl_result = osst_seek_logical_blk(STp, &SRpnt, STp->logical_blk_num-1);
+ STps->drv_block++;
+ STp->logical_blk_num++;
+ STp->frame_seq_number++;
+ STp->frame_in_buffer = 0;
+ STp->buffer->read_pointer = 0;
+ }
else if (cmd_in == MTFSF)
STps->eof = (STp->first_frame_position >= STp->eod_frame_ppos)?ST_EOD:ST_FM;
else if (chg_eof)
@@ -4233,8 +4234,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)
#endif
return (-EBUSY);
}
-
- if (!scsi_device_get(STp->device)) {
+ if (scsi_device_get(STp->device)) {
write_unlock(&os_scsi_tapes_lock);
#if DEBUG
printk(OSST_DEB_MSG "%s:D: Failed scsi_device_get.\n", name);
@@ -4856,12 +4856,6 @@ static int osst_ioctl(struct inode * inode,struct file * file,
}
if (mtc.mt_op == MTSETPART) {
-/* if (!STp->can_partitions ||
- mtc.mt_count < 0 || mtc.mt_count >= ST_NBR_PARTITIONS)
- return (-EINVAL);
- if (mtc.mt_count >= STp->nbr_partitions &&
- (STp->nbr_partitions = nbr_partitions(inode)) < 0)
- return (-EIO);*/
if (mtc.mt_count >= STp->nbr_partitions)
retval = -EINVAL;
else {
@@ -4909,10 +4903,6 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto out;
}
-/* if (STp->can_partitions && STp->ready == ST_READY &&
- (i = update_partition(inode)) < 0)
- {retval=i;goto out;}*/
-
if (mtc.mt_op == MTCOMPRESSION)
retval = -EINVAL /*osst_compression(STp, (mtc.mt_count & 1))*/;
else
@@ -4931,10 +4921,6 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto out;
}
-/* if (STp->can_partitions &&
- (i = update_partition(inode)) < 0)
- {retval=i;goto out;}*/
-
if (cmd_type == _IOC_TYPE(MTIOCGET) && cmd_nr == _IOC_NR(MTIOCGET)) {
struct mtget mt_status;
@@ -5110,9 +5096,7 @@ static int enlarge_buffer(OSST_buffer *STbuffer, int need_dma)
for (segs=STbuffer->sg_segs=1, got=b_size;
segs < max_segs && got < OS_FRAME_SIZE; ) {
STbuffer->sg[segs].page =
- (OS_FRAME_SIZE - got <= PAGE_SIZE / 2) ?
- kmalloc(OS_FRAME_SIZE - got, priority):
- alloc_pages(priority, order);
+ alloc_pages(priority, (OS_FRAME_SIZE - got <= PAGE_SIZE) ? 0 : order);
STbuffer->sg[segs].offset = 0;
if (STbuffer->sg[segs].page == NULL) {
if (OS_FRAME_SIZE - got <= (max_segs - segs) * b_size / 2 && order) {
@@ -5320,10 +5304,8 @@ static void validate_options (void)
if (max_sg_segs >= OSST_FIRST_SG)
osst_max_sg_segs = max_sg_segs;
#if DEBUG
- printk(OSST_DEB_MSG "osst :D: max tapes %d, write threshold %d, s/g segs %d.\n",
+ printk(OSST_DEB_MSG "osst :D: max tapes %d, write threshold %d, max s/g segs %d.\n",
osst_max_dev, osst_write_threshold, osst_max_sg_segs);
-//printk(OSST_DEB_MSG "osst :D: sizeof(header) = %d (%s)\n",
-// sizeof(os_header_t),sizeof(os_header_t)==OS_DATA_SIZE?"ok":"error");
#endif
}
@@ -5446,7 +5428,7 @@ static int osst_attach(Scsi_Device * SDp)
drive = alloc_disk(1);
if (!drive) {
printk(KERN_ERR "osst :E: Out of memory. Device not attached.\n");
- return 1;
+ goto out_slave_detach;
}
/* if this is the first attach, build the infrastructure */
@@ -5458,7 +5440,7 @@ static int osst_attach(Scsi_Device * SDp)
if (os_scsi_tapes == NULL) {
write_unlock(&os_scsi_tapes_lock);
printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n");
- return 1;
+ goto out_put_disk;
}
for (i=0; i < osst_max_dev; ++i) os_scsi_tapes[i] = NULL;
}
@@ -5466,8 +5448,7 @@ static int osst_attach(Scsi_Device * SDp)
if (osst_nr_dev >= osst_max_dev) {
write_unlock(&os_scsi_tapes_lock);
printk(KERN_ERR "osst :E: Too many tape devices (max. %d).\n", osst_max_dev);
- put_disk(drive);
- return 1;
+ goto out_put_disk;
}
/* find a free minor number */
@@ -5480,9 +5461,7 @@ static int osst_attach(Scsi_Device * SDp)
if (tpnt == NULL) {
write_unlock(&os_scsi_tapes_lock);
printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n");
- put_disk(drive);
- scsi_slave_detach(SDp);
- return 1;
+ goto out_put_disk;
}
memset(tpnt, 0, sizeof(OS_Scsi_Tape));
@@ -5495,9 +5474,7 @@ static int osst_attach(Scsi_Device * SDp)
write_unlock(&os_scsi_tapes_lock);
printk(KERN_ERR "osst :E: Unable to allocate a tape buffer, device not attached.\n");
kfree(tpnt);
- put_disk(drive);
- scsi_slave_detach(SDp);
- return 1;
+ goto out_put_disk;
}
os_scsi_tapes[dev_num] = tpnt;
tpnt->buffer = buffer;
@@ -5623,6 +5600,12 @@ static int osst_attach(Scsi_Device * SDp)
SDp->model, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun, tape_name(tpnt));
return 0;
+
+out_put_disk:
+ put_disk(drive);
+out_slave_detach:
+ scsi_slave_detach(SDp);
+ return 1;
};
static void osst_detach(Scsi_Device * SDp)
@@ -5630,48 +5613,46 @@ static void osst_detach(Scsi_Device * SDp)
OS_Scsi_Tape * tpnt;
int i, mode;
+ if ((SDp->type != TYPE_TAPE) || (osst_nr_dev <= 0))
+ return;
+
write_lock(&os_scsi_tapes_lock);
- if (os_scsi_tapes != NULL) {
- for(i=0; i<osst_max_dev; i++) {
- tpnt = os_scsi_tapes[i];
- if(tpnt != NULL && tpnt->device == SDp) {
- tpnt->device = NULL;
- for (mode = 0; mode < ST_NBR_MODES; ++mode) {
- devfs_unregister (tpnt->de_r[mode]);
- tpnt->de_r[mode] = NULL;
- devfs_unregister (tpnt->de_n[mode]);
- tpnt->de_n[mode] = NULL;
- }
- devfs_unregister_tape(tpnt->drive->number);
- put_disk(tpnt->drive);
- os_scsi_tapes[i] = NULL;
- scsi_slave_detach(SDp);
- osst_nr_dev--;
- write_unlock(&os_scsi_tapes_lock);
- for (mode = 0; mode < ST_NBR_MODES; ++mode) {
- device_remove_file(&tpnt->driverfs_dev_r[mode],
- &dev_attr_type);
- device_remove_file(&tpnt->driverfs_dev_r[mode],
- &dev_attr_kdev);
- device_unregister(&tpnt->driverfs_dev_r[mode]);
- device_remove_file(&tpnt->driverfs_dev_n[mode],
- &dev_attr_type);
- device_remove_file(&tpnt->driverfs_dev_n[mode],
- &dev_attr_kdev);
- device_unregister(&tpnt->driverfs_dev_n[mode]);
- }
- if (tpnt->header_cache != NULL)
- vfree(tpnt->header_cache);
- if (tpnt->buffer) {
- normalize_buffer(tpnt->buffer);
- kfree(tpnt->buffer);
+ for(i=0; i < osst_max_dev; i++) {
+ if((tpnt = os_scsi_tapes[i]) && (tpnt->device == SDp)) {
+ tpnt->device = NULL;
+ for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ devfs_unregister (tpnt->de_r[mode]);
+ tpnt->de_r[mode] = NULL;
+ devfs_unregister (tpnt->de_n[mode]);
+ tpnt->de_n[mode] = NULL;
+ }
+ devfs_unregister_tape(tpnt->drive->number);
+ put_disk(tpnt->drive);
+ os_scsi_tapes[i] = NULL;
+ scsi_slave_detach(SDp);
+ osst_nr_dev--;
+ write_unlock(&os_scsi_tapes_lock);
+ for (mode = 0; mode < ST_NBR_MODES; ++mode) {
+ device_remove_file(&tpnt->driverfs_dev_r[mode],
+ &dev_attr_type);
+ device_remove_file(&tpnt->driverfs_dev_r[mode],
+ &dev_attr_kdev);
+ device_unregister(&tpnt->driverfs_dev_r[mode]);
+ device_remove_file(&tpnt->driverfs_dev_n[mode],
+ &dev_attr_type);
+ device_remove_file(&tpnt->driverfs_dev_n[mode],
+ &dev_attr_kdev);
+ device_unregister(&tpnt->driverfs_dev_n[mode]);
}
- kfree(tpnt);
- break;
+ if (tpnt->header_cache != NULL) vfree(tpnt->header_cache);
+ if (tpnt->buffer) {
+ normalize_buffer(tpnt->buffer);
+ kfree(tpnt->buffer);
}
- }
+ kfree(tpnt);
+ return;
+ }
}
-
write_unlock(&os_scsi_tapes_lock);
return;
}
@@ -5681,12 +5662,8 @@ static int __init init_osst(void)
printk(KERN_INFO "osst :I: Tape driver with OnStream support version %s\nosst :I: %s\n", osst_version, cvsid);
validate_options();
-#if DEBUG
- printk(OSST_DEB_MSG "osst :D: %d s/g segments, write threshold %d bytes.\n",
- max_sg_segs, osst_write_threshold);
-#endif
- if ((register_chrdev(OSST_MAJOR, "osst", &osst_fops) < 0) ||
- scsi_register_device(&osst_template)) {
+
+ if ((register_chrdev(OSST_MAJOR,"osst", &osst_fops) < 0) || scsi_register_device(&osst_template)) {
printk(KERN_ERR "osst :E: Unable to register major %d for OnStream tapes\n", OSST_MAJOR);
return 1;
}
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2325f4487950..21f57ced3d76 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -177,6 +177,13 @@ void scsi_initialize_queue(Scsi_Device * SDpnt, struct Scsi_Host * SHpnt)
*/
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
+ if(!SHpnt->max_sectors)
+ /* driver imposes no hard sector transfer limit.
+ * start at machine infinity initially */
+ SHpnt->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
+
+ /* FIXME: we should also adjust this limit later on
+ * after we know what the device capabilities are */
blk_queue_max_sectors(q, SHpnt->max_sectors);
if (!SHpnt->use_clustering)
diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h
index 855b7d413006..bd1a70e934ba 100644
--- a/drivers/scsi/scsi.h
+++ b/drivers/scsi/scsi.h
@@ -374,6 +374,14 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
#define SYNC_RESET 0x40
/*
+ * This specifies "machine infinity" for host templates which don't
+ * limit the transfer size. Note this limit represents an absolute
+ * maximum, and may be over the transfer limits allowed for individual
+ * devices (e.g. 256 for SCSI-1)
+ */
+#define SCSI_DEFAULT_MAX_SECTORS 1024
+
+/*
* This is the crap from the old error handling code. We have it in a special
* place so that we can more easily delete it later on.
*/
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 1cf90282fa7e..de0d94f9e6dd 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -172,7 +172,7 @@ static inline struct scsi_disk *scsi_disk(struct gendisk *disk)
**/
static int sd_init_command(struct scsi_cmnd * SCpnt)
{
- int this_count, timeout;
+ unsigned int this_count, timeout;
struct gendisk *disk;
sector_t block;
struct scsi_device *sdp = SCpnt->device;
@@ -298,8 +298,23 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
"writing" : "reading", this_count, SCpnt->request->nr_sectors));
SCpnt->cmnd[1] = 0;
-
- if (((this_count > 0xff) || (block > 0x1fffff)) || SCpnt->device->ten) {
+
+ if (block > 0xffffffff) {
+ SCpnt->cmnd[0] += READ_16 - READ_6;
+ SCpnt->cmnd[2] = (unsigned char) (block >> 56) & 0xff;
+ SCpnt->cmnd[3] = (unsigned char) (block >> 48) & 0xff;
+ SCpnt->cmnd[4] = (unsigned char) (block >> 40) & 0xff;
+ SCpnt->cmnd[5] = (unsigned char) (block >> 32) & 0xff;
+ SCpnt->cmnd[6] = (unsigned char) (block >> 24) & 0xff;
+ SCpnt->cmnd[7] = (unsigned char) (block >> 16) & 0xff;
+ SCpnt->cmnd[8] = (unsigned char) (block >> 8) & 0xff;
+ SCpnt->cmnd[9] = (unsigned char) block & 0xff;
+ SCpnt->cmnd[10] = (unsigned char) (this_count >> 24) & 0xff;
+ SCpnt->cmnd[11] = (unsigned char) (this_count >> 16) & 0xff;
+ SCpnt->cmnd[12] = (unsigned char) (this_count >> 8) & 0xff;
+ SCpnt->cmnd[13] = (unsigned char) this_count & 0xff;
+ SCpnt->cmnd[14] = SCpnt->cmnd[15] = 0;
+ } else if (((this_count > 0xff) || (block > 0x1fffff)) || SCpnt->device->ten) {
if (this_count > 0xffff)
this_count = 0xffff;
@@ -904,24 +919,34 @@ sd_read_cache_type(struct scsi_disk *sdkp, char *diskname,
static void
sd_read_capacity(struct scsi_disk *sdkp, char *diskname,
struct scsi_request *SRpnt, unsigned char *buffer) {
- unsigned char cmd[10];
+ unsigned char cmd[16];
struct scsi_device *sdp = sdkp->device;
int the_result, retries;
- int sector_size;
+ int sector_size = 0;
+ int longrc = 0;
+repeat:
retries = 3;
do {
- cmd[0] = READ_CAPACITY;
- memset((void *) &cmd[1], 0, 9);
- memset((void *) buffer, 0, 8);
-
+ if (longrc) {
+ memset((void *) cmd, 0, 16);
+ cmd[0] = SERVICE_ACTION_IN;
+ cmd[1] = 0x10; /* READ CAPACITY (16) */
+ cmd[13] = 12;
+ memset((void *) buffer, 0, 12);
+ } else {
+ cmd[0] = READ_CAPACITY;
+ memset((void *) &cmd[1], 0, 9);
+ memset((void *) buffer, 0, 8);
+ }
+
SRpnt->sr_cmd_len = 0;
SRpnt->sr_sense_buffer[0] = 0;
SRpnt->sr_sense_buffer[2] = 0;
SRpnt->sr_data_direction = SCSI_DATA_READ;
scsi_wait_req(SRpnt, (void *) cmd, (void *) buffer,
- 8, SD_TIMEOUT, SD_MAX_RETRIES);
+ longrc ? 12 : 8, SD_TIMEOUT, SD_MAX_RETRIES);
if (media_not_present(sdkp, SRpnt))
return;
@@ -931,7 +956,7 @@ sd_read_capacity(struct scsi_disk *sdkp, char *diskname,
} while (the_result && retries);
- if (the_result) {
+ if (the_result && !longrc) {
printk(KERN_NOTICE "%s : READ CAPACITY failed.\n"
"%s : status=%x, message=%02x, host=%d, driver=%02x \n",
diskname, diskname,
@@ -957,16 +982,51 @@ sd_read_capacity(struct scsi_disk *sdkp, char *diskname,
sdkp->capacity = 0x200000; /* 1 GB - random */
return;
- }
-
- sdkp->capacity = 1 + (((sector_t)buffer[0] << 24) |
- (buffer[1] << 16) |
- (buffer[2] << 8) |
- buffer[3]);
-
- sector_size = (buffer[4] << 24) |
- (buffer[5] << 16) | (buffer[6] << 8) | buffer[7];
+ } else if (the_result && longrc) {
+ /* READ CAPACITY(16) has been failed */
+ printk(KERN_NOTICE "%s : READ CAPACITY(16) failed.\n"
+ "%s : status=%x, message=%02x, host=%d, driver=%02x \n",
+ diskname, diskname,
+ status_byte(the_result),
+ msg_byte(the_result),
+ host_byte(the_result),
+ driver_byte(the_result));
+ printk(KERN_NOTICE "%s : use 0xffffffff as device size\n",
+ diskname);
+
+ sdkp->capacity = 1 + (sector_t) 0xffffffff;
+ goto got_data;
+ }
+
+ if (!longrc) {
+ sector_size = (buffer[4] << 24) |
+ (buffer[5] << 16) | (buffer[6] << 8) | buffer[7];
+ if (buffer[0] == 0xff && buffer[1] == 0xff &&
+ buffer[2] == 0xff && buffer[3] == 0xff) {
+ printk(KERN_NOTICE "%s : very big device. try to use"
+ " READ CAPACITY(16).\n", diskname);
+ longrc = 1;
+ goto repeat;
+ }
+ sdkp->capacity = 1 + (((sector_t)buffer[0] << 24) |
+ (buffer[1] << 16) |
+ (buffer[2] << 8) |
+ buffer[3]);
+ } else {
+ sdkp->capacity = 1 + (((sector_t)buffer[0] << 56) |
+ ((sector_t)buffer[1] << 48) |
+ ((sector_t)buffer[2] << 40) |
+ ((sector_t)buffer[3] << 32) |
+ ((sector_t)buffer[4] << 24) |
+ ((sector_t)buffer[5] << 16) |
+ ((sector_t)buffer[6] << 8) |
+ (sector_t)buffer[7]);
+
+ sector_size = (buffer[8] << 24) |
+ (buffer[9] << 16) | (buffer[10] << 8) | buffer[11];
+ }
+got_data:
if (sector_size == 0) {
sector_size = 512;
printk(KERN_NOTICE "%s : sector size 0 reported, "
@@ -1139,10 +1199,10 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk)
if (sdkp->media_present)
sd_read_capacity(sdkp, disk->disk_name, SRpnt, buffer);
-
+
if (sdp->removable && sdkp->media_present)
sd_read_write_protect_flag(sdkp, disk->disk_name, SRpnt, buffer);
-
+
SRpnt->sr_device->ten = 1;
SRpnt->sr_device->remap = 1;
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 526b93e4297b..075c3c2a62e3 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -389,8 +389,8 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
break;
case DeviceOutRequest | USB_REQ_SET_ADDRESS:
// wValue == urb->dev->devaddr
- dbg ("%s root hub device address %d",
- hcd->self.bus_name, wValue);
+ dev_dbg (*hcd->controller, "root hub device address %d\n",
+ wValue);
break;
/* INTERFACE REQUESTS (no defined feature/status flags) */
@@ -1188,7 +1188,6 @@ static int hcd_unlink_urb (struct urb *urb)
if (urb->transfer_flags & URB_ASYNC_UNLINK)
return -EINPROGRESS;
- dev_dbg (*sys, "wait for giveback urb %p\n", urb);
wait_for_completion (&splice.done);
return 0;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index db9e4a460387..22245f2d4832 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -57,6 +57,12 @@ static inline char *portspeed (int portstatus)
}
#endif
+/* for dev_info, dev_dbg, etc */
+static inline struct device *hubdev (struct usb_device *dev)
+{
+ return &dev->actconfig->interface [0].dev;
+}
+
/* USB 2.0 spec Section 11.24.4.5 */
static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size)
{
@@ -298,7 +304,7 @@ static int usb_hub_configure(struct usb_hub *hub,
}
dev->maxchild = hub->descriptor->bNbrPorts;
- info("%d port%s detected", dev->maxchild,
+ dev_info (*hubdev (dev), "%d port%s detected\n", dev->maxchild,
(dev->maxchild == 1) ? "" : "s");
le16_to_cpus(&hub->descriptor->wHubCharacteristics);
@@ -521,7 +527,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
}
/* We found a hub */
- info("USB hub found at %s", dev->devpath);
+ dev_info (*hubdev (dev), "USB hub found\n");
hub = kmalloc(sizeof(*hub), GFP_KERNEL);
if (!hub) {
@@ -651,8 +657,6 @@ static int usb_hub_port_status(struct usb_device *hub, int port,
else {
*status = le16_to_cpu(portsts->wPortStatus);
*change = le16_to_cpu(portsts->wPortChange);
- dbg("port %d, portstatus %x, change %x, %s", port + 1,
- *status, *change, portspeed(*status));
ret = 0;
}
kfree(portsts);
@@ -710,8 +714,9 @@ static int usb_hub_port_wait_reset(struct usb_device *hub, int port,
if (delay_time >= 2 * HUB_SHORT_RESET_TIME)
delay = HUB_LONG_RESET_TIME;
- dbg("port %d of hub %s not reset yet, waiting %dms", port + 1,
- hub->devpath, delay);
+ dev_dbg (*hubdev (hub),
+ "port %d not reset yet, waiting %dms\n",
+ port + 1, delay);
}
return -1;
@@ -735,14 +740,15 @@ static int usb_hub_port_reset(struct usb_device *hub, int port,
return status;
}
- dbg("port %d of hub %s not enabled, trying reset again...",
- port + 1, hub->devpath);
+ dev_dbg (*hubdev (hub),
+ "port %d not enabled, trying reset again...\n",
+ port + 1);
delay = HUB_LONG_RESET_TIME;
}
- err("Cannot enable port %i of hub %s, disabling port.",
- port + 1, hub->devpath);
- err("Maybe the USB cable is bad?");
+ dev_err (*hubdev (hub),
+ "Cannot enable port %i. Maybe the USB cable is bad?\n",
+ port + 1);
return -1;
}
@@ -808,8 +814,9 @@ static int usb_hub_port_debounce(struct usb_device *hub, int port)
}
/* XXX Replace this with dbg() when 2.6 is about to ship. */
- info("debounce: hub %d port %d: delay %dms stable %d status 0x%x\n",
- hub->devnum, port, delay_time, stable_count, portstatus);
+ dev_info (*hubdev (hub),
+ "debounce: port %d: delay %dms stable %d status 0x%x\n",
+ port + 1, delay_time, stable_count, portstatus);
return ((portstatus&USB_PORT_STAT_CONNECTION)) ? 0 : 1;
}
@@ -822,9 +829,9 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
unsigned int delay = HUB_SHORT_RESET_TIME;
int i;
- dbg("hub %s port %d, portstatus %x, change %x, %s",
- hub->devpath, port + 1,
- portstatus, portchange, portspeed (portstatus));
+ dev_dbg (hubstate->intf->dev,
+ "port %d, status %x, change %x, %s\n",
+ port + 1, portstatus, portchange, portspeed (portstatus));
/* Clear the connection change status */
usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_CONNECTION);
@@ -842,7 +849,9 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
}
if (usb_hub_port_debounce(hub, port)) {
- err("connect-debounce failed, port %d disabled", port+1);
+ dev_err (hubstate->intf->dev,
+ "connect-debounce failed, port %d disabled\n",
+ port+1);
usb_hub_port_disable(hub, port);
return;
}
@@ -861,7 +870,8 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
/* Allocate a new device struct */
dev = usb_alloc_dev(hub, hub->bus);
if (!dev) {
- err("couldn't allocate usb_device");
+ dev_err (hubstate->intf->dev,
+ "couldn't allocate usb_device\n");
break;
}
@@ -904,10 +914,12 @@ static void usb_hub_port_connect_change(struct usb_hub *hubstate, int port,
len = snprintf (dev->devpath, sizeof dev->devpath,
"%d", port + 1);
if (len == sizeof dev->devpath)
- warn ("devpath size! usb/%03d/%03d path %s",
+ dev_err (hubstate->intf->dev,
+ "devpath size! usb/%03d/%03d path %s\n",
dev->bus->busnum, dev->devnum, dev->devpath);
- info("new USB device %s-%s, assigned address %d",
- dev->bus->bus_name, dev->devpath, dev->devnum);
+ dev_info (hubstate->intf->dev,
+ "new USB device on port %d, assigned address %d\n",
+ port + 1, dev->devnum);
/* put the device in the global device tree. the hub port
* is the "bus_id"; hubs show in hierarchy like bridges
@@ -992,12 +1004,11 @@ static void usb_hub_events(void)
}
if (portchange & USB_PORT_STAT_C_CONNECTION) {
- dbg("hub %s port %d connection change",
- dev->devpath, i + 1);
usb_hub_port_connect_change(hub, i, portstatus, portchange);
} else if (portchange & USB_PORT_STAT_C_ENABLE) {
- dbg("hub %s port %d enable change, status %x",
- dev->devpath, i + 1, portstatus);
+ dev_dbg (*hubdev (dev),
+ "port %d enable change, status %x\n",
+ i + 1, portstatus);
usb_clear_port_feature(dev,
i + 1, USB_PORT_FEAT_C_ENABLE);
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index ee5900f3969f..bceafa9b8966 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -487,10 +487,15 @@ static void fs_remove_file (struct dentry *dentry)
* It will be removed when the 2.7.x development cycle is started.
* You have been warned :)
*/
+static struct file_system_type usbdevice_fs_type;
static struct super_block *usb_get_sb(struct file_system_type *fs_type,
int flags, char *dev_name, void *data)
{
+ if (fs_type == &usbdevice_fs_type)
+ printk (KERN_INFO "Please use the 'usbfs' filetype instead, "
+ "the 'usbdevfs' name is depreciated.\n");
+
return get_sb_single(fs_type, flags, data, usbfs_fill_super);
}
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 69d60a2d9a95..3cb4fe3a1ad2 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -18,21 +18,45 @@
/* this file is part of ehci-hcd.c */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,50)
+
#define ehci_dbg(ehci, fmt, args...) \
dev_dbg (*(ehci)->hcd.controller, fmt, ## args )
+#define ehci_err(ehci, fmt, args...) \
+ dev_err (*(ehci)->hcd.controller, fmt, ## args )
+#define ehci_info(ehci, fmt, args...) \
+ dev_info (*(ehci)->hcd.controller, fmt, ## args )
+#define ehci_warn(ehci, fmt, args...) \
+ dev_warn (*(ehci)->hcd.controller, fmt, ## args )
-#ifdef EHCI_VERBOSE_DEBUG
-#define ehci_vdbg(ehci, fmt, args...) \
- dev_dbg (*(ehci)->hcd.controller, fmt, ## args )
#else
-#define ehci_vdbg(ehci, fmt, args...) do { } while (0)
+
+#ifdef DEBUG
+#define ehci_dbg(ehci, fmt, args...) \
+ printk(KERN_DEBUG "%s %s: " fmt, hcd_name, \
+ (ehci)->hcd.pdev->slot_name, ## args )
+#else
+#define ehci_dbg(ehci, fmt, args...) do { } while (0)
+#endif
+
+#define ehci_err(ehci, fmt, args...) \
+ printk(KERN_ERR "%s %s: " fmt, hcd_name, \
+ (ehci)->hcd.pdev->slot_name, ## args )
+#define ehci_info(ehci, fmt, args...) \
+ printk(KERN_INFO "%s %s: " fmt, hcd_name, \
+ (ehci)->hcd.pdev->slot_name, ## args )
+#define ehci_warn(ehci, fmt, args...) \
+ printk(KERN_WARNING "%s %s: " fmt, hcd_name, \
+ (ehci)->hcd.pdev->slot_name, ## args )
#endif
#ifdef EHCI_VERBOSE_DEBUG
# define vdbg dbg
+# define ehci_vdbg ehci_dbg
#else
- static inline void vdbg (char *fmt, ...) { }
+# define vdbg(fmt,args...) do { } while (0)
+# define ehci_vdbg(ehci, fmt, args...) do { } while (0)
#endif
#ifdef DEBUG
@@ -289,7 +313,8 @@ static void qh_lines (struct ehci_qh *qh, char **nextp, unsigned *sizep)
scratch = cpu_to_le32p (&qh->hw_info1);
hw_curr = cpu_to_le32p (&qh->hw_current);
- temp = snprintf (next, size, "qh/%p dev%d %cs ep%d %08x %08x (%08x %08x)",
+ temp = snprintf (next, size,
+ "qh/%p dev%d %cs ep%d %08x %08x (%08x %08x)",
qh, scratch & 0x007f,
speed_char (scratch),
(scratch >> 8) & 0x000f,
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a76b46186c50..48d9b806fcb2 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -123,12 +123,6 @@ static int log2_irq_thresh = 0; // 0 to 6
MODULE_PARM (log2_irq_thresh, "i");
MODULE_PARM_DESC (log2_irq_thresh, "log2 IRQ latency, 1-64 microframes");
-/* allow irqs at least every N URB completions */
-static int max_completions = 16;
-MODULE_PARM (max_completions, "i");
-MODULE_PARM_DESC (max_completions,
- "limit for urb completions called with irqs disenabled");
-
#define INTR_MASK (STS_IAA | STS_FATAL | STS_ERR | STS_INT)
/*-------------------------------------------------------------------------*/
@@ -202,7 +196,7 @@ static int ehci_reset (struct ehci_hcd *ehci)
dbg_cmd (ehci, "reset", command);
writel (command, &ehci->regs->command);
ehci->hcd.state = USB_STATE_HALT;
- return handshake (&ehci->regs->command, CMD_RESET, 0, 250);
+ return handshake (&ehci->regs->command, CMD_RESET, 0, 250 * 1000);
}
/* idle the controller (from running) */
@@ -250,9 +244,7 @@ static void ehci_ready (struct ehci_hcd *ehci)
/*-------------------------------------------------------------------------*/
-static void ehci_tasklet (unsigned long param);
-
-static void ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs);
+static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs);
static void ehci_watchdog (unsigned long param)
{
@@ -260,10 +252,25 @@ static void ehci_watchdog (unsigned long param)
unsigned long flags;
spin_lock_irqsave (&ehci->lock, flags);
- /* guard against lost IAA, which wedges everything */
- ehci_irq (&ehci->hcd, NULL);
+
+ /* lost IAA irqs wedge things badly; seen with a vt8235 */
+ if (ehci->reclaim) {
+ u32 status = readl (&ehci->regs->status);
+
+ if (status & STS_IAA) {
+ ehci_vdbg (ehci, "lost IAA\n");
+ writel (STS_IAA, &ehci->regs->status);
+ ehci->reclaim_ready = 1;
+ }
+ }
+
+ ehci_work (ehci, NULL);
+ if (ehci->reclaim && !timer_pending (&ehci->watchdog))
+ mod_timer (&ehci->watchdog,
+ jiffies + EHCI_WATCHDOG_JIFFIES);
+
/* stop async processing after it's idled a while */
- if (ehci->async_idle) {
+ else if (ehci->async_idle) {
start_unlink_async (ehci, ehci->async);
ehci->async_idle = 0;
}
@@ -289,8 +296,7 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
pci_read_config_dword (ehci->hcd.pdev, where, &cap);
} while ((cap & (1 << 16)) && msec);
if (cap & (1 << 16)) {
- dev_info (*ehci->hcd.controller,
- "BIOS handoff failed (%d, %04x)\n",
+ ehci_err (ehci, "BIOS handoff failed (%d, %04x)\n",
where, cap);
return 1;
}
@@ -333,8 +339,7 @@ static int ehci_start (struct usb_hcd *hcd)
return -EOPNOTSUPP;
break;
case 0: /* illegal reserved capability */
- dev_warn (*ehci->hcd.controller,
- "illegal capability!\n");
+ ehci_warn (ehci, "illegal capability!\n");
cap = 0;
/* FALLTHROUGH */
default: /* unknown */
@@ -381,6 +386,8 @@ static int ehci_start (struct usb_hcd *hcd)
* dedicate a qh for the async ring head, since we couldn't unlink
* a 'real' qh without stopping the async schedule [4.8]. use it
* as the 'reclamation list head' too.
+ * its dummy is used in hw_alt_next of many tds, to prevent the qh
+ * from automatically advancing to the next td after short reads.
*/
ehci->async->qh_next.qh = 0;
ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma);
@@ -388,8 +395,7 @@ static int ehci_start (struct usb_hcd *hcd)
ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT);
ehci->async->hw_qtd_next = EHCI_LIST_END;
ehci->async->qh_state = QH_STATE_LINKED;
- ehci_qtd_free (ehci, ehci->async->dummy);
- ehci->async->dummy = 0;
+ ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma);
writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);
/*
@@ -406,8 +412,7 @@ static int ehci_start (struct usb_hcd *hcd)
if (HCC_64BIT_ADDR (hcc_params)) {
writel (0, &ehci->regs->segment);
if (!pci_set_dma_mask (ehci->hcd.pdev, 0xffffffffffffffffULL))
- dev_info (*ehci->hcd.controller,
- "enabled 64bit PCI DMA (DAC)\n");
+ ehci_info (ehci, "enabled 64bit PCI DMA\n");
}
/* clear interrupt enables, set irq latency */
@@ -426,9 +431,6 @@ static int ehci_start (struct usb_hcd *hcd)
/* set async sleep time = 10 us ... ? */
- ehci->tasklet.func = ehci_tasklet;
- ehci->tasklet.data = (unsigned long) ehci;
-
init_timer (&ehci->watchdog);
ehci->watchdog.function = ehci_watchdog;
ehci->watchdog.data = (unsigned long) ehci;
@@ -454,7 +456,7 @@ done2:
/* PCI Serial Bus Release Number is at 0x60 offset */
pci_read_config_byte (hcd->pdev, 0x60, &tempbyte);
temp = readw (&ehci->caps->hci_version);
- dev_info (*hcd->controller,
+ ehci_info (ehci,
"USB %x.%x enabled, EHCI %x.%02x, driver %s\n",
((tempbyte & 0xf0)>>4), (tempbyte & 0x0f),
temp >> 8, temp & 0xff, DRIVER_VERSION);
@@ -494,10 +496,11 @@ static void ehci_stop (struct usb_hcd *hcd)
/* no more interrupts ... */
if (hcd->state == USB_STATE_RUNNING)
ehci_ready (ehci);
- if (in_interrupt ()) /* should not happen!! */
- dev_err (*hcd->controller, "stopped %s!\n", RUN_CONTEXT);
- else
- del_timer_sync (&ehci->watchdog);
+ if (in_interrupt ()) { /* must not happen!! */
+ ehci_err (ehci, "stopped in_interrupt!\n");
+ return;
+ }
+ del_timer_sync (&ehci->watchdog);
ehci_reset (ehci);
/* let companion controllers work when we aren't */
@@ -506,8 +509,9 @@ static void ehci_stop (struct usb_hcd *hcd)
remove_debug_files (ehci);
/* root hub is shut down separately (first, when possible) */
- tasklet_disable (&ehci->tasklet);
- ehci_tasklet ((unsigned long) ehci);
+ spin_lock_irq (&ehci->lock);
+ ehci_work (ehci, NULL);
+ spin_unlock_irq (&ehci->lock);
ehci_mem_cleanup (ehci);
#ifdef EHCI_STATS
@@ -615,22 +619,16 @@ dbg ("%s: resume port %d", hcd_to_bus (hcd)->bus_name, i);
/*-------------------------------------------------------------------------*/
/*
- * tasklet scheduled by some interrupts and other events
- * calls driver completion functions ... but not in_irq()
+ * ehci_work is called from some interrupts, timers, and so on.
+ * it calls driver completion functions, after dropping ehci->lock.
*/
-static void ehci_tasklet (unsigned long param)
+static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs)
{
- struct ehci_hcd *ehci = (struct ehci_hcd *) param;
-
- spin_lock_irq (&ehci->lock);
-
if (ehci->reclaim_ready)
- end_unlink_async (ehci);
- scan_async (ehci);
+ end_unlink_async (ehci, regs);
+ scan_async (ehci, regs);
if (ehci->next_uframe != -1)
- scan_periodic (ehci);
-
- spin_unlock_irq (&ehci->lock);
+ scan_periodic (ehci, regs);
}
/*-------------------------------------------------------------------------*/
@@ -643,7 +641,7 @@ static void ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
/* e.g. cardbus physical eject */
if (status == ~(u32) 0) {
- dbg ("%s: device removed!", hcd_to_bus (hcd)->bus_name);
+ ehci_dbg (ehci, "device removed\n");
goto dead;
}
@@ -651,6 +649,8 @@ static void ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
if (!status) /* irq sharing? */
return;
+ spin_lock (&ehci->lock);
+
/* clear (just) interrupts */
writel (status, &ehci->regs->status);
readl (&ehci->regs->command); /* unblock posted write */
@@ -681,8 +681,7 @@ static void ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
/* PCI errors [4.15.2.4] */
if (unlikely ((status & STS_FATAL) != 0)) {
- err ("%s: fatal error, state %x",
- hcd_to_bus (hcd)->bus_name, hcd->state);
+ ehci_err (ehci, "fatal error\n");
dead:
ehci_reset (ehci);
/* generic layer kills/unlinks all urbs, then
@@ -691,9 +690,9 @@ dead:
bh = 1;
}
- /* most work doesn't need to be in_irq() */
- if (likely (bh == 1))
- tasklet_schedule (&ehci->tasklet);
+ if (bh)
+ ehci_work (ehci, regs);
+ spin_unlock (&ehci->lock);
}
/*-------------------------------------------------------------------------*/
@@ -754,52 +753,52 @@ static int ehci_urb_enqueue (
static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
- struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv;
+ struct ehci_qh *qh;
unsigned long flags;
+ int maybe_irq = 1;
- ehci_vdbg (ehci, "urb_dequeue %p qh %p state %d\n",
- urb, qh, qh->qh_state);
-
+ spin_lock_irqsave (&ehci->lock, flags);
switch (usb_pipetype (urb->pipe)) {
// case PIPE_CONTROL:
// case PIPE_BULK:
default:
- spin_lock_irqsave (&ehci->lock, flags);
- if (ehci->reclaim) {
- vdbg ("dq %p: reclaim = %p, %s",
- qh, ehci->reclaim, RUN_CONTEXT);
- if (qh == ehci->reclaim) {
- /* unlinking qh for another queued urb? */
- spin_unlock_irqrestore (&ehci->lock, flags);
- return 0;
- }
- if (in_interrupt ()) {
- spin_unlock_irqrestore (&ehci->lock, flags);
- return -EAGAIN;
- }
- while (qh->qh_state == QH_STATE_LINKED
- && ehci->reclaim
- && ehci->hcd.state != USB_STATE_HALT
- ) {
- spin_unlock_irqrestore (&ehci->lock, flags);
- /* let pending unlinks complete */
- wait_ms (1);
- spin_lock_irqsave (&ehci->lock, flags);
+ qh = (struct ehci_qh *) urb->hcpriv;
+ if (!qh)
+ break;
+ while (qh->qh_state == QH_STATE_LINKED
+ && ehci->reclaim
+ && HCD_IS_RUNNING (ehci->hcd.state)
+ ) {
+ spin_unlock_irqrestore (&ehci->lock, flags);
+
+ if (maybe_irq) {
+ if (in_interrupt ())
+ return -EAGAIN;
+ maybe_irq = 0;
}
+ /* let pending unlinks complete, so this can start */
+ wait_ms (1);
+
+ spin_lock_irqsave (&ehci->lock, flags);
}
+ if (!HCD_IS_RUNNING (ehci->hcd.state) && ehci->reclaim)
+ end_unlink_async (ehci, NULL);
+
+ /* something else might have unlinked the qh by now */
if (qh->qh_state == QH_STATE_LINKED)
start_unlink_async (ehci, qh);
- spin_unlock_irqrestore (&ehci->lock, flags);
break;
case PIPE_INTERRUPT:
- spin_lock_irqsave (&ehci->lock, flags);
+ qh = (struct ehci_qh *) urb->hcpriv;
+ if (!qh)
+ break;
if (qh->qh_state == QH_STATE_LINKED) {
/* messy, can spin or block a microframe ... */
intr_deschedule (ehci, qh, 1);
/* qh_state == IDLE */
}
- qh_completions (ehci, qh);
+ qh_completions (ehci, qh, NULL);
/* reschedule QH iff another request is queued */
if (!list_empty (&qh->qtd_list)
@@ -817,7 +816,6 @@ static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
}
return status;
}
- spin_unlock_irqrestore (&ehci->lock, flags);
break;
case PIPE_ISOCHRONOUS:
@@ -828,6 +826,7 @@ static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
urb->transfer_flags |= EHCI_STATE_UNLINK;
break;
}
+ spin_unlock_irqrestore (&ehci->lock, flags);
return 0;
}
@@ -885,11 +884,11 @@ static void ehci_free_config (struct usb_hcd *hcd, struct usb_device *udev)
*/
while (qh->qh_state == QH_STATE_LINKED
&& ehci->reclaim
- && ehci->hcd.state != USB_STATE_HALT
+ && HCD_IS_RUNNING (ehci->hcd.state)
) {
spin_unlock_irqrestore (&ehci->lock, flags);
/* wait_ms() won't spin, we're a thread;
- * and we know IRQ+tasklet can progress
+ * and we know IRQ/timer/... can progress
*/
wait_ms (1);
spin_lock_irqsave (&ehci->lock, flags);
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index c0795ddba09f..6dbf4e3cc4e3 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -315,7 +315,7 @@ static int ehci_hub_control (
wIndex + 1);
temp |= PORT_OWNER;
} else {
- ehci_vdbg (ehci, "port %d reset", wIndex + 1);
+ ehci_vdbg (ehci, "port %d reset\n", wIndex + 1);
temp |= PORT_RESET;
temp &= ~PORT_PE;
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 11e054680fd4..1ecaa0dda389 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -73,8 +73,11 @@ static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, int flags)
dma_addr_t dma;
qtd = pci_pool_alloc (ehci->qtd_pool, flags, &dma);
- if (qtd != 0)
+ if (qtd != 0) {
ehci_qtd_init (qtd, dma);
+ if (ehci->async)
+ qtd->hw_alt_next = ehci->async->hw_alt_next;
+ }
return qtd;
}
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index c4c6b9f7e6c1..1948de4eb2a9 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -73,11 +73,6 @@ qtd_fill (struct ehci_qtd *qtd, dma_addr_t buf, size_t len, int token)
qtd->hw_token = cpu_to_le32 ((count << 16) | token);
qtd->length = count;
-#if 0
- vdbg (" qtd_fill %p, token %8x bytes %d dma %x",
- qtd, le32_to_cpu (qtd->hw_token), count, qtd->hw_buf [0]);
-#endif
-
return count;
}
@@ -85,11 +80,12 @@ qtd_fill (struct ehci_qtd *qtd, dma_addr_t buf, size_t len, int token)
/* update halted (but potentially linked) qh */
-static void qh_update (struct ehci_qh *qh, struct ehci_qtd *qtd)
+static void
+qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd)
{
qh->hw_current = 0;
qh->hw_qtd_next = QTD_NEXT (qtd->qtd_dma);
- qh->hw_alt_next = EHCI_LIST_END;
+ qh->hw_alt_next = ehci->async->hw_alt_next;
/* HC must see latest qtd and qh data before we clear ACTIVE+HALT */
wmb ();
@@ -98,7 +94,12 @@ static void qh_update (struct ehci_qh *qh, struct ehci_qtd *qtd)
/*-------------------------------------------------------------------------*/
-static inline void qtd_copy_status (struct urb *urb, size_t length, u32 token)
+static inline void qtd_copy_status (
+ struct ehci_hcd *ehci,
+ struct urb *urb,
+ size_t length,
+ u32 token
+)
{
/* count IN/OUT bytes, not SETUP (even short packets) */
if (likely (QTD_PID (token) != 2))
@@ -132,7 +133,7 @@ static inline void qtd_copy_status (struct urb *urb, size_t length, u32 token)
ehci_vdbg (ehci,
"dev%d ep%d%s qtd token %08x --> status %d\n",
- usb_pipedev (urb->pipe),
+ usb_pipedevice (urb->pipe),
usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out",
token, urb->status);
@@ -157,9 +158,17 @@ static inline void qtd_copy_status (struct urb *urb, size_t length, u32 token)
}
}
}
+
+ /* force cleanup after short read; not necessarily an error */
+ if (unlikely (urb->status == -EINPROGRESS
+ && QTD_LENGTH (token) != 0
+ && QTD_PID (token) == 1)) {
+ urb->status = -EREMOTEIO;
+ }
}
-static void ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb)
+static void
+ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
{
if (likely (urb->hcpriv != 0)) {
struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv;
@@ -171,27 +180,31 @@ static void ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb)
hcd_to_bus (&ehci->hcd)->bandwidth_int_reqs--;
}
qh_put (ehci, qh);
- urb->hcpriv = 0;
}
- if (likely (urb->status == -EINPROGRESS)) {
- if (urb->actual_length != urb->transfer_buffer_length
- && (urb->transfer_flags & URB_SHORT_NOT_OK))
- urb->status = -EREMOTEIO;
- else
+ spin_lock (&urb->lock);
+ urb->hcpriv = 0;
+ switch (urb->status) {
+ case -EINPROGRESS: /* success */
+ urb->status = 0;
+ default: /* fault */
+ COUNT (ehci->stats.complete);
+ break;
+ case -EREMOTEIO: /* fault or normal */
+ if (!(urb->transfer_flags & URB_SHORT_NOT_OK))
urb->status = 0;
- }
-
- if (likely (urb->status == 0))
COUNT (ehci->stats.complete);
- else if (urb->status == -ECONNRESET || urb->status == -ENOENT)
+ break;
+ case -ECONNRESET: /* canceled */
+ case -ENOENT:
COUNT (ehci->stats.unlink);
- else
- COUNT (ehci->stats.error);
+ break;
+ }
+ spin_unlock (&urb->lock);
/* complete() can reenter this HCD */
spin_unlock (&ehci->lock);
- usb_hcd_giveback_urb (&ehci->hcd, urb, NULL);
+ usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
spin_lock (&ehci->lock);
}
@@ -203,14 +216,14 @@ static void ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb)
* indicating how much "real" work we did.
*/
static unsigned
-qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
+qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
{
struct ehci_qtd *qtd, *last;
struct list_head *next, *qtd_list = &qh->qtd_list;
- int unlink = 0, halted = 0;
+ int unlink = 0, stopped = 0;
unsigned count = 0;
- if (unlikely (list_empty (qtd_list)))
+ if (unlikely (list_empty (&qh->qtd_list)))
return count;
/* scan QTDs till end of list, or we reach an active one */
@@ -225,7 +238,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
/* clean up any state from previous QTD ...*/
if (last) {
if (likely (last->urb != urb)) {
- ehci_urb_done (ehci, last->urb);
+ ehci_urb_done (ehci, last->urb, regs);
count++;
}
ehci_qtd_free (ehci, last);
@@ -236,12 +249,14 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
/* QTDs at tail may be active if QH+HC are running,
* or when unlinking some urbs queued to this QH
*/
+ rmb ();
token = le32_to_cpu (qtd->hw_token);
- halted = halted
+ stopped = stopped
+ || (qh->qh_state == QH_STATE_IDLE)
|| (__constant_cpu_to_le32 (QTD_STS_HALT)
& qh->hw_token) != 0
|| (ehci->hcd.state == USB_STATE_HALT)
- || (qh->qh_state == QH_STATE_IDLE);
+ || (qh->hw_current == ehci->async->hw_alt_next);
// FIXME Remove the automagic unlink mode.
// Drivers can now clean up safely; it's their job.
@@ -257,7 +272,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
/* status copied below */
/* QH halts only because of fault (above) or unlink (here). */
- } else if (unlikely (halted != 0)) {
+ } else if (unlikely (stopped != 0)) {
/* unlinking everything because of HC shutdown? */
if (ehci->hcd.state == USB_STATE_HALT) {
@@ -293,32 +308,22 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
}
spin_lock (&urb->lock);
- qtd_copy_status (urb, qtd->length, token);
+ qtd_copy_status (ehci, urb, qtd->length, token);
spin_unlock (&urb->lock);
list_del (&qtd->qtd_list);
-
-#if 0
- if (urb->status == -EINPROGRESS)
- vdbg (" qtd %p ok, urb %p, token %8x, len %d",
- qtd, urb, token, urb->actual_length);
- else
- vdbg ("urb %p status %d, qtd %p, token %8x, len %d",
- urb, urb->status, qtd, token,
- urb->actual_length);
-#endif
}
/* last urb's completion might still need calling */
if (likely (last != 0)) {
- ehci_urb_done (ehci, last->urb);
+ ehci_urb_done (ehci, last->urb, regs);
count++;
ehci_qtd_free (ehci, last);
}
/* reactivate queue after error and driver's cleanup */
- if (unlikely (halted && !list_empty (qtd_list))) {
- qh_update (qh, list_entry (qtd_list->next,
+ if (unlikely (stopped && !list_empty (&qh->qtd_list))) {
+ qh_update (ehci, qh, list_entry (qh->qtd_list.next,
struct ehci_qtd, qtd_list));
}
@@ -369,7 +374,6 @@ qh_urb_transaction (
qtd = ehci_qtd_alloc (ehci, flags);
if (unlikely (!qtd))
return 0;
- qtd_prev = 0;
list_add_tail (&qtd->qtd_list, head);
qtd->urb = urb;
@@ -377,6 +381,8 @@ qh_urb_transaction (
token |= (EHCI_TUNE_CERR << 10);
/* for split transactions, SplitXState initialized to zero */
+ len = urb->transfer_buffer_length;
+ is_input = usb_pipein (urb->pipe);
if (usb_pipecontrol (urb->pipe)) {
/* SETUP pid */
qtd_fill (qtd, urb->setup_dma, sizeof (struct usb_ctrlrequest),
@@ -392,15 +398,14 @@ qh_urb_transaction (
qtd_prev->hw_next = QTD_NEXT (qtd->qtd_dma);
list_add_tail (&qtd->qtd_list, head);
- if (!(urb->transfer_flags & URB_SHORT_NOT_OK))
+ if (len > 0 && is_input
+ && !(urb->transfer_flags & URB_SHORT_NOT_OK))
status_patch = 1;
}
/*
* data transfer stage: buffer setup
*/
- len = urb->transfer_buffer_length;
- is_input = usb_pipein (urb->pipe);
if (likely (len > 0))
buf = urb->transfer_dma;
else
@@ -420,7 +425,6 @@ qh_urb_transaction (
for (;;) {
int this_qtd_len;
- qtd->urb = urb;
this_qtd_len = qtd_fill (qtd, buf, len, token);
len -= this_qtd_len;
buf += this_qtd_len;
@@ -578,7 +582,6 @@ ehci_qh_make (
if (qh->period < 1) {
dbg ("intr period %d uframes, NYET!",
urb->interval);
- qh = 0;
goto done;
}
} else {
@@ -639,7 +642,9 @@ ehci_qh_make (
break;
default:
dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed);
- return 0;
+done:
+ qh_put (ehci, qh);
+ return 0;
}
/* NOTE: if (PIPE_INTERRUPT) { scheduler sets s-mask } */
@@ -658,15 +663,13 @@ ehci_qh_make (
list_splice (qtd_list, &qh->qtd_list);
qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
- qh_update (qh, qtd);
+ qh_update (ehci, qh, qtd);
} else {
qh->hw_qtd_next = qh->hw_alt_next = EHCI_LIST_END;
}
/* initialize data toggle state */
clear_toggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, qh);
-
-done:
return qh;
}
#undef hb_mult
@@ -685,7 +688,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
head = ehci->async;
if (ehci->async_idle)
del_timer (&ehci->watchdog);
- else if (!head->qh_next.qh) {
+ if (!head->qh_next.qh) {
u32 cmd = readl (&ehci->regs->command);
if (!(cmd & CMD_ASE)) {
@@ -698,6 +701,8 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
}
}
+ qh->hw_token &= ~__constant_cpu_to_le32 (QTD_STS_HALT);
+
/* splice right after start */
qh->qh_next = head->qh_next;
qh->hw_next = head->hw_next;
@@ -774,8 +779,8 @@ static struct ehci_qh *qh_append_tds (
*/
token = qtd->hw_token;
qtd->hw_token = 0;
+ wmb ();
dummy = qh->dummy;
- // dbg ("swap td %p with dummy %p", qtd, dummy);
dma = dummy->qtd_dma;
*dummy = *qtd;
@@ -784,9 +789,11 @@ static struct ehci_qh *qh_append_tds (
list_add (&dummy->qtd_list, qtd_list);
ehci_qtd_init (qtd, qtd->qtd_dma);
+ qtd->hw_alt_next = ehci->async->hw_alt_next;
qh->dummy = qtd;
/* hc must see the new dummy at list end */
+ dma = qtd->qtd_dma;
qtd = list_entry (qh->qtd_list.prev,
struct ehci_qtd, qtd_list);
qtd->hw_next = QTD_NEXT (dma);
@@ -797,15 +804,6 @@ static struct ehci_qh *qh_append_tds (
/* no URB queued */
} else {
- struct ehci_qtd *last_qtd;
-
- /* make sure hc sees current dummy at the end */
- last_qtd = list_entry (qtd_list->prev,
- struct ehci_qtd, qtd_list);
- last_qtd->hw_next = QTD_NEXT (qh->dummy->qtd_dma);
-
- // dbg_qh ("empty qh", ehci, qh);
-
/* usb_clear_halt() means qh data toggle gets reset */
if (unlikely (!usb_gettoggle (urb->dev,
(epnum & 0x0f),
@@ -813,15 +811,23 @@ static struct ehci_qh *qh_append_tds (
clear_toggle (urb->dev,
epnum & 0x0f, !(epnum & 0x10), qh);
}
- if (qtd)
- qh_update (qh, qtd);
+
+ /* make sure hc sees current dummy at the end */
+ if (qtd) {
+ struct ehci_qtd *last_qtd;
+
+ last_qtd = list_entry (qtd_list->prev,
+ struct ehci_qtd, qtd_list);
+ last_qtd->hw_next = QTD_NEXT (
+ qh->dummy->qtd_dma);
+ qh_update (ehci, qh, qtd);
+ }
}
list_splice (qtd_list, qh->qtd_list.prev);
} else {
/* can't sleep here, we have ehci->lock... */
qh = ehci_qh_make (ehci, urb, qtd_list, SLAB_ATOMIC);
- // if (qh) dbg_qh ("new qh", ehci, qh);
*ptr = qh;
}
if (qh)
@@ -877,34 +883,38 @@ submit_async (
/*-------------------------------------------------------------------------*/
/* the async qh for the qtds being reclaimed are now unlinked from the HC */
-/* caller must not own ehci->lock */
-static void end_unlink_async (struct ehci_hcd *ehci)
+static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
{
struct ehci_qh *qh = ehci->reclaim;
del_timer (&ehci->watchdog);
+ qh->hw_next = cpu_to_le32 (qh->qh_dma);
qh->qh_state = QH_STATE_IDLE;
qh->qh_next.qh = 0;
qh_put (ehci, qh); // refcount from reclaim
ehci->reclaim = 0;
ehci->reclaim_ready = 0;
- qh_completions (ehci, qh);
+ qh_completions (ehci, qh, regs);
if (!list_empty (&qh->qtd_list)
&& HCD_IS_RUNNING (ehci->hcd.state))
qh_link_async (ehci, qh);
- else
+ else {
qh_put (ehci, qh); // refcount from async list
- /* it's not free to turn the async schedule on/off, so we leave it
- * active but idle for a while once it empties.
- */
- if (!ehci->async->qh_next.qh && !timer_pending (&ehci->watchdog)) {
- ehci->async_idle = 1;
- mod_timer (&ehci->watchdog, jiffies + EHCI_ASYNC_JIFFIES);
+ /* it's not free to turn the async schedule on/off; leave it
+ * active but idle for a while once it empties.
+ */
+ if (HCD_IS_RUNNING (ehci->hcd.state)
+ && ehci->async->qh_next.qh == 0
+ && !timer_pending (&ehci->watchdog)) {
+ ehci->async_idle = 1;
+ mod_timer (&ehci->watchdog,
+ jiffies + EHCI_ASYNC_JIFFIES);
+ }
}
}
@@ -941,12 +951,6 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
qh->qh_state = QH_STATE_UNLINK;
ehci->reclaim = qh = qh_get (qh);
- if (unlikely (ehci->hcd.state == USB_STATE_HALT)) {
- ehci->reclaim_ready = 1;
- tasklet_schedule (&ehci->tasklet);
- return;
- }
-
prev = ehci->async;
while (prev->qh_next.qh != qh)
prev = prev->qh_next.qh;
@@ -955,6 +959,11 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
prev->qh_next = qh->qh_next;
wmb ();
+ if (unlikely (ehci->hcd.state == USB_STATE_HALT)) {
+ end_unlink_async (ehci, NULL);
+ return;
+ }
+
ehci->reclaim_ready = 0;
cmd |= CMD_IAAD;
writel (cmd, &ehci->regs->command);
@@ -966,7 +975,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
/*-------------------------------------------------------------------------*/
static void
-scan_async (struct ehci_hcd *ehci)
+scan_async (struct ehci_hcd *ehci, struct pt_regs *regs)
{
struct ehci_qh *qh;
unsigned count;
@@ -984,7 +993,7 @@ rescan:
* reporting drops the lock.
*/
qh = qh_get (qh);
- temp = qh_completions (ehci, qh);
+ temp = qh_completions (ehci, qh, regs);
qh_put (ehci, qh);
if (temp != 0) {
count += temp;
@@ -1002,14 +1011,6 @@ rescan:
start_unlink_async (ehci, qh);
}
- /* keep latencies down: let any irqs in */
- if (count > max_completions) {
- spin_unlock_irq (&ehci->lock);
- cpu_relax ();
- spin_lock_irq (&ehci->lock);
- goto rescan;
- }
-
qh = qh->qh_next.qh;
} while (qh);
}
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 528574425424..c104506eeafb 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -190,7 +190,7 @@ static int enable_periodic (struct ehci_hcd *ehci)
/* posted write ... PSS happens later */
ehci->hcd.state = USB_STATE_RUNNING;
- /* make sure tasklet scans these */
+ /* make sure ehci_work scans these */
ehci->next_uframe = readl (&ehci->regs->frame_index)
% (ehci->periodic_size << 3);
return 0;
@@ -495,7 +495,8 @@ static unsigned
intr_complete (
struct ehci_hcd *ehci,
unsigned frame,
- struct ehci_qh *qh
+ struct ehci_qh *qh,
+ struct pt_regs *regs
) {
unsigned count;
@@ -509,7 +510,7 @@ intr_complete (
}
/* handle any completions */
- count = qh_completions (ehci, qh);
+ count = qh_completions (ehci, qh, regs);
if (unlikely (list_empty (&qh->qtd_list)))
intr_deschedule (ehci, qh, 0);
@@ -867,7 +868,8 @@ static unsigned
itd_complete (
struct ehci_hcd *ehci,
struct ehci_itd *itd,
- unsigned uframe
+ unsigned uframe,
+ struct pt_regs *regs
) {
struct urb *urb = itd->urb;
struct usb_iso_packet_descriptor *desc;
@@ -922,7 +924,7 @@ itd_complete (
/* complete() can reenter this HCD */
spin_unlock (&ehci->lock);
- usb_hcd_giveback_urb (&ehci->hcd, urb, NULL);
+ usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
spin_lock (&ehci->lock);
/* defer stopping schedule; completion can submit */
@@ -973,7 +975,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, int mem_flags)
/*-------------------------------------------------------------------------*/
static void
-scan_periodic (struct ehci_hcd *ehci)
+scan_periodic (struct ehci_hcd *ehci, struct pt_regs *regs)
{
unsigned frame, clock, now_uframe, mod;
unsigned count = 0;
@@ -999,14 +1001,6 @@ scan_periodic (struct ehci_hcd *ehci)
u32 type, *hw_p;
unsigned uframes;
- /* keep latencies down: let any irqs in */
- if (count > max_completions) {
- spin_unlock_irq (&ehci->lock);
- cpu_relax ();
- count = 0;
- spin_lock_irq (&ehci->lock);
- }
-
restart:
/* scan schedule to _before_ current frame index */
if (frame == clock)
@@ -1031,7 +1025,7 @@ restart:
temp = q.qh->qh_next;
type = Q_NEXT_TYPE (q.qh->hw_next);
count += intr_complete (ehci, frame,
- qh_get (q.qh));
+ qh_get (q.qh), regs);
qh_put (ehci, q.qh);
q = temp;
break;
@@ -1064,7 +1058,7 @@ restart:
/* might free q.itd ... */
count += itd_complete (ehci,
- temp.itd, uf);
+ temp.itd, uf, regs);
break;
}
}
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index d7fd079ba1b1..f57b8e3e179e 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -65,9 +65,6 @@ struct ehci_hcd { /* one per controller */
int next_uframe; /* scan periodic, start here */
unsigned periodic_sched; /* periodic activity count */
- /* deferred work from IRQ, etc */
- struct tasklet_struct tasklet;
-
/* per root hub port */
unsigned long reset_done [EHCI_MAX_ROOT_PORTS];
diff --git a/drivers/usb/media/ibmcam.c b/drivers/usb/media/ibmcam.c
index 1630ba673fde..7a53772811c2 100644
--- a/drivers/usb/media/ibmcam.c
+++ b/drivers/usb/media/ibmcam.c
@@ -87,7 +87,7 @@ typedef struct {
} ibmcam_t;
#define IBMCAM_T(uvd) ((ibmcam_t *)((uvd)->user_data))
-usbvideo_t *cams = NULL;
+struct usbvideo *cams = NULL;
static int debug = 0;
@@ -249,7 +249,7 @@ static videosize_t ibmcam_size_to_videosize(int size)
* History:
* 1/21/00 Created.
*/
-static ParseState_t ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */
+static enum ParseState ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */
{
struct usbvideo_frame *frame;
ibmcam_t *icam;
@@ -397,7 +397,7 @@ case IBMCAM_MODEL_4:
* 21-Jan-2000 Created.
* 12-Oct-2000 Reworked to reflect interlaced nature of the data.
*/
-static ParseState_t ibmcam_parse_lines(
+static enum ParseState ibmcam_parse_lines(
struct uvd *uvd,
struct usbvideo_frame *frame,
long *pcopylen)
@@ -662,7 +662,7 @@ static ParseState_t ibmcam_parse_lines(
* them both as R component in attempt to at least partially recover the
* lost resolution.
*/
-static ParseState_t ibmcam_model2_320x240_parse_lines(
+static enum ParseState ibmcam_model2_320x240_parse_lines(
struct uvd *uvd,
struct usbvideo_frame *frame,
long *pcopylen)
@@ -816,7 +816,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines(
return scan_Continue;
}
-static ParseState_t ibmcam_model3_parse_lines(
+static enum ParseState ibmcam_model3_parse_lines(
struct uvd *uvd,
struct usbvideo_frame *frame,
long *pcopylen)
@@ -961,7 +961,7 @@ static ParseState_t ibmcam_model3_parse_lines(
* History:
* 10-Feb-2001 Created.
*/
-static ParseState_t ibmcam_model4_128x96_parse_lines(
+static enum ParseState ibmcam_model4_128x96_parse_lines(
struct uvd *uvd,
struct usbvideo_frame *frame,
long *pcopylen)
@@ -1051,7 +1051,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines(
*/
void ibmcam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
{
- ParseState_t newstate;
+ enum ParseState newstate;
long copylen = 0;
int mod = IBMCAM_T(uvd)->camera_model;
diff --git a/drivers/usb/media/konicawc.c b/drivers/usb/media/konicawc.c
index 22b738aee272..324d3ab0fcfd 100644
--- a/drivers/usb/media/konicawc.c
+++ b/drivers/usb/media/konicawc.c
@@ -51,7 +51,7 @@ enum frame_sizes {
#define MAX_FRAME_SIZE SIZE_320X240
-static usbvideo_t *cams;
+static struct usbvideo *cams;
#ifdef CONFIG_USB_DEBUG
static int debug;
diff --git a/drivers/usb/media/pwc-ctrl.c b/drivers/usb/media/pwc-ctrl.c
index 6244117a470f..92c5c8239913 100644
--- a/drivers/usb/media/pwc-ctrl.c
+++ b/drivers/usb/media/pwc-ctrl.c
@@ -446,8 +446,8 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
Info("Video mode %s@%d fps is only supported with the decompressor module (pwcx).\n", size2name[size], frames);
else {
Err("Failed to set video mode %s@%d fps; return code = %d\n", size2name[size], frames, ret);
- return ret;
}
+ return ret;
}
pdev->view.x = width;
pdev->view.y = height;
@@ -1534,7 +1534,15 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
*dynnoise = ret;
break;
}
-
+
+ case VIDIOCPWCGREALSIZE:
+ {
+ struct pwc_imagesize *size = arg;
+
+ size->width = pdev->image.x;
+ size->height = pdev->image.y;
+ break;
+ }
default:
ret = -ENOIOCTLCMD;
diff --git a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c
index 08dff12a572a..d6352f45f261 100644
--- a/drivers/usb/media/pwc-if.c
+++ b/drivers/usb/media/pwc-if.c
@@ -77,7 +77,7 @@ static struct usb_device_id pwc_device_table [] = {
{ USB_DEVICE(0x0471, 0x0312) },
{ USB_DEVICE(0x069A, 0x0001) }, /* Askey */
{ USB_DEVICE(0x046D, 0x08b0) }, /* Logitech QuickCam Pro 3000 */
- { USB_DEVICE(0x046D, 0x08b1) }, /* Logitech QuickCam for Notebooks */
+ { USB_DEVICE(0x046D, 0x08b1) }, /* Logitech QuickCam Notebook Pro */
{ USB_DEVICE(0x046D, 0x08b2) }, /* Logitech QuickCam Pro 4000 */
{ USB_DEVICE(0x046D, 0x08b3) }, /* Logitech QuickCam Zoom */
{ USB_DEVICE(0x055D, 0x9000) }, /* Samsung */
@@ -992,7 +992,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
case 0x40: sensor_type = "UPA 1021 sensor"; break;
case 0x100: sensor_type = "VGA sensor"; break;
case 0x101: sensor_type = "PAL MR sensor"; break;
- default: sensor_type = "unknown type of sensor"; break;
+ default: sensor_type = "unknown type of sensor"; break;
}
if (sensor_type != NULL)
Info("This %s camera is equipped with a %s (%d).\n", pdev->vdev->name, sensor_type, i);
@@ -1064,7 +1064,6 @@ static int pwc_video_open(struct inode *inode, struct file *file)
i = pwc_isoc_init(pdev);
if (i) {
Trace(TRACE_OPEN, "Failed to init ISOC stuff = %d.\n", i);
- MOD_DEC_USE_COUNT;
up(&pdev->modlock);
return i;
}
@@ -1689,8 +1688,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
type_id = 730;
break;
case 0x08b1:
- Info("Logitech QuickCam for Noteboos USB webcam detected.\n");
- name = "Logitech QuickCam Notebook";
+ Info("Logitech QuickCam Notebook Pro USB webcam detected.\n");
+ name = "Logitech QuickCam Notebook Pro";
type_id = 740; /* ?? unknown sensor */
break;
case 0x08b2:
diff --git a/drivers/usb/media/pwc-ioctl.h b/drivers/usb/media/pwc-ioctl.h
index d7306635fa06..141f063dd5cb 100644
--- a/drivers/usb/media/pwc-ioctl.h
+++ b/drivers/usb/media/pwc-ioctl.h
@@ -18,12 +18,13 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* This is pwc-ioctl.h belonging to PWC 8.7 */
+/* This is pwc-ioctl.h belonging to PWC 8.10 */
/*
Changes
2001/08/03 Alvarado Added ioctl constants to access methods for
changing white balance and red/blue gains
+ 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE
*/
/* These are private ioctl() commands, specific for the Philips webcams.
@@ -104,7 +105,12 @@ struct pwc_leds
int led_off; /* Led off-time; range = 0..25000 */
};
-
+/* Image size (used with GREALSIZE) */
+struct pwc_imagesize
+{
+ int width;
+ int height;
+};
/* Restore user settings */
#define VIDIOCPWCRUSER _IO('v', 192)
@@ -173,4 +179,7 @@ struct pwc_leds
#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int)
#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int)
+ /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */
+#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize)
+
#endif
diff --git a/drivers/usb/media/pwc-uncompress.h b/drivers/usb/media/pwc-uncompress.h
index 58c32aab0792..0f3789b4d0ad 100644
--- a/drivers/usb/media/pwc-uncompress.h
+++ b/drivers/usb/media/pwc-uncompress.h
@@ -20,8 +20,8 @@
significant change should be reflected by increasing the
pwc_decompressor_version major number.
*/
-#ifndef PWC_DEC_H
-#define PWC_DEC_H
+#ifndef PWC_UNCOMPRESS_H
+#define PWC_UNCOMPRESS_H
#include <linux/config.h>
#include <linux/list.h>
diff --git a/drivers/usb/media/pwc.h b/drivers/usb/media/pwc.h
index 913f2d4aa193..3ff42fc9f20e 100644
--- a/drivers/usb/media/pwc.h
+++ b/drivers/usb/media/pwc.h
@@ -60,8 +60,8 @@
/* Version block */
#define PWC_MAJOR 8
-#define PWC_MINOR 9
-#define PWC_VERSION "8.9"
+#define PWC_MINOR 10
+#define PWC_VERSION "8.10"
#define PWC_NAME "pwc"
/* Turn certain features on/off */
diff --git a/drivers/usb/media/ultracam.c b/drivers/usb/media/ultracam.c
index f0f3a8e9d60a..cc8bca854b56 100644
--- a/drivers/usb/media/ultracam.c
+++ b/drivers/usb/media/ultracam.c
@@ -25,7 +25,7 @@ typedef struct {
} ultracam_t;
#define ULTRACAM_T(uvd) ((ultracam_t *)((uvd)->user_data))
-static usbvideo_t *cams = NULL;
+static struct usbvideo *cams = NULL;
static int debug = 0;
diff --git a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c
index 1a8c63da8460..fe0c7e35f812 100644
--- a/drivers/usb/media/usbvideo.c
+++ b/drivers/usb/media/usbvideo.c
@@ -42,8 +42,8 @@ MODULE_PARM(video_nr, "i");
* Local prototypes.
*/
#if USES_PROC_FS
-static void usbvideo_procfs_level1_create(usbvideo_t *ut);
-static void usbvideo_procfs_level1_destroy(usbvideo_t *ut);
+static void usbvideo_procfs_level1_create(struct usbvideo *ut);
+static void usbvideo_procfs_level1_destroy(struct usbvideo *ut);
static void usbvideo_procfs_level2_create(struct uvd *uvd);
static void usbvideo_procfs_level2_destroy(struct uvd *uvd);
static int usbvideo_default_procfs_read_proc(
@@ -765,7 +765,7 @@ static void usbvideo_ClientDecModCount(struct uvd *uvd)
}
int usbvideo_register(
- usbvideo_t **pCams,
+ struct usbvideo **pCams,
const int num_cams,
const int num_extra,
const char *driverName,
@@ -773,7 +773,7 @@ int usbvideo_register(
struct module *md,
const struct usb_device_id *id_table)
{
- usbvideo_t *cams;
+ struct usbvideo *cams;
int i, base_size;
/* Check parameters for sanity */
@@ -788,10 +788,10 @@ int usbvideo_register(
return -EINVAL;
}
- base_size = num_cams * sizeof(struct uvd) + sizeof(usbvideo_t);
- cams = (usbvideo_t *) kmalloc(base_size, GFP_KERNEL);
+ base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
+ cams = (struct usbvideo *) kmalloc(base_size, GFP_KERNEL);
if (cams == NULL) {
- err("Failed to allocate %d. bytes for usbvideo_t", base_size);
+ err("Failed to allocate %d. bytes for usbvideo struct", base_size);
return -ENOMEM;
}
dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
@@ -823,7 +823,7 @@ int usbvideo_register(
#else /* !USES_PROC_FS */
/* Report a warning so that user knows why there is no /proc entries */
if ((cams->cb.procfs_read != NULL) || (cams->cb.procfs_write == NULL)) {
- dbg("%s: /proc fs support requested but not configured!", proc);
+ dbg("%s: /proc fs support requested but not configured!", __FUNCTION__);
}
#endif
cams->num_cameras = num_cams;
@@ -889,9 +889,9 @@ EXPORT_SYMBOL(usbvideo_register);
* if you had some dynamically allocated components in ->user field then
* you should free them before calling here.
*/
-void usbvideo_Deregister(usbvideo_t **pCams)
+void usbvideo_Deregister(struct usbvideo **pCams)
{
- usbvideo_t *cams;
+ struct usbvideo *cams;
int i;
if (pCams == NULL) {
@@ -1049,12 +1049,12 @@ static void usbvideo_CameraRelease(struct uvd *uvd)
* History:
* 27-Jan-2000 Created.
*/
-static int usbvideo_find_struct(usbvideo_t *cams)
+static int usbvideo_find_struct(struct usbvideo *cams)
{
int u, rv = -1;
if (cams == NULL) {
- err("No usbvideo_t handle?");
+ err("No usbvideo handle?");
return -1;
}
down(&cams->lock);
@@ -1089,13 +1089,13 @@ static struct video_device usbvideo_template = {
.fops = &usbvideo_fops,
};
-struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams)
+struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams)
{
int i, devnum;
struct uvd *uvd = NULL;
if (cams == NULL) {
- err("No usbvideo_t handle?");
+ err("No usbvideo handle?");
return NULL;
}
@@ -2357,7 +2357,7 @@ static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
extern struct proc_dir_entry *video_proc_entry;
-static void usbvideo_procfs_level1_create(usbvideo_t *ut)
+static void usbvideo_procfs_level1_create(struct usbvideo *ut)
{
if (ut == NULL) {
err("%s: ut == NULL", __FUNCTION__);
@@ -2376,7 +2376,7 @@ static void usbvideo_procfs_level1_create(usbvideo_t *ut)
}
}
-static void usbvideo_procfs_level1_destroy(usbvideo_t *ut)
+static void usbvideo_procfs_level1_destroy(struct usbvideo *ut)
{
if (ut == NULL) {
err("%s: ut == NULL", __FUNCTION__);
diff --git a/drivers/usb/media/usbvideo.h b/drivers/usb/media/usbvideo.h
index d8813b6d9d18..091ac84e1058 100644
--- a/drivers/usb/media/usbvideo.h
+++ b/drivers/usb/media/usbvideo.h
@@ -126,37 +126,37 @@ struct RingQueue {
wait_queue_head_t wqh; /* Processes waiting */
};
-typedef enum {
+enum ScanState {
ScanState_Scanning, /* Scanning for header */
ScanState_Lines /* Parsing lines */
-} ScanState_t;
+};
/* Completion states of the data parser */
-typedef enum {
+enum ParseState {
scan_Continue, /* Just parse next item */
scan_NextFrame, /* Frame done, send it to V4L */
scan_Out, /* Not enough data for frame */
scan_EndParse /* End parsing */
-} ParseState_t;
+};
-typedef enum {
+enum FrameState {
FrameState_Unused, /* Unused (no MCAPTURE) */
FrameState_Ready, /* Ready to start grabbing */
FrameState_Grabbing, /* In the process of being grabbed into */
FrameState_Done, /* Finished grabbing, but not been synced yet */
FrameState_Done_Hold, /* Are syncing or reading */
FrameState_Error, /* Something bad happened while processing */
-} FrameState_t;
+};
/*
* Some frames may contain only even or odd lines. This type
* specifies what type of deinterlacing is required.
*/
-typedef enum {
+enum Deinterlace {
Deinterlace_None=0,
Deinterlace_FillOddLines,
Deinterlace_FillEvenLines
-} Deinterlace_t;
+};
#define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */
#define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */
@@ -175,9 +175,9 @@ struct usbvideo_frame {
videosize_t request; /* That's what the application asked for */
unsigned short palette; /* The desired format */
- FrameState_t frameState;/* State of grabbing */
- ScanState_t scanstate; /* State of scanning */
- Deinterlace_t deinterlace;
+ enum FrameState frameState;/* State of grabbing */
+ enum ScanState scanstate; /* State of scanning */
+ enum Deinterlace deinterlace;
int flags; /* USBVIDEO_FRAME_FLAG_xxx bit flags */
int curline; /* Line of frame we're working on */
@@ -199,12 +199,12 @@ struct usbvideo_statistics {
unsigned long iso_err_count; /* How many bad ISO packets received */
};
-struct s_usbvideo_t;
+struct usbvideo;
struct uvd {
struct video_device vdev; /* Must be the first field! */
struct usb_device *dev;
- struct s_usbvideo_t *handle; /* Points back to the usbvideo_t */
+ struct usbvideo *handle; /* Points back to the struct usbvideo */
void *user_data; /* Camera-dependent data */
int user_size; /* Size of that camera-dependent data */
int debug; /* Debug level for usbvideo */
@@ -273,7 +273,7 @@ struct usbvideo_cb {
int (*setVideoMode)(struct uvd *uvd, struct video_window *vw);
};
-struct s_usbvideo_t {
+struct usbvideo {
int num_cameras; /* As allocated */
struct usb_driver usbdrv; /* Interface to the USB stack */
char drvName[80]; /* Driver name */
@@ -285,7 +285,7 @@ struct s_usbvideo_t {
struct proc_dir_entry *procfs_dEntry; /* /proc/video/MYDRIVER */
struct module *md_module; /* Minidriver module */
};
-typedef struct s_usbvideo_t usbvideo_t;
+
/*
* This macro retrieves callback address from the struct uvd object.
@@ -332,16 +332,16 @@ void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode);
unsigned long usbvideo_kvirt_to_pa(unsigned long adr);
int usbvideo_register(
- usbvideo_t **pCams,
+ struct usbvideo **pCams,
const int num_cams,
const int num_extra,
const char *driverName,
const struct usbvideo_cb *cbTable,
struct module *md,
const struct usb_device_id *id_table);
-struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams);
+struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams);
int usbvideo_RegisterVideoDevice(struct uvd *uvd);
-void usbvideo_Deregister(usbvideo_t **uvt);
+void usbvideo_Deregister(struct usbvideo **uvt);
int usbvideo_v4l_initialize(struct video_device *dev);
diff --git a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
index d9acad35b1f0..9f71e2e7c7f0 100644
--- a/drivers/usb/misc/speedtouch.c
+++ b/drivers/usb/misc/speedtouch.c
@@ -144,8 +144,9 @@ struct udsl_instance_data *minor_data[MAX_UDSL];
static const char udsl_driver_name[] = "Alcatel SpeedTouch USB";
/* data thread */
-static int datapid = 0;
DECLARE_WAIT_QUEUE_HEAD (udsl_wqh);
+static DECLARE_COMPLETION(thread_grave);
+static unsigned int datapid;
#ifdef DEBUG_PACKET
int udsl_print_packet (const unsigned char *data, int len);
@@ -431,21 +432,36 @@ int udsl_atm_processqueue_thread (void *data)
strcpy (current->comm, "kSpeedSARd");
add_wait_queue (&udsl_wqh, &wait);
+ set_current_state(TASK_INTERRUPTIBLE);
for (;;) {
- interruptible_sleep_on (&udsl_wqh);
+ schedule();
if (signal_pending (current))
break;
PDEBUG ("SpeedSARd awoke\n");
+retry:
for (i = 0; i < MAX_UDSL; i++)
if (minor_data[i])
udsl_atm_processqueue (minor_data[i]);
+ set_current_state(TASK_INTERRUPTIBLE);
+ /* we must check for data recieved and restart processing if there's any */
+ for (i = 0; i < MAX_UDSL; i++) {
+ spin_lock_irq(&minor_data[i]->recvqlock);
+ if (!skb_queue_empty(&minor_data[i]->recvqueue)) {
+ spin_unlock_irq(&minor_data[i]->recvqlock);
+ set_current_state(TASK_RUNNING);
+ goto retry;
+ } else {
+ spin_unlock_irq(&minor_data[i]->recvqlock);
+ }
+ }
};
+ set_current_state(TASK_RUNNING);
remove_wait_queue (&udsl_wqh, &wait);
- datapid = 0;
PDEBUG ("SpeedSARd is exiting\n");
- return 0;
+ complete_and_exit(&thread_grave, 0);
+ return 0; //never reached
}
@@ -461,16 +477,7 @@ void udsl_atm_sar_stop (void)
/* Kill the thread */
ret = kill_proc (datapid, SIGTERM, 1);
if (!ret) {
- /* Wait 10 seconds */
- int count = 10 * 100;
-
- while (datapid && --count) {
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout (1);
- }
-
- if (!count)
- err ("giving up on killing SpeedSAR thread.");
+ wait_for_completion(&thread_grave);
}
}
@@ -598,7 +605,7 @@ static void udsl_usb_send_data_complete (struct urb *urb, struct pt_regs *regs)
(unsigned char *) ctx->skb->data,
ctx->skb->len, udsl_usb_send_data_complete, ctx);
- err = usb_submit_urb (urb, GFP_KERNEL);
+ err = usb_submit_urb (urb, GFP_ATOMIC);
PDEBUG ("udsl_usb_send_data_completion (send packet %p with length %d), retval = %d\n",
ctx->skb, ctx->skb->len, err);
@@ -747,7 +754,7 @@ void udsl_usb_data_receive (struct urb *urb, struct pt_regs *regs)
usb_rcvbulkpipe (instance->usb_dev, UDSL_ENDPOINT_DATA_IN),
(unsigned char *) ctx->skb->data,
UDSL_RECEIVE_BUFFER_SIZE, udsl_usb_data_receive, ctx);
- usb_submit_urb (urb, GFP_KERNEL);
+ usb_submit_urb (urb, GFP_ATOMIC);
return;
};
@@ -845,8 +852,7 @@ static int udsl_usb_data_exit (struct udsl_instance_data *instance)
if ((!ctx->urb) || (!ctx->skb))
continue;
- if (ctx->urb->status == -EINPROGRESS)
- usb_unlink_urb (ctx->urb);
+ usb_unlink_urb (ctx->urb);
usb_free_urb (ctx->urb);
kfree_skb (ctx->skb);
@@ -856,8 +862,7 @@ static int udsl_usb_data_exit (struct udsl_instance_data *instance)
for (i = 0; i < UDSL_NUMBER_SND_URBS; i++) {
struct udsl_usb_send_data_context *ctx = &(instance->send_ctx[i]);
- if (ctx->urb->status == -EINPROGRESS)
- usb_unlink_urb (ctx->urb);
+ usb_unlink_urb (ctx->urb);
if (ctx->skb)
ctx->vcc->pop (ctx->vcc, ctx->skb);
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 6340291683fd..7fc2e2ab224d 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -98,7 +98,7 @@ ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd,
return -EFAULT;
break;
default:
- return -ENOIOCTLCMD;
+ return -ENOTTY;
break;
}
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 11546d617984..17eb48408556 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -35,7 +35,7 @@
* - GeneSys GL620USB-A
* - NetChip 1080 (interoperates with NetChip Win32 drivers)
* - Prolific PL-2301/2302 (replaces "plusb" driver)
- * - SA-1100 based Linux PDAs like iPaq, Yopy, and Zaurus
+ * - PXA-250 or SA-1100 Linux PDAs like iPaq, Yopy, and Zaurus
*
* USB devices can implement their side of this protocol at the cost
* of two bulk endpoints; it's not restricted to "cable" applications.
@@ -61,8 +61,9 @@
* sheets, sometimes it's not needed and sometimes it hangs. Prolific has
* not responded to repeated support/information requests.
*
- * - SA-1100 PDAs ... the www.handhelds.org SA-1100 support works nicely.
- * Zaurus support has some problems; it's made UHCI die.
+ * - SA-1100 PDAs ... the standard ARM Linux SA-1100 support works nicely,
+ * as found in www.handhelds.org and other kernels. The Sharp/Lineo
+ * kernels use different drivers, which also talk to this code.
*
* Interop with more Win32 drivers may be a good thing.
*
@@ -116,7 +117,10 @@
* 07-may-2002 Generalize/cleanup keventd support, handling rx stalls (mostly
* for USB 2.0 TTs) and memory shortages (potential) too. (db)
* Use "locally assigned" IEEE802 address space. (Brad Hards)
- * 18-oct-2002 Support for Zaurus (Pavel Machek), related cleanup (db).
+ * 18-oct-2002 Support for Zaurus (Pavel Machek), related cleanup (db).
+ * 14-dec-2002 Remove Zaurus-private crc32 code (Pavel); 2.5 oops fix,
+ * cleanups and stubbed PXA-250 support (db), fix for framing
+ * issues on Z, net1080, and gl620a (Toby Milne)
*
*-------------------------------------------------------------------------*/
@@ -150,7 +154,8 @@
#define CONFIG_USB_GENESYS
#define CONFIG_USB_NET1080
#define CONFIG_USB_PL2301
-#define CONFIG_USB_SA1110
+// #define CONFIG_USB_PXA
+#define CONFIG_USB_SA1100
#define CONFIG_USB_ZAURUS
@@ -162,6 +167,8 @@
* Nineteen USB 1.1 max size bulk transactions per frame (ms), max.
* Several dozen bytes of IPv4 data can fit in two such transactions.
* One maximum size Ethernet packet takes twenty four of them.
+ * For high speed, each frame comfortably fits almost 36 max size
+ * Ethernet packets (so queues should be bigger).
*/
#ifdef REALLY_QUEUE
#define RX_QLEN 4
@@ -233,6 +240,7 @@ struct driver_info {
int flags;
#define FLAG_FRAMING_NC 0x0001 /* guard against device dropouts */
#define FLAG_FRAMING_GL 0x0002 /* genelink batches packets */
+#define FLAG_FRAMING_Z 0x0004 /* zaurus adds a trailer */
#define FLAG_NO_SETINT 0x0010 /* device can't set_interface() */
/* reset device ... can sleep */
@@ -287,6 +295,12 @@ MODULE_PARM_DESC (msg_level, "Initial message level (default = 1)");
#define RUN_CONTEXT (in_irq () ? "in_irq" \
: (in_interrupt () ? "in_interrupt" : "can sleep"))
+/* mostly for PDA style devices, which are always present */
+static int always_connected (struct usbnet *dev)
+{
+ return 0;
+}
+
/*-------------------------------------------------------------------------*/
#ifdef DEBUG
@@ -364,6 +378,7 @@ static const struct driver_info belkin_info = {
static const struct driver_info epson2888_info = {
.description = "Epson USB Device",
+ .check_connect = always_connected,
.in = 4, .out = 3,
.epsize = 64,
@@ -457,10 +472,12 @@ static void gl_interrupt_complete (struct urb *urb, struct pt_regs *regs)
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
- dbg("%s - urb shutting down with status: %d", __FUNCTION__, status);
+ dbg("%s - urb shutting down with status: %d",
+ __FUNCTION__, status);
return;
default:
- dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
+ dbg("%s - nonzero urb status received: %d",
+ __FUNCTION__, urb->status);
}
status = usb_submit_urb (urb, GFP_ATOMIC);
@@ -1224,22 +1241,44 @@ static const struct driver_info prolific_info = {
+#ifdef CONFIG_USB_PXA
+
+/*-------------------------------------------------------------------------
+ *
+ * PXA250 and PXA210 use XScale cores (ARM v5TE) with better USB support,
+ * and different USB endpoint numbering than the SA1100 devices.
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info pxa_info = {
+ .description = "PXA-250 Linux Device",
+ .check_connect = always_connected,
+
+ .in = 1, .out = 2,
+ .epsize = 64,
+};
+
+#endif /* CONFIG_USB_PXA */
+
+
+
#ifdef CONFIG_USB_SA1100
/*-------------------------------------------------------------------------
*
* Intel's SA-1100 chip integrates basic USB support, and is used
* in PDAs like some iPaqs, the Yopy, some Zaurus models, and more.
- * When they runs Linux, arch/arm/sa1100/usb-eth.c may be used to
+ * When they run Linux, arch/arm/mach-sa1100/usb-eth.c may be used to
* network using minimal USB framing data.
*
- * This describes the driver currently in www.handhelds.org kernels.
+ * This describes the driver currently in standard ARM Linux kernels.
* The Zaurus uses a different driver (see later).
*
*-------------------------------------------------------------------------*/
static const struct driver_info linuxdev_info = {
.description = "SA-1100 Linux Device",
+ .check_connect = always_connected,
.in = 2, .out = 1,
.epsize = 64,
@@ -1247,6 +1286,7 @@ static const struct driver_info linuxdev_info = {
static const struct driver_info yopy_info = {
.description = "Yopy",
+ .check_connect = always_connected,
.in = 2, .out = 1,
.epsize = 64,
@@ -1257,65 +1297,20 @@ static const struct driver_info yopy_info = {
#ifdef CONFIG_USB_ZAURUS
+#include <linux/crc32.h>
+
/*-------------------------------------------------------------------------
*
* Zaurus is also a SA-1110 based PDA, but one using a different driver
- * for its USB slave/target controller than the case above.
+ * (and framing) for its USB slave/gadget controller than the case above.
*
- * The key differences are that (a) it's got a msft-friendly configuration,
- * and (b) the linux-friendly framing adds a crc32 to cope with some
- * memory corruption observed with usb-to-memory DMA in some cases.
+ * For the current version of that driver, the main way that framing is
+ * nonstandard (also from perspective of the CDC ethernet model!) is a
+ * crc32, added to help detect when some sa1100 usb-to-memory DMA errata
+ * haven't been fully worked around.
*
*-------------------------------------------------------------------------*/
-static const u32 crc32_table [256] = {
- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
- 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
- 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
- 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
- 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
- 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
- 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
- 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
- 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
- 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
- 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
- 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
- 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
- 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
- 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
- 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
- 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
- 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
- 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
- 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
- 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
- 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
- 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
- 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
- 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
- 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
- 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
- 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
- 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
- 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
-#define CRC32_INITFCS 0xffffffff // Initial FCS value
-#define CRC32_FCS(fcs, c) (((fcs) >> 8) ^ crc32_table[((fcs) ^ (c)) & 0xff])
-
-/* fcs_compute32 - memcpy and calculate fcs
- * Perform a memcpy and calculate fcs using ppp 32bit CRC algorithm.
- */
-static inline u32 fcs_compute32 (unsigned char *sp, int len, u32 fcs)
-{
- for (;len-- > 0; fcs = CRC32_FCS (fcs, *sp++))
- continue;
- return fcs;
-}
-
static struct sk_buff *
zaurus_tx_fixup (struct usbnet *dev, struct sk_buff *skb, int flags)
{
@@ -1334,11 +1329,9 @@ zaurus_tx_fixup (struct usbnet *dev, struct sk_buff *skb, int flags)
if (skb) {
u32 fcs;
done:
- fcs = fcs_compute32 (skb->data, skb->len, CRC32_INITFCS);
+ fcs = crc32_le (~0, skb->data, skb->len);
fcs = ~fcs;
- // ? add optional byte make addr even ?
-
*skb_put (skb, 1) = fcs & 0xff;
*skb_put (skb, 1) = (fcs>> 8) & 0xff;
*skb_put (skb, 1) = (fcs>>16) & 0xff;
@@ -1349,6 +1342,8 @@ done:
static const struct driver_info zaurus_sl5x00_info = {
.description = "Sharp Zaurus SL-5x00",
+ .flags = FLAG_FRAMING_Z,
+ .check_connect = always_connected,
.tx_fixup = zaurus_tx_fixup,
.in = 2, .out = 1,
@@ -1356,11 +1351,16 @@ static const struct driver_info zaurus_sl5x00_info = {
};
static const struct driver_info zaurus_sla300_info = {
.description = "Sharp Zaurus SL-A300",
+ .flags = FLAG_FRAMING_Z,
+ .check_connect = always_connected,
.tx_fixup = zaurus_tx_fixup,
.in = 1, .out = 2,
.epsize = 64,
};
+
+// SL-5600 and C-700 are PXA based; should resemble A300
+
#endif
@@ -1403,7 +1403,7 @@ static struct net_device_stats *usbnet_get_stats (struct net_device *net)
/*-------------------------------------------------------------------------*/
-/* urb completions are currently in_irq; avoid doing real work then. */
+/* urb completions may be in_irq; avoid doing real work then. */
static void defer_bh (struct usbnet *dev, struct sk_buff *skb)
{
@@ -1457,6 +1457,11 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, int flags)
size = GL_RCV_BUF_SIZE;
else
#endif
+#ifdef CONFIG_USB_ZAURUS
+ if (dev->driver_info->flags & FLAG_FRAMING_Z)
+ size = 6 + (sizeof (struct ethhdr) + dev->net.mtu);
+ else
+#endif
size = (sizeof (struct ethhdr) + dev->net.mtu);
if ((skb = alloc_skb (size, flags)) == 0) {
@@ -1476,11 +1481,6 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, int flags)
usb_rcvbulkpipe (dev->udev, dev->driver_info->in),
skb->data, size, rx_complete, skb);
urb->transfer_flags |= URB_ASYNC_UNLINK;
-#if 0
- // Idle-but-posted reads with UHCI really chew up
- // PCI bandwidth unless FSBR is disabled
- urb->transfer_flags |= URB_NO_FSBR;
-#endif
spin_lock_irqsave (&dev->rxq.lock, lockflags);
@@ -1524,8 +1524,6 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
if (skb->len) {
int status;
-// FIXME: eth_copy_and_csum "small" packets to new SKB (small < ~200 bytes) ?
-
skb->dev = &dev->net;
skb->protocol = eth_type_trans (skb, &dev->net);
dev->stats.rx_packets++;
@@ -1904,7 +1902,7 @@ static void usbnet_tx_timeout (struct net_device *net)
static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
{
struct usbnet *dev = (struct usbnet *) net->priv;
- int length = skb->len;
+ int length;
int retval = NET_XMIT_SUCCESS;
struct urb *urb = 0;
struct skb_data *entry;
@@ -1924,6 +1922,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
goto drop;
}
}
+ length = skb->len;
if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) {
dbg ("no urb");
@@ -1938,6 +1937,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
// FIXME: reorganize a bit, so that fixup() fills out NetChip
// framing too. (Packet ID update needs the spinlock...)
+ // [ BETTER: we already own net->xmit_lock, that's enough ]
#ifdef CONFIG_USB_NET1080
if (info->flags & FLAG_FRAMING_NC) {
@@ -1958,7 +1958,6 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
usb_sndbulkpipe (dev->udev, info->out),
skb->data, skb->len, tx_complete, skb);
urb->transfer_flags |= URB_ASYNC_UNLINK;
- // FIXME urb->timeout = ... jiffies ... ;
spin_lock_irqsave (&dev->txq.lock, flags);
@@ -2198,7 +2197,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
#endif
// ok, it's ready to go.
- dev_set_drvdata (&udev->dev, net);
+ dev_set_drvdata (&udev->dev, dev);
mutex_lock (&usbnet_mutex);
list_add (&dev->dev_list, &usbnet_list);
mutex_unlock (&dev->mutex);
@@ -2280,15 +2279,28 @@ static const struct usb_device_id products [] = {
},
#endif
+#ifdef CONFIG_USB_PXA
+/*
+ * PXA250 or PXA210 ... these use a "usb-eth" driver much like
+ * the sa1100 one.
+ */
+{
+ // Compaq "Itsy" vendor/product id, version "2.0"
+ USB_DEVICE_VER (0x049F, 0x505A, 0x0200, 0x0200),
+ .driver_info = (unsigned long) &pxa_info,
+},
+#endif
+
#ifdef CONFIG_USB_SA1100
/*
- * SA-1100 using www.handhelds.org kernels, or compatible.
+ * SA-1100 using standard ARM Linux kernels, or compatible.
* Often used when talking to Linux PDAs (iPaq, Yopy, etc).
* The sa-1100 "usb-eth" driver handles the basic framing.
*/
{
// 1183 = 0x049F, both used as hex values?
- USB_DEVICE (0x049F, 0x505A), // iPaq: Compaq "Itsy"
+ // Compaq "Itsy" vendor/product id, version "0.0"
+ USB_DEVICE_VER (0x049F, 0x505A, 0, 0),
.driver_info = (unsigned long) &linuxdev_info,
}, {
USB_DEVICE (0x0E7E, 0x1001), // G.Mate "Yopy"
@@ -2323,8 +2335,6 @@ static const struct usb_device_id products [] = {
},
#endif
-/* KC2190 from www.sepoong.co.kr "InstaNET" */
-
{ }, // END
};
MODULE_DEVICE_TABLE (usb, products);
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 9786ad32d092..b41178f59bf0 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -126,6 +126,7 @@ static struct usb_driver belkin_driver = {
static struct usb_serial_device_type belkin_device = {
.owner = THIS_MODULE,
.name = "Belkin / Peracom / GoHubs USB Serial Adapter",
+ .short_name = "belkin",
.id_table = id_table_combined,
.num_interrupt_in = 1,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index 393310c420f1..3d99da8441d5 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -121,7 +121,10 @@ int usb_serial_bus_register(struct usb_serial_device_type *device)
{
int retval;
- device->driver.name = (char *)device->name;
+ if (device->short_name)
+ device->driver.name = (char *)device->short_name;
+ else
+ device->driver.name = (char *)device->name;
device->driver.bus = &usb_serial_bus_type;
device->driver.probe = usb_serial_device_probe;
device->driver.remove = usb_serial_device_remove;
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 7392d3586510..a532245eee80 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -83,6 +83,7 @@ static struct usb_driver cyberjack_driver = {
static struct usb_serial_device_type cyberjack_device = {
.owner = THIS_MODULE,
.name = "Reiner SCT Cyberjack USB card reader",
+ .short_name = "cyberjack",
.id_table = id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index cc381d0fa681..d4dde44d06b5 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -43,6 +43,7 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
struct usb_serial_device_type usb_serial_generic_device = {
.owner = THIS_MODULE,
.name = "Generic",
+ .short_name = "generic",
.id_table = generic_device_ids,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
diff --git a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h
index a1ecf48b71ad..5e287ec28a43 100644
--- a/drivers/usb/serial/io_tables.h
+++ b/drivers/usb/serial/io_tables.h
@@ -100,6 +100,7 @@ MODULE_DEVICE_TABLE (usb, id_table_combined);
static struct usb_serial_device_type edgeport_1port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 1 port adapter",
+ .short_name = "edgeport_1",
.id_table = edgeport_1port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
@@ -122,6 +123,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
static struct usb_serial_device_type edgeport_2port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 2 port adapter",
+ .short_name = "edgeport_2",
.id_table = edgeport_2port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
@@ -144,6 +146,7 @@ static struct usb_serial_device_type edgeport_2port_device = {
static struct usb_serial_device_type edgeport_4port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 4 port adapter",
+ .short_name = "edgeport_4",
.id_table = edgeport_4port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
@@ -166,6 +169,7 @@ static struct usb_serial_device_type edgeport_4port_device = {
static struct usb_serial_device_type edgeport_8port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 8 port adapter",
+ .short_name = "edgeport_8",
.id_table = edgeport_8port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 6e3bf74c11da..ba9e939667f1 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2635,6 +2635,7 @@ static void edge_shutdown (struct usb_serial *serial)
static struct usb_serial_device_type edgeport_1port_device = {
.owner = THIS_MODULE,
.name = "Edgeport TI 1 port adapter",
+ .short_name = "edgeport_ti_1",
.id_table = edgeport_1port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
@@ -2657,6 +2658,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
static struct usb_serial_device_type edgeport_2port_device = {
.owner = THIS_MODULE,
.name = "Edgeport TI 2 port adapter",
+ .short_name = "edgeport_ti_2",
.id_table = edgeport_2port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 2,
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index 4dd960f2125c..7d8e09372c9f 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -481,6 +481,7 @@ static struct usb_device_id keyspan_4port_ids[] = {
static struct usb_serial_device_type keyspan_pre_device = {
.owner = THIS_MODULE,
.name = "Keyspan - (without firmware)",
+ .short_name = "keyspan_no_firm",
.id_table = keyspan_pre_ids,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -492,6 +493,7 @@ static struct usb_serial_device_type keyspan_pre_device = {
static struct usb_serial_device_type keyspan_1port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 1 port adapter",
+ .short_name = "keyspan_1",
.id_table = keyspan_1port_ids,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 3,
@@ -514,6 +516,7 @@ static struct usb_serial_device_type keyspan_1port_device = {
static struct usb_serial_device_type keyspan_2port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 2 port adapter",
+ .short_name = "keyspan_2",
.id_table = keyspan_2port_ids,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -536,6 +539,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
static struct usb_serial_device_type keyspan_4port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 4 port adapter",
+ .short_name = "keyspan_4",
.id_table = keyspan_4port_ids,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 5,
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 94c1e26348d7..70ca7d7b6659 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -827,6 +827,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
static struct usb_serial_device_type keyspan_pda_fake_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA - (prerenumeration)",
+ .short_name = "kyspn_pda_nofirm",
.id_table = id_table_fake,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -840,6 +841,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = {
static struct usb_serial_device_type xircom_pgs_fake_device = {
.owner = THIS_MODULE,
.name = "Xircom / Entregra PGS - (prerenumeration)",
+ .short_name = "xircom_nofirm",
.id_table = id_table_fake_xircom,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -852,6 +854,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = {
static struct usb_serial_device_type keyspan_pda_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA",
+ .short_name = "keyspan_pda",
.id_table = id_table_std,
.num_interrupt_in = 1,
.num_bulk_in = 0,
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 7ec0577d8726..986c06cf45c0 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -127,6 +127,7 @@ static struct usb_driver kl5kusb105d_driver = {
static struct usb_serial_device_type kl5kusb105d_device = {
.owner = THIS_MODULE,
.name = "KL5KUSB105D / PalmConnect",
+ .short_name = "kl5kusb105d",
.id_table = id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 911b42ceb7e2..525e0e5779e6 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -149,6 +149,7 @@ static struct usb_driver mct_u232_driver = {
static struct usb_serial_device_type mct_u232_device = {
.owner = THIS_MODULE,
.name = "Magic Control Technology USB-RS232",
+ .short_name = "mct_u232",
.id_table = id_table_combined,
.num_interrupt_in = 2,
.num_bulk_in = 0,
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index c5d0ded0b17f..8bfaea63e419 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -94,6 +94,7 @@ static struct usb_driver omninet_driver = {
static struct usb_serial_device_type zyxel_omninet_device = {
.owner = THIS_MODULE,
.name = "ZyXEL - omni.net lcd plus usb",
+ .short_name = "omninet",
.id_table = id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index 735ddd7372b7..236b671f685f 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -168,6 +168,9 @@ struct usb_serial {
* @owner: pointer to the module that owns this device.
* @name: pointer to a string that describes this device. This string used
* in the syslog messages when a device is inserted or removed.
+ * @short_name: a pointer to a string that describes this device in
+ * KOBJ_NAME_LEN characters or less. This is used for the sysfs interface
+ * to describe the driver.
* @id_table: pointer to a list of usb_device_id structures that define all
* of the devices this structure can support.
* @num_interrupt_in: the number of interrupt in endpoints this device will
@@ -201,6 +204,7 @@ struct usb_serial {
struct usb_serial_device_type {
struct module *owner;
char *name;
+ char *short_name;
const struct usb_device_id *id_table;
char num_interrupt_in;
char num_bulk_in;
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index aa733472273c..ce7fb050ad8d 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -236,6 +236,7 @@ static struct usb_driver visor_driver = {
static struct usb_serial_device_type handspring_device = {
.owner = THIS_MODULE,
.name = "Handspring Visor / Treo / Palm 4.0 / Clié 4.x",
+ .short_name = "visor",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 2,
@@ -262,6 +263,7 @@ static struct usb_serial_device_type handspring_device = {
static struct usb_serial_device_type clie_3_5_device = {
.owner = THIS_MODULE,
.name = "Sony Clié 3.5",
+ .short_name = "clie_3.5",
.id_table = clie_id_3_5_table,
.num_interrupt_in = 0,
.num_bulk_in = 1,
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index dc29c4ec06e9..6b4df93d85c4 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -156,6 +156,7 @@ static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs);
static struct usb_serial_device_type whiteheat_fake_device = {
.owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT - (prerenumeration)",
+ .short_name = "whiteheatnofirm",
.id_table = id_table_prerenumeration,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -168,6 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = {
static struct usb_serial_device_type whiteheat_device = {
.owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT",
+ .short_name = "whiteheat",
.id_table = id_table_std,
.num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE,
@@ -512,9 +514,11 @@ no_rx_wrap:
no_rx_buf:
usb_free_urb(urb);
no_rx_urb:
+ ;
}
kfree(info);
no_private:
+ ;
}
return -ENOMEM;
}
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 0593585d5064..f74f8ac40ab0 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -480,7 +480,7 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
status = usb_stor_msg_common(us);
/* return the actual length of the data transferred if no error */
- if (status >= 0)
+ if (status == 0)
status = us->current_urb->actual_length;
return status;
}
@@ -583,50 +583,52 @@ static int interpret_urb_result(struct us_data *us, unsigned int pipe,
US_DEBUGP("Status code %d; transferred %u/%u\n",
result, partial, length);
+ switch (result) {
- /* stalled */
- if (result == -EPIPE) {
+ /* no error code; did we send all the data? */
+ case 0:
+ if (partial != length) {
+ US_DEBUGP("-- short transfer\n");
+ return USB_STOR_XFER_SHORT;
+ }
+
+ US_DEBUGP("-- transfer complete\n");
+ return USB_STOR_XFER_GOOD;
- /* for non-bulk (i.e., control) endpoints, a stall indicates
- * a protocol error */
- if (!usb_pipebulk(pipe)) {
+ /* stalled */
+ case -EPIPE:
+ /* for control endpoints, a stall indicates a protocol error */
+ if (usb_pipecontrol(pipe)) {
US_DEBUGP("-- stall on control pipe\n");
return USB_STOR_XFER_ERROR;
}
- /* for a bulk endpoint, clear the stall */
+ /* for other sorts of endpoint, clear the stall */
US_DEBUGP("clearing endpoint halt for pipe 0x%x\n", pipe);
if (usb_stor_clear_halt(us, pipe) < 0)
return USB_STOR_XFER_ERROR;
return USB_STOR_XFER_STALLED;
- }
/* NAK - that means we've retried this a few times already */
- if (result == -ETIMEDOUT) {
+ case -ETIMEDOUT:
US_DEBUGP("-- device NAKed\n");
return USB_STOR_XFER_ERROR;
- }
/* the transfer was cancelled, presumably by an abort */
- if (result == -ENODEV) {
+ case -ENODEV:
US_DEBUGP("-- transfer cancelled\n");
return USB_STOR_XFER_ERROR;
- }
+
+ /* short scatter-gather read transfer */
+ case -EREMOTEIO:
+ US_DEBUGP("-- short read transfer\n");
+ return USB_STOR_XFER_SHORT;
/* the catch-all error case */
- if (result < 0) {
+ default:
US_DEBUGP("-- unknown error\n");
return USB_STOR_XFER_ERROR;
}
-
- /* no error code; did we send all the data? */
- if (partial != length) {
- US_DEBUGP("-- transferred only %u bytes\n", partial);
- return USB_STOR_XFER_SHORT;
- }
-
- US_DEBUGP("-- transfer complete\n");
- return USB_STOR_XFER_GOOD;
}
/*
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 34479a463682..bf216fbd5ba7 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -728,9 +728,13 @@ static int storage_probe(struct usb_interface *intf,
USB_ENDPOINT_NUMBER_MASK;
ss->ep_out = ep_out->bEndpointAddress &
USB_ENDPOINT_NUMBER_MASK;
- ss->ep_int = ep_int->bEndpointAddress &
- USB_ENDPOINT_NUMBER_MASK;
- ss->ep_bInterval = ep_int->bInterval;
+ if (ep_int) {
+ ss->ep_int = ep_int->bEndpointAddress &
+ USB_ENDPOINT_NUMBER_MASK;
+ ss->ep_bInterval = ep_int->bInterval;
+ }
+ else
+ ss->ep_int = ss->ep_bInterval = 0;
/* allocate the URB, the usb_ctrlrequest, and the IRQ URB */
if (usb_stor_allocate_urbs(ss))
@@ -771,9 +775,13 @@ static int storage_probe(struct usb_interface *intf,
USB_ENDPOINT_NUMBER_MASK;
ss->ep_out = ep_out->bEndpointAddress &
USB_ENDPOINT_NUMBER_MASK;
- ss->ep_int = ep_int->bEndpointAddress &
- USB_ENDPOINT_NUMBER_MASK;
- ss->ep_bInterval = ep_int->bInterval;
+ if (ep_int) {
+ ss->ep_int = ep_int->bEndpointAddress &
+ USB_ENDPOINT_NUMBER_MASK;
+ ss->ep_bInterval = ep_int->bInterval;
+ }
+ else
+ ss->ep_int = ss->ep_bInterval = 0;
/* establish the connection to the new device */
ss->ifnum = ifnum;
diff --git a/fs/intermezzo/Makefile b/fs/intermezzo/Makefile
index 82f51bd36186..260c7af24da5 100644
--- a/fs/intermezzo/Makefile
+++ b/fs/intermezzo/Makefile
@@ -5,7 +5,7 @@
obj-$(CONFIG_INTERMEZZO_FS) += intermezzo.o
intermezzo-objs := cache.o dcache.o dir.o ext_attr.o file.o fileset.o \
- inode.o io_daemon.o journal.o journal_ext2.o journal_ext3.o \
+ inode.o journal.o journal_ext2.o journal_ext3.o \
journal_obdfs.o journal_reiserfs.o journal_tmpfs.o journal_xfs.o \
kml_reint.o kml_unpack.o methods.o presto.o psdev.o replicator.o \
super.o sysctl.o upcall.o vfs.o
diff --git a/include/asm-alpha/dma.h b/include/asm-alpha/dma.h
index dc46ba5b4f1c..683afaa3deed 100644
--- a/include/asm-alpha/dma.h
+++ b/include/asm-alpha/dma.h
@@ -112,9 +112,9 @@
# elif defined(CONFIG_ALPHA_RUFFIAN)
# define MAX_ISA_DMA_ADDRESS ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS
# elif defined(CONFIG_ALPHA_SABLE)
-# define MAX_ISA_DMA_ADDRESS ALPHA_SABLE_MAX_DMA_ISA_ADDRESS
+# define MAX_ISA_DMA_ADDRESS ALPHA_SABLE_MAX_ISA_DMA_ADDRESS
# elif defined(CONFIG_ALPHA_ALCOR)
-# define MAX_ISA_DMA_ADDRESS ALPHA_ALCOR_MAX_DMA_ISA_ADDRESS
+# define MAX_ISA_DMA_ADDRESS ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS
# else
# define MAX_ISA_DMA_ADDRESS ALPHA_MAX_ISA_DMA_ADDRESS
# endif
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index f215aa90809b..5a3b8681f6af 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -126,7 +126,7 @@ struct __large_struct { unsigned long buf[100]; };
__asm__("1: ldq %0,%2\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 2b-1b(%1)\n" \
".previous" \
: "=r"(__gu_val), "=r"(__gu_err) \
@@ -136,7 +136,7 @@ struct __large_struct { unsigned long buf[100]; };
__asm__("1: ldl %0,%2\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 2b-1b(%1)\n" \
".previous" \
: "=r"(__gu_val), "=r"(__gu_err) \
@@ -149,7 +149,7 @@ struct __large_struct { unsigned long buf[100]; };
__asm__("1: ldwu %0,%2\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 2b-1b(%1)\n" \
".previous" \
: "=r"(__gu_val), "=r"(__gu_err) \
@@ -159,7 +159,7 @@ struct __large_struct { unsigned long buf[100]; };
__asm__("1: ldbu %0,%2\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 2b-1b(%1)\n" \
".previous" \
: "=r"(__gu_val), "=r"(__gu_err) \
@@ -178,10 +178,10 @@ struct __large_struct { unsigned long buf[100]; };
" or %0,%1,%0\n" \
"3:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 3b-1b(%2)\n" \
- " .gprel32 2b\n" \
- " lda %0, 2b-1b(%2)\n" \
+ " .long 2b - .\n" \
+ " lda %0, 3b-2b(%2)\n" \
".previous" \
: "=&r"(__gu_val), "=&r"(__gu_tmp), "=r"(__gu_err) \
: "r"(addr), "2"(__gu_err)); \
@@ -192,7 +192,7 @@ struct __large_struct { unsigned long buf[100]; };
" extbl %0,%2,%0\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda %0, 2b-1b(%1)\n" \
".previous" \
: "=&r"(__gu_val), "=r"(__gu_err) \
@@ -240,7 +240,7 @@ extern void __put_user_unknown(void);
__asm__ __volatile__("1: stq %r2,%1\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31,2b-1b(%0)\n" \
".previous" \
: "=r"(__pu_err) \
@@ -250,7 +250,7 @@ __asm__ __volatile__("1: stq %r2,%1\n" \
__asm__ __volatile__("1: stl %r2,%1\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31,2b-1b(%0)\n" \
".previous" \
: "=r"(__pu_err) \
@@ -263,7 +263,7 @@ __asm__ __volatile__("1: stl %r2,%1\n" \
__asm__ __volatile__("1: stw %r2,%1\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31,2b-1b(%0)\n" \
".previous" \
: "=r"(__pu_err) \
@@ -273,7 +273,7 @@ __asm__ __volatile__("1: stw %r2,%1\n" \
__asm__ __volatile__("1: stb %r2,%1\n" \
"2:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31,2b-1b(%0)\n" \
".previous" \
: "=r"(__pu_err) \
@@ -298,13 +298,13 @@ __asm__ __volatile__("1: stb %r2,%1\n" \
"4: stq_u %1,0(%5)\n" \
"5:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31, 5b-1b(%0)\n" \
- " .gprel32 2b\n" \
+ " .long 2b - .\n" \
" lda $31, 5b-2b(%0)\n" \
- " .gprel32 3b\n" \
+ " .long 3b - .\n" \
" lda $31, 5b-3b(%0)\n" \
- " .gprel32 4b\n" \
+ " .long 4b - .\n" \
" lda $31, 5b-4b(%0)\n" \
".previous" \
: "=r"(__pu_err), "=&r"(__pu_tmp1), \
@@ -324,9 +324,9 @@ __asm__ __volatile__("1: stb %r2,%1\n" \
"2: stq_u %1,0(%4)\n" \
"3:\n" \
".section __ex_table,\"a\"\n" \
- " .gprel32 1b\n" \
+ " .long 1b - .\n" \
" lda $31, 3b-1b(%0)\n" \
- " .gprel32 2b\n" \
+ " .long 2b - .\n" \
" lda $31, 3b-2b(%0)\n" \
".previous" \
: "=r"(__pu_err), \
@@ -356,7 +356,7 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len)
register long __cu_len __asm__("$0") = len;
__asm__ __volatile__(
- "jsr $28,(%3),__copy_user\n\tldgp $29,0($28)"
+ "jsr $28,(%3),__copy_user"
: "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to), "=r"(pv)
: "0" (__cu_len), "1" (__cu_from), "2" (__cu_to), "3"(pv)
: "$1","$2","$3","$4","$5","$28","memory");
@@ -373,7 +373,7 @@ __copy_tofrom_user(void *to, const void *from, long len, const void *validate)
register const void * __cu_from __asm__("$7") = from;
register long __cu_len __asm__("$0") = len;
__asm__ __volatile__(
- "jsr $28,(%3),__copy_user\n\tldgp $29,0($28)"
+ "jsr $28,(%3),__copy_user"
: "=r"(__cu_len), "=r"(__cu_from), "=r"(__cu_to),
"=r" (pv)
: "0" (__cu_len), "1" (__cu_from), "2" (__cu_to),
@@ -413,7 +413,7 @@ __clear_user(void *to, long len)
register void * __cl_to __asm__("$6") = to;
register long __cl_len __asm__("$0") = len;
__asm__ __volatile__(
- "jsr $28,(%2),__do_clear_user\n\tldgp $29,0($28)"
+ "jsr $28,(%2),__do_clear_user"
: "=r"(__cl_len), "=r"(__cl_to), "=r"(pv)
: "0"(__cl_len), "1"(__cl_to), "2"(pv)
: "$1","$2","$3","$4","$5","$28","memory");
@@ -428,7 +428,7 @@ clear_user(void *to, long len)
register void * __cl_to __asm__("$6") = to;
register long __cl_len __asm__("$0") = len;
__asm__ __volatile__(
- "jsr $28,(%2),__do_clear_user\n\tldgp $29,0($28)"
+ "jsr $28,(%2),__do_clear_user"
: "=r"(__cl_len), "=r"(__cl_to), "=r"(pv)
: "0"(__cl_len), "1"(__cl_to), "2"(pv)
: "$1","$2","$3","$4","$5","$28","memory");
@@ -471,7 +471,7 @@ extern inline long strnlen_user(const char *str, long n)
/*
* About the exception table:
*
- * - insn is a 32-bit offset off of the kernel's or module's gp.
+ * - insn is a 32-bit pc-relative offset from the faulting insn.
* - nextinsn is a 16-bit offset off of the faulting instruction
* (not off of the *next* instruction as branches are).
* - errreg is the register in which to place -EFAULT.
@@ -502,7 +502,7 @@ struct exception_table_entry
};
/* Returns 0 if exception not found and fixup.unit otherwise. */
-extern unsigned search_exception_table(unsigned long, unsigned long);
+extern unsigned search_exception_table(unsigned long);
/* Returns the new pc */
#define fixup_exception(map_reg, fixup_unit, pc) \
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 69b242234d8a..f7ad699487b4 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -100,6 +100,12 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
#define ELF_PLATFORM (system_utsname.machine)
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them, start the x86-specific ones at 32.
+ */
+#define AT_SYSINFO 32
+
#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
@@ -116,6 +122,11 @@ extern void dump_smp_unlazy_fpu(void);
#define ELF_CORE_SYNC dump_smp_unlazy_fpu
#endif
+#define ARCH_DLINFO \
+do { \
+ NEW_AUX_ENT(AT_SYSINFO, 0xffffe000); \
+} while (0)
+
#endif
#endif
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index 0972df25f4c9..a5ccad80c262 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -42,8 +42,8 @@
* task switches.
*/
enum fixed_addresses {
- FIX_VSYSCALL,
FIX_HOLE,
+ FIX_VSYSCALL,
#ifdef CONFIG_X86_LOCAL_APIC
FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
#endif
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 0a5e1dd66212..3cb90417556b 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -23,6 +23,7 @@ static __inline__ int irq_cannonicalize(int irq)
extern void disable_irq(unsigned int);
extern void disable_irq_nosync(unsigned int);
extern void enable_irq(unsigned int);
+extern void release_x86_irqs(struct task_struct *);
#ifdef CONFIG_X86_LOCAL_APIC
#define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */
diff --git a/include/asm-i386/segment.h b/include/asm-i386/segment.h
index 2abdb7c5bea7..f6949fb109d9 100644
--- a/include/asm-i386/segment.h
+++ b/include/asm-i386/segment.h
@@ -65,9 +65,9 @@
#define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 11)
/*
- * The GDT has 23 entries but we pad it to cacheline boundary:
+ * The GDT has 25 entries but we pad it to cacheline boundary:
*/
-#define GDT_ENTRIES 24
+#define GDT_ENTRIES 28
#define GDT_SIZE (GDT_ENTRIES * 8)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index c7562734f0ac..8b014e109f20 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -96,6 +96,10 @@ extern const unsigned char scsi_command_size[8];
#define READ_ELEMENT_STATUS 0xb8
#define SEND_VOLUME_TAG 0xb6
#define WRITE_LONG_2 0xea
+#define READ_16 0x88
+#define WRITE_16 0x8a
+#define SERVICE_ACTION_IN 0x9e
+
/*
* Status codes
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index fd550b424a7c..fd6c403d0828 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -199,6 +199,10 @@
#define AC97_ALC650_MULTICH 0x6a
#define AC97_ALC650_CLOCK 0x7a
+/* specific - Yamaha YMF753 */
+#define AC97_YMF753_DIT_CTRL2 0x66 /* DIT Control 2 */
+#define AC97_YMF753_3D_MODE_SEL 0x68 /* 3D Mode Select */
+
/* ac97->scaps */
#define AC97_SCAP_AUDIO (1<<0) /* audio AC'97 codec */
#define AC97_SCAP_MODEM (1<<1) /* modem AC'97 codec */
diff --git a/include/sound/control.h b/include/sound/control.h
index ec0f2f6ccf65..139028a72a65 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -111,6 +111,8 @@ snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid);
snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id);
int snd_ctl_register(snd_card_t *card);
+int snd_ctl_disconnect(snd_card_t *card);
+int snd_ctl_can_unregister(snd_card_t *card);
int snd_ctl_unregister(snd_card_t *card);
int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn);
int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn);
diff --git a/include/sound/core.h b/include/sound/core.h
index 4ea5f5ff8849..9d705453eca1 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -24,6 +24,7 @@
#include <linux/sched.h> /* wake_up() */
#include <asm/semaphore.h> /* struct semaphore */
+#include <linux/rwsem.h> /* struct rw_semaphore */
/* Typedef's */
typedef struct timeval snd_timestamp_t;
@@ -58,8 +59,9 @@ typedef enum {
} snd_device_type_t;
typedef enum {
- SNDRV_DEV_BUILD = 0,
- SNDRV_DEV_REGISTERED = 1
+ SNDRV_DEV_BUILD,
+ SNDRV_DEV_REGISTERED,
+ SNDRV_DEV_DISCONNECTED
} snd_device_state_t;
typedef enum {
@@ -73,11 +75,13 @@ typedef struct _snd_device snd_device_t;
typedef int (snd_dev_free_t)(snd_device_t *device);
typedef int (snd_dev_register_t)(snd_device_t *device);
+typedef int (snd_dev_disconnect_t)(snd_device_t *device);
typedef int (snd_dev_unregister_t)(snd_device_t *device);
typedef struct {
snd_dev_free_t *dev_free;
snd_dev_register_t *dev_register;
+ snd_dev_disconnect_t *dev_disconnect;
snd_dev_unregister_t *dev_unregister;
} snd_device_ops_t;
@@ -109,6 +113,15 @@ typedef struct _snd_hwdep snd_hwdep_t;
typedef struct _snd_oss_mixer snd_mixer_oss_t;
#endif
+/* monitor files for graceful shutdown (hotplug) */
+
+struct snd_monitor_file {
+ struct file *file;
+ struct snd_monitor_file *next;
+};
+
+struct snd_shutdown_f_ops; /* define it later */
+
/* main structure for soundcard */
struct _snd_card {
@@ -129,8 +142,8 @@ struct _snd_card {
struct list_head devices; /* devices */
unsigned int last_numid; /* last used numeric ID */
- rwlock_t control_rwlock; /* control list lock */
- rwlock_t control_owner_lock; /* control list lock */
+ struct rw_semaphore controls_rwsem; /* controls list lock */
+ rwlock_t ctl_files_rwlock; /* ctl_files list lock */
int controls_count; /* count of all controls */
struct list_head controls; /* all controls for this card */
struct list_head ctl_files; /* active control files */
@@ -139,6 +152,12 @@ struct _snd_card {
snd_info_entry_t *proc_id; /* the card id */
struct proc_dir_entry *proc_root_link; /* number link to real id */
+ struct snd_monitor_file *files; /* all files associated to this card */
+ struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown state */
+ spinlock_t files_lock; /* lock the files for this card */
+ int shutdown; /* this card is going down */
+ wait_queue_head_t shutdown_sleep;
+
#ifdef CONFIG_PM
int (*set_power_state) (snd_card_t *card, unsigned int state);
void *power_state_private_data;
@@ -285,19 +304,27 @@ int copy_from_user_toio(unsigned long dst, const void *src, size_t count);
/* init.c */
extern int snd_cards_count;
+extern unsigned int snd_cards_lock;
extern snd_card_t *snd_cards[SNDRV_CARDS];
extern rwlock_t snd_card_rwlock;
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
-extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int free_flag);
+#define SND_MIXER_OSS_NOTIFY_REGISTER 0
+#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
+#define SND_MIXER_OSS_NOTIFY_FREE 2
+extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int cmd);
#endif
snd_card_t *snd_card_new(int idx, const char *id,
struct module *module, int extra_size);
+int snd_card_disconnect(snd_card_t *card);
int snd_card_free(snd_card_t *card);
+int snd_card_free_in_thread(snd_card_t *card);
int snd_card_register(snd_card_t *card);
int snd_card_info_init(void);
int snd_card_info_done(void);
int snd_component_add(snd_card_t *card, const char *component);
+int snd_card_file_add(snd_card_t *card, struct file *file);
+int snd_card_file_remove(snd_card_t *card, struct file *file);
/* device.c */
@@ -305,6 +332,8 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type,
void *device_data, snd_device_ops_t *ops);
int snd_device_register(snd_card_t *card, void *device_data);
int snd_device_register_all(snd_card_t *card);
+int snd_device_disconnect(snd_card_t *card, void *device_data);
+int snd_device_disconnect_all(snd_card_t *card);
int snd_device_free(snd_card_t *card, void *device_data);
int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd);
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 09ae6c772aa0..dc849a634aec 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1663,6 +1663,8 @@ typedef struct _snd_cs46xx_pcm_t {
snd_pcm_substream_t *substream;
pcm_channel_descriptor_t * pcm_channel;
+
+ int pcm_channel_id; /* Fron Rear, Center Lfe ... */
} cs46xx_pcm_t;
typedef struct {
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index 8366aefaff6b..1522a61ba85c 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -63,7 +63,6 @@
#define DSP_SPDIF_STATUS_OUTPUT_ENABLED 1
#define DSP_SPDIF_STATUS_PLAYBACK_OPEN 2
#define DSP_SPDIF_STATUS_HW_ENABLED 4
-#define DSP_SPDIF_STATUS_AC3_MODE 8
struct _dsp_module_desc_t;
@@ -141,7 +140,6 @@ typedef struct _pcm_channel_descriptor_t {
dsp_scb_descriptor_t * pcm_reader_scb;
dsp_scb_descriptor_t * src_scb;
dsp_scb_descriptor_t * mixer_scb;
- int pcm_channel_id;
void * private_data;
} pcm_channel_descriptor_t;
@@ -196,6 +194,10 @@ typedef struct _dsp_spos_instance_t {
int spdif_status_in;
u16 spdif_input_volume_right;
u16 spdif_input_volume_left;
+ /* spdif channel status,
+ left right and user validity bits */
+ int spdif_csuv_default;
+ int spdif_csuv_stream;
/* SPDIF input sample rate converter */
dsp_scb_descriptor_t * spdif_in_src;
diff --git a/include/sound/initval.h b/include/sound/initval.h
index 7f47b8c74f92..2cced5c7eb06 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -155,12 +155,15 @@ static int __init get_id(char **str, char **dst)
return 0;
for (s = *str; isalpha(*s) || isdigit(*s) || *s == '_'; s++);
if (s != *str) {
- *dst = (char *)kmalloc(s - *str, GFP_KERNEL);
- if ((d = *dst) != NULL) {
- s = *str;
- while (isalpha(*s) || isdigit(*s) || *s == '_')
- *d++ = *s++;
+ *dst = (char *)kmalloc((s - *str) + 1, GFP_KERNEL);
+ s = *str; d = *dst;
+ while (isalpha(*s) || isdigit(*s) || *s == '_') {
+ if (d != NULL)
+ *d++ = *s;
+ s++;
}
+ if (d != NULL)
+ *d = '\0';
}
*str = s;
if (*s == ',') {
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h
index 458d53cbd583..d88e1621097d 100644
--- a/include/sound/mixer_oss.h
+++ b/include/sound/mixer_oss.h
@@ -61,6 +61,7 @@ struct _snd_oss_mixer {
void (*private_free_recsrc)(snd_mixer_oss_t *mixer);
struct semaphore reg_mutex;
snd_info_entry_t *proc_entry;
+ int oss_dev_alloc;
/* --- */
int oss_recsrc;
};
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index 41502e177c0e..5ebec02cccd5 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -41,6 +41,7 @@
#define MPU401_HW_CMIPCI 15 /* CMIPCI MPU-401 UART */
#define MPU401_HW_ALS4000 16 /* Avance Logic ALS4000 */
#define MPU401_HW_INTEL8X0 17 /* Intel8x0 driver */
+#define MPU401_HW_PC98II 18 /* Roland PC98II */
#define MPU401_MODE_BIT_INPUT 0
#define MPU401_MODE_BIT_OUTPUT 1
@@ -64,6 +65,7 @@ struct _snd_mpu401 {
unsigned short hardware; /* MPU401_HW_XXXX */
unsigned long port; /* base port of MPU-401 chip */
+ unsigned long cport; /* port + 1 (usually) */
struct resource *res; /* port resource */
int irq; /* IRQ number of MPU-401 chip (-1 = poll) */
int irq_flags;
@@ -89,8 +91,8 @@ struct _snd_mpu401 {
/* I/O ports */
-#define MPU401C(mpu) ((mpu)->port + 1)
-#define MPU401D(mpu) ((mpu)->port + 0)
+#define MPU401C(mpu) (mpu)->cport
+#define MPU401D(mpu) (mpu)->port
/*
diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index a447f92a6957..f516550dc9a1 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -229,6 +229,7 @@
#define OPL3_HW_OPL3_CS 0x0302 /* CS4232/CS4236+ */
#define OPL3_HW_OPL3_FM801 0x0303 /* FM801 */
#define OPL3_HW_OPL3_CS4281 0x0304 /* CS4281 */
+#define OPL3_HW_OPL3_PC98 0x0305 /* PC9800 */
#define OPL3_HW_OPL4 0x0400
#define OPL3_HW_MASK 0xff00
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index c7f41630c253..d97f7e751d9a 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -443,8 +443,9 @@ struct _snd_pcm {
};
typedef struct _snd_pcm_notify {
- int (*n_register) (unsigned short minor, snd_pcm_t * pcm);
- int (*n_unregister) (unsigned short minor, snd_pcm_t * pcm);
+ int (*n_register) (snd_pcm_t * pcm);
+ int (*n_disconnect) (snd_pcm_t * pcm);
+ int (*n_unregister) (snd_pcm_t * pcm);
struct list_head list;
} snd_pcm_notify_t;
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 1c3d8d138518..d6274a5a1c76 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -77,6 +77,7 @@ typedef struct _snd_pcm_oss_stream {
typedef struct _snd_pcm_oss {
int reg;
+ unsigned int reg_mask;
} snd_pcm_oss_t;
#endif /* __SOUND_PCM_OSS_H */
diff --git a/include/sound/sb.h b/include/sound/sb.h
index ec4f93c1b350..53f243b7bf64 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -225,7 +225,6 @@ typedef struct _snd_sb sb_t;
#define SB_DT019X_MIC_DEV 0x6a
#define SB_DT019X_SPKR_DEV 0x6a
#define SB_DT019X_LINE_DEV 0x6e
-#define SB_DT019X_OUTPUT_SW1 0x3c
#define SB_DT019X_OUTPUT_SW2 0x4c
#define SB_DT019X_CAPTURE_SW 0x6c
@@ -235,6 +234,14 @@ typedef struct _snd_sb sb_t;
#define SB_DT019X_CAP_SYNTH 0x07
#define SB_DT019X_CAP_MAIN 0x07
+#define SB_ALS4000_MONO_IO_CTRL 0x4b
+#define SB_ALS4000_MIC_IN_GAIN 0x4d
+#define SB_ALS4000_FMDAC 0x4f
+#define SB_ALS4000_3D_SND_FX 0x50
+#define SB_ALS4000_3D_TIME_DELAY 0x51
+#define SB_ALS4000_3D_AUTO_MUTE 0x52
+#define SB_ALS4000_QSOUND 0xdb
+
/* IRQ setting bitmap */
#define SB_IRQSETUP_IRQ9 0x01
#define SB_IRQSETUP_IRQ5 0x02
diff --git a/include/sound/trident.h b/include/sound/trident.h
index 56bf20a14a03..bf4ed45f1a63 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -101,10 +101,18 @@
/* Global registers */
enum global_control_bits {
- CHANNEL_IDX = 0x0000003f, OVERRUN_IE = 0x00000400,
- UNDERRUN_IE = 0x00000800, ENDLP_IE = 0x00001000,
- MIDLP_IE = 0x00002000, ETOG_IE = 0x00004000,
- EDROP_IE = 0x00008000, BANK_B_EN = 0x00010000
+ CHANNEL_IDX = 0x0000003f,
+ OVERRUN_IE = 0x00000400, /* interrupt enable: capture overrun */
+ UNDERRUN_IE = 0x00000800, /* interrupt enable: playback underrun */
+ ENDLP_IE = 0x00001000, /* interrupt enable: end of buffer */
+ MIDLP_IE = 0x00002000, /* interrupt enable: middle buffer */
+ ETOG_IE = 0x00004000, /* interrupt enable: envelope toggling */
+ EDROP_IE = 0x00008000, /* interrupt enable: envelope drop */
+ BANK_B_EN = 0x00010000, /* SiS: enable bank B (64 channels) */
+ PCMIN_B_MIX = 0x00020000, /* SiS: PCM IN B mixing enable */
+ I2S_OUT_ASSIGN = 0x00040000, /* SiS: I2S Out contains surround PCM */
+ SPDIF_OUT_ASSIGN= 0x00080000, /* SiS: 0=S/PDIF L/R | 1=PCM Out FIFO */
+ MAIN_OUT_ASSIGN = 0x00100000, /* SiS: 0=PCM Out FIFO | 1=MMC Out buffer */
};
enum miscint_bits {
@@ -423,6 +431,8 @@ struct _snd_trident {
int ChanPCM; /* max number of PCM channels */
int ChanPCMcnt; /* actual number of PCM channels */
+ int ac97_detect; /* 1 = AC97 in detection phase */
+
struct _snd_4dwave synth; /* synth specific variables */
spinlock_t event_lock;
diff --git a/include/sound/version.h b/include/sound/version.h
index acaac7181bbe..a0166739358d 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
/* include/version.h. Generated automatically by configure. */
-#define CONFIG_SND_VERSION "0.9.0rc5"
-#define CONFIG_SND_DATE " (Sun Nov 10 19:48:18 2002 UTC)"
+#define CONFIG_SND_VERSION "0.9.0rc6"
+#define CONFIG_SND_DATE " (Tue Dec 17 19:01:13 2002 UTC)"
diff --git a/kernel/params.c b/kernel/params.c
index ffc65eb38748..5c5e9b3c23fe 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -24,7 +24,7 @@
#if 0
#define DEBUGP printk
#else
-#define DEBUGP(fmt , ...)
+#define DEBUGP(fmt, a...)
#endif
static int parse_one(char *param,
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index 70ff03c4c1c2..c4b546830ffd 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -15,7 +15,7 @@
* 2002-04-04 Tomas Kasparek better rates handling (allow non-standard rates)
*/
-/* $Id: sa11xx-uda1341.c,v 1.5 2002/10/21 18:28:19 perex Exp $ */
+/* $Id: sa11xx-uda1341.c,v 1.6 2002/12/04 18:52:05 perex Exp $ */
#include <sound/driver.h>
#include <linux/module.h>
diff --git a/sound/core/control.c b/sound/core/control.c
index 7f818300c3b0..6dce340429ff 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -37,7 +37,7 @@ typedef struct _snd_kctl_ioctl {
#define snd_kctl_ioctl(n) list_entry(n, snd_kctl_ioctl_t, list)
-static rwlock_t snd_ioctl_rwlock = RW_LOCK_UNLOCKED;
+static DECLARE_RWSEM(snd_ioctl_rwsem);
static LIST_HEAD(snd_control_ioctls);
static inline void dec_mod_count(struct module *module)
@@ -62,9 +62,14 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
err = -ENODEV;
goto __error1;
}
+ err = snd_card_file_add(card, file);
+ if (err < 0) {
+ err = -ENODEV;
+ goto __error1;
+ }
if (!try_inc_mod_count(card->module)) {
err = -EFAULT;
- goto __error1;
+ goto __error2;
}
ctl = snd_magic_kcalloc(snd_ctl_file_t, 0, GFP_KERNEL);
if (ctl == NULL) {
@@ -77,13 +82,15 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
ctl->card = card;
ctl->pid = current->pid;
file->private_data = ctl;
- write_lock_irqsave(&card->control_rwlock, flags);
+ write_lock_irqsave(&card->ctl_files_rwlock, flags);
list_add_tail(&ctl->list, &card->ctl_files);
- write_unlock_irqrestore(&card->control_rwlock, flags);
+ write_unlock_irqrestore(&card->ctl_files_rwlock, flags);
return 0;
__error:
dec_mod_count(card->module);
+ __error2:
+ snd_card_file_remove(card, file);
__error1:
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
@@ -116,19 +123,20 @@ static int snd_ctl_release(struct inode *inode, struct file *file)
fasync_helper(-1, file, 0, &ctl->fasync);
file->private_data = NULL;
card = ctl->card;
- write_lock_irqsave(&card->control_rwlock, flags);
+ write_lock_irqsave(&card->ctl_files_rwlock, flags);
list_del(&ctl->list);
- write_unlock_irqrestore(&card->control_rwlock, flags);
- write_lock(&card->control_owner_lock);
+ write_unlock_irqrestore(&card->ctl_files_rwlock, flags);
+ down_write(&card->controls_rwsem);
list_for_each(list, &card->controls) {
control = snd_kcontrol(list);
if (control->owner == ctl)
control->owner = NULL;
}
- write_unlock(&card->control_owner_lock);
+ up_write(&card->controls_rwsem);
snd_ctl_empty_read_queue(ctl);
snd_magic_kfree(ctl);
dec_mod_count(card->module);
+ snd_card_file_remove(card, file);
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
#endif
@@ -143,7 +151,7 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id)
snd_kctl_event_t *ev;
snd_runtime_check(card != NULL && id != NULL, return);
- read_lock_irqsave(&card->control_rwlock, flags);
+ read_lock(&card->ctl_files_rwlock);
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
card->mixer_oss_change_count++;
#endif
@@ -152,7 +160,7 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id)
ctl = snd_ctl_file(flist);
if (!ctl->subscribed)
continue;
- spin_lock(&ctl->read_lock);
+ spin_lock_irqsave(&ctl->read_lock, flags);
list_for_each(elist, &ctl->events) {
ev = snd_kctl_event(elist);
if (ev->id.numid == id->numid) {
@@ -171,9 +179,9 @@ void snd_ctl_notify(snd_card_t *card, unsigned int mask, snd_ctl_elem_id_t *id)
_found:
wake_up(&ctl->change_sleep);
kill_fasync(&ctl->fasync, SIGIO, POLL_IN);
- spin_unlock(&ctl->read_lock);
+ spin_unlock_irqrestore(&ctl->read_lock, flags);
}
- read_unlock_irqrestore(&card->control_rwlock, flags);
+ read_unlock(&card->ctl_files_rwlock);
}
snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * control)
@@ -225,11 +233,11 @@ int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol)
snd_assert(kcontrol->info != NULL, return -EINVAL);
snd_assert(!(kcontrol->access & SNDRV_CTL_ELEM_ACCESS_READ) || kcontrol->get != NULL, return -EINVAL);
snd_assert(!(kcontrol->access & SNDRV_CTL_ELEM_ACCESS_WRITE) || kcontrol->put != NULL, return -EINVAL);
- write_lock(&card->control_rwlock);
+ down_write(&card->controls_rwsem);
list_add_tail(&kcontrol->list, &card->controls);
card->controls_count++;
kcontrol->id.numid = ++card->last_numid;
- write_unlock(&card->control_rwlock);
+ up_write(&card->controls_rwsem);
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &kcontrol->id);
return 0;
}
@@ -237,10 +245,10 @@ int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol)
int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol)
{
snd_runtime_check(card != NULL && kcontrol != NULL, return -EINVAL);
- write_lock(&card->control_rwlock);
+ down_write(&card->controls_rwsem);
list_del(&kcontrol->list);
card->controls_count--;
- write_unlock(&card->control_rwlock);
+ up_write(&card->controls_rwsem);
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_REMOVE, &kcontrol->id);
snd_ctl_free_one(kcontrol);
return 0;
@@ -256,47 +264,46 @@ int snd_ctl_remove_id(snd_card_t * card, snd_ctl_elem_id_t *id)
return snd_ctl_remove(card, kctl);
}
+static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id); /* w/o lock */
+
int snd_ctl_rename_id(snd_card_t * card, snd_ctl_elem_id_t *src_id, snd_ctl_elem_id_t *dst_id)
{
snd_kcontrol_t *kctl;
- kctl = snd_ctl_find_id(card, src_id);
- if (kctl == NULL)
+ down_write(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, src_id);
+ if (kctl == NULL) {
+ up_write(&card->controls_rwsem);
return -ENOENT;
- write_lock(&card->control_rwlock);
+ }
kctl->id = *dst_id;
kctl->id.numid = ++card->last_numid;
- write_unlock(&card->control_rwlock);
+ up_write(&card->controls_rwsem);
return 0;
}
-snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid)
+static snd_kcontrol_t *_ctl_find_numid(snd_card_t * card, unsigned int numid)
{
struct list_head *list;
snd_kcontrol_t *kctl;
snd_runtime_check(card != NULL && numid != 0, return NULL);
- read_lock(&card->control_rwlock);
list_for_each(list, &card->controls) {
kctl = snd_kcontrol(list);
- if (kctl->id.numid == numid) {
- read_unlock(&card->control_rwlock);
+ if (kctl->id.numid == numid)
return kctl;
- }
}
- read_unlock(&card->control_rwlock);
return NULL;
}
-snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
+static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
{
struct list_head *list;
snd_kcontrol_t *kctl;
snd_runtime_check(card != NULL && id != NULL, return NULL);
if (id->numid != 0)
- return snd_ctl_find_numid(card, id->numid);
- read_lock(&card->control_rwlock);
+ return _ctl_find_numid(card, id->numid);
list_for_each(list, &card->controls) {
kctl = snd_kcontrol(list);
if (kctl->id.iface != id->iface)
@@ -309,20 +316,38 @@ snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
continue;
if (kctl->id.index != id->index)
continue;
- read_unlock(&card->control_rwlock);
return kctl;
}
- read_unlock(&card->control_rwlock);
return NULL;
}
+/* exported: with read lock */
+snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
+{
+ snd_kcontrol_t *kctl;
+ down_read(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, id);
+ up_read(&card->controls_rwsem);
+ return kctl;
+}
+
+/* exported: with read lock */
+snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid)
+{
+ snd_kcontrol_t *kctl;
+ down_read(&card->controls_rwsem);
+ kctl = _ctl_find_numid(card, numid);
+ up_read(&card->controls_rwsem);
+ return kctl;
+}
+
static int snd_ctl_card_info(snd_card_t * card, snd_ctl_file_t * ctl,
unsigned int cmd, unsigned long arg)
{
snd_ctl_card_info_t info;
memset(&info, 0, sizeof(info));
- read_lock(&snd_ioctl_rwlock);
+ down_read(&snd_ioctl_rwsem);
info.card = card->number;
strncpy(info.id, card->id, sizeof(info.id) - 1);
strncpy(info.driver, card->driver, sizeof(info.driver) - 1);
@@ -330,7 +355,7 @@ static int snd_ctl_card_info(snd_card_t * card, snd_ctl_file_t * ctl,
strncpy(info.longname, card->longname, sizeof(info.longname) - 1);
strncpy(info.mixername, card->mixername, sizeof(info.mixername) - 1);
strncpy(info.components, card->components, sizeof(info.components) - 1);
- read_unlock(&snd_ioctl_rwlock);
+ up_read(&snd_ioctl_rwsem);
if (copy_to_user((void *) arg, &info, sizeof(snd_ctl_card_info_t)))
return -EFAULT;
return 0;
@@ -356,7 +381,7 @@ static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t *_list)
dst = vmalloc(space * sizeof(snd_ctl_elem_id_t));
if (dst == NULL)
return -ENOMEM;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
list.count = card->controls_count;
plist = card->controls.next;
while (offset-- > 0 && plist != &card->controls)
@@ -371,14 +396,14 @@ static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t *_list)
space--;
list.used++;
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
if (list.used > 0 && copy_to_user(list.pids, dst, list.used * sizeof(snd_ctl_elem_id_t)))
return -EFAULT;
vfree(dst);
} else {
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
list.count = card->controls_count;
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
}
if (copy_to_user(_list, &list, sizeof(list)))
return -EFAULT;
@@ -394,10 +419,10 @@ static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info)
if (copy_from_user(&info, _info, sizeof(info)))
return -EFAULT;
- read_lock(&card->control_rwlock);
- kctl = snd_ctl_find_id(card, &info.id);
+ down_read(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, &info.id);
if (kctl == NULL) {
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
return -ENOENT;
}
#ifdef CONFIG_SND_DEBUG
@@ -417,7 +442,7 @@ static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info)
info.owner = -1;
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
if (result >= 0)
if (copy_to_user(_info, &info, sizeof(info)))
return -EFAULT;
@@ -435,8 +460,8 @@ static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
return -ENOMEM;
if (copy_from_user(control, _control, sizeof(*control)))
return -EFAULT;
- read_lock(&card->control_rwlock);
- kctl = snd_ctl_find_id(card, &control->id);
+ down_read(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, &control->id);
if (kctl == NULL) {
result = -ENOENT;
} else {
@@ -452,7 +477,7 @@ static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
result = -EPERM;
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
if (result >= 0)
if (copy_to_user(_control, control, sizeof(*control)))
return -EFAULT;
@@ -472,8 +497,8 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
return -ENOMEM;
if (copy_from_user(control, _control, sizeof(*control)))
return -EFAULT;
- read_lock(&card->control_rwlock);
- kctl = snd_ctl_find_id(card, &control->id);
+ down_read(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, &control->id);
if (kctl == NULL) {
result = -ENOENT;
} else {
@@ -481,7 +506,6 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
if (control->indirect != indirect) {
result = -EACCES;
} else {
- read_lock(&card->control_owner_lock);
if (!(kctl->access & SNDRV_CTL_ELEM_ACCESS_WRITE) ||
kctl->put == NULL ||
(kctl->owner != NULL && kctl->owner != file)) {
@@ -491,16 +515,15 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
if (result >= 0)
control->id = kctl->id;
}
- read_unlock(&card->control_owner_lock);
if (result > 0) {
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
result = 0;
goto __unlocked;
}
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
__unlocked:
if (result >= 0)
if (copy_to_user(_control, control, sizeof(*control)))
@@ -518,12 +541,11 @@ static int snd_ctl_elem_lock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
if (copy_from_user(&id, _id, sizeof(id)))
return -EFAULT;
- read_lock(&card->control_rwlock);
- kctl = snd_ctl_find_id(card, &id);
+ down_write(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, &id);
if (kctl == NULL) {
result = -ENOENT;
} else {
- write_lock(&card->control_owner_lock);
if (kctl->owner != NULL)
result = -EBUSY;
else {
@@ -531,9 +553,8 @@ static int snd_ctl_elem_lock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
kctl->owner_pid = current->pid;
result = 0;
}
- write_unlock(&card->control_owner_lock);
}
- read_unlock(&card->control_rwlock);
+ up_write(&card->controls_rwsem);
return result;
}
@@ -546,12 +567,11 @@ static int snd_ctl_elem_unlock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
if (copy_from_user(&id, _id, sizeof(id)))
return -EFAULT;
- read_lock(&card->control_rwlock);
- kctl = snd_ctl_find_id(card, &id);
+ down_write(&card->controls_rwsem);
+ kctl = _ctl_find_id(card, &id);
if (kctl == NULL) {
result = -ENOENT;
} else {
- write_lock(&card->control_owner_lock);
if (kctl->owner == NULL)
result = -EINVAL;
else if (kctl->owner != file)
@@ -561,9 +581,8 @@ static int snd_ctl_elem_unlock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
kctl->owner_pid = 0;
result = 0;
}
- write_unlock(&card->control_owner_lock);
}
- read_unlock(&card->control_rwlock);
+ up_write(&card->controls_rwsem);
return result;
}
@@ -638,16 +657,16 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
return put_user(SNDRV_CTL_POWER_D0, (int *)arg) ? -EFAULT : 0;
#endif
}
- read_lock(&snd_ioctl_rwlock);
+ down_read(&snd_ioctl_rwsem);
list_for_each(list, &snd_control_ioctls) {
p = list_entry(list, snd_kctl_ioctl_t, list);
err = p->fioctl(card, ctl, cmd, arg);
if (err != -ENOIOCTLCMD) {
- read_unlock(&snd_ioctl_rwlock);
+ up_read(&snd_ioctl_rwsem);
return err;
}
}
- read_unlock(&snd_ioctl_rwlock);
+ up_read(&snd_ioctl_rwsem);
snd_printd("unknown ioctl = 0x%x\n", cmd);
return -ENOTTY;
}
@@ -732,9 +751,9 @@ int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn)
if (pn == NULL)
return -ENOMEM;
pn->fioctl = fcn;
- write_lock(&snd_ioctl_rwlock);
+ down_write(&snd_ioctl_rwsem);
list_add_tail(&pn->list, &snd_control_ioctls);
- write_unlock(&snd_ioctl_rwlock);
+ up_write(&snd_ioctl_rwsem);
return 0;
}
@@ -744,17 +763,17 @@ int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn)
snd_kctl_ioctl_t *p;
snd_runtime_check(fcn != NULL, return -EINVAL);
- write_lock(&snd_ioctl_rwlock);
+ down_write(&snd_ioctl_rwsem);
list_for_each(list, &snd_control_ioctls) {
p = list_entry(list, snd_kctl_ioctl_t, list);
if (p->fioctl == fcn) {
list_del(&p->list);
- write_unlock(&snd_ioctl_rwlock);
+ up_write(&snd_ioctl_rwsem);
kfree(p);
return 0;
}
}
- write_unlock(&snd_ioctl_rwlock);
+ up_write(&snd_ioctl_rwsem);
snd_BUG();
return -EINVAL;
}
@@ -808,6 +827,21 @@ int snd_ctl_register(snd_card_t *card)
return 0;
}
+int snd_ctl_disconnect(snd_card_t *card)
+{
+ struct list_head *flist;
+ snd_ctl_file_t *ctl;
+
+ down_read(&card->controls_rwsem);
+ list_for_each(flist, &card->ctl_files) {
+ ctl = snd_ctl_file(flist);
+ wake_up(&ctl->change_sleep);
+ kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
+ }
+ up_read(&card->controls_rwsem);
+ return 0;
+}
+
int snd_ctl_unregister(snd_card_t *card)
{
int err, cardnum;
diff --git a/sound/core/device.c b/sound/core/device.c
index 84f654dc14fa..cb23f8a3eb7d 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -56,7 +56,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
continue;
/* unlink */
list_del(&dev->list);
- if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_unregister) {
+ if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) &&
+ dev->ops->dev_unregister) {
if (dev->ops->dev_unregister(dev))
snd_printk(KERN_ERR "device unregister failure\n");
} else {
@@ -72,6 +73,28 @@ int snd_device_free(snd_card_t *card, void *device_data)
return -ENXIO;
}
+int snd_device_disconnect(snd_card_t *card, void *device_data)
+{
+ struct list_head *list;
+ snd_device_t *dev;
+
+ snd_assert(card != NULL, return -ENXIO);
+ snd_assert(device_data != NULL, return -ENXIO);
+ list_for_each(list, &card->devices) {
+ dev = snd_device(list);
+ if (dev->device_data != device_data)
+ continue;
+ if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) {
+ if (dev->ops->dev_disconnect(dev))
+ snd_printk(KERN_ERR "device disconnect failure\n");
+ dev->state = SNDRV_DEV_DISCONNECTED;
+ }
+ return 0;
+ }
+ snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0));
+ return -ENXIO;
+}
+
int snd_device_register(snd_card_t *card, void *device_data)
{
struct list_head *list;
@@ -113,6 +136,21 @@ int snd_device_register_all(snd_card_t *card)
return 0;
}
+int snd_device_disconnect_all(snd_card_t *card)
+{
+ snd_device_t *dev;
+ struct list_head *list;
+ int err = 0;
+
+ snd_assert(card != NULL, return -ENXIO);
+ list_for_each(list, &card->devices) {
+ dev = snd_device(list);
+ if (snd_device_disconnect(card, dev->device_data) < 0)
+ err = -ENXIO;
+ }
+ return err;
+}
+
int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd)
{
snd_device_t *dev;
diff --git a/sound/core/info.c b/sound/core/info.c
index c636f4c24a11..808f46456976 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -933,11 +933,7 @@ snd_info_entry_t *snd_info_create_device(const char *name, unsigned int number,
p = create_proc_entry(entry->name, entry->mode, snd_proc_dev);
if (p) {
snd_info_device_entry_prepare(p, entry);
-#ifndef LINUX_2_2
- /* we should not set this - at least on 2.4.14 or later it causes
- problems! */
- /* p->proc_fops = &snd_fops; */
-#else
+#ifdef LINUX_2_2
p->ops = &snd_info_device_inode_operations;
#endif
} else {
@@ -1028,7 +1024,7 @@ static void snd_info_version_read(snd_info_entry_t *entry, snd_info_buffer_t * b
snd_iprintf(buffer,
"Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"
"Compiled on " __DATE__ " for kernel %s"
-#ifdef __SMP__
+#ifdef CONFIG_SMP
" (SMP)"
#endif
#ifdef MODVERSIONS
diff --git a/sound/core/init.c b/sound/core/init.c
index 77565af5ba45..10768c6f2898 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -21,15 +21,23 @@
#include <sound/driver.h>
#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/file.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/ctype.h>
+#include <linux/workqueue.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
+struct snd_shutdown_f_ops {
+ struct file_operations f_ops;
+ struct snd_shutdown_f_ops *next;
+};
+
int snd_cards_count = 0;
-static unsigned int snd_cards_lock = 0; /* locked for registering/using */
+unsigned int snd_cards_lock = 0; /* locked for registering/using */
snd_card_t *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL};
rwlock_t snd_card_rwlock = RW_LOCK_UNLOCKED;
@@ -42,6 +50,16 @@ static void snd_card_id_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer
snd_iprintf(buffer, "%s\n", entry->card->id);
}
+/**
+ * snd_card_new: create and initialize a soundcard structure
+ * @idx: card index (address) [0 ... (SNDRV_CARDS-1)]
+ * @xid: card identification (ASCII string)
+ * @module: top level module for locking
+ * @extra_size: allocate this extra size after the main soundcard structure
+ *
+ * Returns kmallocated snd_card_t structure. Creates the ALSA control interface
+ * (which is blocked until #snd_card_register function is called).
+ */
snd_card_t *snd_card_new(int idx, const char *xid,
struct module *module, int extra_size)
{
@@ -81,10 +99,12 @@ snd_card_t *snd_card_new(int idx, const char *xid,
card->number = idx;
card->module = module;
INIT_LIST_HEAD(&card->devices);
- rwlock_init(&card->control_rwlock);
- rwlock_init(&card->control_owner_lock);
+ init_rwsem(&card->controls_rwsem);
+ rwlock_init(&card->ctl_files_rwlock);
INIT_LIST_HEAD(&card->controls);
INIT_LIST_HEAD(&card->ctl_files);
+ spin_lock_init(&card->files_lock);
+ init_waitqueue_head(&card->shutdown_sleep);
#ifdef CONFIG_PM
init_MUTEX(&card->power_lock);
init_waitqueue_head(&card->power_sleep);
@@ -110,17 +130,129 @@ snd_card_t *snd_card_new(int idx, const char *xid,
return NULL;
}
+static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait)
+{
+ return POLLERR | POLLNVAL;
+}
+
+/**
+ * snd_card_disconnect: disconnect all APIs from the file-operations (user space)
+ * @card: soundcard structure
+ *
+ * Returns - zero, otherwise a negative error code.
+ *
+ * Note: The current implementation replaces all active file->f_op with special
+ * dummy file operations (they do nothing except release).
+ */
+int snd_card_disconnect(snd_card_t * card)
+{
+ struct snd_monitor_file *mfile;
+ struct file *file;
+ struct snd_shutdown_f_ops *s_f_ops;
+ struct file_operations *f_ops, *old_f_ops;
+ int err;
+
+ spin_lock(&card->files_lock);
+ if (card->shutdown) {
+ spin_unlock(&card->files_lock);
+ return 0;
+ }
+ card->shutdown = 1;
+ spin_unlock(&card->files_lock);
+
+ /* phase 1: disable fops (user space) operations for ALSA API */
+ write_lock(&snd_card_rwlock);
+ snd_cards[card->number] = NULL;
+ write_unlock(&snd_card_rwlock);
+
+ /* phase 2: replace file->f_op with special dummy operations */
+
+ spin_lock(&card->files_lock);
+ mfile = card->files;
+ while (mfile) {
+ file = mfile->file;
+
+ /* it's critical part, use endless loop */
+ /* we have no room to fail */
+ s_f_ops = kmalloc(sizeof(struct snd_shutdown_f_ops), GFP_ATOMIC);
+ if (s_f_ops == NULL)
+ panic("Atomic allocation failed for snd_shutdown_f_ops!");
+
+ f_ops = &s_f_ops->f_ops;
+
+ memset(f_ops, 0, sizeof(*f_ops));
+#ifndef LINUX_2_2
+ f_ops->owner = file->f_op->owner;
+#endif
+ f_ops->release = file->f_op->release;
+ f_ops->poll = snd_disconnect_poll;
+
+ s_f_ops->next = card->s_f_ops;
+ card->s_f_ops = s_f_ops;
+
+ f_ops = fops_get(f_ops);
+
+ old_f_ops = file->f_op;
+ file->f_op = f_ops; /* must be atomic */
+ fops_put(old_f_ops);
+
+ mfile = mfile->next;
+ }
+ spin_unlock(&card->files_lock);
+
+ /* phase 3: notify all connected devices about disconnection */
+ /* at this point, they cannot respond to any calls except release() */
+
+ snd_ctl_disconnect(card);
+
+#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
+ if (snd_mixer_oss_notify_callback)
+ snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_DISCONNECT);
+#endif
+
+ /* notify all devices that we are disconnected */
+ err = snd_device_disconnect_all(card);
+ if (err < 0)
+ snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number);
+
+ return 0;
+}
+
+/**
+ * snd_card_free: frees given soundcard structure
+ * @card: soundcard structure
+ *
+ * This function releases the soundcard structure and the all assigned
+ * devices automatically. That is, you don't have to release the devices
+ * by yourself.
+ *
+ * Returns - zero. Frees all associated devices and frees the control
+ * interface associated to given soundcard.
+ */
int snd_card_free(snd_card_t * card)
{
+ wait_queue_t wait;
+ struct snd_shutdown_f_ops *s_f_ops;
+
if (card == NULL)
return -EINVAL;
write_lock(&snd_card_rwlock);
snd_cards[card->number] = NULL;
snd_cards_count--;
write_unlock(&snd_card_rwlock);
+
+ /* wait, until all devices are ready for the free operation */
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&card->shutdown_sleep, &wait);
+ while (card->files) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(30 * HZ);
+ }
+ remove_wait_queue(&card->shutdown_sleep, &wait);
+
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
if (snd_mixer_oss_notify_callback)
- snd_mixer_oss_notify_callback(card, 1);
+ snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_FREE);
#endif
if (snd_device_free_all(card, SNDRV_DEV_CMD_PRE) < 0) {
snd_printk(KERN_ERR "unable to free all devices (pre)\n");
@@ -145,6 +277,11 @@ int snd_card_free(snd_card_t * card)
snd_printk(KERN_WARNING "unable to free card info\n");
/* Not fatal error */
}
+ while (card->s_f_ops) {
+ s_f_ops = card->s_f_ops;
+ card->s_f_ops = s_f_ops->next;
+ kfree(s_f_ops);
+ }
write_lock(&snd_card_rwlock);
snd_cards_lock &= ~(1 << card->number);
write_unlock(&snd_card_rwlock);
@@ -152,7 +289,56 @@ int snd_card_free(snd_card_t * card)
return 0;
}
-static void choose_default_id(snd_card_t *card)
+static void snd_card_free_thread(void * __card)
+{
+ snd_card_t *card = __card;
+ struct module * module;
+
+ if (!try_inc_mod_count(module = card->module)) {
+ snd_printk(KERN_ERR "unable to lock toplevel module for card %i in free thread\n", card->number);
+ module = NULL;
+ }
+
+ wait_event(card->shutdown_sleep, card->files == NULL);
+
+ snd_card_free(card);
+
+ if (module)
+ __MOD_DEC_USE_COUNT(module);
+}
+
+/**
+ * snd_card_free_in_thread: call snd_card_free() in thread
+ * @card: soundcard structure
+ *
+ * This function schedules the call of #snd_card_free function in a
+ * work queue. When all devices are released (non-busy), the work
+ * is woken up and calls #snd_card_free.
+ *
+ * When a card can be disconnected at any time by hotplug service,
+ * this function should be used in disconnect (or detach) callback
+ * instead of calling #snd_card_free directly.
+ *
+ * Returns - zero otherwise a negative error code if the start of thread failed.
+ */
+int snd_card_free_in_thread(snd_card_t * card)
+{
+ DECLARE_WORK(works, snd_card_free_thread, card);
+
+ if (card->files == NULL) {
+ snd_card_free(card);
+ return 0;
+ }
+ if (schedule_work(&works))
+ return 0;
+
+ snd_printk(KERN_ERR "kernel_thread failed in snd_card_free_in_thread for card %i\n", card->number);
+ /* try to free the structure immediately */
+ snd_card_free(card);
+ return -EFAULT;
+}
+
+static void choose_default_id(snd_card_t * card)
{
int i, len, idx_flag = 0, loops = 8;
char *id, *spos;
@@ -204,10 +390,19 @@ static void choose_default_id(snd_card_t *card)
idx_flag++;
}
}
-
- strcpy(card->id, id);
}
+/**
+ * snd_card_register: register the soundcard
+ * @card: soundcard structure
+ *
+ * This function registers all the devices assigned to the soundcard.
+ * Until calling this, the ALSA control interface is blocked from the
+ * external accesses. Thus, you should call this function at the end
+ * of the initialization of the card.
+ *
+ * Returns - zero otherwise a negative error code if the registrain failed.
+ */
int snd_card_register(snd_card_t * card)
{
int err;
@@ -246,7 +441,7 @@ int snd_card_register(snd_card_t * card)
__skip_info:
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
if (snd_mixer_oss_notify_callback)
- snd_mixer_oss_notify_callback(card, 0);
+ snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER);
#endif
return 0;
}
@@ -312,7 +507,6 @@ int __init snd_card_info_init(void)
return -ENOMEM;
}
snd_card_info_entry = entry;
-
return 0;
}
@@ -323,6 +517,17 @@ int __exit snd_card_info_done(void)
return 0;
}
+/**
+ * snd_component_add: add a component string
+ * @card: soundcard structure
+ * @component: the component id string
+ *
+ * This function adds the component id string to the supported list.
+ * The component can be referred from the alsa-lib.
+ *
+ * Returns - zero otherwise a negative error code.
+ */
+
int snd_component_add(snd_card_t *card, const char *component)
{
char *ptr;
@@ -343,8 +548,87 @@ int snd_component_add(snd_card_t *card, const char *component)
return 0;
}
+/**
+ * snd_card_file_add: add the file to the file list of the card
+ * @card: soundcard structure
+ * @file: file pointer
+ *
+ * This function adds the file to the file linked-list of the card.
+ * This linked-list is used to keep tracking the connection state,
+ * and to avoid the release of busy resources by hotplug.
+ *
+ * Returns zero or a negative error code.
+ */
+int snd_card_file_add(snd_card_t *card, struct file *file)
+{
+ struct snd_monitor_file *mfile;
+
+ mfile = kmalloc(sizeof(*mfile), GFP_KERNEL);
+ if (mfile == NULL)
+ return -ENOMEM;
+ mfile->file = file;
+ mfile->next = NULL;
+ spin_lock(&card->files_lock);
+ if (card->shutdown) {
+ spin_unlock(&card->files_lock);
+ kfree(mfile);
+ return -ENODEV;
+ }
+ mfile->next = card->files;
+ card->files = mfile;
+ spin_unlock(&card->files_lock);
+ return 0;
+}
+
+/**
+ * snd_card_file_remove: remove the file from the file list
+ * @card: soundcard structure
+ * @file: file pointer
+ *
+ * This function removes the file formerly added to the card via
+ * #snd_card_file_add function.
+ * If all files are removed and the release of the card is
+ * scheduled, it will wake up the the thread to call #snd_card_free
+ * (see #snd_card_free_in_thread function).
+ *
+ * Returns zero or a negative error code.
+ */
+int snd_card_file_remove(snd_card_t *card, struct file *file)
+{
+ struct snd_monitor_file *mfile, *pfile = NULL;
+
+ spin_lock(&card->files_lock);
+ mfile = card->files;
+ while (mfile) {
+ if (mfile->file == file) {
+ if (pfile)
+ pfile->next = mfile->next;
+ else
+ card->files = mfile->next;
+ break;
+ }
+ pfile = mfile;
+ mfile = mfile->next;
+ }
+ spin_unlock(&card->files_lock);
+ if (card->files == NULL)
+ wake_up(&card->shutdown_sleep);
+ if (mfile) {
+ kfree(mfile);
+ } else {
+ snd_printk(KERN_ERR "ALSA card file remove problem (%p)\n", file);
+ return -ENOENT;
+ }
+ return 0;
+}
+
#ifdef CONFIG_PM
-/* the power lock must be active before call */
+/**
+ * snd_power_wait: wait until the power-state is changed.
+ * @card: soundcard structure
+ *
+ * Note: the power lock must be active before call.
+ */
void snd_power_wait(snd_card_t *card)
{
wait_queue_t wait;
@@ -352,6 +636,7 @@ void snd_power_wait(snd_card_t *card)
init_waitqueue_entry(&wait, current);
add_wait_queue(&card->power_sleep, &wait);
snd_power_unlock(card);
+ set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(30 * HZ);
remove_wait_queue(&card->power_sleep, &wait);
snd_power_lock(card);
diff --git a/sound/core/ioctl32/ioctl32.c b/sound/core/ioctl32/ioctl32.c
index 4c2e37a01ee4..fd37aab6d80d 100644
--- a/sound/core/ioctl32/ioctl32.c
+++ b/sound/core/ioctl32/ioctl32.c
@@ -24,7 +24,6 @@
#include <linux/init.h>
#include <linux/time.h>
#include <linux/slab.h>
-#include <linux/fs.h>
#include <linux/init.h>
#include <sound/core.h>
#include <sound/control.h>
diff --git a/sound/core/ioctl32/rawmidi32.c b/sound/core/ioctl32/rawmidi32.c
index 31b3319fba7a..f75a53d4e8af 100644
--- a/sound/core/ioctl32/rawmidi32.c
+++ b/sound/core/ioctl32/rawmidi32.c
@@ -20,7 +20,6 @@
#include <sound/driver.h>
#include <linux/time.h>
-#include <linux/fs.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <asm/uaccess.h>
diff --git a/sound/core/ioctl32/seq32.c b/sound/core/ioctl32/seq32.c
index 1d396554b7ba..e7a19f6c4ce6 100644
--- a/sound/core/ioctl32/seq32.c
+++ b/sound/core/ioctl32/seq32.c
@@ -20,7 +20,6 @@
#include <sound/driver.h>
#include <linux/time.h>
-#include <linux/fs.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <asm/uaccess.h>
diff --git a/sound/core/ioctl32/timer32.c b/sound/core/ioctl32/timer32.c
index 1672e0342ec4..b0167274aca1 100644
--- a/sound/core/ioctl32/timer32.c
+++ b/sound/core/ioctl32/timer32.c
@@ -20,7 +20,6 @@
#include <sound/driver.h>
#include <linux/time.h>
-#include <linux/fs.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <asm/uaccess.h>
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 03167976060f..0d6aecd9016c 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -45,14 +45,20 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
int cardnum = SNDRV_MINOR_OSS_CARD(minor(inode->i_rdev));
snd_card_t *card;
snd_mixer_oss_file_t *fmixer;
+ int err;
if ((card = snd_cards[cardnum]) == NULL)
return -ENODEV;
if (card->mixer_oss == NULL)
return -ENODEV;
+ err = snd_card_file_add(card, file);
+ if (err < 0)
+ return err;
fmixer = (snd_mixer_oss_file_t *)snd_kcalloc(sizeof(*fmixer), GFP_KERNEL);
- if (fmixer == NULL)
+ if (fmixer == NULL) {
+ snd_card_file_remove(card, file);
return -ENOMEM;
+ }
fmixer->card = card;
fmixer->mixer = card->mixer_oss;
file->private_data = fmixer;
@@ -64,6 +70,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file)
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
#endif
+ snd_card_file_remove(card, file);
return -EFAULT;
}
return 0;
@@ -79,6 +86,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file)
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
#endif
+ snd_card_file_remove(fmixer->card, file);
kfree(fmixer);
}
return 0;
@@ -554,7 +562,7 @@ static int snd_mixer_oss_get_volume1(snd_mixer_oss_file_t *fmixer,
struct slot *slot = (struct slot *)pslot->private_data;
*left = *right = 100;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
@@ -571,7 +579,7 @@ static int snd_mixer_oss_get_volume1(snd_mixer_oss_file_t *fmixer,
} else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) {
snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
return 0;
}
@@ -647,7 +655,7 @@ static int snd_mixer_oss_put_volume1(snd_mixer_oss_file_t *fmixer,
snd_card_t *card = fmixer->card;
struct slot *slot = (struct slot *)pslot->private_data;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
@@ -677,7 +685,7 @@ static int snd_mixer_oss_put_volume1(snd_mixer_oss_file_t *fmixer,
snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1);
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
return 0;
}
@@ -690,9 +698,9 @@ static int snd_mixer_oss_get_recsrc1_sw(snd_mixer_oss_file_t *fmixer,
int left, right;
left = right = 1;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CSWITCH], &left, &right, 0);
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
*active = (left || right) ? 1 : 0;
return 0;
}
@@ -706,9 +714,9 @@ static int snd_mixer_oss_get_recsrc1_route(snd_mixer_oss_file_t *fmixer,
int left, right;
left = right = 1;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CROUTE], &left, &right, 1);
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
*active = (left || right) ? 1 : 0;
return 0;
}
@@ -720,9 +728,9 @@ static int snd_mixer_oss_put_recsrc1_sw(snd_mixer_oss_file_t *fmixer,
snd_card_t *card = fmixer->card;
struct slot *slot = (struct slot *)pslot->private_data;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0);
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
return 0;
}
@@ -733,9 +741,9 @@ static int snd_mixer_oss_put_recsrc1_route(snd_mixer_oss_file_t *fmixer,
snd_card_t *card = fmixer->card;
struct slot *slot = (struct slot *)pslot->private_data;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->kcontrol[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1);
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
return 0;
}
@@ -756,16 +764,15 @@ static int snd_mixer_oss_get_recsrc2(snd_mixer_oss_file_t *fmixer, int *active_i
err = -ENOMEM;
goto __unlock;
}
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
snd_runtime_check(kctl != NULL, err = -ENOENT; goto __unlock);
snd_runtime_check(!(err = kctl->info(kctl, uinfo)), goto __unlock);
snd_runtime_check(!(err = kctl->get(kctl, uctl)), goto __unlock);
- read_unlock(&card->control_rwlock);
for (idx = 0; idx < 32; idx++) {
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
- pslot = &fmixer->mixer->slots[idx];
+ pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
@@ -777,10 +784,8 @@ static int snd_mixer_oss_get_recsrc2(snd_mixer_oss_file_t *fmixer, int *active_i
}
}
err = 0;
- goto __unalloc;
__unlock:
- read_unlock(&card->control_rwlock);
- __unalloc:
+ up_read(&card->controls_rwsem);
if (uctl)
kfree(uctl);
if (uinfo)
@@ -805,14 +810,14 @@ static int snd_mixer_oss_put_recsrc2(snd_mixer_oss_file_t *fmixer, int active_in
err = -ENOMEM;
goto __unlock;
}
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
snd_runtime_check(kctl != NULL, err = -ENOENT; goto __unlock);
snd_runtime_check(!(err = kctl->info(kctl, uinfo)), goto __unlock);
for (idx = 0; idx < 32; idx++) {
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
- pslot = &fmixer->mixer->slots[idx];
+ pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
@@ -830,7 +835,7 @@ static int snd_mixer_oss_put_recsrc2(snd_mixer_oss_file_t *fmixer, int active_in
snd_ctl_notify(fmixer->card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
err = 0;
__unlock:
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
if (uctl)
kfree(uctl);
if (uinfo)
@@ -1200,10 +1205,11 @@ static int snd_mixer_oss_free1(void *private)
return 0;
}
-static int snd_mixer_oss_notify_handler(snd_card_t * card, int free_flag)
+static int snd_mixer_oss_notify_handler(snd_card_t * card, int cmd)
{
- if (!free_flag) {
- snd_mixer_oss_t *mixer;
+ snd_mixer_oss_t *mixer;
+
+ if (cmd == SND_MIXER_OSS_NOTIFY_REGISTER) {
char name[128];
int idx, err;
@@ -1220,6 +1226,7 @@ static int snd_mixer_oss_notify_handler(snd_card_t * card, int free_flag)
snd_magic_kfree(mixer);
return err;
}
+ mixer->oss_dev_alloc = 1;
mixer->card = card;
if (*card->mixername) {
strncpy(mixer->name, card->mixername, sizeof(mixer->name) - 1);
@@ -1236,14 +1243,21 @@ static int snd_mixer_oss_notify_handler(snd_card_t * card, int free_flag)
card->mixer_oss = mixer;
snd_mixer_oss_build(mixer);
snd_mixer_oss_proc_init(mixer);
- } else {
- snd_mixer_oss_t *mixer = card->mixer_oss;
+ } else if (cmd == SND_MIXER_OSS_NOTIFY_DISCONNECT) {
+ mixer = card->mixer_oss;
+ if (mixer == NULL || !mixer->oss_dev_alloc)
+ return 0;
+ snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, mixer->card, 0);
+ mixer->oss_dev_alloc = 0;
+ } else { /* free */
+ mixer = card->mixer_oss;
if (mixer == NULL)
return 0;
#ifdef SNDRV_OSS_INFO_DEV_MIXERS
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_MIXERS, mixer->card->number);
#endif
- snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, mixer->card, 0);
+ if (mixer->oss_dev_alloc)
+ snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, mixer->card, 0);
snd_mixer_oss_proc_done(mixer);
return snd_mixer_oss_free1(mixer);
}
@@ -1257,7 +1271,7 @@ static int __init alsa_mixer_oss_init(void)
snd_mixer_oss_notify_callback = snd_mixer_oss_notify_handler;
for (idx = 0; idx < SNDRV_CARDS; idx++) {
if (snd_cards[idx])
- snd_mixer_oss_notify_handler(snd_cards[idx], 0);
+ snd_mixer_oss_notify_handler(snd_cards[idx], SND_MIXER_OSS_NOTIFY_REGISTER);
}
return 0;
}
@@ -1269,7 +1283,7 @@ static void __exit alsa_mixer_oss_exit(void)
snd_mixer_oss_notify_callback = NULL;
for (idx = 0; idx < SNDRV_CARDS; idx++) {
if (snd_cards[idx])
- snd_mixer_oss_notify_handler(snd_cards[idx], 1);
+ snd_mixer_oss_notify_handler(snd_cards[idx], SND_MIXER_OSS_NOTIFY_FREE);
}
}
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index ad505e74f82d..c6e18a7e0d0a 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1554,13 +1554,16 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
err = -ENODEV;
goto __error1;
}
+ err = snd_card_file_add(pcm->card, file);
+ if (err < 0)
+ goto __error1;
if (!try_inc_mod_count(pcm->card->module)) {
err = -EFAULT;
- goto __error1;
+ goto __error2;
}
if (snd_task_name(current, task_name, sizeof(task_name)) < 0) {
err = -EFAULT;
- goto __error1;
+ goto __error;
}
if (file->f_mode & FMODE_WRITE)
psetup = snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_PLAYBACK, task_name);
@@ -1584,13 +1587,12 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
init_waitqueue_entry(&wait, current);
add_wait_queue(&pcm->open_wait, &wait);
+ down(&pcm->open_mutex);
while (1) {
- down(&pcm->open_mutex);
err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file,
minor, psetup, csetup);
if (err >= 0)
break;
- up(&pcm->open_mutex);
if (err == -EAGAIN) {
if (nonblock) {
err = -EBUSY;
@@ -1599,7 +1601,9 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
} else
break;
set_current_state(TASK_INTERRUPTIBLE);
+ up(&pcm->open_mutex);
schedule();
+ down(&pcm->open_mutex);
if (signal_pending(current)) {
err = -ERESTARTSYS;
break;
@@ -1607,13 +1611,15 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file)
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&pcm->open_wait, &wait);
+ up(&pcm->open_mutex);
if (err < 0)
goto __error;
- up(&pcm->open_mutex);
return err;
__error:
dec_mod_count(pcm->card->module);
+ __error2:
+ snd_card_file_remove(pcm->card, file);
__error1:
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
@@ -1639,6 +1645,7 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file)
up(&pcm->open_mutex);
wake_up(&pcm->open_wait);
dec_mod_count(pcm->card->module);
+ snd_card_file_remove(pcm->card, file);
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
#endif
@@ -2108,7 +2115,7 @@ static snd_minor_t snd_pcm_oss_reg =
.f_ops = &snd_pcm_oss_f_reg,
};
-static void register_oss_dsp(unsigned short native_minor, snd_pcm_t *pcm, int index)
+static void register_oss_dsp(snd_pcm_t *pcm, int index)
{
char name[128];
sprintf(name, "dsp%i%i", pcm->card->number, pcm->device);
@@ -2119,14 +2126,13 @@ static void register_oss_dsp(unsigned short native_minor, snd_pcm_t *pcm, int in
}
}
-static int snd_pcm_oss_register_minor(unsigned short native_minor,
- snd_pcm_t * pcm)
+static int snd_pcm_oss_register_minor(snd_pcm_t * pcm)
{
pcm->oss.reg = 0;
if (dsp_map[pcm->card->number] == pcm->device) {
char name[128];
int duplex;
- register_oss_dsp(native_minor, pcm, 0);
+ register_oss_dsp(pcm, 0);
duplex = (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count > 0 &&
pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count &&
!(pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX));
@@ -2137,10 +2143,12 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor,
name);
#endif
pcm->oss.reg++;
+ pcm->oss.reg_mask |= 1;
}
if (adsp_map[pcm->card->number] == pcm->device) {
- register_oss_dsp(native_minor, pcm, 1);
+ register_oss_dsp(pcm, 1);
pcm->oss.reg++;
+ pcm->oss.reg_mask |= 2;
}
if (pcm->oss.reg)
@@ -2149,20 +2157,32 @@ static int snd_pcm_oss_register_minor(unsigned short native_minor,
return 0;
}
-static int snd_pcm_oss_unregister_minor(unsigned short native_minor,
- snd_pcm_t * pcm)
+static int snd_pcm_oss_disconnect_minor(snd_pcm_t * pcm)
{
if (pcm->oss.reg) {
- if (dsp_map[pcm->card->number] == pcm->device) {
+ if (pcm->oss.reg_mask & 1) {
+ pcm->oss.reg_mask &= ~1;
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
pcm->card, 0);
+ }
+ if (pcm->oss.reg_mask & 2) {
+ pcm->oss.reg_mask &= ~2;
+ snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
+ pcm->card, 1);
+ }
+ }
+ return 0;
+}
+
+static int snd_pcm_oss_unregister_minor(snd_pcm_t * pcm)
+{
+ snd_pcm_oss_disconnect_minor(pcm);
+ if (pcm->oss.reg) {
+ if (dsp_map[pcm->card->number] == pcm->device) {
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_AUDIO, pcm->card->number);
#endif
}
- if (adsp_map[pcm->card->number] == pcm->device)
- snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_PCM,
- pcm->card, 1);
pcm->oss.reg = 0;
snd_pcm_oss_proc_done(pcm);
}
@@ -2172,6 +2192,7 @@ static int snd_pcm_oss_unregister_minor(unsigned short native_minor,
static snd_pcm_notify_t snd_pcm_oss_notify =
{
.n_register = snd_pcm_oss_register_minor,
+ .n_disconnect = snd_pcm_oss_disconnect_minor,
.n_unregister = snd_pcm_oss_unregister_minor,
};
@@ -2180,8 +2201,6 @@ static int __init alsa_pcm_oss_init(void)
int i;
int err;
- if ((err = snd_pcm_notify(&snd_pcm_oss_notify, 0)) < 0)
- return err;
/* check device map table */
for (i = 0; i < SNDRV_CARDS; i++) {
if (dsp_map[i] < 0 || dsp_map[i] >= SNDRV_PCM_DEVICES) {
@@ -2193,6 +2212,8 @@ static int __init alsa_pcm_oss_init(void)
adsp_map[i] = 1;
}
}
+ if ((err = snd_pcm_notify(&snd_pcm_oss_notify, 0)) < 0)
+ return err;
return 0;
}
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 67bd109368fe..562f4f4ca6a2 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -37,9 +37,10 @@ snd_pcm_t *snd_pcm_devices[SNDRV_CARDS * SNDRV_PCM_DEVICES];
static LIST_HEAD(snd_pcm_notify_list);
static DECLARE_MUTEX(register_mutex);
-int snd_pcm_free(snd_pcm_t *pcm);
+static int snd_pcm_free(snd_pcm_t *pcm);
static int snd_pcm_dev_free(snd_device_t *device);
static int snd_pcm_dev_register(snd_device_t *device);
+static int snd_pcm_dev_disconnect(snd_device_t *device);
static int snd_pcm_dev_unregister(snd_device_t *device);
void snd_pcm_lock(int xup)
@@ -590,7 +591,7 @@ int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count)
}
int snd_pcm_new(snd_card_t * card, char *id, int device,
- int playback_count, int capture_count,
+ int playback_count, int capture_count,
snd_pcm_t ** rpcm)
{
snd_pcm_t *pcm;
@@ -598,6 +599,7 @@ int snd_pcm_new(snd_card_t * card, char *id, int device,
static snd_device_ops_t ops = {
.dev_free = snd_pcm_dev_free,
.dev_register = snd_pcm_dev_register,
+ .dev_disconnect = snd_pcm_dev_disconnect,
.dev_unregister = snd_pcm_dev_unregister
};
@@ -653,7 +655,7 @@ static void snd_pcm_free_stream(snd_pcm_str_t * pstr)
#endif
}
-int snd_pcm_free(snd_pcm_t *pcm)
+static int snd_pcm_free(snd_pcm_t *pcm)
{
snd_assert(pcm != NULL, return -ENXIO);
if (pcm->private_free)
@@ -664,7 +666,7 @@ int snd_pcm_free(snd_pcm_t *pcm)
return 0;
}
-int snd_pcm_dev_free(snd_device_t *device)
+static int snd_pcm_dev_free(snd_device_t *device)
{
snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
return snd_pcm_free(pcm);
@@ -696,7 +698,7 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
return -ENODEV;
card = pcm->card;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
list_for_each(list, &card->ctl_files) {
kctl = snd_ctl_file(list);
if (kctl->pid == current->pid) {
@@ -704,7 +706,7 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
break;
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
if (pstr->substream_count == 0)
return -ENODEV;
@@ -793,7 +795,7 @@ void snd_pcm_release_substream(snd_pcm_substream_t *substream)
substream->pstr->substream_opened--;
}
-int snd_pcm_dev_register(snd_device_t *device)
+static int snd_pcm_dev_register(snd_device_t *device)
{
int idx, cidx, err;
unsigned short minor;
@@ -837,7 +839,25 @@ int snd_pcm_dev_register(snd_device_t *device)
list_for_each(list, &snd_pcm_notify_list) {
snd_pcm_notify_t *notify;
notify = list_entry(list, snd_pcm_notify_t, list);
- notify->n_register(-1 /* idx + SNDRV_MINOR_PCM */, pcm);
+ notify->n_register(pcm);
+ }
+ snd_pcm_lock(1);
+ return 0;
+}
+
+static int snd_pcm_dev_disconnect(snd_device_t *device)
+{
+ snd_pcm_t *pcm = snd_magic_cast(snd_pcm_t, device->device_data, return -ENXIO);
+ struct list_head *list;
+ int idx;
+
+ snd_pcm_lock(0);
+ idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
+ snd_pcm_devices[idx] = NULL;
+ list_for_each(list, &snd_pcm_notify_list) {
+ snd_pcm_notify_t *notify;
+ notify = list_entry(list, snd_pcm_notify_t, list);
+ notify->n_disconnect(pcm);
}
snd_pcm_lock(1);
return 0;
@@ -853,10 +873,7 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
snd_assert(pcm != NULL, return -ENXIO);
snd_pcm_lock(0);
idx = (pcm->card->number * SNDRV_PCM_DEVICES) + pcm->device;
- if (snd_pcm_devices[idx] != pcm) {
- snd_pcm_lock(1);
- return -EINVAL;
- }
+ snd_pcm_devices[idx] = NULL;
for (cidx = 0; cidx < 2; cidx++) {
devtype = -1;
switch (cidx) {
@@ -874,9 +891,8 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
list_for_each(list, &snd_pcm_notify_list) {
snd_pcm_notify_t *notify;
notify = list_entry(list, snd_pcm_notify_t, list);
- notify->n_unregister(-1 /* SNDRV_MINOR_PCM + idx */, pcm);
+ notify->n_unregister(pcm);
}
- snd_pcm_devices[idx] = NULL;
snd_pcm_lock(1);
return snd_pcm_free(pcm);
}
@@ -892,16 +908,14 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree)
for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) {
if (snd_pcm_devices[idx] == NULL)
continue;
- notify->n_unregister(-1 /* idx + SNDRV_MINOR_PCM */,
- snd_pcm_devices[idx]);
+ notify->n_unregister(snd_pcm_devices[idx]);
}
} else {
list_add_tail(&notify->list, &snd_pcm_notify_list);
for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) {
if (snd_pcm_devices[idx] == NULL)
continue;
- notify->n_register(-1 /* idx + SNDRV_MINOR_PCM */,
- snd_pcm_devices[idx]);
+ notify->n_register(snd_pcm_devices[idx]);
}
}
snd_pcm_lock(1);
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 809d62c24d5b..e5c4d15e55c9 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -106,12 +106,12 @@ int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream)
if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
snd_timestamp_now((snd_timestamp_t*)&runtime->status->tstamp);
#ifdef CONFIG_SND_DEBUG
- if (pos > runtime->buffer_size) {
+ if (pos >= runtime->buffer_size) {
snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size);
} else
#endif
- snd_runtime_check(pos <= runtime->buffer_size, return 0);
-
+ snd_runtime_check(pos < runtime->buffer_size, return 0);
+
pos -= pos % runtime->min_align;
new_hw_ptr = runtime->hw_ptr_base + pos;
@@ -172,12 +172,12 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream)
if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
snd_timestamp_now((snd_timestamp_t*)&runtime->status->tstamp);
#ifdef CONFIG_SND_DEBUG
- if (pos > runtime->buffer_size) {
+ if (pos >= runtime->buffer_size) {
snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size);
} else
#endif
- snd_runtime_check(pos <= runtime->buffer_size, return 0);
-
+ snd_runtime_check(pos < runtime->buffer_size, return 0);
+
pos -= pos % runtime->min_align;
new_hw_ptr = runtime->hw_ptr_base + pos;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 92be5eea7036..773d3a10c567 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1796,9 +1796,12 @@ int snd_pcm_open(struct inode *inode, struct file *file)
err = -ENODEV;
goto __error1;
}
+ err = snd_card_file_add(pcm->card, file);
+ if (err < 0)
+ goto __error1;
if (!try_inc_mod_count(pcm->card->module)) {
err = -EFAULT;
- goto __error1;
+ goto __error2;
}
init_waitqueue_entry(&wait, current);
add_wait_queue(&pcm->open_wait, &wait);
@@ -1831,6 +1834,8 @@ int snd_pcm_open(struct inode *inode, struct file *file)
__error:
dec_mod_count(pcm->card->module);
+ __error2:
+ snd_card_file_remove(pcm->card, file);
__error1:
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
@@ -1859,6 +1864,7 @@ int snd_pcm_release(struct inode *inode, struct file *file)
up(&pcm->open_mutex);
wake_up(&pcm->open_wait);
dec_mod_count(pcm->card->module);
+ snd_card_file_remove(pcm->card, file);
#ifdef LINUX_2_2
MOD_DEC_USE_COUNT;
#endif
diff --git a/sound/core/pcm_sgbuf.c b/sound/core/pcm_sgbuf.c
index 11371eb5130b..2511b99b3ede 100644
--- a/sound/core/pcm_sgbuf.c
+++ b/sound/core/pcm_sgbuf.c
@@ -93,6 +93,56 @@ int snd_pcm_sgbuf_delete(snd_pcm_substream_t *substream)
}
/*
+ * snd_pci_alloc_page - allocate a page in the valid pci dma mask
+ *
+ * returns the virtual address and stores the physical address on
+ * addrp. this function cannot be called from interrupt handlers or
+ * within spinlocks.
+ */
+#ifdef __i386__
+/*
+ * on ix86, we allocate a page with GFP_KERNEL to assure the
+ * allocation. the code is almost same with kernel/i386/pci-dma.c but
+ * it allocates only a single page and checkes the validity of the
+ * page address with the given pci dma mask.
+ */
+inline static void *snd_pci_alloc_page(struct pci_dev *pci, dma_addr_t *addrp)
+{
+ void *ptr;
+ dma_addr_t addr;
+ unsigned long rmask;
+
+ if (pci)
+ rmask = ~(unsigned long)pci->dma_mask;
+ else
+ rmask = 0;
+ ptr = (void *)__get_free_page(GFP_KERNEL);
+ if (ptr) {
+ addr = virt_to_phys(ptr);
+ if (((unsigned long)addr + PAGE_SIZE - 1) & rmask) {
+ /* try to reallocate with the GFP_DMA */
+ free_page((unsigned long)ptr);
+ ptr = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
+ if (ptr) /* ok, the address must be within lower 16MB... */
+ addr = virt_to_phys(ptr);
+ else
+ addr = 0;
+ }
+ } else
+ addr = 0;
+ if (ptr)
+ memset(ptr, 0, PAGE_SIZE);
+ *addrp = addr;
+ return ptr;
+}
+#else
+/* on other architectures, call snd_malloc_pci_pages() helper function
+ * which uses pci_alloc_consistent().
+ */
+#define snd_pci_alloc_page(pci, addrp) snd_malloc_pci_pages(pci, PAGE_SIZE, addrp)
+#endif
+
+/*
* allocate sg buffer table with the given byte size.
* if the buffer table already exists, try to resize it.
* call this from hw_params callback.
@@ -128,7 +178,7 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size)
while (sgbuf->pages < pages) {
void *ptr;
dma_addr_t addr;
- ptr = snd_malloc_pci_pages(sgbuf->pci, PAGE_SIZE, &addr);
+ ptr = snd_pci_alloc_page(sgbuf->pci, &addr);
if (! ptr)
return -ENOMEM;
sgbuf->table[sgbuf->pages].buf = ptr;
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 2b5e56617107..18dc962f094d 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -51,6 +51,7 @@ MODULE_PARM_SYNTAX(amidi_map, "default:1,skill:advanced");
static int snd_rawmidi_free(snd_rawmidi_t *rawmidi);
static int snd_rawmidi_dev_free(snd_device_t *device);
static int snd_rawmidi_dev_register(snd_device_t *device);
+static int snd_rawmidi_dev_disconnect(snd_device_t *device);
static int snd_rawmidi_dev_unregister(snd_device_t *device);
snd_rawmidi_t *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES];
@@ -389,24 +390,29 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
rmidi = snd_rawmidi_devices[(cardnum * SNDRV_RAWMIDI_DEVICES) + device];
if (rmidi == NULL)
return -ENODEV;
- card = rmidi->card;
#ifdef CONFIG_SND_OSSEMUL
if (maj == SOUND_MAJOR && !rmidi->ossreg)
return -ENXIO;
#endif
- fflags = snd_rawmidi_file_flags(file);
- if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK))
+ if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK))
return -EINVAL; /* invalid combination */
+ card = rmidi->card;
+ err = snd_card_file_add(card, file);
+ if (err < 0)
+ return -ENODEV;
+ fflags = snd_rawmidi_file_flags(file);
if ((file->f_flags & O_APPEND) || maj != CONFIG_SND_MAJOR) /* OSS emul? */
fflags |= SNDRV_RAWMIDI_LFLG_APPEND;
rawmidi_file = snd_magic_kmalloc(snd_rawmidi_file_t, 0, GFP_KERNEL);
- if (rawmidi_file == NULL)
+ if (rawmidi_file == NULL) {
+ snd_card_file_remove(card, file);
return -ENOMEM;
+ }
init_waitqueue_entry(&wait, current);
add_wait_queue(&rmidi->open_wait, &wait);
while (1) {
subdevice = -1;
- read_lock(&card->control_rwlock);
+ down_read(&card->controls_rwsem);
list_for_each(list, &card->ctl_files) {
kctl = snd_ctl_file(list);
if (kctl->pid == current->pid) {
@@ -414,7 +420,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
break;
}
}
- read_unlock(&card->control_rwlock);
+ up_read(&card->controls_rwsem);
err = snd_rawmidi_kernel_open(cardnum, device, subdevice, fflags, rawmidi_file);
if (err >= 0)
break;
@@ -443,6 +449,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
if (err >= 0) {
file->private_data = rawmidi_file;
} else {
+ snd_card_file_remove(card, file);
snd_magic_kfree(rawmidi_file);
}
return err;
@@ -507,12 +514,15 @@ int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile)
static int snd_rawmidi_release(struct inode *inode, struct file *file)
{
snd_rawmidi_file_t *rfile;
+ snd_rawmidi_t *rmidi;
int err;
rfile = snd_magic_cast(snd_rawmidi_file_t, file->private_data, return -ENXIO);
err = snd_rawmidi_kernel_release(rfile);
- wake_up(&rfile->rmidi->open_wait);
+ rmidi = rfile->rmidi;
+ wake_up(&rmidi->open_wait);
snd_magic_kfree(rfile);
+ snd_card_file_remove(rmidi->card, file);
return err;
}
@@ -1318,6 +1328,7 @@ int snd_rawmidi_new(snd_card_t * card, char *id, int device,
static snd_device_ops_t ops = {
.dev_free = snd_rawmidi_dev_free,
.dev_register = snd_rawmidi_dev_register,
+ .dev_disconnect = snd_rawmidi_dev_disconnect,
.dev_unregister = snd_rawmidi_dev_unregister
};
@@ -1466,6 +1477,18 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
return 0;
}
+static int snd_rawmidi_dev_disconnect(snd_device_t *device)
+{
+ snd_rawmidi_t *rmidi = snd_magic_cast(snd_rawmidi_t, device->device_data, return -ENXIO);
+ int idx;
+
+ down(&register_mutex);
+ idx = (rmidi->card->number * SNDRV_RAWMIDI_DEVICES) + rmidi->device;
+ snd_rawmidi_devices[idx] = NULL;
+ up(&register_mutex);
+ return 0;
+}
+
static int snd_rawmidi_dev_unregister(snd_device_t *device)
{
int idx;
@@ -1474,10 +1497,7 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
snd_assert(rmidi != NULL, return -ENXIO);
down(&register_mutex);
idx = (rmidi->card->number * SNDRV_RAWMIDI_DEVICES) + rmidi->device;
- if (snd_rawmidi_devices[idx] != rmidi) {
- up(&register_mutex);
- return -EINVAL;
- }
+ snd_rawmidi_devices[idx] = NULL;
if (rmidi->proc_entry) {
snd_info_unregister(rmidi->proc_entry);
rmidi->proc_entry = NULL;
@@ -1498,7 +1518,6 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
if (rmidi->ops && rmidi->ops->dev_unregister)
rmidi->ops->dev_unregister(rmidi);
snd_unregister_device(SNDRV_DEVICE_TYPE_RAWMIDI, rmidi->card, rmidi->device);
- snd_rawmidi_devices[idx] = NULL;
up(&register_mutex);
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
if (rmidi->seq_dev) {
@@ -1526,10 +1545,10 @@ void snd_rawmidi_set_ops(snd_rawmidi_t *rmidi, int stream, snd_rawmidi_ops_t *op
static int __init alsa_rawmidi_init(void)
{
- int i;
snd_ctl_register_ioctl(snd_rawmidi_control_ioctl);
#ifdef CONFIG_SND_OSSEMUL
+ { int i;
/* check device map table */
for (i = 0; i < SNDRV_CARDS; i++) {
if (midi_map[i] < 0 || midi_map[i] >= SNDRV_RAWMIDI_DEVICES) {
@@ -1541,6 +1560,7 @@ static int __init alsa_rawmidi_init(void)
amidi_map[i] = 1;
}
}
+ }
#endif /* CONFIG_SND_OSSEMUL */
return 0;
}
diff --git a/sound/core/seq/Makefile b/sound/core/seq/Makefile
index 2f73dfa49e8e..59b386b1f74a 100644
--- a/sound/core/seq/Makefile
+++ b/sound/core/seq/Makefile
@@ -29,50 +29,53 @@ endif
obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o
# Toplevel Module Dependency
-obj-$(CONFIG_SND_VIRMIDI) += snd-seq-virmidi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_SERIAL_U16550) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_MTPAV) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_MPU401) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_ALS100) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_AZT2320) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_DT019X) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_ES18XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_OPL3SA2) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_AD1816A) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_CS4231) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_CS4232) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_CS4236) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_ES1688) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_GUSCLASSIC) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_GUSMAX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_GUSEXTREME) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_INTERWAVE) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_INTERWAVE_STB) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_OPTI92X_AD1848) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_OPTI92X_CS4231) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_OPTI93X) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_SB8) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_SB16) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_SBAWE) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o snd-seq-virmidi.o
-obj-$(CONFIG_SND_ES968) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_WAVEFRONT) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_ALS4000) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_CMIPCI) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_CS4281) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_ENS1370) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_ENS1371) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_ES1938) += snd-seq-device.o snd-seq-midi-emul.o snd-seq.o snd-seq-instr.o snd-seq-midi.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_ES1968) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_FM801) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_ICE1712) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_INTEL8X0) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_SONICVIBES) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_VIA82XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_ALI5451) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_CS46XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
-obj-$(CONFIG_SND_EMU10K1) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-virmidi.o
-obj-$(CONFIG_SND_TRIDENT) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_YMFPCI) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_USB_AUDIO) += snd-seq.o snd-seq-device.o snd-seq-midi-event.o
+RAWMIDI_OBJS = snd-seq-midi.o snd-seq-midi-event.o
+OPL3_OBJS = snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
+obj-$(CONFIG_SND_VIRMIDI) += snd-seq-virmidi.o snd-seq-midi-event.o
+obj-$(CONFIG_SND_SERIAL_U16550) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_MTPAV) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_MPU401) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_ALS100) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_AZT2320) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_DT019X) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES18XX) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPL3SA2) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_AD1816A) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4231) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_CS4232) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4236) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_PC98_CS4232) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES1688) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_GUSCLASSIC) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_GUSMAX) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_GUSEXTREME) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_INTERWAVE) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_INTERWAVE_STB) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI92X_AD1848) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI92X_CS4231) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI93X) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_SB8) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_SB16) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_SBAWE) += $(RAWMIDI_OBJS) $(OPL3_OBJS) snd-seq-virmidi.o
+obj-$(CONFIG_SND_ES968) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_WAVEFRONT) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ALS4000) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_CMIPCI) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4281) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ENS1370) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_ENS1371) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_ES1938) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES1968) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_FM801) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_ICE1712) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_INTEL8X0) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_SONICVIBES) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_VIA82XX) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_ALI5451) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_CS46XX) += $(RAWMIDI_OBJS)
+obj-$(CONFIG_SND_EMU10K1) += $(RAWMIDI_OBJS) snd-seq-midi-emul.o snd-seq-virmidi.o
+obj-$(CONFIG_SND_TRIDENT) += $(RAWMIDI_OBJS) snd-seq-midi-emul.o snd-seq-instr.o
+obj-$(CONFIG_SND_YMFPCI) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
+obj-$(CONFIG_SND_USB_AUDIO) += $(RAWMIDI_OBJS)
obj-m := $(sort $(obj-m))
diff --git a/sound/core/seq/instr/Makefile b/sound/core/seq/instr/Makefile
index 69f740c60e70..ad002b076f38 100644
--- a/sound/core/seq/instr/Makefile
+++ b/sound/core/seq/instr/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_SND_OPL3SA2) += snd-ainstr-fm.o
obj-$(CONFIG_SND_AD1816A) += snd-ainstr-fm.o
obj-$(CONFIG_SND_CS4232) += snd-ainstr-fm.o
obj-$(CONFIG_SND_CS4236) += snd-ainstr-fm.o
+obj-$(CONFIG_SND_PC98_CS4232) += snd-ainstr-fm.o
obj-$(CONFIG_SND_ES1688) += snd-ainstr-fm.o
obj-$(CONFIG_SND_GUSCLASSIC) += snd-ainstr-iw.o snd-ainstr-gf1.o snd-ainstr-simple.o
obj-$(CONFIG_SND_GUSMAX) += snd-ainstr-iw.o snd-ainstr-gf1.o snd-ainstr-simple.o
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c
index d94194c1a3cb..0d0783dced8d 100644
--- a/sound/core/seq/seq.c
+++ b/sound/core/seq/seq.c
@@ -134,7 +134,7 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);
EXPORT_SYMBOL(snd_seq_event_port_attach);
EXPORT_SYMBOL(snd_seq_event_port_detach);
/* seq_lock.c */
-#if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
+#if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
/*EXPORT_SYMBOL(snd_seq_sleep_in_lock);*/
/*EXPORT_SYMBOL(snd_seq_sleep_timeout_in_lock);*/
EXPORT_SYMBOL(snd_use_lock_sync_helper);
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index a3287d6d1fb0..f10d02b438af 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -92,6 +92,7 @@ static snd_info_entry_t *info_entry = NULL;
static int snd_seq_device_free(snd_seq_device_t *dev);
static int snd_seq_device_dev_free(snd_device_t *device);
static int snd_seq_device_dev_register(snd_device_t *device);
+static int snd_seq_device_dev_disconnect(snd_device_t *device);
static int snd_seq_device_dev_unregister(snd_device_t *device);
static int init_device(snd_seq_device_t *dev, ops_list_t *ops);
@@ -166,6 +167,7 @@ int snd_seq_device_new(snd_card_t *card, int device, char *id, int argsize,
static snd_device_ops_t dops = {
.dev_free = snd_seq_device_dev_free,
.dev_register = snd_seq_device_dev_register,
+ .dev_disconnect = snd_seq_device_dev_disconnect,
.dev_unregister = snd_seq_device_dev_unregister
};
@@ -269,6 +271,24 @@ static int snd_seq_device_dev_register(snd_device_t *device)
}
/*
+ * disconnect the device
+ */
+static int snd_seq_device_dev_disconnect(snd_device_t *device)
+{
+ snd_seq_device_t *dev = snd_magic_cast(snd_seq_device_t, device->device_data, return -ENXIO);
+ ops_list_t *ops;
+
+ ops = find_driver(dev->id, 0);
+ if (ops == NULL)
+ return -ENOENT;
+
+ free_device(dev, ops);
+
+ unlock_driver(ops);
+ return 0;
+}
+
+/*
* unregister the existing device
*/
static int snd_seq_device_dev_unregister(snd_device_t *device)
diff --git a/sound/core/seq/seq_lock.c b/sound/core/seq/seq_lock.c
index 289393276663..7e832bd9a31f 100644
--- a/sound/core/seq/seq_lock.c
+++ b/sound/core/seq/seq_lock.c
@@ -23,7 +23,7 @@
#include <sound/core.h>
#include "seq_lock.h"
-#if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
+#if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
#if 0 /* NOT USED */
/* (interruptible) sleep_on during the specified spinlock */
diff --git a/sound/core/seq/seq_lock.h b/sound/core/seq/seq_lock.h
index 68b3271cdfc7..54044bc2c9ef 100644
--- a/sound/core/seq/seq_lock.h
+++ b/sound/core/seq/seq_lock.h
@@ -3,7 +3,7 @@
#include <linux/sched.h>
-#if defined(__SMP__) || defined(CONFIG_SND_DEBUG)
+#if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
typedef atomic_t snd_use_lock_t;
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 4d26a23e30e1..0a18ccae9fd1 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -76,8 +76,12 @@ static devfs_handle_t devfs_handle = NULL;
void snd_request_card(int card)
{
char str[32];
+ int locked;
- if (snd_cards[card] != NULL)
+ read_lock(&snd_card_rwlock);
+ locked = snd_cards_lock & (1 << card);
+ read_unlock(&snd_card_rwlock);
+ if (locked)
return;
if (card < 0 || card >= snd_ecards_limit)
return;
@@ -423,9 +427,13 @@ EXPORT_SYMBOL(snd_cards);
EXPORT_SYMBOL(snd_mixer_oss_notify_callback);
#endif
EXPORT_SYMBOL(snd_card_new);
+EXPORT_SYMBOL(snd_card_disconnect);
EXPORT_SYMBOL(snd_card_free);
+EXPORT_SYMBOL(snd_card_free_in_thread);
EXPORT_SYMBOL(snd_card_register);
EXPORT_SYMBOL(snd_component_add);
+EXPORT_SYMBOL(snd_card_file_add);
+EXPORT_SYMBOL(snd_card_file_remove);
#ifdef CONFIG_PM
EXPORT_SYMBOL(snd_power_wait);
#endif
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index 3506d5f6dbd6..7d649fd991f7 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -40,6 +40,9 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */
+#ifdef CONFIG_PC9800
+static int pc98ii[SNDRV_CARDS]; /* PC98-II dauther board */
+#endif
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
@@ -56,6 +59,11 @@ MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
+#ifdef CONFIG_PC9800
+MODULE_PARM(pc98ii, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(pc98ii, "Roland MPU-PC98II support.");
+MODULE_PARM_SYNTAX(pc98ii, SNDRV_BOOLEAN_FALSE_DESC);
+#endif
static snd_card_t *snd_mpu401_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
@@ -76,7 +84,11 @@ static int __init snd_card_mpu401_probe(int dev)
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
- if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
+ if (snd_mpu401_uart_new(card, 0,
+#ifdef CONFIG_PC9800
+ pc98ii[dev] ? MPU401_HW_PC98II :
+#endif
+ MPU401_HW_MPU401,
port[dev], 0,
irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) {
printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]);
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index 373cc4b52c39..88e3f72c89be 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -401,12 +401,17 @@ int snd_mpu401_uart_new(snd_card_t * card, int device,
spin_lock_init(&mpu->timer_lock);
mpu->hardware = hardware;
if (!integrated) {
- if ((mpu->res = request_region(port, 2, "MPU401 UART")) == NULL) {
+ int res_size = hardware == MPU401_HW_PC98II ? 4 : 2;
+ if ((mpu->res = request_region(port, res_size, "MPU401 UART")) == NULL) {
snd_device_free(card, rmidi);
return -EBUSY;
}
}
mpu->port = port;
+ if (hardware == MPU401_HW_PC98II)
+ mpu->cport = port + 2;
+ else
+ mpu->cport = port + 1;
if (irq >= 0 && irq_flags) {
if (request_irq(irq, snd_mpu401_uart_interrupt, irq_flags, "MPU401 UART", (void *) mpu)) {
snd_printk("unable to grab IRQ %d\n", irq);
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index 85d14df412f4..73aa429cedbd 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -205,19 +205,19 @@ static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev)
static int translate_hwport_to_subdevice(mtpav_t *chip, int hwport)
{
- int port;
+ int p;
if (hwport <= 0x00) /* all ports */
return chip->num_ports + MTPAV_PIDX_BROADCAST;
else if (hwport <= 0x08) { /* single port */
- port = hwport - 1;
- if (port >= chip->num_ports)
- port = 0;
- return port;
+ p = hwport - 1;
+ if (p >= chip->num_ports)
+ p = 0;
+ return p;
} else if (hwport <= 0x10) { /* remote port */
- port = hwport - 0x09 + chip->num_ports;
- if (port >= chip->num_ports * 2)
- port = chip->num_ports;
- return port;
+ p = hwport - 0x09 + chip->num_ports;
+ if (p >= chip->num_ports * 2)
+ p = chip->num_ports;
+ return p;
} else if (hwport == 0x11) /* computer port */
return chip->num_ports + MTPAV_PIDX_COMPUTER;
else /* ADAT */
@@ -335,11 +335,11 @@ static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream)
static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
{
- u8 port;
+ u8 p;
- for (port = 0; port < 8; port++) {
+ for (p = 0; p < 8; p++) {
snd_mtpav_send_byte(chip, 0xf5);
- snd_mtpav_send_byte(chip, port);
+ snd_mtpav_send_byte(chip, p);
snd_mtpav_send_byte(chip, 0xfe);
}
}
@@ -350,12 +350,12 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
//printk("mtpav port: %d opened\n", (int) substream->number);
spin_lock_irqsave(&mtp_card->spinlock, flags);
- port->mode |= MTPAV_MODE_INPUT_OPENED;
- port->input = substream;
+ portp->mode |= MTPAV_MODE_INPUT_OPENED;
+ portp->input = substream;
if (mtp_card->share_irq++ == 0)
snd_mtpav_mputreg(mtp_card, CREG, (SIGC_INTEN | SIGC_WRITE)); // enable pport interrupts
spin_unlock_irqrestore(&mtp_card->spinlock, flags);
@@ -368,14 +368,14 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
- //printk("mtpav port: %d closed\n", (int) port);
+ //printk("mtpav port: %d closed\n", (int) portp);
spin_lock_irqsave(&mtp_card->spinlock, flags);
- port->mode &= (~MTPAV_MODE_INPUT_OPENED);
- port->input = NULL;
+ portp->mode &= (~MTPAV_MODE_INPUT_OPENED);
+ portp->input = NULL;
if (--mtp_card->share_irq == 0)
snd_mtpav_mputreg(mtp_card, CREG, 0); // disable pport interrupts
@@ -389,13 +389,13 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags);
if (up)
- port->mode |= MTPAV_MODE_INPUT_TRIGGERED;
+ portp->mode |= MTPAV_MODE_INPUT_TRIGGERED;
else
- port->mode &= ~MTPAV_MODE_INPUT_TRIGGERED;
+ portp->mode &= ~MTPAV_MODE_INPUT_TRIGGERED;
spin_unlock_irqrestore(&mtp_card->spinlock, flags);
}
@@ -416,9 +416,9 @@ static void snd_mtpav_output_timer(unsigned long data)
add_timer(&chip->timer);
/* process each port */
for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) {
- mtpav_port_t *port = &mtp_card->ports[p];
- if ((port->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && port->output)
- snd_mtpav_output_port_write(port, port->output);
+ mtpav_port_t *portp = &mtp_card->ports[p];
+ if ((portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && portp->output)
+ snd_mtpav_output_port_write(portp, portp->output);
}
spin_unlock(&chip->spinlock);
}
@@ -445,11 +445,11 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip)
static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags);
- port->mode |= MTPAV_MODE_OUTPUT_OPENED;
- port->output = substream;
+ portp->mode |= MTPAV_MODE_OUTPUT_OPENED;
+ portp->output = substream;
spin_unlock_irqrestore(&mtp_card->spinlock, flags);
return 0;
};
@@ -460,11 +460,11 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags);
- port->mode &= (~MTPAV_MODE_OUTPUT_OPENED);
- port->output = NULL;
+ portp->mode &= (~MTPAV_MODE_OUTPUT_OPENED);
+ portp->output = NULL;
spin_unlock_irqrestore(&mtp_card->spinlock, flags);
return 0;
};
@@ -475,17 +475,17 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up)
{
unsigned long flags;
- mtpav_port_t *port = &mtp_card->ports[substream->number];
+ mtpav_port_t *portp = &mtp_card->ports[substream->number];
spin_lock_irqsave(&mtp_card->spinlock, flags);
if (up) {
- if (! (port->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) {
+ if (! (portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) {
if (mtp_card->istimer++ == 0)
snd_mtpav_add_output_timer(mtp_card);
- port->mode |= MTPAV_MODE_OUTPUT_TRIGGERED;
+ portp->mode |= MTPAV_MODE_OUTPUT_TRIGGERED;
}
} else {
- port->mode &= ~MTPAV_MODE_OUTPUT_TRIGGERED;
+ portp->mode &= ~MTPAV_MODE_OUTPUT_TRIGGERED;
if (--mtp_card->istimer == 0)
snd_mtpav_remove_output_timer(mtp_card);
}
@@ -501,15 +501,15 @@ static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up
static void snd_mtpav_inmidi_process(mtpav_t *mcrd, u8 inbyte)
{
- mtpav_port_t *port;
+ mtpav_port_t *portp;
if (mcrd->inmidiport > mcrd->num_ports * 2 + MTPAV_PIDX_BROADCAST)
return;
- port = &mcrd->ports[mcrd->inmidiport];
- if (port->mode & MTPAV_MODE_INPUT_TRIGGERED) {
+ portp = &mcrd->ports[mcrd->inmidiport];
+ if (portp->mode & MTPAV_MODE_INPUT_TRIGGERED) {
spin_unlock(&mcrd->spinlock);
- snd_rawmidi_receive(port->input, &inbyte, 1);
+ snd_rawmidi_receive(portp->input, &inbyte, 1);
spin_lock(&mcrd->spinlock);
}
}
diff --git a/sound/drivers/opl3/Makefile b/sound/drivers/opl3/Makefile
index db5a5a7f1892..d494e1409f94 100644
--- a/sound/drivers/opl3/Makefile
+++ b/sound/drivers/opl3/Makefile
@@ -13,56 +13,35 @@ snd-opl3-synth-objs += opl3_oss.o
endif
endif
-# Toplevel Module Dependency
-obj-$(CONFIG_SND_ALS100) += snd-opl3-lib.o
-obj-$(CONFIG_SND_AZT2320) += snd-opl3-lib.o
-obj-$(CONFIG_SND_DT019X) += snd-opl3-lib.o
-obj-$(CONFIG_SND_ES18XX) += snd-opl3-lib.o
-obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-lib.o
-obj-$(CONFIG_SND_AD1816A) += snd-opl3-lib.o
-obj-$(CONFIG_SND_CS4232) += snd-opl3-lib.o
-obj-$(CONFIG_SND_CS4236) += snd-opl3-lib.o
-obj-$(CONFIG_SND_ES1688) += snd-opl3-lib.o
-obj-$(CONFIG_SND_GUSEXTREME) += snd-opl3-lib.o
-obj-$(CONFIG_SND_OPTI92X_AD1848) += snd-opl3-lib.o
-obj-$(CONFIG_SND_OPTI92X_CS4231) += snd-opl3-lib.o
-obj-$(CONFIG_SND_OPTI93X) += snd-opl3-lib.o
-obj-$(CONFIG_SND_SB8) += snd-opl3-lib.o
-obj-$(CONFIG_SND_SB16) += snd-opl3-lib.o
-obj-$(CONFIG_SND_SBAWE) += snd-opl3-lib.o
-obj-$(CONFIG_SND_WAVEFRONT) += snd-opl3-lib.o
-obj-$(CONFIG_SND_ALS4000) += snd-opl3-lib.o
-obj-$(CONFIG_SND_CMIPCI) += snd-opl3-lib.o
-obj-$(CONFIG_SND_CS4281) += snd-opl3-lib.o
-obj-$(CONFIG_SND_ES1938) += snd-opl3-lib.o
-obj-$(CONFIG_SND_FM801) += snd-opl3-lib.o
-obj-$(CONFIG_SND_SONICVIBES) += snd-opl3-lib.o
-obj-$(CONFIG_SND_YMFPCI) += snd-opl3-lib.o
+OPL3_OBJS = snd-opl3-lib.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
- obj-$(CONFIG_SND_ALS100) += snd-opl3-synth.o
- obj-$(CONFIG_SND_AZT2320) += snd-opl3-synth.o
- obj-$(CONFIG_SND_DT019X) += snd-opl3-synth.o
- obj-$(CONFIG_SND_ES18XX) += snd-opl3-synth.o
- obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-synth.o
- obj-$(CONFIG_SND_AD1816A) += snd-opl3-synth.o
- obj-$(CONFIG_SND_CS4232) += snd-opl3-synth.o
- obj-$(CONFIG_SND_CS4236) += snd-opl3-synth.o
- obj-$(CONFIG_SND_ES1688) += snd-opl3-synth.o
- obj-$(CONFIG_SND_GUSEXTREME) += snd-opl3-synth.o
- obj-$(CONFIG_SND_OPTI92X_AD1848) += snd-opl3-synth.o
- obj-$(CONFIG_SND_OPTI92X_CS4231) += snd-opl3-synth.o
- obj-$(CONFIG_SND_OPTI93X) += snd-opl3-synth.o
- obj-$(CONFIG_SND_SB8) += snd-opl3-synth.o
- obj-$(CONFIG_SND_SB16) += snd-opl3-synth.o
- obj-$(CONFIG_SND_SBAWE) += snd-opl3-synth.o
- obj-$(CONFIG_SND_WAVEFRONT) += snd-opl3-synth.o
- obj-$(CONFIG_SND_ALS4000) += snd-opl3-synth.o
- obj-$(CONFIG_SND_CMIPCI) += snd-opl3-synth.o
- obj-$(CONFIG_SND_CS4281) += snd-opl3-synth.o
- obj-$(CONFIG_SND_ES1938) += snd-opl3-synth.o
- obj-$(CONFIG_SND_FM801) += snd-opl3-synth.o
- obj-$(CONFIG_SND_SONICVIBES) += snd-opl3-synth.o
- obj-$(CONFIG_SND_YMFPCI) += snd-opl3-synth.o
+OPL3_OBJS += snd-opl3-synth.o
endif
+# Toplevel Module Dependency
+obj-$(CONFIG_SND_ALS100) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_AZT2320) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_DT019X) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES18XX) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPL3SA2) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_AD1816A) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4232) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4236) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES1688) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_GUSEXTREME) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI92X_AD1848) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI92X_CS4231) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_OPTI93X) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_SB8) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_SB16) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_SBAWE) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_WAVEFRONT) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_ALS4000) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_CMIPCI) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_CS4281) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_ES1938) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_FM801) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_SONICVIBES) += $(OPL3_OBJS)
+obj-$(CONFIG_SND_YMFPCI) += $(OPL3_OBJS)
+
obj-m := $(sort $(obj-m))
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index de826efaf83c..ad2fc43a6835 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -420,6 +420,26 @@ int snd_opl3_create(snd_card_t * card,
case OPL3_HW_OPL3_FM801:
opl3->command = &snd_opl3_command;
break;
+ case OPL3_HW_OPL3_PC98:
+ opl3->command = &snd_opl3_command;
+
+ /* Initialize? */
+ opl3->command(opl3, OPL3_RIGHT | 0x05, 0x05);
+ opl3->command(opl3, OPL3_RIGHT | 0x08, 0x04);
+ opl3->command(opl3, OPL3_RIGHT | 0x08, 0x00);
+ opl3->command(opl3, OPL3_LEFT | 0xf7, 0x00);
+ opl3->command(opl3, OPL3_LEFT | 0x04, 0x60);
+ opl3->command(opl3, OPL3_LEFT | 0x04, 0x80);
+ inb(opl3->l_port);
+
+ opl3->command(opl3, OPL3_LEFT | 0x02, 0xff);
+ opl3->command(opl3, OPL3_LEFT | 0x04, 0x21);
+ inb(opl3->l_port);
+
+ opl3->command(opl3, OPL3_LEFT | 0x04, 0x60);
+ opl3->command(opl3, OPL3_LEFT | 0x04, 0x80);
+
+ break;
case OPL3_HW_OPL3_CS4281:
opl3->command = &snd_opl3_cs4281_command;
break;
@@ -438,6 +458,7 @@ int snd_opl3_create(snd_card_t * card,
opl3->command = &snd_opl3_command;
}
}
+
opl3->command(opl3, OPL3_LEFT | OPL3_REG_TEST, OPL3_ENABLE_WAVE_SELECT);
opl3->command(opl3, OPL3_LEFT | OPL3_REG_PERCUSSION, 0x00); /* Melodic mode */
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index a834a9ac590a..2651522d72e5 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -266,7 +266,6 @@ static int snd_opl3_seq_new_device(snd_seq_device_t *dev)
snd_seq_fm_init(&opl3->fm_ops, NULL);
/* setup system timer */
- memset(&opl3->tlist, 0, sizeof(opl3->tlist));
init_timer(&opl3->tlist);
opl3->tlist.function = snd_opl3_timer_func;
opl3->tlist.data = (unsigned long) opl3;
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index 451fb32fd332..4ade60026d6d 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -51,6 +51,9 @@
#define SNDRV_GET_ID
#include <sound/initval.h>
+/* hack: OSS defines midi_devs, so undefine it (versioned symbols) */
+#undef midi_devs
+
MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices");
MODULE_LICENSE("GPL");
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 7c688deb8a50..80ceb4581ba3 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -445,6 +445,9 @@ static int snd_cs4231_trigger(snd_pcm_substream_t *substream,
{
cs4231_t *chip = snd_pcm_substream_chip(substream);
int result = 0;
+ unsigned int what;
+ snd_pcm_substream_t *s;
+ int do_start;
#if 0
printk("codec trigger!!! - what = %i, enable = %i, status = 0x%x\n", what, enable, cs4231_inb(chip, CS4231P(STATUS)));
@@ -452,38 +455,39 @@ static int snd_cs4231_trigger(snd_pcm_substream_t *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ do_start = 1; break;
case SNDRV_PCM_TRIGGER_STOP:
- {
- unsigned int what = 0;
- snd_pcm_substream_t *s = substream;
- do {
- if (s == chip->playback_substream) {
- what |= CS4231_PLAYBACK_ENABLE;
- snd_pcm_trigger_done(s, substream);
- } else if (s == chip->capture_substream) {
- what |= CS4231_RECORD_ENABLE;
- snd_pcm_trigger_done(s, substream);
- }
- s = s->link_next;
- } while (s != substream);
- spin_lock(&chip->reg_lock);
- if (cmd == SNDRV_PCM_TRIGGER_START) {
- chip->image[CS4231_IFACE_CTRL] |= what;
- if (chip->trigger)
- chip->trigger(chip, what, 1);
- } else {
- chip->image[CS4231_IFACE_CTRL] &= ~what;
- if (chip->trigger)
- chip->trigger(chip, what, 0);
- }
- snd_cs4231_out(chip, CS4231_IFACE_CTRL, chip->image[CS4231_IFACE_CTRL]);
- spin_unlock(&chip->reg_lock);
- break;
- }
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ do_start = 0; break;
default:
- result = -EINVAL;
- break;
+ return -EINVAL;
+ }
+
+ what = 0;
+ s = substream;
+ do {
+ if (s == chip->playback_substream) {
+ what |= CS4231_PLAYBACK_ENABLE;
+ snd_pcm_trigger_done(s, substream);
+ } else if (s == chip->capture_substream) {
+ what |= CS4231_RECORD_ENABLE;
+ snd_pcm_trigger_done(s, substream);
+ }
+ s = s->link_next;
+ } while (s != substream);
+ spin_lock(&chip->reg_lock);
+ if (do_start) {
+ chip->image[CS4231_IFACE_CTRL] |= what;
+ if (chip->trigger)
+ chip->trigger(chip, what, 1);
+ } else {
+ chip->image[CS4231_IFACE_CTRL] &= ~what;
+ if (chip->trigger)
+ chip->trigger(chip, what, 0);
}
+ snd_cs4231_out(chip, CS4231_IFACE_CTRL, chip->image[CS4231_IFACE_CTRL]);
+ spin_unlock(&chip->reg_lock);
#if 0
snd_cs4231_debug(chip);
#endif
@@ -1188,7 +1192,9 @@ int snd_cs4231_probe(cs4231_t *chip)
static snd_pcm_hardware_t snd_cs4231_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),
.rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
@@ -1207,7 +1213,9 @@ static snd_pcm_hardware_t snd_cs4231_playback =
static snd_pcm_hardware_t snd_cs4231_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),
.rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 1bc7de15a97e..7ff8546cbdd8 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -263,6 +263,8 @@ static struct isapnp_card_id snd_card_pnpids[] __devinitdata = {
ISAPNP_CS4232('C','S','C',0xd937,0x0000,0x0010,0x0003),
/* CS4235 without MPU401 */
ISAPNP_CS4232_WOMPU('C','S','C',0xe825,0x0100,0x0110),
+ /* IBM IntelliStation M Pro 6898 11U - CS4236B */
+ ISAPNP_CS4232_WOMPU('C','S','C',0xe835,0x0000,0x0010),
/* Some noname CS4236 based card */
ISAPNP_CS4232('C','S','C',0xe936,0x0000,0x0010,0x0003),
/* CS4236B */
@@ -609,12 +611,10 @@ module_exit(alsa_card_cs423x_exit)
/* format is: snd-cs4232=enable,index,id,isapnp,port,
cport,mpu_port,fm_port,sb_port,
- irq,mpu_irq,dma1,dma1_size,
- dma2,dma2_size */
+ irq,mpu_irq,dma1,dma2 */
/* format is: snd-cs4236=enable,index,id,isapnp,port,
cport,mpu_port,fm_port,sb_port,
- irq,mpu_irq,dma1,dma1_size,
- dma2,dma2_size */
+ irq,mpu_irq,dma1,dma2 */
static int __init alsa_card_cs423x_setup(char *str)
{
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 67bc35c40661..f62c466009fe 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -444,8 +444,7 @@ static int snd_es18xx_playback_hw_params(snd_pcm_substream_t * substream,
if (snd_pcm_format_width(params_format(hw_params)) == 16)
shift++;
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) {
if ((chip->caps & ES18XX_DUPLEX_MONO) &&
(chip->capture_a_substream) &&
params_channels(hw_params) != 1) {
@@ -453,10 +452,8 @@ static int snd_es18xx_playback_hw_params(snd_pcm_substream_t * substream,
return -EBUSY;
}
chip->dma2_shift = shift;
- break;
- case 1:
+ } else {
chip->dma1_shift = shift;
- break;
}
if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
return err;
@@ -495,19 +492,12 @@ static int snd_es18xx_playback1_trigger(es18xx_t *chip,
snd_pcm_substream_t * substream,
int cmd)
{
- if (cmd == SNDRV_PCM_TRIGGER_START) {
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
if (chip->active & DAC2)
return 0;
chip->active |= DAC2;
- } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
- if (!(chip->active & DAC2))
- return 0;
- chip->active &= ~DAC2;
- } else {
- return -EINVAL;
- }
-
- if (cmd == SNDRV_PCM_TRIGGER_START) {
/* Start DMA */
if (chip->dma2 >= 4)
snd_es18xx_mixer_write(chip, 0x78, 0xb3);
@@ -523,8 +513,12 @@ static int snd_es18xx_playback1_trigger(es18xx_t *chip,
/* Enable PCM output */
snd_es18xx_dsp_command(chip, 0xD1);
#endif
- }
- else {
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ if (!(chip->active & DAC2))
+ return 0;
+ chip->active &= ~DAC2;
/* Stop DMA */
snd_es18xx_mixer_write(chip, 0x78, 0x00);
#ifdef AVOID_POPS
@@ -536,7 +530,10 @@ static int snd_es18xx_playback1_trigger(es18xx_t *chip,
/* Disable PCM output */
snd_es18xx_dsp_command(chip, 0xD3);
#endif
- }
+ break;
+ default:
+ return -EINVAL;
+ }
return 0;
}
@@ -608,24 +605,27 @@ static int snd_es18xx_capture_trigger(snd_pcm_substream_t *substream,
{
es18xx_t *chip = snd_pcm_substream_chip(substream);
- if (cmd == SNDRV_PCM_TRIGGER_START) {
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
if (chip->active & ADC1)
return 0;
chip->active |= ADC1;
- } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
+ /* Start DMA */
+ snd_es18xx_write(chip, 0xB8, 0x0f);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
if (!(chip->active & ADC1))
return 0;
chip->active &= ~ADC1;
- } else {
+ /* Stop DMA */
+ snd_es18xx_write(chip, 0xB8, 0x00);
+ break;
+ default:
return -EINVAL;
}
- if (cmd == SNDRV_PCM_TRIGGER_START)
- /* Start DMA */
- snd_es18xx_write(chip, 0xB8, 0x0f);
- else
- /* Stop DMA */
- snd_es18xx_write(chip, 0xB8, 0x00);
return 0;
}
@@ -670,19 +670,12 @@ static int snd_es18xx_playback2_trigger(es18xx_t *chip,
snd_pcm_substream_t *substream,
int cmd)
{
- if (cmd == SNDRV_PCM_TRIGGER_START) {
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
if (chip->active & DAC1)
return 0;
chip->active |= DAC1;
- } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
- if (!(chip->active & DAC1))
- return 0;
- chip->active &= ~DAC1;
- } else {
- return -EINVAL;
- }
-
- if (cmd == SNDRV_PCM_TRIGGER_START) {
/* Start DMA */
snd_es18xx_write(chip, 0xB8, 0x05);
#ifdef AVOID_POPS
@@ -691,8 +684,12 @@ static int snd_es18xx_playback2_trigger(es18xx_t *chip,
/* Enable Audio 1 */
snd_es18xx_dsp_command(chip, 0xD1);
#endif
- }
- else {
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ if (!(chip->active & DAC1))
+ return 0;
+ chip->active &= ~DAC1;
/* Stop DMA */
snd_es18xx_write(chip, 0xB8, 0x00);
#ifdef AVOID_POPS
@@ -701,33 +698,31 @@ static int snd_es18xx_playback2_trigger(es18xx_t *chip,
/* Disable Audio 1 */
snd_es18xx_dsp_command(chip, 0xD3);
#endif
- }
+ break;
+ default:
+ return -EINVAL;
+ }
+
return 0;
}
static int snd_es18xx_playback_prepare(snd_pcm_substream_t *substream)
{
es18xx_t *chip = snd_pcm_substream_chip(substream);
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2))
return snd_es18xx_playback1_prepare(chip, substream);
- case 1:
+ else
return snd_es18xx_playback2_prepare(chip, substream);
- }
- return -EINVAL;
}
static int snd_es18xx_playback_trigger(snd_pcm_substream_t *substream,
int cmd)
{
es18xx_t *chip = snd_pcm_substream_chip(substream);
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2))
return snd_es18xx_playback1_trigger(chip, substream, cmd);
- case 1:
+ else
return snd_es18xx_playback2_trigger(chip, substream, cmd);
- }
- return -EINVAL;
}
static void snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -798,19 +793,17 @@ static snd_pcm_uframes_t snd_es18xx_playback_pointer(snd_pcm_substream_t * subst
es18xx_t *chip = snd_pcm_substream_chip(substream);
int pos;
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) {
if (!(chip->active & DAC2))
return 0;
pos = chip->dma2_size - snd_dma_residue(chip->dma2);
return pos >> chip->dma2_shift;
- case 1:
+ } else {
if (!(chip->active & DAC1))
return 0;
pos = chip->dma1_size - snd_dma_residue(chip->dma1);
return pos >> chip->dma1_shift;
}
- return 0;
}
static snd_pcm_uframes_t snd_es18xx_capture_pointer(snd_pcm_substream_t * substream)
@@ -827,6 +820,7 @@ static snd_pcm_uframes_t snd_es18xx_capture_pointer(snd_pcm_substream_t * substr
static snd_pcm_hardware_t snd_es18xx_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE),
@@ -846,6 +840,7 @@ static snd_pcm_hardware_t snd_es18xx_playback =
static snd_pcm_hardware_t snd_es18xx_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE),
@@ -867,20 +862,17 @@ static int snd_es18xx_playback_open(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
es18xx_t *chip = snd_pcm_substream_chip(substream);
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2)) {
if ((chip->caps & ES18XX_DUPLEX_MONO) &&
chip->capture_a_substream &&
chip->capture_a_substream->runtime->channels != 1)
return -EAGAIN;
chip->playback_a_substream = substream;
- break;
- case 1:
+ } else if (substream->number <= 1) {
if (chip->capture_a_substream)
return -EAGAIN;
chip->playback_b_substream = substream;
- break;
- default:
+ } else {
snd_BUG();
return -EINVAL;
}
@@ -912,17 +904,10 @@ static int snd_es18xx_playback_close(snd_pcm_substream_t * substream)
{
es18xx_t *chip = snd_pcm_substream_chip(substream);
- switch (substream->number) {
- case 0:
+ if (substream->number == 0 && (chip->caps & ES18XX_PCM2))
chip->playback_a_substream = NULL;
- break;
- case 1:
+ else
chip->playback_b_substream = NULL;
- break;
- default:
- snd_BUG();
- return -EINVAL;
- }
snd_pcm_lib_free_pages(substream);
return 0;
@@ -1544,6 +1529,9 @@ static int __init snd_es18xx_probe(es18xx_t *chip)
snd_printd("[0x%lx] ESS%x chip found\n", chip->port, chip->version);
+ if (chip->dma1 == chip->dma2)
+ chip->caps &= ~(ES18XX_PCM2 | ES18XX_DUPLEX_SAME);
+
return snd_es18xx_initialize(chip);
}
@@ -1600,6 +1588,8 @@ int __init snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm)
pcm->info_flags = 0;
if (chip->caps & ES18XX_DUPLEX_SAME)
pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX;
+ if (! (chip->caps & ES18XX_PCM2))
+ pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
sprintf(pcm->name, "ESS AudioDrive ES%x", chip->version);
chip->pcm = pcm;
@@ -1709,7 +1699,7 @@ static int snd_es18xx_free(es18xx_t *chip)
disable_dma(chip->dma1);
free_dma(chip->dma1);
}
- if (chip->dma2 >= 0) {
+ if (chip->dma2 >= 0 && chip->dma1 != chip->dma2) {
disable_dma(chip->dma2);
free_dma(chip->dma2);
}
@@ -1773,7 +1763,7 @@ static int __init snd_es18xx_new_device(snd_card_t * card,
}
chip->dma1 = dma1;
- if (request_dma(dma2, "ES18xx DMA 2")) {
+ if (dma2 != dma1 && request_dma(dma2, "ES18xx DMA 2")) {
snd_es18xx_free(chip);
printk(KERN_ERR PFX "unable to grap DMA2 %d\n", dma2);
return -EBUSY;
@@ -2181,10 +2171,16 @@ static int __init snd_audiodrive_probe(int dev)
#endif
sprintf(card->driver, "ES%x", chip->version);
sprintf(card->shortname, "ESS AudioDrive ES%x", chip->version);
- sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
- card->shortname,
- chip->port,
- xirq, xdma1, xdma2);
+ if (xdma1 != xdma2)
+ sprintf(card->longname, "%s at 0x%lx, irq %d, dma1 %d, dma2 %d",
+ card->shortname,
+ chip->port,
+ xirq, xdma1, xdma2);
+ else
+ sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
+ card->shortname,
+ chip->port,
+ xirq, xdma1);
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index c218858c29c6..41d6d1094c3c 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -182,6 +182,8 @@ static struct isapnp_card_id snd_sb16_pnpids[] __devinitdata = {
/* Sound Blaster 16 PnP */
ISAPNP_SB16('C','T','L',0x0024,0x0031),
/* Sound Blaster 16 PnP */
+ ISAPNP_SB16('C','T','L',0x0025,0x0031),
+ /* Sound Blaster 16 PnP */
ISAPNP_SB16('C','T','L',0x0026,0x0031),
/* Sound Blaster 16 PnP */
ISAPNP_SB16('C','T','L',0x0027,0x0031),
@@ -664,7 +666,7 @@ static int __init alsa_card_sb16_setup(char *str)
{
static unsigned __initdata nr_dev = 0;
int __attribute__ ((__unused__)) pnp = INT_MAX;
- int __attribute__ ((__unused__)) csp = INT_MAX;
+ int __attribute__ ((__unused__)) xcsp = INT_MAX;
if (nr_dev >= SNDRV_CARDS)
return 0;
@@ -681,7 +683,7 @@ static int __init alsa_card_sb16_setup(char *str)
get_option(&str,&mic_agc[nr_dev]) == 2
#ifdef CONFIG_SND_SB16_CSP
&&
- get_option(&str,&csp[nr_dev]) == 2
+ get_option(&str,&xcsp) == 2
#endif
#ifdef SNDRV_SBAWE_EMU8000
&&
@@ -694,8 +696,8 @@ static int __init alsa_card_sb16_setup(char *str)
isapnp[nr_dev] = pnp;
#endif
#ifdef CONFIG_SND_SB16_CSP
- if (csp != INT_MAX)
- csp[nr_dev] = csp;
+ if (xcsp != INT_MAX)
+ csp[nr_dev] = xcsp;
#endif
nr_dev++;
return 1;
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index b9d3bfd08e70..30a1a67249ce 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -10,6 +10,12 @@
* Note: 16-bit wide is assigned to first direction which made request.
* With full duplex - playback is preferred with abstract layer.
*
+ * Note: Some chip revisions have hardware bug. Changing capture
+ * channel from full-duplex 8bit DMA to 16bit DMA will block
+ * 16bit DMA transfers from DSP chip (capture) until 8bit transfer
+ * to DSP chip (playback) starts. This bug can be avoided with
+ * "16bit DMA Allocation" setting set to Playback or Capture.
+ *
*
* 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
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 1f08e1221647..e63a3052def7 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -428,13 +428,22 @@ static int snd_sb16mixer_put_input_sw(snd_kcontrol_t * kcontrol, snd_ctl_elem_va
return change;
}
-#define SB20_CONTROLS (sizeof(snd_sb20_controls)/sizeof(snd_kcontrol_new_t))
-
-static snd_kcontrol_new_t snd_sb20_controls[] = {
-SB_SINGLE("Master Playback Volume", SB_DSP20_MASTER_DEV, 1, 7),
-SB_SINGLE("PCM Playback Volume", SB_DSP20_PCM_DEV, 1, 3),
-SB_SINGLE("Synth Playback Volume", SB_DSP20_FM_DEV, 1, 7),
-SB_SINGLE("CD Playback Volume", SB_DSP20_CD_DEV, 1, 7)
+#define SB20_CONTROLS (sizeof(snd_sb20_controls)/sizeof(snd_kcontrol_new_t *))
+
+static snd_kcontrol_new_t snd_sb20_ctl_master_play_vol =
+ SB_SINGLE("Master Playback Volume", SB_DSP20_MASTER_DEV, 1, 7);
+static snd_kcontrol_new_t snd_sb20_ctl_pcm_play_vol =
+ SB_SINGLE("PCM Playback Volume", SB_DSP20_PCM_DEV, 1, 3);
+static snd_kcontrol_new_t snd_sb20_ctl_synth_play_vol =
+ SB_SINGLE("Synth Playback Volume", SB_DSP20_FM_DEV, 1, 7);
+static snd_kcontrol_new_t snd_sb20_ctl_cd_play_vol =
+ SB_SINGLE("CD Playback Volume", SB_DSP20_CD_DEV, 1, 7);
+
+static snd_kcontrol_new_t *snd_sb20_controls[] = {
+ &snd_sb20_ctl_master_play_vol,
+ &snd_sb20_ctl_pcm_play_vol,
+ &snd_sb20_ctl_synth_play_vol,
+ &snd_sb20_ctl_cd_play_vol
};
#define SB20_INIT_VALUES (sizeof(snd_sb20_init_values)/sizeof(unsigned char)/2)
@@ -444,25 +453,46 @@ static unsigned char snd_sb20_init_values[][2] = {
{ SB_DSP20_FM_DEV, 0 },
};
-#define SBPRO_CONTROLS (sizeof(snd_sbpro_controls)/sizeof(snd_kcontrol_new_t))
-
-static snd_kcontrol_new_t snd_sbpro_controls[] = {
-SB_DOUBLE("Master Playback Volume", SB_DSP_MASTER_DEV, SB_DSP_MASTER_DEV, 5, 1, 7),
-SB_DOUBLE("PCM Playback Volume", SB_DSP_PCM_DEV, SB_DSP_PCM_DEV, 5, 1, 7),
-SB_SINGLE("PCM Playback Filter", SB_DSP_PLAYBACK_FILT, 5, 1),
-SB_DOUBLE("Synth Playback Volume", SB_DSP_FM_DEV, SB_DSP_FM_DEV, 5, 1, 7),
-SB_DOUBLE("CD Playback Volume", SB_DSP_CD_DEV, SB_DSP_CD_DEV, 5, 1, 7),
-SB_DOUBLE("Line Playback Volume", SB_DSP_LINE_DEV, SB_DSP_LINE_DEV, 5, 1, 7),
-SB_SINGLE("Mic Playback Volume", SB_DSP_MIC_DEV, 1, 3),
-{
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Capture Source",
- .info = snd_sb8mixer_info_mux,
- .get = snd_sb8mixer_get_mux,
- .put = snd_sb8mixer_put_mux,
-},
-SB_SINGLE("Capture Filter", SB_DSP_CAPTURE_FILT, 5, 1),
-SB_SINGLE("Capture Low-Pass Filter", SB_DSP_CAPTURE_FILT, 3, 1)
+#define SBPRO_CONTROLS (sizeof(snd_sbpro_controls)/sizeof(snd_kcontrol_new_t *))
+
+static snd_kcontrol_new_t snd_sbpro_ctl_master_play_vol =
+ SB_DOUBLE("Master Playback Volume", SB_DSP_MASTER_DEV, SB_DSP_MASTER_DEV, 5, 1, 7);
+static snd_kcontrol_new_t snd_sbpro_ctl_pcm_play_vol =
+ SB_DOUBLE("PCM Playback Volume", SB_DSP_PCM_DEV, SB_DSP_PCM_DEV, 5, 1, 7);
+static snd_kcontrol_new_t snd_sbpro_ctl_pcm_play_filter =
+ SB_SINGLE("PCM Playback Filter", SB_DSP_PLAYBACK_FILT, 5, 1);
+static snd_kcontrol_new_t snd_sbpro_ctl_synth_play_vol =
+ SB_DOUBLE("Synth Playback Volume", SB_DSP_FM_DEV, SB_DSP_FM_DEV, 5, 1, 7);
+static snd_kcontrol_new_t snd_sbpro_ctl_cd_play_vol =
+ SB_DOUBLE("CD Playback Volume", SB_DSP_CD_DEV, SB_DSP_CD_DEV, 5, 1, 7);
+static snd_kcontrol_new_t snd_sbpro_ctl_line_play_vol =
+ SB_DOUBLE("Line Playback Volume", SB_DSP_LINE_DEV, SB_DSP_LINE_DEV, 5, 1, 7);
+static snd_kcontrol_new_t snd_sbpro_ctl_mic_play_vol =
+ SB_SINGLE("Mic Playback Volume", SB_DSP_MIC_DEV, 1, 3);
+static snd_kcontrol_new_t snd_sbpro_ctl_capture_source =
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = snd_sb8mixer_info_mux,
+ .get = snd_sb8mixer_get_mux,
+ .put = snd_sb8mixer_put_mux,
+ };
+static snd_kcontrol_new_t snd_sbpro_ctl_capture_filter =
+ SB_SINGLE("Capture Filter", SB_DSP_CAPTURE_FILT, 5, 1);
+static snd_kcontrol_new_t snd_sbpro_ctl_capture_low_filter =
+ SB_SINGLE("Capture Low-Pass Filter", SB_DSP_CAPTURE_FILT, 3, 1);
+
+static snd_kcontrol_new_t *snd_sbpro_controls[] = {
+ &snd_sbpro_ctl_master_play_vol,
+ &snd_sbpro_ctl_pcm_play_vol,
+ &snd_sbpro_ctl_pcm_play_filter,
+ &snd_sbpro_ctl_synth_play_vol,
+ &snd_sbpro_ctl_cd_play_vol,
+ &snd_sbpro_ctl_line_play_vol,
+ &snd_sbpro_ctl_mic_play_vol,
+ &snd_sbpro_ctl_capture_source,
+ &snd_sbpro_ctl_capture_filter,
+ &snd_sbpro_ctl_capture_low_filter
};
#define SBPRO_INIT_VALUES (sizeof(snd_sbpro_init_values)/sizeof(unsigned char)/2)
@@ -473,29 +503,70 @@ static unsigned char snd_sbpro_init_values[][2] = {
{ SB_DSP_FM_DEV, 0 },
};
-#define SB16_CONTROLS (sizeof(snd_sb16_controls)/sizeof(snd_kcontrol_new_t))
-
-static snd_kcontrol_new_t snd_sb16_controls[] = {
-SB_DOUBLE("Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
-SB_SINGLE("3D Enhancement Switch", SB_DSP4_3DSE, 0, 1),
-SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
-SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15),
-SB_DOUBLE("PCM Playback Volume", SB_DSP4_PCM_DEV, (SB_DSP4_PCM_DEV + 1), 3, 3, 31),
-SB16_INPUT_SW("Synth Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 6, 5),
-SB_DOUBLE("Synth Playback Volume", SB_DSP4_SYNTH_DEV, (SB_DSP4_SYNTH_DEV + 1), 3, 3, 31),
-SB16_INPUT_SW("CD Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 2, 1),
-SB_DOUBLE("CD Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1),
-SB_DOUBLE("CD Playback Volume", SB_DSP4_CD_DEV, (SB_DSP4_CD_DEV + 1), 3, 3, 31),
-SB16_INPUT_SW("Line Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 4, 3),
-SB_DOUBLE("Line Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1),
-SB_DOUBLE("Line Playback Volume", SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31),
-SB_DOUBLE("Mic Capture Switch", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0, 1),
-SB_SINGLE("Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1),
-SB_SINGLE("Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31),
-SB_SINGLE("PC Speaker Volume", SB_DSP4_SPEAKER_DEV, 6, 3),
-SB_DOUBLE("Capture Volume", SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3),
-SB_DOUBLE("Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3),
-SB_SINGLE("Auto Mic Gain", SB_DSP4_MIC_AGC, 0, 1)
+#define SB16_CONTROLS (sizeof(snd_sb16_controls)/sizeof(snd_kcontrol_new_t *))
+
+static snd_kcontrol_new_t snd_sb16_ctl_master_play_vol =
+ SB_DOUBLE("Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_3d_enhance_switch =
+ SB_SINGLE("3D Enhancement Switch", SB_DSP4_3DSE, 0, 1);
+static snd_kcontrol_new_t snd_sb16_ctl_tone_bass =
+ SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15);
+static snd_kcontrol_new_t snd_sb16_ctl_tone_treble =
+ SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15);
+static snd_kcontrol_new_t snd_sb16_ctl_pcm_play_vol =
+ SB_DOUBLE("PCM Playback Volume", SB_DSP4_PCM_DEV, (SB_DSP4_PCM_DEV + 1), 3, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_synth_capture_route =
+ SB16_INPUT_SW("Synth Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 6, 5);
+static snd_kcontrol_new_t snd_sb16_ctl_synth_play_vol =
+ SB_DOUBLE("Synth Playback Volume", SB_DSP4_SYNTH_DEV, (SB_DSP4_SYNTH_DEV + 1), 3, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_cd_capture_route =
+ SB16_INPUT_SW("CD Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 2, 1);
+static snd_kcontrol_new_t snd_sb16_ctl_cd_play_switch =
+ SB_DOUBLE("CD Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 2, 1, 1);
+static snd_kcontrol_new_t snd_sb16_ctl_cd_play_vol =
+ SB_DOUBLE("CD Playback Volume", SB_DSP4_CD_DEV, (SB_DSP4_CD_DEV + 1), 3, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_line_capture_route =
+ SB16_INPUT_SW("Line Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 4, 3);
+static snd_kcontrol_new_t snd_sb16_ctl_line_play_switch =
+ SB_DOUBLE("Line Playback Switch", SB_DSP4_OUTPUT_SW, SB_DSP4_OUTPUT_SW, 4, 3, 1);
+static snd_kcontrol_new_t snd_sb16_ctl_line_play_vol =
+ SB_DOUBLE("Line Playback Volume", SB_DSP4_LINE_DEV, (SB_DSP4_LINE_DEV + 1), 3, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_mic_capture_route =
+ SB16_INPUT_SW("Mic Capture Route", SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, 0, 0);
+static snd_kcontrol_new_t snd_sb16_ctl_mic_play_switch =
+ SB_SINGLE("Mic Playback Switch", SB_DSP4_OUTPUT_SW, 0, 1);
+static snd_kcontrol_new_t snd_sb16_ctl_mic_play_vol =
+ SB_SINGLE("Mic Playback Volume", SB_DSP4_MIC_DEV, 3, 31);
+static snd_kcontrol_new_t snd_sb16_ctl_pc_speaker_vol =
+ SB_SINGLE("PC Speaker Volume", SB_DSP4_SPEAKER_DEV, 6, 3);
+static snd_kcontrol_new_t snd_sb16_ctl_capture_vol =
+ SB_DOUBLE("Capture Volume", SB_DSP4_IGAIN_DEV, (SB_DSP4_IGAIN_DEV + 1), 6, 6, 3);
+static snd_kcontrol_new_t snd_sb16_ctl_play_vol =
+ SB_DOUBLE("Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6, 3);
+static snd_kcontrol_new_t snd_sb16_ctl_auto_mic_gain =
+ SB_SINGLE("Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1);
+
+static snd_kcontrol_new_t *snd_sb16_controls[] = {
+ &snd_sb16_ctl_master_play_vol,
+ &snd_sb16_ctl_3d_enhance_switch,
+ &snd_sb16_ctl_tone_bass,
+ &snd_sb16_ctl_tone_treble,
+ &snd_sb16_ctl_pcm_play_vol,
+ &snd_sb16_ctl_synth_capture_route,
+ &snd_sb16_ctl_synth_play_vol,
+ &snd_sb16_ctl_cd_capture_route,
+ &snd_sb16_ctl_cd_play_switch,
+ &snd_sb16_ctl_cd_play_vol,
+ &snd_sb16_ctl_line_capture_route,
+ &snd_sb16_ctl_line_play_switch,
+ &snd_sb16_ctl_line_play_vol,
+ &snd_sb16_ctl_mic_capture_route,
+ &snd_sb16_ctl_mic_play_switch,
+ &snd_sb16_ctl_mic_play_vol,
+ &snd_sb16_ctl_pc_speaker_vol,
+ &snd_sb16_ctl_capture_vol,
+ &snd_sb16_ctl_play_vol,
+ &snd_sb16_ctl_auto_mic_gain
};
#define SB16_INIT_VALUES (sizeof(snd_sb16_init_values)/sizeof(unsigned char)/2)
@@ -513,28 +584,50 @@ static unsigned char snd_sb16_init_values[][2] = {
{ SB_DSP4_SPEAKER_DEV, 0 },
};
-#define DT019X_CONTROLS (sizeof(snd_dt019x_controls)/sizeof(snd_kcontrol_new_t))
-
-static snd_kcontrol_new_t snd_dt019x_controls[] = {
-SB_DOUBLE("Master Playback Volume", SB_DT019X_MASTER_DEV, SB_DT019X_MASTER_DEV, 4,0, 15),
-SB_DOUBLE("PCM Playback Volume", SB_DT019X_PCM_DEV, SB_DT019X_PCM_DEV, 4,0, 15),
-SB_DOUBLE("Synth Playback Volume", SB_DT019X_SYNTH_DEV, SB_DT019X_SYNTH_DEV, 4,0, 15),
-SB_DOUBLE("CD Playback Volume", SB_DT019X_CD_DEV, SB_DT019X_CD_DEV, 4,0, 15),
-SB_SINGLE("Mic Playback Volume", SB_DT019X_MIC_DEV, 4, 7),
-SB_SINGLE("PC Speaker Volume", SB_DT019X_SPKR_DEV, 0, 7),
-SB_DOUBLE("Line Playback Volume", SB_DT019X_LINE_DEV, SB_DT019X_LINE_DEV, 4,0, 15),
-SB_SINGLE("Mic Playback Switch", SB_DT019X_OUTPUT_SW1, 0, 1),
-SB_DOUBLE("CD Playback Switch", SB_DT019X_OUTPUT_SW1, SB_DT019X_OUTPUT_SW1, 2,1, 1),
-SB_DOUBLE("Line Playback Switch", SB_DT019X_OUTPUT_SW1, SB_DT019X_OUTPUT_SW1, 4,3, 1),
-SB_DOUBLE("PCM Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2,1, 1),
-SB_DOUBLE("Synth Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4,3, 1),
-{
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Capture Source",
- .info = snd_dt019x_input_sw_info,
- .get = snd_dt019x_input_sw_get,
- .put = snd_dt019x_input_sw_put,
-},
+#define DT019X_CONTROLS (sizeof(snd_dt019x_controls)/sizeof(snd_kcontrol_new_t *))
+
+
+static snd_kcontrol_new_t snd_dt019x_ctl_master_play_vol =
+ SB_DOUBLE("Master Playback Volume", SB_DT019X_MASTER_DEV, SB_DT019X_MASTER_DEV, 4,0, 15);
+static snd_kcontrol_new_t snd_dt019x_ctl_pcm_play_vol =
+ SB_DOUBLE("PCM Playback Volume", SB_DT019X_PCM_DEV, SB_DT019X_PCM_DEV, 4,0, 15);
+static snd_kcontrol_new_t snd_dt019x_ctl_synth_play_vol =
+ SB_DOUBLE("Synth Playback Volume", SB_DT019X_SYNTH_DEV, SB_DT019X_SYNTH_DEV, 4,0, 15);
+static snd_kcontrol_new_t snd_dt019x_ctl_cd_play_vol =
+ SB_DOUBLE("CD Playback Volume", SB_DT019X_CD_DEV, SB_DT019X_CD_DEV, 4,0, 15);
+static snd_kcontrol_new_t snd_dt019x_ctl_mic_play_vol =
+ SB_SINGLE("Mic Playback Volume", SB_DT019X_MIC_DEV, 4, 7);
+static snd_kcontrol_new_t snd_dt019x_ctl_pc_speaker_vol =
+ SB_SINGLE("PC Speaker Volume", SB_DT019X_SPKR_DEV, 0, 7);
+static snd_kcontrol_new_t snd_dt019x_ctl_line_play_vol =
+ SB_DOUBLE("Line Playback Volume", SB_DT019X_LINE_DEV, SB_DT019X_LINE_DEV, 4,0, 15);
+static snd_kcontrol_new_t snd_dt019x_ctl_pcm_play_switch =
+ SB_DOUBLE("PCM Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2,1, 1);
+static snd_kcontrol_new_t snd_dt019x_ctl_synth_play_switch =
+ SB_DOUBLE("Synth Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4,3, 1);
+static snd_kcontrol_new_t snd_dt019x_ctl_capture_source =
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = snd_dt019x_input_sw_info,
+ .get = snd_dt019x_input_sw_get,
+ .put = snd_dt019x_input_sw_put,
+ };
+
+static snd_kcontrol_new_t *snd_dt019x_controls[] = {
+ &snd_dt019x_ctl_master_play_vol,
+ &snd_dt019x_ctl_pcm_play_vol,
+ &snd_dt019x_ctl_synth_play_vol,
+ &snd_dt019x_ctl_cd_play_vol,
+ &snd_dt019x_ctl_mic_play_vol,
+ &snd_dt019x_ctl_pc_speaker_vol,
+ &snd_dt019x_ctl_line_play_vol,
+ &snd_sb16_ctl_mic_play_switch,
+ &snd_sb16_ctl_cd_play_switch,
+ &snd_sb16_ctl_line_play_switch,
+ &snd_dt019x_ctl_pcm_play_switch,
+ &snd_dt019x_ctl_synth_play_switch,
+ &snd_dt019x_ctl_capture_source
};
#define DT019X_INIT_VALUES (sizeof(snd_dt019x_init_values)/sizeof(unsigned char)/2)
@@ -546,13 +639,92 @@ static unsigned char snd_dt019x_init_values[][2] = {
{ SB_DT019X_CD_DEV, 0 },
{ SB_DT019X_MIC_DEV, 0 }, /* Includes PC-speaker in high nibble */
{ SB_DT019X_LINE_DEV, 0 },
- { SB_DT019X_OUTPUT_SW1, 0 },
+ { SB_DSP4_OUTPUT_SW, 0 },
{ SB_DT019X_OUTPUT_SW2, 0 },
{ SB_DT019X_CAPTURE_SW, 0x06 },
};
+/* FIXME: SB_ALS4000_MONO_IO_CTRL needs output select ctrl ! */
+static snd_kcontrol_new_t snd_als4000_ctl_mono_output_switch =
+ SB_SINGLE("Mono Output Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1);
+/* FIXME: mono input switch also available on DT019X ? */
+static snd_kcontrol_new_t snd_als4000_ctl_mono_input_switch =
+ SB_SINGLE("Mono Input Switch", SB_DT019X_OUTPUT_SW2, 0, 1);
+static snd_kcontrol_new_t snd_als4000_ctl_mic_20db_boost =
+ SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03);
+static snd_kcontrol_new_t snd_als4000_ctl_mixer_out_to_in =
+ SB_SINGLE("Mixer Out To In", SB_ALS4000_MIC_IN_GAIN, 7, 0x01);
+/* FIXME: 3D needs much more sophisticated controls, many more features ! */
+static snd_kcontrol_new_t snd_als4000_ctl_3d_output_switch =
+ SB_SINGLE("3D Output Switch", SB_ALS4000_3D_SND_FX, 6, 0x01);
+static snd_kcontrol_new_t snd_als4000_ctl_3d_output_ratio =
+ SB_SINGLE("3D Output Ratio", SB_ALS4000_3D_SND_FX, 0, 0x07);
+static snd_kcontrol_new_t snd_als4000_ctl_3d_poweroff_switch =
+ SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01);
+static snd_kcontrol_new_t snd_als4000_ctl_3d_delay =
+ SB_SINGLE("3D Delay", SB_ALS4000_3D_TIME_DELAY, 0, 0x0f);
+#if NOT_AVAILABLE
+static snd_kcontrol_new_t snd_als4000_ctl_fmdac =
+ SB_SINGLE("FMDAC Switch (Option ?)", SB_ALS4000_FMDAC, 0, 0x01);
+static snd_kcontrol_new_t snd_als4000_ctl_qsound =
+ SB_SINGLE("QSound Mode", SB_ALS4000_QSOUND, 1, 0x1f);
+#endif
+
+#define ALS4000_CONTROLS (sizeof(snd_als4000_controls)/sizeof(snd_kcontrol_new_t *))
+
+static snd_kcontrol_new_t *snd_als4000_controls[] = {
+ &snd_sb16_ctl_master_play_vol,
+ &snd_dt019x_ctl_pcm_play_switch,
+ &snd_sb16_ctl_pcm_play_vol,
+ &snd_sb16_ctl_synth_capture_route,
+ &snd_dt019x_ctl_synth_play_switch,
+ &snd_sb16_ctl_synth_play_vol,
+ &snd_sb16_ctl_cd_capture_route,
+ &snd_sb16_ctl_cd_play_switch,
+ &snd_sb16_ctl_cd_play_vol,
+ &snd_sb16_ctl_line_capture_route,
+ &snd_sb16_ctl_line_play_switch,
+ &snd_sb16_ctl_line_play_vol,
+ &snd_sb16_ctl_mic_capture_route,
+ &snd_als4000_ctl_mic_20db_boost,
+ &snd_sb16_ctl_auto_mic_gain,
+ &snd_sb16_ctl_mic_play_switch,
+ &snd_sb16_ctl_mic_play_vol,
+ &snd_sb16_ctl_pc_speaker_vol,
+ &snd_sb16_ctl_capture_vol,
+ &snd_sb16_ctl_play_vol,
+ &snd_als4000_ctl_mono_output_switch,
+ &snd_als4000_ctl_mono_input_switch,
+ &snd_als4000_ctl_mixer_out_to_in,
+ &snd_als4000_ctl_3d_output_switch,
+ &snd_als4000_ctl_3d_output_ratio,
+ &snd_als4000_ctl_3d_delay,
+ &snd_als4000_ctl_3d_poweroff_switch,
+#if NOT_AVAILABLE
+ &snd_als4000_ctl_fmdac,
+ &snd_als4000_ctl_qsound,
+#endif
+};
+
+#define ALS4000_INIT_VALUES (sizeof(snd_als4000_init_values)/sizeof(unsigned char)/2)
+
+static unsigned char snd_als4000_init_values[][2] = {
+ { SB_DSP4_MASTER_DEV + 0, 0 },
+ { SB_DSP4_MASTER_DEV + 1, 0 },
+ { SB_DSP4_PCM_DEV + 0, 0 },
+ { SB_DSP4_PCM_DEV + 1, 0 },
+ { SB_DSP4_SYNTH_DEV + 0, 0 },
+ { SB_DSP4_SYNTH_DEV + 1, 0 },
+ { SB_DSP4_SPEAKER_DEV, 0 },
+ { SB_DSP4_OUTPUT_SW, 0 },
+ { SB_DSP4_INPUT_LEFT, 0 },
+ { SB_DSP4_INPUT_RIGHT, 0 },
+ { SB_DT019X_OUTPUT_SW2, 0 },
+ { SB_ALS4000_MIC_IN_GAIN, 0 },
+};
+
static int snd_sbmixer_init(sb_t *chip,
- snd_kcontrol_new_t *controls,
+ snd_kcontrol_new_t **controls,
int controls_count,
unsigned char map[][2],
int map_count,
@@ -575,7 +747,7 @@ static int snd_sbmixer_init(sb_t *chip,
}
for (idx = 0; idx < controls_count; idx++) {
- if ((err = snd_ctl_add(card, snd_ctl_new1(&controls[idx], chip))) < 0)
+ if ((err = snd_ctl_add(card, snd_ctl_new1(controls[idx], chip))) < 0)
return err;
}
snd_component_add(card, name);
@@ -612,13 +784,19 @@ int snd_sbmixer_new(sb_t *chip)
break;
case SB_HW_16:
case SB_HW_ALS100:
- case SB_HW_ALS4000:
if ((err = snd_sbmixer_init(chip,
snd_sb16_controls, SB16_CONTROLS,
snd_sb16_init_values, SB16_INIT_VALUES,
"CTL1745")) < 0)
return err;
break;
+ case SB_HW_ALS4000:
+ if ((err = snd_sbmixer_init(chip,
+ snd_als4000_controls, ALS4000_CONTROLS,
+ snd_als4000_init_values, ALS4000_INIT_VALUES,
+ "ALS4000")) < 0)
+ return err;
+ break;
case SB_HW_DT019X:
if ((err = snd_sbmixer_init(chip,
snd_dt019x_controls, DT019X_CONTROLS,
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 47f04d83d745..58f5aeb5533c 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -293,7 +293,7 @@ comment "Compiled-in MSND Classic support requires firmware during compilation."
depends on SOUND_PRIME && SOUND_MSNDCLAS=y
config MSNDCLAS_HAVE_BOOT
- bool "Have MSNDINIT.BIN firmware file"
+ bool
depends on SOUND_MSNDCLAS=y
default y
@@ -355,7 +355,7 @@ comment "Compiled-in MSND Pinnacle support requires firmware during compilation.
depends on SOUND_PRIME && SOUND_MSNDPIN=y
config MSNDPIN_HAVE_BOOT
- bool "Have PNDSPINI.BIN firmware file"
+ bool
depends on SOUND_MSNDPIN=y
default y
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index ec4872a4bd52..d675b5103c8b 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -104,13 +104,13 @@ config SND_CMIPCI
config SND_ENS1370
tristate "(Creative) Ensoniq AudioPCI 1370"
- depends on SND
+ depends on SND && SOUND_GAMEPORT
help
Say 'Y' or 'M' to include support for Ensoniq AudioPCI ES1370.
config SND_ENS1371
tristate "(Creative) Ensoniq AudioPCI 1371/1373"
- depends on SND
+ depends on SND && SOUND_GAMEPORT
help
Say 'Y' or 'M' to include support for Ensoniq AudioPCI ES1371 and
Sound Blaster PCI 64 or 128 soundcards.
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 85c2ab2bb234..19f155712df4 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -126,6 +126,7 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
{ 0x48525300, 0xffffff00, "HMP9701", NULL },
{ 0x49434501, 0xffffffff, "ICE1230", NULL },
{ 0x49434511, 0xffffffff, "ICE1232", NULL }, // alias VIA VT1611A?
+{ 0x49434551, 0xffffffff, "VT1616", NULL },
{ 0x49544520, 0xffffffff, "IT2226E", NULL },
{ 0x4e534300, 0xffffffff, "LM4540/43/45/46/48", NULL }, // only guess --jk
{ 0x4e534331, 0xffffffff, "LM4549", NULL },
@@ -145,7 +146,7 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
{ 0x574d4c05, 0xffffffff, "WM9705", NULL }, // patch?
{ 0x594d4800, 0xffffffff, "YMF743", NULL },
{ 0x594d4802, 0xffffffff, "YMF752", NULL },
-{ 0x594d4803, 0xffffffff, "YMF753", NULL },
+{ 0x594d4803, 0xffffffff, "YMF753", patch_yamaha_ymf753 },
{ 0x83847600, 0xffffffff, "STAC9700/83/84", NULL },
{ 0x83847604, 0xffffffff, "STAC9701/3/4/5", NULL },
{ 0x83847605, 0xffffffff, "STAC9704", NULL },
@@ -678,6 +679,13 @@ AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0)
static const snd_kcontrol_new_t snd_ac97_control_eapd =
AC97_SINGLE("External Amplifier Power Down", AC97_POWERDOWN, 15, 1, 0);
+static const snd_kcontrol_new_t snd_ac97_controls_vt1616[] = {
+AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0),
+AC97_SINGLE("Alternate Level to Surround Out", 0x5a, 15, 1, 0),
+AC97_SINGLE("Downmix LFE and Center to Front", 0x5a, 12, 1, 0),
+AC97_SINGLE("Downmix Surround to Front", 0x5a, 11, 1, 0),
+};
+
static int snd_ac97_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
@@ -933,6 +941,151 @@ static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
#endif
};
+/* The following snd_ac97_ymf753_... items added by David Shust (dshust@shustring.com) */
+
+/* It is possible to indicate to the Yamaha YMF753 the type of speakers being used. */
+static int snd_ac97_ymf753_info_speaker(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ static char *texts[3] = {
+ "Standard", "Small", "Smaller"
+ };
+
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+ uinfo->count = 1;
+ uinfo->value.enumerated.items = 3;
+ if (uinfo->value.enumerated.item > 2)
+ uinfo->value.enumerated.item = 2;
+ strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+ return 0;
+}
+
+static int snd_ac97_ymf753_get_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ val = ac97->regs[AC97_YMF753_3D_MODE_SEL];
+ val = (val >> 10) & 3;
+ if (val > 0) /* 0 = invalid */
+ val--;
+ ucontrol->value.enumerated.item[0] = val;
+ return 0;
+}
+
+static int snd_ac97_ymf753_put_speaker(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ if (ucontrol->value.enumerated.item[0] > 2)
+ return -EINVAL;
+ val = (ucontrol->value.enumerated.item[0] + 1) << 10;
+ return snd_ac97_update(ac97, AC97_YMF753_3D_MODE_SEL, val);
+}
+
+static const snd_kcontrol_new_t snd_ac97_ymf753_controls_speaker =
+{
+ iface: SNDRV_CTL_ELEM_IFACE_MIXER,
+ name: "3D Control - Speaker",
+ info: snd_ac97_ymf753_info_speaker,
+ get: snd_ac97_ymf753_get_speaker,
+ put: snd_ac97_ymf753_put_speaker,
+};
+
+/* It is possible to indicate to the Yamaha YMF753 the source to direct to the S/PDIF output. */
+static int snd_ac97_ymf753_spdif_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ static char *texts[2] = { "AC-Link", "A/D Converter" };
+
+ 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 snd_ac97_ymf753_spdif_source_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ val = ac97->regs[AC97_YMF753_DIT_CTRL2];
+ ucontrol->value.enumerated.item[0] = (val >> 1) & 1;
+ return 0;
+}
+
+static int snd_ac97_ymf753_spdif_source_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ if (ucontrol->value.enumerated.item[0] > 1)
+ return -EINVAL;
+ val = ucontrol->value.enumerated.item[0] << 1;
+ return snd_ac97_update_bits(ac97, AC97_YMF753_DIT_CTRL2, 0x0002, val);
+}
+
+/* The AC'97 spec states that the S/PDIF signal is to be output at pin 48.
+ The YMF753 will ouput the S/PDIF signal to pin 43, 47 (EAPD), or 48.
+ By default, no output pin is selected, and the S/PDIF signal is not output.
+ There is also a bit to mute S/PDIF output in a vendor-specific register. */
+static int snd_ac97_ymf753_spdif_output_pin_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ static char *texts[3] = { "Disabled", "Pin 43", "Pin 48" };
+
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+ uinfo->count = 1;
+ uinfo->value.enumerated.items = 3;
+ if (uinfo->value.enumerated.item > 2)
+ uinfo->value.enumerated.item = 2;
+ strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+ return 0;
+}
+
+static int snd_ac97_ymf753_spdif_output_pin_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ val = ac97->regs[AC97_YMF753_DIT_CTRL2];
+ ucontrol->value.enumerated.item[0] = (val & 0x0008) ? 2 : (val & 0x0020) ? 1 : 0;
+ return 0;
+}
+
+static int snd_ac97_ymf753_spdif_output_pin_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ unsigned short val;
+
+ if (ucontrol->value.enumerated.item[0] > 2)
+ return -EINVAL;
+ val = (ucontrol->value.enumerated.item[0] == 2) ? 0x0008 :
+ (ucontrol->value.enumerated.item[0] == 1) ? 0x0020 : 0;
+ return snd_ac97_update_bits(ac97, AC97_YMF753_DIT_CTRL2, 0x0028, val);
+ /* The following can be used to direct S/PDIF output to pin 47 (EAPD).
+ snd_ac97_write_cache(ac97, 0x62, snd_ac97_read(ac97, 0x62) | 0x0008); */
+}
+
+static const snd_kcontrol_new_t snd_ac97_ymf753_controls_spdif[3] = {
+ {
+ iface: SNDRV_CTL_ELEM_IFACE_MIXER,
+ name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
+ info: snd_ac97_ymf753_spdif_source_info,
+ get: snd_ac97_ymf753_spdif_source_get,
+ put: snd_ac97_ymf753_spdif_source_put,
+ },
+ {
+ iface: SNDRV_CTL_ELEM_IFACE_MIXER,
+ name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Output Pin",
+ info: snd_ac97_ymf753_spdif_output_pin_info,
+ get: snd_ac97_ymf753_spdif_output_pin_get,
+ put: snd_ac97_ymf753_spdif_output_pin_put,
+ },
+ AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",NONE,NONE) "Mute", AC97_YMF753_DIT_CTRL2, 2, 1, 1)
+};
+
/*
*
*/
@@ -1163,9 +1316,14 @@ static int snd_ac97_mixer_build(snd_card_t * card, ac97_t * ac97)
/* build master tone controls */
if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) {
- for (idx = 0; idx < 2; idx++)
- if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0)
+ for (idx = 0; idx < 2; idx++) {
+ if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0)
return err;
+ if (ac97->id == AC97_ID_YMF753) {
+ kctl->private_value &= ~(0xff << 16);
+ kctl->private_value |= 7 << 16;
+ }
+ }
snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f);
}
@@ -1339,6 +1497,16 @@ static int snd_ac97_mixer_build(snd_card_t * card, ac97_t * ac97)
kctl->private_value = AC97_3D_CONTROL | (3 << 16);
snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000);
break;
+ case AC97_ID_YMF753:
+ if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_3d[0], ac97))) < 0)
+ return err;
+ strcpy(kctl->id.name, "3D Control - Wide");
+ kctl->private_value = AC97_3D_CONTROL | (9 << 8) | (7 << 16);
+ snd_ac97_write_cache(ac97, AC97_3D_CONTROL, 0x0000);
+ if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_ymf753_controls_speaker, ac97))) < 0)
+ return err;
+ snd_ac97_write_cache(ac97, AC97_YMF753_3D_MODE_SEL, 0x0c00);
+ break;
default:
if (snd_ac97_try_volume_mix(ac97, AC97_3D_CONTROL)) {
unsigned short val;
@@ -1366,7 +1534,7 @@ static int snd_ac97_mixer_build(snd_card_t * card, ac97_t * ac97)
return err;
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_cirrus_controls_spdif[0], ac97))) < 0)
return err;
- switch (ac97->id) {
+ switch (ac97->id & AC97_ID_CS_MASK) {
case AC97_ID_CS4205:
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_cirrus_controls_spdif[1], ac97))) < 0)
return err;
@@ -1390,6 +1558,11 @@ static int snd_ac97_mixer_build(snd_card_t * card, ac97_t * ac97)
for (idx = 0; idx < 5; idx++)
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_spdif[idx], ac97))) < 0)
return err;
+ if (ac97->id == AC97_ID_YMF753) {
+ for (idx = 0; idx < 3; idx++)
+ if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_ymf753_controls_spdif[idx], ac97))) < 0)
+ return err;
+ }
/* set default PCM S/PDIF params */
/* consumer,PCM audio,no copyright,no preemphasis,PCM coder,original,48000Hz */
snd_ac97_write_cache(ac97, AC97_SPDIF, 0x2a20);
@@ -1418,6 +1591,14 @@ static int snd_ac97_mixer_build(snd_card_t * card, ac97_t * ac97)
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_alc650[idx], ac97))) < 0)
return err;
break;
+ case AC97_ID_VT1616:
+ if (snd_ac97_try_bit(ac97, 0x5a, 9))
+ if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_vt1616[0], ac97))) < 0)
+ return err;
+ for (idx = 1; idx < ARRAY_SIZE(snd_ac97_controls_vt1616); idx++)
+ if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_vt1616[idx], ac97))) < 0)
+ return err;
+ break;
default:
/* nothing */
break;
@@ -1697,7 +1878,8 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
goto __modem;
- val = snd_ac97_read(ac97, AC97_RESET);
+ // val = snd_ac97_read(ac97, AC97_RESET);
+ val = ac97->caps;
snd_iprintf(buffer, "Capabilities :%s%s%s%s%s%s\n",
val & AC97_BC_DEDICATED_MIC ? " -dedicated MIC PCM IN channel-" : "",
val & AC97_BC_RESERVED1 ? " -reserved1-" : "",
@@ -1946,6 +2128,45 @@ static void snd_ac97_proc_done(ac97_t * ac97)
* PCM support
*/
+static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
+{
+ unsigned short old, bits, reg;
+
+ if (! (ac97->ext_id & AC97_EI_SPDIF))
+ return -ENODEV;
+
+ if (ac97->flags & AC97_CS_SPDIF) {
+ switch (rate) {
+ case 48000: bits = 0; break;
+ case 44100: bits = 1 << AC97_SC_SPSR_SHIFT; break;
+ default: /* invalid - disable output */
+ snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+ return -EINVAL;
+ }
+ reg = AC97_CSR_SPDIF;
+ } else {
+ switch (rate) {
+ case 44100: bits = AC97_SC_SPSR_44K; break;
+ case 48000: bits = AC97_SC_SPSR_48K; break;
+ case 32000: bits = AC97_SC_SPSR_32K; break;
+ default: /* invalid - disable output */
+ snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+ return -EINVAL;
+ }
+ reg = AC97_SPDIF;
+ }
+
+ spin_lock(&ac97->reg_lock);
+ old = ac97->regs[reg] & ~AC97_SC_SPSR_MASK;
+ if (old != bits) {
+ snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
+ snd_ac97_update_bits_nolock(ac97, reg, AC97_SC_SPSR_MASK, bits);
+ }
+ snd_ac97_update_bits_nolock(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, AC97_EA_SPDIF);
+ spin_unlock(&ac97->reg_lock);
+ return 0;
+}
+
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate)
{
unsigned short mask;
@@ -1971,8 +2192,9 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned short rate)
return -EINVAL;
break;
case AC97_SPDIF:
- return 0;
- default: return -EINVAL;
+ return set_spdif_rate(ac97, rate);
+ default:
+ return -EINVAL;
}
tmp = ((unsigned int)rate * ac97->clock) / 48000;
if (tmp > 65535)
diff --git a/sound/pci/ac97/ac97_id.h b/sound/pci/ac97/ac97_id.h
index 7f7ffe24aa0f..6fb11e22500c 100644
--- a/sound/pci/ac97/ac97_id.h
+++ b/sound/pci/ac97/ac97_id.h
@@ -43,4 +43,7 @@
#define AC97_ID_CS4299 0x43525930
#define AC97_ID_CS4201 0x43525948
#define AC97_ID_CS4205 0x43525958
+#define AC97_ID_CS_MASK 0xfffffff8 /* bit 0-2: rev */
#define AC97_ID_ALC650 0x414c4720
+#define AC97_ID_YMF753 0x594d4803
+#define AC97_ID_VT1616 0x49434551
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index b9f3f9378071..ef1c768a9128 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -37,6 +37,20 @@
* Chip specific initialization
*/
+int patch_yamaha_ymf753(ac97_t * ac97)
+{
+ /* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust@shustring.com.
+ This chip has nonstandard and extended behaviour with regard to its S/PDIF output.
+ The AC'97 spec states that the S/PDIF signal is to be output at pin 48.
+ The YMF753 will ouput the S/PDIF signal to pin 43, 47 (EAPD), or 48.
+ By default, no output pin is selected, and the S/PDIF signal is not output.
+ There is also a bit to mute S/PDIF output in a vendor-specific register.
+ */
+ ac97->caps |= AC97_BC_BASS_TREBLE;
+ ac97->caps |= 0x04 << 10; /* Yamaha 3D enhancement */
+ return 0;
+}
+
int patch_wolfson00(ac97_t * ac97)
{
/* This sequence is suspect because it was designed for
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index 317669c7bdec..b0504e607d34 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -22,6 +22,7 @@
*
*/
+int patch_yamaha_ymf753(ac97_t * ac97);
int patch_wolfson00(ac97_t * ac97);
int patch_wolfson03(ac97_t * ac97);
int patch_wolfson04(ac97_t * ac97);
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 140da1843066..f05aeb5fbb5a 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -529,7 +529,8 @@ static int snd_ali_reset_5451(ali_t *codec)
udelay(5000);
}
- return -1;
+ snd_printk(KERN_WARNING "ali5451: reset time out\n");
+ return 0;
}
#ifdef CODEC_RESET
@@ -1209,59 +1210,64 @@ static int snd_ali_trigger(snd_pcm_substream_t *substream,
unsigned int what, whati, capture_flag;
snd_ali_voice_t *pvoice = NULL, *evoice = NULL;
unsigned int val;
+ int do_start;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ do_start = 1; break;
case SNDRV_PCM_TRIGGER_STOP:
- {
- what = whati = capture_flag = 0;
- s = substream;
- do {
- if ((ali_t *) _snd_pcm_chip(s->pcm) == codec) {
- pvoice = (snd_ali_voice_t *) s->runtime->private_data;
- evoice = pvoice->extra;
- what |= 1 << (pvoice->number & 0x1f);
- if (evoice == NULL) {
- whati |= 1 << (pvoice->number & 0x1f);
- } else {
- whati |= 1 << (evoice->number & 0x1f);
- what |= 1 << (evoice->number & 0x1f);
- }
- if (cmd == SNDRV_PCM_TRIGGER_START) {
- pvoice->running = 1;
- if (evoice != NULL)
- evoice->running = 1;
- }
- snd_pcm_trigger_done(s, substream);
- if (pvoice->mode)
- capture_flag = 1;
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ do_start = 0; break;
+ default:
+ return -EINVAL;
+ }
+
+ what = whati = capture_flag = 0;
+ s = substream;
+ do {
+ if ((ali_t *) _snd_pcm_chip(s->pcm) == codec) {
+ pvoice = (snd_ali_voice_t *) s->runtime->private_data;
+ evoice = pvoice->extra;
+ what |= 1 << (pvoice->number & 0x1f);
+ if (evoice == NULL) {
+ whati |= 1 << (pvoice->number & 0x1f);
+ } else {
+ whati |= 1 << (evoice->number & 0x1f);
+ what |= 1 << (evoice->number & 0x1f);
}
- s = s->link_next;
- } while (s != substream);
- spin_lock(&codec->reg_lock);
- if (cmd == SNDRV_PCM_TRIGGER_STOP) {
- outl(what, ALI_REG(codec, ALI_STOP));
- pvoice->running = 0;
- if (evoice != NULL)
- evoice->running = 0;
- }
- val = inl(ALI_REG(codec, ALI_AINTEN));
- if (cmd == SNDRV_PCM_TRIGGER_START) {
- val |= whati;
- } else {
- val &= ~whati;
- }
- outl(val, ALI_REG(codec, ALI_AINTEN));
- if (cmd == SNDRV_PCM_TRIGGER_START) {
- outl(what, ALI_REG(codec, ALI_START));
+ if (do_start) {
+ pvoice->running = 1;
+ if (evoice != NULL)
+ evoice->running = 1;
+ } else {
+ pvoice->running = 0;
+ if (evoice != NULL)
+ evoice->running = 0;
+ }
+ snd_pcm_trigger_done(s, substream);
+ if (pvoice->mode)
+ capture_flag = 1;
}
- snd_ali_printk("trigger: what=%xh whati=%xh\n",what,whati);
- spin_unlock(&codec->reg_lock);
- break;
+ s = s->link_next;
+ } while (s != substream);
+ spin_lock(&codec->reg_lock);
+ if (! do_start) {
+ outl(what, ALI_REG(codec, ALI_STOP));
}
- default:
- return -EINVAL;
+ val = inl(ALI_REG(codec, ALI_AINTEN));
+ if (do_start) {
+ val |= whati;
+ } else {
+ val &= ~whati;
+ }
+ outl(val, ALI_REG(codec, ALI_AINTEN));
+ if (do_start) {
+ outl(what, ALI_REG(codec, ALI_START));
}
+ snd_ali_printk("trigger: what=%xh whati=%xh\n",what,whati);
+ spin_unlock(&codec->reg_lock);
+
return 0;
}
@@ -1543,7 +1549,9 @@ static snd_pcm_hardware_t snd_ali_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE),
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
@@ -1567,7 +1575,9 @@ static snd_pcm_hardware_t snd_ali_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_SYNC_START),
.formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE),
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
@@ -1821,9 +1831,10 @@ static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
return change;
}
-static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinit = {
+static snd_kcontrol_new_t snd_ali5451_mixer_spdif[] __devinitdata = {
/* spdif aplayback switch */
- ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, 0),
+ /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */
+ ALI5451_SPDIF("IEC958 Output switch", 0, 0),
/* spdif out to spdif channel */
ALI5451_SPDIF("IEC958 Channel Output Switch", 0, 1),
/* spdif in from spdif channel */
@@ -1851,7 +1862,7 @@ static int __devinit snd_ali_mixer(ali_t * codec)
return err;
}
if (codec->revision == ALI_5451_V02) {
- for(idx = 0; idx < 3; idx++) {
+ for(idx = 0; idx < ARRAY_SIZE(snd_ali5451_mixer_spdif); idx++) {
err=snd_ctl_add(codec->card, snd_ctl_new1(&snd_ali5451_mixer_spdif[idx], codec));
if (err < 0) return err;
}
@@ -1999,15 +2010,13 @@ static int snd_ali_chip_init(ali_t *codec)
if (codec->revision == ALI_5451_V02) {
pci_dev = codec->pci_m1533;
- if (pci_dev == NULL)
- return -1;
pci_read_config_byte(pci_dev, 0x59, &temp);
+ temp |= 0x80;
+ pci_write_config_byte(pci_dev, 0x59, temp);
- pci_dev = pci_find_device(0x10b9,0x7101, pci_dev);
- if (pci_dev == NULL)
- return -1;
- pci_read_config_byte(pci_dev,0xb8,&temp);
- temp |= 1 << 6;
+ pci_dev = codec->pci_m7101;
+ pci_read_config_byte(pci_dev, 0xb8, &temp);
+ temp |= 0x20;
pci_write_config_byte(pci_dev, 0xB8, temp);
}
@@ -2139,10 +2148,22 @@ static int __devinit snd_ali_create(snd_card_t * card,
codec->chregs.data.aint = 0x00;
codec->chregs.data.ainten = 0x00;
- pci_dev = pci_find_device(0x10b9,0x1533, pci_dev);
+ /* M1533: southbridge */
+ pci_dev = pci_find_device(0x10b9, 0x1533, NULL);
codec->pci_m1533 = pci_dev;
- pci_dev = pci_find_device(0x10b9,0x7101, pci_dev);
+ if (! codec->pci_m1533) {
+ snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n");
+ snd_ali_free(codec);
+ return -ENODEV;
+ }
+ /* M7101: power management */
+ pci_dev = pci_find_device(0x10b9, 0x7101, NULL);
codec->pci_m7101 = pci_dev;
+ if (! codec->pci_m7101) {
+ snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");
+ snd_ali_free(codec);
+ return -ENODEV;
+ }
snd_ali_printk("snd_device_new is called.\n");
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, codec, &ops)) < 0) {
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index d11d55ad2d93..92599a20cfaa 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -2,6 +2,7 @@
* card-als4000.c - driver for Avance Logic ALS4000 based soundcards.
* Copyright (C) 2000 by Bart Hartgers <bart@etpmod.phys.tue.nl>,
* Jaroslav Kysela <perex@suse.cz>
+ * Copyright (C) 2002 by Andreas Mohr <hw7oshyuv3001@sneakemail.com>
*
* Framework borrowed from Massimo Piccioni's card-als100.c.
*
@@ -11,6 +12,9 @@
* bought an ALS4000 based soundcard, I was forced to base this driver
* on reverse engineering.
*
+ * Note: this is no longer true. Pretty verbose chip docu (ALS4000a.PDF)
+ * can be found on the ALSA web site.
+ *
* The ALS4000 seems to be the PCI-cousin of the ALS100. It contains an
* ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
* interface. These subsystems can be mapped into ISA io-port space,
@@ -23,11 +27,21 @@
*
* The ALS4000 can do real full duplex playback/capture.
*
- * BUGS
- * The box suggests there is some support for 3D sound, but I did not
- * investigate this yet.
- *
+ * FMDAC:
+ * - 0x4f -> port 0x14
+ * - port 0x15 |= 1
+ *
+ * Enable/disable 3D sound:
+ * - 0x50 -> port 0x14
+ * - change bit 6 (0x40) of port 0x15
+ *
+ * Set QSound:
+ * - 0xdb -> port 0x14
+ * - set port 0x15:
+ * 0x3e (mode 3), 0x3c (mode 2), 0x3a (mode 1), 0x38 (mode 0)
*
+ * Set KSound:
+ * - value -> some port 0x0c0d
*
* 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
@@ -256,11 +270,18 @@ static int snd_als4000_playback_prepare(snd_pcm_substream_t *substream)
count >>=1;
count--;
+ /* FIXME: from second playback on, there's a lot more clicks and pops
+ * involved here than on first playback. Fiddling with
+ * tons of different settings didn't help (DMA, speaker on/off,
+ * reordering, ...). Something seems to get enabled on playback
+ * that I haven't found out how to disable again, which then causes
+ * the switching pops to reach the speakers the next time here. */
spin_lock_irqsave(&chip->reg_lock, flags);
snd_als4000_set_rate(chip, runtime->rate);
snd_als4000_set_playback_dma(chip, runtime->dma_addr, size);
- snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON);
+ /* SPEAKER_ON not needed, since dma_on seems to also enable speaker */
+ /* snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON); */
snd_sbdsp_command(chip, playback_cmd(chip).dsp_cmd);
snd_sbdsp_command(chip, playback_cmd(chip).format);
snd_sbdsp_command(chip, count);
@@ -359,9 +380,9 @@ static void snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock_irqrestore(&chip->mixer_lock, flags);
if (sb_status & SB_IRQTYPE_8BIT)
- inb(SBP(chip, DATA_AVAIL));
+ snd_sb_ack_8bit(chip);
if (sb_status & SB_IRQTYPE_16BIT)
- inb(SBP(chip, DATA_AVAIL_16));
+ snd_sb_ack_16bit(chip);
if (sb_status & SB_IRQTYPE_MPUIN)
inb(chip->mpu_port);
if (sb_status & 0x20)
@@ -547,14 +568,14 @@ static void __devinit snd_als4000_configure(sb_t *chip)
spin_unlock_irqrestore(&chip->reg_lock,flags);
}
-static void snd_card_als4k_free( snd_card_t *card )
+static void snd_card_als4000_free( snd_card_t *card )
{
snd_card_als4000_t * acard = (snd_card_als4000_t *)card->private_data;
/* make sure that interrupts are disabled */
snd_als4000_gcr_write_addr( acard->gcr, 0x8c, 0);
}
-static int __devinit snd_card_als4k_probe(struct pci_dev *pci,
+static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
static int dev;
@@ -608,7 +629,7 @@ static int __devinit snd_card_als4k_probe(struct pci_dev *pci,
acard = (snd_card_als4000_t *)card->private_data;
acard->gcr = gcr;
- card->private_free = snd_card_als4k_free;
+ card->private_free = snd_card_als4000_free;
if ((err = snd_sbdsp_create(card,
gcr + 0x10,
@@ -672,7 +693,7 @@ static int __devinit snd_card_als4k_probe(struct pci_dev *pci,
return 0;
}
-static void __devexit snd_card_als4k_remove(struct pci_dev *pci)
+static void __devexit snd_card_als4000_remove(struct pci_dev *pci)
{
snd_card_free(pci_get_drvdata(pci));
pci_set_drvdata(pci, NULL);
@@ -681,11 +702,11 @@ static void __devexit snd_card_als4k_remove(struct pci_dev *pci)
static struct pci_driver driver = {
.name = "ALS4000",
.id_table = snd_als4000_ids,
- .probe = snd_card_als4k_probe,
- .remove = __devexit_p(snd_card_als4k_remove),
+ .probe = snd_card_als4000_probe,
+ .remove = __devexit_p(snd_card_als4000_remove),
};
-static int __init alsa_card_als4k_init(void)
+static int __init alsa_card_als4000_init(void)
{
int err;
@@ -698,13 +719,13 @@ static int __init alsa_card_als4k_init(void)
return 0;
}
-static void __exit alsa_card_als4k_exit(void)
+static void __exit alsa_card_als4000_exit(void)
{
pci_unregister_driver(&driver);
}
-module_init(alsa_card_als4k_init)
-module_exit(alsa_card_als4k_exit)
+module_init(alsa_card_als4000_init)
+module_exit(alsa_card_als4000_exit)
#ifndef MODULE
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 4894b5128a79..ce0a20f9f7e5 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -17,8 +17,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/* Does not work. Warning may block system in capture mode */
+/* #define USE_VAR48KRATE */
+
+/* Define this if you want soft ac3 encoding - it's still buggy.. */
+/* #define DO_SOFT_AC3 */
+/* #define USE_AES_IEC958 */
+#define DO_SOFT_AC3
+#define USE_AES_IEC958
+
#include <sound/driver.h>
#include <asm/io.h>
+#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/pci.h>
@@ -151,9 +161,15 @@ MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0}
#define CM_REG_INT_STATUS 0x10
#define CM_INTR 0x80000000
+#define CM_VCO 0x08000000 /* Voice Control? CMI8738 */
+#define CM_MCBINT 0x04000000 /* Master Control Block abort cond.? */
#define CM_UARTINT 0x00010000
#define CM_LTDMAINT 0x00008000
#define CM_HTDMAINT 0x00004000
+#define CM_XDO46 0x00000080 /* Modell 033? Direct programming EEPROM (read data register) */
+#define CM_LHBTOG 0x00000040 /* High/Low status from DMA ctrl register */
+#define CM_LEG_HDMA 0x00000020 /* Legacy is in High DMA channel */
+#define CM_LEG_STEREO 0x00000010 /* Legacy is in Stereo mode */
#define CM_CH1BUSY 0x00000008
#define CM_CH0BUSY 0x00000004
#define CM_CHINT1 0x00000002
@@ -218,6 +234,11 @@ MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0}
#define CM_REG_SB16_DATA 0x22
#define CM_REG_SB16_ADDR 0x23
+#define CM_REFFREQ_XIN (315*1000*1000)/22 /* 14.31818 Mhz reference clock frequency pin XIN */
+#define CM_ADCMULT_XIN 512 /* Guessed (487 best for 44.1kHz, not for 88/176kHz) */
+#define CM_TOLERANCE_RATE 0.001 /* Tolerance sample rate pitch (1000ppm) */
+#define CM_MAXIMUM_RATE 80000000 /* Note more than 80MHz */
+
#define CM_REG_MIXER1 0x24
#define CM_FMMUTE 0x80 /* mute FM */
#define CM_FMMUTE_SHIFT 7
@@ -263,6 +284,39 @@ MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0}
#define CM_DMAUTO 0x01
#define CM_REG_AC97 0x28 /* hmmm.. do we have ac97 link? */
+/*
+ * For CMI-8338 (0x28 - 0x2b) .. is this valid for CMI-8738
+ * or identical with AC97 codec?
+ */
+#define CM_REG_EXTERN_CODEC CM_REG_AC97
+
+/*
+ * MPU401 pci port index address 0x40 - 0x4f (CMI-8738 spec ver. 0.6)
+ */
+#define CM_REG_MPU_PCI 0x40
+
+/*
+ * FM pci port index address 0x50 - 0x5f (CMI-8738 spec ver. 0.6)
+ */
+#define CM_REG_FM_PCI 0x50
+
+/*
+ * for CMI-8338 .. this is not valid for CMI-8738.
+ */
+#define CM_REG_EXTENT_IND 0xf0
+#define CM_VPHONE_MASK 0xe0 /* Phone volume control (0-3) << 5 */
+#define CM_VPHONE_SHIFT 5
+#define CM_VPHOM 0x10 /* Phone mute control */
+#define CM_VSPKM 0x08 /* Speaker mute control, default high */
+#define CM_RLOOPREN 0x04 /* Rec. R-channel enable */
+#define CM_RLOOPLEN 0x02 /* Rec. L-channel enable */
+
+/*
+ * CMI-8338 spec ver 0.5 (this is not valid for CMI-8738):
+ * the 8 registers 0xf8 - 0xff are used for programming m/n counter by the PLL
+ * unit (readonly?).
+ */
+#define CM_REG_PLL 0xf8
/*
* extended registers
@@ -331,12 +385,6 @@ MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0}
/*
- * define this if you want soft ac3 encoding - it's still buggy..
- */
-/* #define DO_SOFT_AC3 */
-
-
-/*
* driver data
*/
@@ -401,6 +449,9 @@ struct snd_stru_cmipci {
unsigned int dig_status;
unsigned int dig_pcm_status;
+#ifdef USE_AES_IEC958
+ snd_ctl_elem_value_t *spdif_channel;
+#endif
snd_kcontrol_t *spdif_pcm_ctl;
snd_pcm_hardware_t *hw_info[3]; /* for playbacks */
@@ -515,12 +566,86 @@ static unsigned int snd_cmipci_rate_freq(unsigned int rate)
return 0;
}
+#ifdef USE_VAR48KRATE
+/*
+ * Determine PLL values for frequency setup, maybe the CMI8338 (CMI8738???)
+ * does it this way .. maybe not. Never get any information from C-Media about
+ * that <werner@suse.de>.
+ */
+static int snd_cmipci_pll_rmn(unsigned int rate, unsigned int adcmult, int *r, int *m, int *n)
+{
+ unsigned int delta, tolerance;
+ int xm, xn, xr;
+
+ for (*r = 0; rate < CM_MAXIMUM_RATE/adcmult; *r += (1<<5))
+ rate <<= 1;
+ *n = -1;
+ if (*r > 0xff)
+ goto out;
+ tolerance = rate*CM_TOLERANCE_RATE;
+
+ for (xn = (1+2); xn < (0x1f+2); xn++) {
+ for (xm = (1+2); xm < (0xff+2); xm++) {
+ xr = ((CM_REFFREQ_XIN/adcmult) * xm) / xn;
+
+ if (xr < rate)
+ delta = rate - xr;
+ else
+ delta = xr - rate;
+
+ /*
+ * If we found one, remember this,
+ * and try to find a closer one
+ */
+ if (delta < tolerance) {
+ tolerance = delta;
+ *m = xm - 2;
+ *n = xn - 2;
+ }
+ }
+ }
+out:
+ return (*n > -1);
+}
+
+/*
+ * Program pll register bits, I assume that the 8 registers 0xf8 upto 0xff
+ * are mapped onto the 8 ADC/DAC sampling frequency which can be choosen
+ * at the register CM_REG_FUNCTRL1 (0x04).
+ * Problem: other ways are also possible (any information about that?)
+ */
+static void snd_cmipci_set_pll(cmipci_t *cm, unsigned int rate, unsigned int slot)
+{
+ unsigned int reg = CM_REG_PLL + slot;
+ /*
+ * Guess that this programs at reg. 0x04 the pos 15:13/12:10
+ * for DSFC/ASFC (000 upto 111).
+ */
+
+ /* FIXME: Init (Do we've to set an other register first before programming?) */
+
+ /* FIXME: Is this correct? Or shouldn't the m/n/r values be used for that? */
+ snd_cmipci_write_b(cm, reg, rate>>8);
+ snd_cmipci_write_b(cm, reg, rate&0xff);
+
+ /* FIXME: Setup (Do we've to set an other register first to enable this?) */
+}
+#endif /* USE_VAR48KRATE */
+
static int snd_cmipci_hw_params(snd_pcm_substream_t * substream,
snd_pcm_hw_params_t * hw_params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
+static void snd_cmipci_ch_reset(cmipci_t *cm, int ch)
+{
+ int reset = CM_RST_CH0 << (cm->channel[ch].ch);
+ snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl | reset);
+ snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl & ~reset);
+ udelay(10);
+}
+
static int snd_cmipci_hw_free(snd_pcm_substream_t * substream)
{
return snd_pcm_lib_free_pages(substream);
@@ -699,7 +824,7 @@ static int snd_cmipci_pcm_trigger(cmipci_t *cm, cmipci_pcm_t *rec,
/* reset */
cm->ctrl &= ~chen;
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl | reset);
- snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
+ snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl & ~reset);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
cm->ctrl |= pause;
@@ -784,8 +909,10 @@ static snd_pcm_uframes_t snd_cmipci_capture_pointer(snd_pcm_substream_t *substre
* write the raw subframe via 32bit data mode.
*/
+# ifndef USE_AES_IEC958
+
/* find parity for bit 4~30 */
-static unsigned parity(unsigned int data)
+static unsigned int parity(unsigned int data)
{
unsigned int parity = 0;
int counter = 4;
@@ -835,6 +962,187 @@ inline static u32 convert_ac3_32bit(cmipci_t *cm, u32 val)
return data;
}
+# else /* if USE_AES_IEC958 */
+
+/*
+ * The bitstream handling
+ */
+typedef struct iec958_stru_bitstream {
+ u32 *data; /* Holds the current position */
+ u32 left; /* Bits left in current 32bit frame */
+ u32 word; /* The 32bit frame of the current position */
+ u32 bits; /* All bits together */
+ int err; /* Error condition */
+} iec958_bitstream_t ;
+
+static iec958_bitstream_t bs;
+
+/* Initialize ptr on the buffer */
+static void iec958_init_bitstream(u8 *buf, u32 size)
+{
+ bs.data = (u32 *)buf; /* Set initial position */
+ bs.word = *bs.data; /* The first 32bit frame */
+ bs.left = 32; /* has exactly 32bits */
+ bs.bits = size;
+ bs.err = 0;
+}
+
+/* Remove ptr on the buffer */
+static void iec958_clear_bitstream(void)
+{
+ bs.data = NULL;
+ bs.left = 0;
+ bs.err = 0;
+}
+
+/* Get bits from bitstream (max 32) */
+static inline u32 iec958_getbits(u32 bits)
+{
+ u32 res;
+
+ if (bs.bits < bits) {
+ bits = bs.bits;
+ bs.err = 1;
+ }
+ if (bits > 32) {
+ bits = 32;
+ bs.err = 1;
+ }
+ bs.bits -= bits;
+
+# ifdef WORDS_BIGENDIAN
+ if (bits < bs.left) { /* Within 32bit frame */
+ res = (bs.word << (32 - bs.left)) >> (32 - bits);
+ bs.left -= bits;
+ goto out;
+ } /* We may cross the frame boundary */
+ res = (bs.word << (32 - bs.left)) >> (32 - bs.left);
+ bits -= bs.left;
+
+ bs.word = *(++bs.data); /* Next 32bit frame */
+
+ if (bits) /* Add remaining bits, if any */
+ res = (res << bits) | (bs.word >> (32 - bits));
+
+# else /* not WORDS_BIGENDIAN */
+
+ if (bits < bs.left) { /* Within 32bit frame */
+ res = (bs.word << (32 - bits)) >> (32 - bits);
+ bs.word >>= bits;
+ bs.left -= bits;
+ goto out;
+ } /* We may cross the frame boundary */
+ res = bs.word;
+ bits -= bs.left;
+
+ bs.word = *(++bs.data); /* Next 32bit frame */
+
+ if (bits) { /* Add remaining bits, if any */
+ res = res | (((bs.word << (32 - bits)) >> (32 - bits)) << bits);
+ bs.word >>= bits;
+ }
+# endif /* not WORDS_BIGENDIAN */
+
+ bs.left = (32 - bits);
+out:
+ return res;
+}
+
+static inline u32 iec958_bits_avail(void)
+{
+ return bs.bits;
+}
+
+static inline int iec958_error(void)
+{
+ return bs.err;
+}
+
+/*
+ * Determine parity for time slots 4 upto 30
+ * to be sure that bit 4 upt 31 will carry
+ * an even number of ones and zeros.
+ */
+static u32 iec958_parity(u32 data)
+{
+ u32 parity = 0;
+ int counter = 4;
+
+ data >>= 4; /* start from bit 4 */
+ while (counter++ <= 30) {
+ if (data & 0x00000001)
+ parity++;
+ data >>= 1;
+ }
+ return (parity & 0x00000001);
+}
+
+/*
+ * Compose 32bit iec958 subframe, two sub frames
+ * build one frame with two channels.
+ *
+ * bit 0-3 = preamble
+ * 4-7 = AUX (=0)
+ * 8-27 = data (12-27 for 16bit, 8-27 for 20bit, and 24bit without AUX)
+ * 28 = validity (0 for valid data, else 'in error')
+ * 29 = user data (0)
+ * 30 = channel status (24 bytes for 192 frames)
+ * 31 = parity
+ */
+
+static inline u32 iec958_subframe(cmipci_t *cm, snd_ctl_elem_value_t * ucontrol)
+{
+ u32 data;
+ u32 byte = cm->spdif_counter >> 4;
+ u32 mask = 1 << ((cm->spdif_counter >> 1) - (byte << 3));
+ u8 * status = ucontrol->value.iec958.status;
+
+ if (status[2] & IEC958_AES2_PRO_SBITS_24) {
+ /* Does this work for LE systems ??? */
+ if (status[2] & IEC958_AES2_PRO_WORDLEN_24_20) {
+ data = iec958_getbits(24);
+ data <<= 4;
+ } else {
+ data = iec958_getbits(20);
+ data <<= 8;
+ }
+ } else {
+ if (status[2] & IEC958_AES2_PRO_WORDLEN_24_20) {
+ /* Does this work for LE systems ??? */
+ data = iec958_getbits(20);
+ data <<= 8;
+ } else {
+ data = iec958_getbits(16);
+ data <<= 12;
+ }
+ }
+
+ /*
+ * Set one of the 192 bits of the channel status (AES3 and higher)
+ */
+ if (status[byte] & mask)
+ data |= 0x40000000;
+
+ if (iec958_parity(data)) /* parity bit 4-30 */
+ data |= 0x80000000;
+
+ /* Preamble */
+ if (!cm->spdif_counter)
+ data |= 0x03; /* Block start, 'Z' */
+ else if (cm->spdif_counter % 2)
+ data |= 0x05; /* odd sub frame, 'Y' */
+ else
+ data |= 0x09; /* even sub frame, 'X' */
+
+ /*
+ * sub frame counter: 2 sub frame are one audio frame
+ * and 192 frames are one block
+ */
+ cm->spdif_counter = (++cm->spdif_counter) % 384;
+
+ return data;
+}
+# endif /* if USE_AES_IEC958 */
static int snd_cmipci_ac3_copy(snd_pcm_substream_t *subs, int channel,
snd_pcm_uframes_t pos, void *src,
@@ -842,9 +1150,15 @@ static int snd_cmipci_ac3_copy(snd_pcm_substream_t *subs, int channel,
{
cmipci_t *cm = snd_pcm_substream_chip(subs);
u32 *dst;
- u16 *srcp = src, val;
snd_pcm_uframes_t offset;
snd_pcm_runtime_t *runtime = subs->runtime;
+#ifndef USE_AES_IEC958
+ u16 *srcp = src, val;
+#else
+ char buf[1920]; /* bits can be divided by 20, 24, 16 */
+ size_t bytes = frames_to_bytes(runtime, count);
+#endif
+
if (!cm->channel[CM_CH_PLAY].ac3_shift) {
if (copy_from_user(runtime->dma_area +
@@ -860,14 +1174,34 @@ static int snd_cmipci_ac3_copy(snd_pcm_substream_t *subs, int channel,
/* frame = 16bit stereo */
offset = (pos << 1) % (cm->channel[CM_CH_PLAY].dma_size << 2);
dst = (u32*)(runtime->dma_area + offset);
-
+# ifndef USE_AES_IEC958
count /= 2;
while (count-- > 0) {
get_user(val, srcp);
srcp++;
*dst++ = convert_ac3_32bit(cm, val);
}
+# else
+ while (bytes) {
+ size_t c = bytes;
+
+ if (c > sizeof(buf))
+ c = sizeof(buf);
+ if (copy_from_user(buf, src, c))
+ return -EFAULT;
+ bytes -= c;
+ src += c;
+
+ iec958_init_bitstream(buf, c*8);
+ while (iec958_bits_avail()) {
+ *(dst++) = iec958_subframe(cm, cm->spdif_channel);
+ if (iec958_error())
+ return -EINVAL;
+ }
+ iec958_clear_bitstream();
+ }
+# endif
return 0;
}
@@ -879,7 +1213,10 @@ static int snd_cmipci_ac3_silence(snd_pcm_substream_t *subs, int channel,
u32 *dst;
snd_pcm_uframes_t offset;
snd_pcm_runtime_t *runtime = subs->runtime;
-
+# ifdef USE_AES_IEC958
+ char buf[1920]; /* bits can be divided by 20, 24, 16 */
+ size_t bytes = frames_to_bytes(runtime, count);
+# endif
if (! cm->channel[CM_CH_PLAY].ac3_shift)
return snd_pcm_format_set_silence(runtime->format,
runtime->dma_area + frames_to_bytes(runtime, pos), count);
@@ -887,12 +1224,31 @@ static int snd_cmipci_ac3_silence(snd_pcm_substream_t *subs, int channel,
/* frame = 16bit stereo */
offset = (pos << 1) % (cm->channel[CM_CH_PLAY].dma_size << 2);
dst = (u32*)(subs->runtime->dma_area + offset);
-
+# ifndef USE_AES_IEC958
count /= 2;
while (count-- > 0) {
*dst++ = convert_ac3_32bit(cm, 0);
}
+# else
+ while (bytes) {
+ size_t c = bytes;
+ if (c > sizeof(buf))
+ c = sizeof(buf);
+
+ /* Q: Does this function know about 24bit silence? */
+ if (snd_pcm_format_set_silence(runtime->format, buf, bytes_to_frames(runtime, c)))
+ return -EINVAL;
+
+ iec958_init_bitstream(buf, c*8);
+ while (iec958_bits_avail()) {
+ *(dst++) = iec958_subframe(cm, cm->spdif_channel);
+ if (iec958_error())
+ return -EINVAL;
+ }
+ iec958_clear_bitstream();
+ }
+# endif
return 0;
}
#endif /* DO_SOFT_AC3 */
@@ -996,6 +1352,9 @@ static int snd_cmipci_spdif_stream_get(snd_kcontrol_t *kcontrol,
spin_lock_irqsave(&chip->reg_lock, flags);
for (i = 0; i < 4; i++)
ucontrol->value.iec958.status[i] = (chip->dig_pcm_status >> (i * 8)) & 0xff;
+#ifdef USE_AES_IEC958
+ ucontrol = chip->spdif_channel;
+#endif
spin_unlock_irqrestore(&chip->reg_lock, flags);
return 0;
}
@@ -1014,6 +1373,9 @@ static int snd_cmipci_spdif_stream_put(snd_kcontrol_t *kcontrol,
val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8);
change = val != chip->dig_pcm_status;
chip->dig_pcm_status = val;
+#ifdef USE_AES_IEC958
+ chip->spdif_channel = ucontrol;
+#endif
spin_unlock_irqrestore(&chip->reg_lock, flags);
return change;
}
@@ -1128,9 +1490,11 @@ static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int r
if (cm->can_ac3_hw) {
snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_SPD24SEL);
} else {
+#ifdef DO_SOFT_AC3
snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL);
snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_SPD24SEL);
snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K);
+#endif /* DO_SOFT_AC3 */
}
}
}
@@ -1248,7 +1612,7 @@ static int snd_cmipci_capture_spdif_hw_free(snd_pcm_substream_t *subs)
static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return);
- unsigned int status;
+ unsigned int status, mask = 0;
/* fastpath out, to ease interrupt sharing */
status = snd_cmipci_read(cm, CM_REG_INT_STATUS);
@@ -1257,14 +1621,12 @@ static void snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* acknowledge interrupt */
spin_lock(&cm->reg_lock);
- if (status & CM_CHINT0) {
- snd_cmipci_clear_bit(cm, CM_REG_INT_HLDCLR, CM_CH0_INT_EN);
- snd_cmipci_set_bit(cm, CM_REG_INT_HLDCLR, CM_CH0_INT_EN);
- }
- if (status & CM_CHINT1) {
- snd_cmipci_clear_bit(cm, CM_REG_INT_HLDCLR, CM_CH1_INT_EN);
- snd_cmipci_set_bit(cm, CM_REG_INT_HLDCLR, CM_CH1_INT_EN);
- }
+ if (status & CM_CHINT0)
+ mask |= CM_CH0_INT_EN;
+ if (status & CM_CHINT1)
+ mask |= CM_CH1_INT_EN;
+ snd_cmipci_clear_bit(cm, CM_REG_INT_HLDCLR, mask);
+ snd_cmipci_set_bit(cm, CM_REG_INT_HLDCLR, mask);
spin_unlock(&cm->reg_lock);
if (cm->rmidi && (status & CM_UARTINT))
@@ -1419,6 +1781,7 @@ static void close_device_check(cmipci_t *cm, int mode)
down(&cm->open_mutex);
if (cm->opened[ch] == mode) {
+ snd_cmipci_ch_reset(cm, ch);
cm->channel[ch].running = 0;
cm->channel[ch].substream = NULL;
cm->opened[ch] = 0;
@@ -2144,9 +2507,8 @@ static snd_cmipci_switch_args_t cmipci_switch_arg_##sname = { \
DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask, xis_byte, xac3)
#if 0 /* these will be controlled in pcm device */
-DEFINE_BIT_SWITCH_ARG(spdif_in, CM_REG_FUNCTRL1, CM_SPDF_1, 0);
-DEFINE_BIT_SWITCH_ARG(spdif_0, CM_REG_FUNCTRL1, CM_SPDF_0, 0);
-DEFINE_BIT_SWITCH_ARG(spdo_48k, CM_REG_MISC_CTRL, CM_SPDF_AC97|CM_SPDIF48K, 0);
+DEFINE_BIT_SWITCH_ARG(spdif_in, CM_REG_FUNCTRL1, CM_SPDF_1, 0, 0);
+DEFINE_BIT_SWITCH_ARG(spdif_out, CM_REG_FUNCTRL1, CM_SPDF_0, 0, 0);
#endif
DEFINE_BIT_SWITCH_ARG(spdif_in_sel1, CM_REG_CHFORMAT, CM_SPDIF_SELECT1, 0, 0);
DEFINE_BIT_SWITCH_ARG(spdif_in_sel2, CM_REG_MISC_CTRL, CM_SPDIF_SELECT2, 0, 0);
@@ -2156,6 +2518,7 @@ DEFINE_BIT_SWITCH_ARG(spdi_valid, CM_REG_MISC, CM_SPDVALID, 1, 0);
DEFINE_BIT_SWITCH_ARG(spdif_copyright, CM_REG_LEGACY_CTRL, CM_SPDCOPYRHT, 0, 0);
DEFINE_BIT_SWITCH_ARG(spdif_dac_out, CM_REG_LEGACY_CTRL, CM_DAC2SPDO, 0, 1);
DEFINE_SWITCH_ARG(spdo_5v, CM_REG_MISC_CTRL, CM_SPDO5V, 0, 0, 0); /* inverse: 0 = 5V */
+// DEFINE_BIT_SWITCH_ARG(spdo_48k, CM_REG_MISC_CTRL, CM_SPDF_AC97|CM_SPDIF48K, 0, 1);
DEFINE_BIT_SWITCH_ARG(spdif_loop, CM_REG_FUNCTRL1, CM_SPDFLOOP, 0, 1);
DEFINE_BIT_SWITCH_ARG(spdi_monitor, CM_REG_MIXER1, CM_CDPLAY, 1, 0);
/* DEFINE_BIT_SWITCH_ARG(spdi_phase, CM_REG_CHFORMAT, CM_SPDIF_INVERSE, 0, 0); */
@@ -2228,8 +2591,7 @@ static snd_kcontrol_new_t snd_cmipci_mixer_switches[] __devinitdata = {
static snd_kcontrol_new_t snd_cmipci_8738_mixer_switches[] __devinitdata = {
#if 0 /* controlled in pcm device */
DEFINE_MIXER_SWITCH("IEC958 In Record", spdif_in),
- DEFINE_MIXER_SWITCH("IEC958 Out", spdif_0),
- DEFINE_MIXER_SWITCH("IEC958 Out 48KHz", spdo_48k),
+ DEFINE_MIXER_SWITCH("IEC958 Out", spdif_out),
DEFINE_MIXER_SWITCH("IEC958 Out To DAC", spdo2dac),
#endif
// DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable),
@@ -2242,6 +2604,7 @@ static snd_kcontrol_new_t snd_cmipci_8738_mixer_switches[] __devinitdata = {
DEFINE_MIXER_SWITCH("IEC958 In Valid", spdi_valid),
DEFINE_MIXER_SWITCH("IEC958 Copyright", spdif_copyright),
DEFINE_MIXER_SWITCH("IEC958 5V", spdo_5v),
+// DEFINE_MIXER_SWITCH("IEC958 In/Out 48KHz", spdo_48k),
DEFINE_MIXER_SWITCH("IEC958 Loop", spdif_loop),
DEFINE_MIXER_SWITCH("IEC958 In Monitor", spdi_monitor),
};
@@ -2475,6 +2838,8 @@ static int snd_cmipci_free(cmipci_t *cm)
snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_FM_EN);
snd_cmipci_clear_bit(cm, CM_REG_LEGACY_CTRL, CM_ENSPDOUT);
snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); /* disable ints */
+ snd_cmipci_ch_reset(cm, CM_CH_PLAY);
+ snd_cmipci_ch_reset(cm, CM_CH_CAPT);
snd_cmipci_write(cm, CM_REG_FUNCTRL0, 0); /* disable channels */
snd_cmipci_write(cm, CM_REG_FUNCTRL1, 0);
@@ -2547,7 +2912,6 @@ static int __devinit snd_cmipci_create(snd_card_t *card,
pci_set_master(cm->pci);
-
/*
* check chip version, max channels and capabilities
*/
@@ -2568,6 +2932,8 @@ static int __devinit snd_cmipci_create(snd_card_t *card,
/* initialize codec registers */
snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); /* disable ints */
+ snd_cmipci_ch_reset(cm, CM_CH_PLAY);
+ snd_cmipci_ch_reset(cm, CM_CH_CAPT);
snd_cmipci_write(cm, CM_REG_FUNCTRL0, 0); /* disable channels */
snd_cmipci_write(cm, CM_REG_FUNCTRL1, 0);
@@ -2578,6 +2944,30 @@ static int __devinit snd_cmipci_create(snd_card_t *card,
#else
snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_XCHGDAC);
#endif
+ /* Set Bus Master Request */
+ snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_BREQ);
+
+ /* Assume TX and compatible chip set (Autodetection required for VX chip sets) */
+ switch (pci->device) {
+ struct list_head *pos;
+ int txvx;
+ case PCI_DEVICE_ID_CMEDIA_CM8738:
+ case PCI_DEVICE_ID_CMEDIA_CM8738B:
+ txvx = 1;
+ list_for_each(pos, &(pci->global_list)) {
+ struct pci_dev * cur = list_entry(pos, struct pci_dev, global_list);
+ if (cur->vendor != 0x8086) /* PCI_VENDOR_ID_INTEL */
+ continue;
+ if (cur->device != 0x7030) /* PCI_DEVICE_ID_INTEL_82437VX */
+ continue;
+ txvx = 0;
+ }
+ if (txvx)
+ snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX);
+ break;
+ default:
+ break;
+ }
/* set MPU address */
switch (iomidi) {
@@ -2663,6 +3053,15 @@ static int __devinit snd_cmipci_create(snd_card_t *card,
snd_cmipci_free(cm);
return err;
}
+#ifdef USE_VAR48KRATE
+ for (val = 0; val < RATES; val++)
+ snd_cmipci_set_pll(cm, rates[val], val);
+
+ /*
+ * (Re-)Enable external switch spdo_48k
+ */
+ snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPDIF48K|CM_SPDF_AC97);
+#endif /* USE_VAR48KRATE */
*rcmipci = cm;
return 0;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 3386309de70e..3185a948c546 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -735,12 +735,14 @@ static int snd_cs4281_trigger(snd_pcm_substream_t *substream, int cmd)
dma->valFCR &= ~BA0_FCR_FEN;
break;
case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
snd_cs4281_pokeBA0(chip, dma->regDMR, dma->valDMR & ~BA0_DMR_DMA);
dma->valDMR |= BA0_DMR_DMA;
dma->valDCR &= ~BA0_DCR_MSK;
dma->valFCR |= BA0_FCR_FEN;
break;
case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
dma->valDMR &= ~(BA0_DMR_DMA|BA0_DMR_POLL);
dma->valDCR |= BA0_DCR_MSK;
dma->valFCR &= ~BA0_FCR_FEN;
@@ -900,6 +902,7 @@ static snd_pcm_hardware_t snd_cs4281_playback =
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
@@ -925,6 +928,7 @@ static snd_pcm_hardware_t snd_cs4281_capture =
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
@@ -1804,7 +1808,7 @@ static int snd_cs4281_midi_output_open(snd_rawmidi_substream_t * substream)
spin_lock_irqsave(&chip->reg_lock, flags);
chip->uartm |= CS4281_MODE_OUTPUT;
chip->midcr |= BA0_MIDCR_TXE;
- chip->midi_input = substream;
+ chip->midi_output = substream;
if (!(chip->uartm & CS4281_MODE_INPUT)) {
snd_cs4281_midi_reset(chip);
} else {
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 182491f8cb27..03bd93443ec5 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -849,7 +849,7 @@ static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_
cpcm->hw_io = ptr;
cpcm->hw_ready -= bytes;
cpcm->sw_io += bytes;
- if (cpcm->sw_io > cpcm->sw_bufsize)
+ if (cpcm->sw_io >= cpcm->sw_bufsize)
cpcm->sw_io -= cpcm->sw_bufsize;
snd_cs46xx_playback_transfer(substream, 0);
return cpcm->sw_io >> cpcm->shift;
@@ -874,7 +874,7 @@ static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(snd_pcm_substream_t
chip->capt.hw_io = ptr;
chip->capt.hw_ready += bytes;
chip->capt.sw_io += bytes;
- if (chip->capt.sw_io > chip->capt.sw_bufsize)
+ if (chip->capt.sw_io >= chip->capt.sw_bufsize)
chip->capt.sw_io -= chip->capt.sw_bufsize;
snd_cs46xx_capture_transfer(substream, 0);
return chip->capt.sw_io >> chip->capt.shift;
@@ -950,15 +950,15 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
+ /* magic value to unmute PCM stream playback volume */
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ SCBVolumeCtrl) << 2, 0x80008000);
+
if (cpcm->pcm_channel->unlinked)
cs46xx_dsp_pcm_link(chip,cpcm->pcm_channel);
+
if (substream->runtime->periods != CS46XX_FRAGS)
snd_cs46xx_playback_transfer(substream, 0);
-
- /* raise playback volume */
- cs46xx_dsp_scb_set_volume (chip,cpcm->pcm_channel->pcm_reader_scb,
- chip->dsp_spos_instance->dac_volume_right,
- chip->dsp_spos_instance->dac_volume_left);
#else
if (substream->runtime->periods != CS46XX_FRAGS)
snd_cs46xx_playback_transfer(substream, 0);
@@ -972,8 +972,9 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- /* mute channel */
- cs46xx_dsp_scb_set_volume (chip,cpcm->pcm_channel->pcm_reader_scb,0,0);
+ /* magic mute channel */
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ SCBVolumeCtrl) << 2, 0xffffffff);
if (!cpcm->pcm_channel->unlinked)
cs46xx_dsp_pcm_unlink(chip,cpcm->pcm_channel);
@@ -1031,32 +1032,27 @@ static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream,
static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm,
int sample_rate)
{
- /* if this is the only PCMReaderSCB child under current
- SrcTask then there no need to re-create pcm-channel */
- if ( cpcm->pcm_channel->src_scb->ref_count == 1 &&
- cpcm->pcm_channel->sample_rate != sample_rate &&
- /* never set a 0 khz sample rate */
- sample_rate) {
- /* sample rate not set or we can reuse
- the same SRC*/
- cs46xx_dsp_set_src_sample_rate (chip,cpcm->pcm_channel->src_scb,sample_rate);
+
+ /* If PCMReaderSCB and SrcTaskSCB not created yet ... */
+ if ( cpcm->pcm_channel == NULL) {
+ cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate,
+ cpcm, cpcm->hw_addr,cpcm->pcm_channel_id);
+ if (cpcm->pcm_channel == NULL) {
+ snd_printk(KERN_ERR "cs46xx: failed to create virtual PCM channel\n");
+ return -ENOMEM;
+ }
cpcm->pcm_channel->sample_rate = sample_rate;
- }
-
- /* if there is more then 1 PCMReaderSCB child's under current
- SrcTask then we must recreate channel */
- if (cpcm->pcm_channel->sample_rate != sample_rate &&
- cpcm->pcm_channel->src_scb->ref_count != 1 &&
- /* never set a 0 khz sample rate */
- sample_rate) {
+ } else
+ /* if sample rate is changed */
+ if (cpcm->pcm_channel->sample_rate != sample_rate) {
int unlinked = cpcm->pcm_channel->unlinked;
cs46xx_dsp_destroy_pcm_channel (chip,cpcm->pcm_channel);
if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm,
cpcm->hw_addr,
- cpcm->pcm_channel->pcm_channel_id)) == NULL) {
+ cpcm->pcm_channel_id)) == NULL) {
snd_printk(KERN_ERR "cs46xx: failed to re-create virtual PCM channel\n");
- return -ENXIO;
+ return -ENOMEM;
}
if (!unlinked) cs46xx_dsp_pcm_link (chip,cpcm->pcm_channel);
@@ -1067,6 +1063,7 @@ static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm,
}
#endif
+
static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
snd_pcm_hw_params_t * hw_params)
{
@@ -1080,18 +1077,19 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
cpcm = snd_magic_cast(cs46xx_pcm_t, runtime->private_data, return -ENXIO);
#ifdef CONFIG_SND_CS46XX_NEW_DSP
+ snd_assert (sample_rate != 0, return -ENXIO);
+
down (&chip->spos_mutex);
- snd_assert (cpcm->pcm_channel != NULL);
+ if (_cs46xx_adjust_sample_rate (chip,cpcm,sample_rate)) {
+ up (&chip->spos_mutex);
+ return -ENXIO;
+ }
- /* if IEC958 is opened in AC3 mode dont adjust SRCTask is not
- used so dont adjust sample rate */
- if (cpcm->pcm_channel->pcm_channel_id != DSP_IEC958_CHANNEL ||
- !(chip->dsp_spos_instance->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE)) {
- if (_cs46xx_adjust_sample_rate (chip,cpcm,sample_rate)) {
- up (&chip->spos_mutex);
- return -ENXIO;
- }
+ snd_assert (cpcm->pcm_channel != NULL);
+ if (!cpcm->pcm_channel) {
+ up (&chip->spos_mutex);
+ return -ENXIO;
}
if (cs46xx_dsp_pcm_channel_set_period (chip,cpcm->pcm_channel,period_size * 4)) {
@@ -1111,11 +1109,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- if (cpcm->pcm_channel->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
+ if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
substream->ops = &snd_cs46xx_playback_ops;
- } else if (cpcm->pcm_channel->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
+ } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
substream->ops = &snd_cs46xx_playback_rear_ops;
- } else if (cpcm->pcm_channel->pcm_channel_id == DSP_IEC958_CHANNEL) {
+ } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) {
substream->ops = &snd_cs46xx_playback_iec958_ops;
} else {
snd_assert(0);
@@ -1138,11 +1136,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- if (cpcm->pcm_channel->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
+ if (cpcm->pcm_channel_id == DSP_PCM_MAIN_CHANNEL) {
substream->ops = &snd_cs46xx_playback_indirect_ops;
- } else if (cpcm->pcm_channel->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
+ } else if (cpcm->pcm_channel_id == DSP_PCM_REAR_CHANNEL) {
substream->ops = &snd_cs46xx_playback_indirect_rear_ops;
- } else if (cpcm->pcm_channel->pcm_channel_id == DSP_IEC958_CHANNEL) {
+ } else if (cpcm->pcm_channel_id == DSP_IEC958_CHANNEL) {
substream->ops = &snd_cs46xx_playback_indirect_iec958_ops;
} else {
snd_assert(0);
@@ -1168,6 +1166,10 @@ static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream)
cpcm = snd_magic_cast(cs46xx_pcm_t, runtime->private_data, return -ENXIO);
+ /* if play_back open fails, then this function
+ is called and cpcm can actually be NULL here */
+ if (!cpcm) return -ENXIO;
+
if (runtime->dma_area != cpcm->hw_area)
snd_pcm_lib_free_pages(substream);
@@ -1485,15 +1487,8 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc
cpcm->substream = substream;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
down (&chip->spos_mutex);
- cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, runtime->rate, cpcm, cpcm->hw_addr,pcm_channel_id);
-
- if (cpcm->pcm_channel == NULL) {
- snd_printk(KERN_ERR "cs46xx: failed to create virtual PCM channel\n");
- snd_free_pci_pages(chip->pci, cpcm->hw_size, cpcm->hw_area, cpcm->hw_addr);
- snd_magic_kfree(cpcm);
- up (&chip->spos_mutex);
- return -ENOMEM;
- }
+ cpcm->pcm_channel = NULL;
+ cpcm->pcm_channel_id = pcm_channel_id;
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
&hw_constraints_period_sizes);
@@ -1586,6 +1581,9 @@ static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream)
cpcm = snd_magic_cast(cs46xx_pcm_t, runtime->private_data, return -ENXIO);
+ /* when playback_open fails, then cpcm can be NULL */
+ if (!cpcm) return -ENXIO;
+
#ifdef CONFIG_SND_CS46XX_NEW_DSP
down (&chip->spos_mutex);
if (cpcm->pcm_channel) {
@@ -1890,8 +1888,8 @@ static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
{
cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_right;
- ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_left;
+ ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_left;
+ ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right;
return 0;
}
@@ -1916,8 +1914,8 @@ static int snd_cs46xx_vol_iec958_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_val
{
cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_right;
- ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_left;
+ ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_left;
+ ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right;
return 0;
}
@@ -1926,8 +1924,8 @@ static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_val
cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
int change = 0;
- if (chip->dsp_spos_instance->spdif_input_volume_right != ucontrol->value.integer.value[0] ||
- chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[1]) {
+ if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] ||
+ chip->dsp_spos_instance->spdif_input_volume_right!= ucontrol->value.integer.value[1]) {
cs46xx_dsp_set_iec958_volume (chip,
ucontrol->value.integer.value[0],
ucontrol->value.integer.value[1]);
@@ -2042,34 +2040,6 @@ static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol,
return 0;
}
-static int snd_cs46xx_iec958_ac3_mode_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
-{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
-
- if (!ins->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE)
- ucontrol->value.integer.value[0] = 1;
- else
- ucontrol->value.integer.value[0] = 0;
-
- return 0;
-}
-
-static int snd_cs46xx_iec958_ac3_mode_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
-{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
- int old = ins->spdif_status_out;
-
- if (ucontrol->value.integer.value[0])
- ins->spdif_status_out |= DSP_SPDIF_STATUS_AC3_MODE;
- else
- ins->spdif_status_out &= ~DSP_SPDIF_STATUS_AC3_MODE;
-
- return (old != ins->spdif_status_out);
-}
static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol,
snd_ctl_elem_value_t *ucontrol)
@@ -2131,8 +2101,113 @@ static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol,
return (val1 != snd_cs46xx_peekBA0(chip, BA0_EGPIODR));
}
+
+static int snd_cs46xx_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
+ uinfo->count = 1;
+ return 0;
+}
+
+static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol,
+ snd_ctl_elem_value_t * ucontrol)
+{
+ cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+
+ down (&chip->spos_mutex);
+ ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
+ ucontrol->value.iec958.status[1] = _wrap_all_bits((ins->spdif_csuv_default >> 16) & 0xff);
+ ucontrol->value.iec958.status[2] = 0;
+ ucontrol->value.iec958.status[3] = _wrap_all_bits((ins->spdif_csuv_default) & 0xff);
+ up (&chip->spos_mutex);
+
+ return 0;
+}
+
+static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol,
+ snd_ctl_elem_value_t * ucontrol)
+{
+ cs46xx_t * chip = snd_kcontrol_chip(kcontrol);
+ dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ unsigned int val;
+ int change;
+
+ down (&chip->spos_mutex);
+ val = _wrap_all_bits(((u32)ucontrol->value.iec958.status[0] << 24)) |
+ _wrap_all_bits(((u32)ucontrol->value.iec958.status[2] << 16)) |
+ _wrap_all_bits( (u32)ucontrol->value.iec958.status[3]) |
+ /* left and right validity bit */
+ (1 << 13) | (1 << 12);
+
+
+ change = ins->spdif_csuv_default != val;
+ ins->spdif_csuv_default = val;
+
+ if ( !(ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) )
+ cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
+
+ up (&chip->spos_mutex);
+
+ return change;
+}
+
+static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol,
+ snd_ctl_elem_value_t * ucontrol)
+{
+ ucontrol->value.iec958.status[0] = 0xff;
+ ucontrol->value.iec958.status[1] = 0xff;
+ ucontrol->value.iec958.status[2] = 0x00;
+ ucontrol->value.iec958.status[3] = 0xff;
+ return 0;
+}
+
+static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol,
+ snd_ctl_elem_value_t * ucontrol)
+{
+ cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+
+ down (&chip->spos_mutex);
+ ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
+ ucontrol->value.iec958.status[1] = _wrap_all_bits((ins->spdif_csuv_stream >> 16) & 0xff);
+ ucontrol->value.iec958.status[2] = 0;
+ ucontrol->value.iec958.status[3] = _wrap_all_bits((ins->spdif_csuv_stream) & 0xff);
+ up (&chip->spos_mutex);
+
+ return 0;
+}
+
+static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol,
+ snd_ctl_elem_value_t * ucontrol)
+{
+ cs46xx_t * chip = snd_kcontrol_chip(kcontrol);
+ dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ unsigned int val;
+ int change;
+
+ down (&chip->spos_mutex);
+ val = _wrap_all_bits(((u32)ucontrol->value.iec958.status[0] << 24)) |
+ _wrap_all_bits(((u32)ucontrol->value.iec958.status[1] << 16)) |
+ _wrap_all_bits( (u32)ucontrol->value.iec958.status[3]) |
+ /* left and right validity bit */
+ (1 << 13) | (1 << 12);
+
+
+ change = ins->spdif_csuv_stream != val;
+ ins->spdif_csuv_stream = val;
+
+ if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN )
+ cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
+
+ up (&chip->spos_mutex);
+
+ return change;
+}
+
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
+
#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol,
snd_ctl_elem_info_t *uinfo)
@@ -2242,7 +2317,7 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC 958 Output Switch",
+ .name = "IEC958 Output Switch",
.info = snd_mixer_boolean_info,
.get = snd_cs46xx_iec958_get,
.put = snd_cs46xx_iec958_put,
@@ -2250,14 +2325,7 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC 958 AC3 Mode Switch",
- .info = snd_mixer_boolean_info,
- .get = snd_cs46xx_iec958_ac3_mode_get,
- .put = snd_cs46xx_iec958_ac3_mode_put,
-},
-{
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC 958 Input Switch",
+ .name = "IEC958 Input Switch",
.info = snd_mixer_boolean_info,
.get = snd_cs46xx_iec958_get,
.put = snd_cs46xx_iec958_put,
@@ -2265,12 +2333,34 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC 958 Input Volume",
+ .name = "IEC958 Input Volume",
.info = snd_cs46xx_vol_info,
.get = snd_cs46xx_vol_iec958_get,
.put = snd_cs46xx_vol_iec958_put,
.private_value = (ASYNCRX_SCB_ADDR + 0xE) << 2,
},
+{
+ .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+ .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+ .info = snd_cs46xx_spdif_info,
+ .get = snd_cs46xx_spdif_default_get,
+ .put = snd_cs46xx_spdif_default_put,
+},
+{
+ .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+ .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
+ .info = snd_cs46xx_spdif_info,
+ .get = snd_cs46xx_spdif_mask_get,
+ .access = SNDRV_CTL_ELEM_ACCESS_READ
+},
+{
+ .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+ .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
+ .info = snd_cs46xx_spdif_info,
+ .get = snd_cs46xx_spdif_stream_get,
+ .put = snd_cs46xx_spdif_stream_put
+},
+
#endif
#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
{
@@ -3243,8 +3333,8 @@ int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* set the attenuation to 0dB */
- snd_cs46xx_poke(chip, (MASTERMIX_SCB_ADDR + 0xE) << 2, 0x80008000);
- snd_cs46xx_poke(chip, (VARIDECIMATE_SCB_ADDR + 0xE) << 2, 0x80008000);
+ /* snd_cs46xx_poke(chip, (MASTERMIX_SCB_ADDR + 0xE) << 2, 0x80008000);
+ snd_cs46xx_poke(chip, (VARIDECIMATE_SCB_ADDR + 0xE) << 2, 0x80008000); */
/*
* Initialize cs46xx SPDIF controller
@@ -3601,7 +3691,7 @@ struct cs_card_type
void (*mixer_init)(cs46xx_t *);
};
-static struct cs_card_type __initdata cards[] = {
+static struct cs_card_type __devinitdata cards[] = {
{0x1489, 0x7001, "Genius Soundmaker 128 value", NULL, amp_none, NULL, NULL},
{0x5053, 0x3357, "Voyetra", NULL, amp_voyetra, NULL, voyetra_mixer_init},
{0x1071, 0x6003, "Mitac MI6020/21", NULL, amp_voyetra, NULL, NULL},
diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h
index 53694dfd5bbb..b6e2282a2e89 100644
--- a/sound/pci/cs46xx/cs46xx_lib.h
+++ b/sound/pci/cs46xx/cs46xx_lib.h
@@ -152,6 +152,7 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * s
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
+ int sample_rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
@@ -202,8 +203,6 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,u32 sa
int pcm_channel_id);
void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,
pcm_channel_descriptor_t * pcm_channel);
-void cs46xx_dsp_set_src_sample_rate(cs46xx_t * chip,dsp_scb_descriptor_t * src,
- u32 rate);
int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel);
int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel);
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source,
@@ -217,6 +216,6 @@ int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
int period_size);
int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
int period_size);
-int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 right,u16 left);
-int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 right,u16 left);
+int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right);
+int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right);
#endif /* __CS46XX_LIB_H__ */
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index 6a3b05de6b1a..50bae3c9c9e4 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -31,6 +31,7 @@
#include <sound/core.h>
#include <sound/control.h>
#include <sound/info.h>
+#include <sound/asoundef.h>
#include <sound/cs46xx.h>
#include "cs46xx_lib.h"
@@ -262,6 +263,15 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
ins->spdif_input_volume_right = 0x8000;
ins->spdif_input_volume_left = 0x8000;
+ /* set left and right validity bits and
+ default channel status */
+ ins->spdif_csuv_default =
+ ins->spdif_csuv_stream =
+ /* byte 0 */ (_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF & 0xff)) << 24) |
+ /* byte 1 */ (_wrap_all_bits( ((SNDRV_PCM_DEFAULT_CON_SPDIF >> 16) & 0xff)) << 16) |
+ /* byte 3 */ _wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF >> 24) & 0xff) |
+ /* left and right validity bits */ (1 << 13) | (1 << 12);
+
return ins;
}
@@ -605,7 +615,7 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"\nMIX_SAMPLE_BUF1:\n");
col = 0;
- for (i = MIX_SAMPLE_BUF1;i < MIX_SAMPLE_BUF1 + 0x30; i += sizeof(u32),col ++) {
+ for (i = MIX_SAMPLE_BUF1;i < MIX_SAMPLE_BUF1 + 0x40; i += sizeof(u32),col ++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -618,14 +628,14 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"%08X ",readl(dst + i));
}
- snd_iprintf(buffer,"\n\n");
+ snd_iprintf(buffer,"\nSRC_TASK_SCB1:\n");
col = 0;
- for (i = SPDIFI_IP_OUTPUT_BUFFER1;i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = 0x2580 ; i < 0x2580 + 0x40 ; i += sizeof(u32),col ++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
-
+
if (col == 0) {
snd_iprintf(buffer, "%04X ",i);
}
@@ -636,7 +646,7 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"\nSPDIFO_BUFFER:\n");
col = 0;
- for (i = SPDIFO_IP_OUTPUT_BUFFER1;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = SPDIFO_IP_OUTPUT_BUFFER1;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x30; i += sizeof(u32),col ++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -695,7 +705,7 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"%08X ",readl(dst + i));
}
-
+#if 0
snd_iprintf(buffer,"\nWRITE_BACK_BUF1: \n");
col = 0;
for (i = WRITE_BACK_BUF1;i < WRITE_BACK_BUF1 + 0x40; i += sizeof(u32),col ++) {
@@ -710,7 +720,22 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"%08X ",readl(dst + i));
}
+#endif
+ snd_iprintf(buffer,"\nSPDIFI_IP_OUTPUT_BUFFER1: \n");
+ col = 0;
+ for (i = SPDIFI_IP_OUTPUT_BUFFER1;i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x80; i += sizeof(u32),col ++) {
+ if (col == 4) {
+ snd_iprintf(buffer,"\n");
+ col = 0;
+ }
+
+ if (col == 0) {
+ snd_iprintf(buffer, "%04X ",i);
+ }
+
+ snd_iprintf(buffer,"%08X ",readl(dst + i));
+ }
snd_iprintf(buffer,"\n");
}
@@ -1346,6 +1371,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
/* SPDIF input sampel rate converter */
src_task_scb = cs46xx_dsp_create_src_task_scb(chip,"SrcTaskSCB_SPDIFI",
+ 48000,
SRC_OUTPUT_BUF1,
SRC_DELAY_BUF1,SRCTASK_SCB_ADDR,
master_mix_scb,
@@ -1549,7 +1575,7 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip)
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CONTROL, 0x80000000);
/* right and left validate bit */
- cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, 0x00000000 | (1 << 13) | (1 << 12));
+ cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, ins->spdif_csuv_default);
/* monitor state */
ins->spdif_status_out |= DSP_SPDIF_STATUS_HW_ENABLED;
@@ -1587,16 +1613,14 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip)
cs46xx_poke_via_dsp (chip,SP_SPDIN_FIFOPTR, 0x0);
cs46xx_src_link(chip,ins->spdif_in_src);
- /* restore SPDIF input volume */
- cs46xx_dsp_scb_set_volume (chip,ins->spdif_in_src,
- ins->spdif_input_volume_right,
- ins->spdif_input_volume_left);
+ /* unmute SRC volume */
+ cs46xx_dsp_scb_set_volume (chip,ins->spdif_in_src,0x7fff,0x7fff);
spin_unlock_irq(&chip->reg_lock);
/* set SPDIF input sample rate and unmute
NOTE: only 48khz support for SPDIF input this time */
- cs46xx_dsp_set_src_sample_rate(chip,ins->spdif_in_src,48000);
+ /* cs46xx_dsp_set_src_sample_rate(chip,ins->spdif_in_src,48000); */
/* monitor state */
ins->spdif_status_in = 1;
@@ -1725,39 +1749,47 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data)
return 0;
}
-int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 right,u16 left)
+int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right)
{
- int i;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ dsp_scb_descriptor_t * scb;
down(&chip->spos_mutex);
+
+ /* main output */
+ scb = ins->master_mix_scb->sub_list_ptr;
+ while (scb != ins->the_null_scb) {
+ cs46xx_dsp_scb_set_volume (chip,scb,left,right);
+ scb = scb->next_scb_ptr;
+ }
- ins->dac_volume_right = right;
- ins->dac_volume_left = left;
-
- for (i = 0; i < DSP_MAX_PCM_CHANNELS; ++i) {
- if (ins->pcm_channels[i].active &&
- !ins->pcm_channels[i].unlinked) {
- cs46xx_dsp_scb_set_volume (chip,ins->pcm_channels[i].pcm_reader_scb,
- right,left);
-
- }
+ /* rear output */
+ scb = ins->rear_mix_scb->sub_list_ptr;
+ while (scb != ins->the_null_scb) {
+ cs46xx_dsp_scb_set_volume (chip,scb,left,right);
+ scb = scb->next_scb_ptr;
}
+ ins->dac_volume_left = left;
+ ins->dac_volume_right = right;
+
up(&chip->spos_mutex);
return 0;
}
-int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 right,u16 left) {
+int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right) {
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
down(&chip->spos_mutex);
- cs46xx_dsp_scb_set_volume (chip,ins->spdif_in_src,
- right,left);
- ins->spdif_input_volume_right = right;
+ if (ins->asynch_rx_scb != NULL)
+ cs46xx_dsp_scb_set_volume (chip,ins->asynch_rx_scb,
+ left,right);
+
ins->spdif_input_volume_left = left;
+ ins->spdif_input_volume_right = right;
+
up(&chip->spos_mutex);
return 0;
diff --git a/sound/pci/cs46xx/dsp_spos.h b/sound/pci/cs46xx/dsp_spos.h
index 1dfba850c687..a3681552212b 100644
--- a/sound/pci/cs46xx/dsp_spos.h
+++ b/sound/pci/cs46xx/dsp_spos.h
@@ -185,6 +185,25 @@ typedef enum {
#define SP_SPDOUT_CONTROL 0x804D
#define SP_SPDOUT_CSUV 0x808E
+static inline u8 _wrap_all_bits (u8 val) {
+ u8 wrapped;
+
+ /* wrap all 8 bits */
+ wrapped =
+ ((val & 0x1 ) << 7) |
+ ((val & 0x2 ) << 5) |
+ ((val & 0x4 ) << 3) |
+ ((val & 0x8 ) << 1) |
+ ((val & 0x10) >> 1) |
+ ((val & 0x20) >> 3) |
+ ((val & 0x40) >> 5) |
+ ((val & 0x80) >> 7);
+
+ return wrapped;
+
+}
+
+
static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descriptor_t * scb)
{
/* update nextSCB and subListPtr in SCB */
@@ -195,12 +214,11 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto
}
static inline void cs46xx_dsp_scb_set_volume (cs46xx_t * chip,dsp_scb_descriptor_t * scb,
- u16 right,u16 left) {
- unsigned int val = ((0xffff - right) << 16 | (0xffff - left));
+ u16 left,u16 right) {
+ unsigned int val = ((0xffff - left) << 16 | (0xffff - right));
snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val);
snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl + 1) << 2, val);
}
-
#endif /* __DSP_SPOS_H__ */
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index b08ba01f51c0..ba47a98fd200 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -576,8 +576,11 @@ cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name,
return scb;
}
+#define GOF_PER_SEC 200
+
dsp_scb_descriptor_t *
cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
+ int rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
@@ -586,45 +589,81 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
-
- src_task_scb_t src_task_scb = {
- 0x0028,0x00c8,
- 0x5555,0x0000,
- 0x0000,0x0000,
- src_buffer_addr,1,
- 0x0028,0x00c8,
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
- 0x0000,src_delay_buffer_addr,
- 0x0,
- 0x80,(src_delay_buffer_addr + (24 * 4)),
- 0,0, /* next_scb, sub_list_ptr */
- 0,0, /* entry, this_spb */
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
- src_buffer_addr << 0x10,
- 0x04000000,
- {
- 0x8000,0x8000,
- 0xffff,0xffff
- }
- };
+ unsigned int tmp1, tmp2;
+ unsigned int phiIncr;
+ unsigned int correctionPerGOF, correctionPerSec;
- if (ins->s16_up == NULL) {
- ins->s16_up = cs46xx_dsp_lookup_symbol (chip,"S16_UPSRC",
- SYMBOL_CODE);
-
- if (ins->s16_up == NULL) {
- snd_printk (KERN_ERR "dsp_spos: symbol S16_UPSRC not found\n");
- return NULL;
- }
- }
+ snd_printdd( "dsp_spos: setting %s rate to %u\n",scb_name,rate);
- /* clear buffers */
- _dsp_clear_sample_buffer (chip,src_buffer_addr,8);
- _dsp_clear_sample_buffer (chip,src_delay_buffer_addr,32);
+ /*
+ * Compute the values used to drive the actual sample rate conversion.
+ * The following formulas are being computed, using inline assembly
+ * since we need to use 64 bit arithmetic to compute the values:
+ *
+ * phiIncr = floor((Fs,in * 2^26) / Fs,out)
+ * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) /
+ * GOF_PER_SEC)
+ * ulCorrectionPerSec = Fs,in * 2^26 - Fs,out * phiIncr -M
+ * GOF_PER_SEC * correctionPerGOF
+ *
+ * i.e.
+ *
+ * phiIncr:other = dividend:remainder((Fs,in * 2^26) / Fs,out)
+ * correctionPerGOF:correctionPerSec =
+ * dividend:remainder(ulOther / GOF_PER_SEC)
+ */
+ tmp1 = rate << 16;
+ phiIncr = tmp1 / 48000;
+ tmp1 -= phiIncr * 48000;
+ tmp1 <<= 10;
+ phiIncr <<= 10;
+ tmp2 = tmp1 / 48000;
+ phiIncr += tmp2;
+ tmp1 -= tmp2 * 48000;
+ correctionPerGOF = tmp1 / GOF_PER_SEC;
+ tmp1 -= correctionPerGOF * GOF_PER_SEC;
+ correctionPerSec = tmp1;
- scb = _dsp_create_generic_scb(chip,scb_name,(u32 *)&src_task_scb,
- dest,ins->s16_up,parent_scb,
- scb_child_type);
+ {
+ src_task_scb_t src_task_scb = {
+ 0x0028,0x00c8,
+ 0x5555,0x0000,
+ 0x0000,0x0000,
+ src_buffer_addr,1,
+ correctionPerGOF,correctionPerSec,
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
+ 0x0000,src_delay_buffer_addr,
+ 0x0,
+ 0x080,(src_delay_buffer_addr + (24 * 4)),
+ 0,0, /* next_scb, sub_list_ptr */
+ 0,0, /* entry, this_spb */
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
+ src_buffer_addr << 0x10,
+ phiIncr,
+ {
+ 0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left,
+ 0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left
+ }
+ };
+
+ if (ins->s16_up == NULL) {
+ ins->s16_up = cs46xx_dsp_lookup_symbol (chip,"S16_UPSRC",
+ SYMBOL_CODE);
+
+ if (ins->s16_up == NULL) {
+ snd_printk (KERN_ERR "dsp_spos: symbol S16_UPSRC not found\n");
+ return NULL;
+ }
+ }
+
+ /* clear buffers */
+ _dsp_clear_sample_buffer (chip,src_buffer_addr,8);
+ _dsp_clear_sample_buffer (chip,src_delay_buffer_addr,32);
+
+ scb = _dsp_create_generic_scb(chip,scb_name,(u32 *)&src_task_scb,
+ dest,ins->s16_up,parent_scb,
+ scb_child_type);
+ }
return scb;
}
@@ -658,7 +697,7 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
/* D */ 0,
{
/* E */ 0x8000,0x8000,
- /* F */ 0xffff,0xffff
+ /* F */ 0x8000,0x8000
}
};
@@ -796,7 +835,7 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest,
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_16,
0,
- 0,input_scb->address,
+ 0,input_scb->address,
{
0x8000,0x8000,
0x8000,0x8000
@@ -830,7 +869,7 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
0,0x2aab, /* Const 1/3 */
{
- 0, /* Define the unused elements */
+ 0, /* Define the unused elements */
0,
0
},
@@ -846,7 +885,7 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
rate etc */
0x18000000, /* Phi increment for approx 32k operation */
0x8000,0x8000, /* Volume controls are unused at this time */
- 0xffff,0xffff
+ 0x8000,0x8000
};
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&asynch_fg_tx_scb,
@@ -864,7 +903,7 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type)
{
-
+ dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
asynch_fg_rx_scb_t asynch_fg_rx_scb = {
@@ -893,9 +932,9 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
rate etc */
0x18000000,
- /* Mute stream */
- 0x8000,0x8000,
- 0xffff,0xffff
+ /* Set IEC958 input volume */
+ 0xffff - ins->spdif_input_volume_right,0xffff - ins->spdif_input_volume_left,
+ 0xffff - ins->spdif_input_volume_right,0xffff - ins->spdif_input_volume_left,
};
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&asynch_fg_rx_scb,
@@ -1007,7 +1046,7 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char *
/* C */ snoop_buffer_address << 0x10,
/* D */ 0,
/* E */ { 0x8000,0x8000,
- /* F */ 0xffff,0xffff
+ /* F */ 0xffff,0xffff
}
};
@@ -1093,6 +1132,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * src_scb = NULL,* pcm_scb, * mixer_scb = NULL;
+ dsp_scb_descriptor_t * src_parent_scb = NULL;
+
/*dsp_scb_descriptor_t * pcm_parent_scb;*/
char scb_name[DSP_MAX_SCB_NAME];
int i,pcm_index = -1, insert_point, src_index = -1;
@@ -1116,10 +1157,13 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
case DSP_IEC958_CHANNEL:
snd_assert (ins->asynch_tx_scb != NULL, return NULL);
mixer_scb = ins->asynch_tx_scb;
- if (ins->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE) {
- snd_printdd ("IEC958 opened in AC3 mode\n");
- /*src_scb = ins->asynch_tx_scb;
- ins->asynch_tx_scb->ref_count ++;*/
+
+ /* if sample rate is set to 48khz we pass
+ the Sample Rate Converted (which could
+ alter the raw data stream ...) */
+ if (sample_rate == 48000) {
+ snd_printdd ("IEC958 pass through\n");
+ src_parent_scb = ins->asynch_tx_scb;
}
break;
default:
@@ -1156,8 +1200,6 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
}
if (src_scb == NULL) {
- dsp_scb_descriptor_t * src_parent_scb;
-
if (ins->nsrc_scb >= DSP_MAX_SRC_NR) {
snd_printk(KERN_ERR "dsp_spos: to many SRC instances\n!");
return NULL;
@@ -1174,18 +1216,21 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
snd_assert (src_index != -1,return NULL);
/* we need to create a new SRC SCB */
- if (mixer_scb->sub_list_ptr == ins->the_null_scb) {
- src_parent_scb = mixer_scb;
- insert_point = SCB_ON_PARENT_SUBLIST_SCB;
- } else {
- src_parent_scb = find_next_free_scb(chip,mixer_scb->sub_list_ptr);
- insert_point = SCB_ON_PARENT_NEXT_SCB;
- }
+ if (src_parent_scb == NULL) {
+ if (mixer_scb->sub_list_ptr == ins->the_null_scb) {
+ src_parent_scb = mixer_scb;
+ insert_point = SCB_ON_PARENT_SUBLIST_SCB;
+ } else {
+ src_parent_scb = find_next_free_scb(chip,mixer_scb->sub_list_ptr);
+ insert_point = SCB_ON_PARENT_NEXT_SCB;
+ }
+ } else insert_point = SCB_ON_PARENT_NEXT_SCB;
snprintf (scb_name,DSP_MAX_SCB_NAME,"SrcTask_SCB%d",src_index);
snd_printdd( "dsp_spos: creating SRC \"%s\"\n",scb_name);
src_scb = cs46xx_dsp_create_src_task_scb(chip,scb_name,
+ sample_rate,
src_output_buffer_addr[src_index],
src_delay_buffer_addr[src_index],
/* 0x400 - 0x600 source SCBs */
@@ -1198,9 +1243,7 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
return NULL;
}
- if (pcm_channel_id != DSP_IEC958_CHANNEL ||
- !(ins->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE))
- cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate);
+ /* cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate); */
ins->nsrc_scb ++;
}
@@ -1226,6 +1269,19 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
return NULL;
}
+ if (pcm_channel_id == DSP_IEC958_CHANNEL && sample_rate == 48000) {
+ snd_assert (ins->spdif_pcm_input_scb == NULL);
+
+ /* a hack to make the skip the SRC and pass the stream
+ directly to the SPDIF task */
+ ins->spdif_pcm_input_scb =
+ cs46xx_dsp_create_pcm_serial_input_scb(chip,"PCMSerialInput_PCM",
+ PCMSERIALINII_SCB_ADDR,
+ pcm_scb,
+ ins->asynch_tx_scb,
+ SCB_ON_PARENT_SUBLIST_SCB);
+ }
+
spin_lock_irqsave(&chip->reg_lock, flags);
ins->pcm_channels[pcm_index].sample_rate = sample_rate;
ins->pcm_channels[pcm_index].pcm_reader_scb = pcm_scb;
@@ -1236,7 +1292,6 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
ins->pcm_channels[pcm_index].active = 1;
ins->pcm_channels[pcm_index].pcm_slot = pcm_index;
ins->pcm_channels[pcm_index].mixer_scb = mixer_scb;
- ins->pcm_channels[pcm_index].pcm_channel_id = pcm_channel_id;
ins->npcm_channels ++;
spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -1416,65 +1471,6 @@ int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
return 0;
}
-
-#define GOF_PER_SEC 200
-
-void cs46xx_dsp_set_src_sample_rate(cs46xx_t *chip,dsp_scb_descriptor_t * src, u32 rate)
-{
- unsigned long flags;
- unsigned int tmp1, tmp2;
- unsigned int phiIncr;
- unsigned int correctionPerGOF, correctionPerSec;
-
- snd_printdd( "dsp_spos: setting SRC rate to %u\n",rate);
- /*
- * Compute the values used to drive the actual sample rate conversion.
- * The following formulas are being computed, using inline assembly
- * since we need to use 64 bit arithmetic to compute the values:
- *
- * phiIncr = floor((Fs,in * 2^26) / Fs,out)
- * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) /
- * GOF_PER_SEC)
- * ulCorrectionPerSec = Fs,in * 2^26 - Fs,out * phiIncr -M
- * GOF_PER_SEC * correctionPerGOF
- *
- * i.e.
- *
- * phiIncr:other = dividend:remainder((Fs,in * 2^26) / Fs,out)
- * correctionPerGOF:correctionPerSec =
- * dividend:remainder(ulOther / GOF_PER_SEC)
- */
- tmp1 = rate << 16;
- phiIncr = tmp1 / 48000;
- tmp1 -= phiIncr * 48000;
- tmp1 <<= 10;
- phiIncr <<= 10;
- tmp2 = tmp1 / 48000;
- phiIncr += tmp2;
- tmp1 -= tmp2 * 48000;
- correctionPerGOF = tmp1 / GOF_PER_SEC;
- tmp1 -= correctionPerGOF * GOF_PER_SEC;
- correctionPerSec = tmp1;
-
- /*
- * Fill in the SampleRateConverter control block.
- */
- spin_lock_irqsave(&chip->reg_lock, flags);
-
- /* mute SCB */
- /* cs46xx_dsp_scb_set_volume (chip,src,0,0); */
-
- snd_cs46xx_poke(chip, (src->address + SRCCorPerGof) << 2,
- ((correctionPerSec << 16) & 0xFFFF0000) | (correctionPerGOF & 0xFFFF));
-
- snd_cs46xx_poke(chip, (src->address + SRCPhiIncr6Int26Frac) << 2, phiIncr);
-
- /* raise volume */
- /* cs46xx_dsp_scb_set_volume (chip,src,0x7fff,0x7fff); */
-
- spin_unlock_irqrestore(&chip->reg_lock, flags);
-}
-
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source,
u16 addr,char * scb_name)
{
@@ -1641,9 +1637,8 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip)
SCB_ON_PARENT_NEXT_SCB);
- if (ins->spdif_status_out & DSP_SPDIF_STATUS_AC3_MODE)
- /* set left (13), right validity bit (12) , and non-audio(1) and profsional bit (0) */
- cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, 0x00000000 | (1 << 13) | (1 << 12) | (1 << 1) | 1);
+ /* set spdif channel status value for streaming */
+ cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, ins->spdif_csuv_stream);
ins->spdif_status_out |= DSP_SPDIF_STATUS_PLAYBACK_OPEN;
@@ -1659,13 +1654,22 @@ int cs46xx_iec958_post_close (cs46xx_t *chip)
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_PLAYBACK_OPEN;
/* restore settings */
- cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, 0x00000000 | (1 << 13) | (1 << 12));
+ cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, ins->spdif_csuv_default);
/* deallocate stuff */
+ if (ins->spdif_pcm_input_scb != NULL) {
+ cs46xx_dsp_remove_scb (chip,ins->spdif_pcm_input_scb);
+ ins->spdif_pcm_input_scb = NULL;
+ }
+
cs46xx_dsp_remove_scb (chip,ins->asynch_tx_scb);
ins->asynch_tx_scb = NULL;
+ /* clear buffer to prevent any undesired noise */
+ _dsp_clear_sample_buffer(chip,SPDIFO_IP_OUTPUT_BUFFER1,256);
+
/* restore state */
+
if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
cs46xx_dsp_enable_spdif_out (chip);
}
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 007a263e7212..fe5c5d0b3698 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -199,7 +199,7 @@ static void __devexit snd_card_emu10k1_remove(struct pci_dev *pci)
}
static struct pci_driver driver = {
- .name = "EMU10K1/Audigy",
+ .name = "EMU10K1_Audigy",
.id_table = snd_emu10k1_ids,
.probe = snd_card_emu10k1_probe,
.remove = __devexit_p(snd_card_emu10k1_remove),
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 12933f97c860..8ae6d3756ea5 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -26,6 +26,7 @@
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
+#include <linux/gameport.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -403,6 +404,9 @@ struct _snd_ensoniq {
unsigned char *bugbuf;
dma_addr_t bugbuf_addr;
#endif
+
+ struct gameport gameport;
+ struct semaphore joy_sem; // gameport configuration semaphore
};
static void snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -1355,6 +1359,7 @@ static snd_kcontrol_new_t snd_ens1373_spdif_default __devinitdata =
static snd_kcontrol_new_t snd_ens1373_spdif_mask __devinitdata =
{
+ .access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
.name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
.info = snd_ens1373_spdif_info,
@@ -1509,6 +1514,8 @@ static int snd_ensoniq_control_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
return 0;
}
+#ifdef CHIP1370
+
static int snd_ensoniq_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
@@ -1527,8 +1534,6 @@ static int snd_ensoniq_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
return change;
}
-#ifdef CHIP1370
-
#define ES1370_CONTROLS 2
static snd_kcontrol_new_t snd_es1370_controls[2] __devinitdata = {
@@ -1571,8 +1576,67 @@ static int __devinit snd_ensoniq_1370_mixer(ensoniq_t * ensoniq)
* General Switches...
*/
+/* MQ: gameport driver connectivity */
+#define ENSONIQ_JOY_CONTROL(xname, mask) \
+{ .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = xname, .info = snd_ensoniq_control_info, \
+ .get = snd_ensoniq_control_get, .put = snd_ensoniq_joy_control_put, \
+ .private_value = mask }
+
+static int snd_ensoniq_joy_enable(ensoniq_t *ensoniq)
+{
+ static int last_jiffies = 0;
+ unsigned long flags;
+
+ if (!request_region(ensoniq->gameport.io, 8, "ens137x: gameport")) {
+#define ES___GAMEPORT_LOG_DELAY (30*HZ)
+ // avoid log pollution: limit to 2 infos per minute
+ if (jiffies > last_jiffies + ES___GAMEPORT_LOG_DELAY) {
+ last_jiffies = jiffies;
+ snd_printk("gameport io port 0x%03x in use", ensoniq->gameport.io);
+ }
+ return 0;
+ }
+ spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ ensoniq->ctrl |= ES_JYSTK_EN;
+ outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
+ spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ gameport_register_port(&ensoniq->gameport);
+ return 1;
+}
+
+static int snd_ensoniq_joy_disable(ensoniq_t *ensoniq)
+{
+ unsigned long flags;
+
+ gameport_unregister_port(&ensoniq->gameport);
+ spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ ensoniq->ctrl &= ~ES_JYSTK_EN;
+ outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
+ spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ release_region(ensoniq->gameport.io, 8);
+ return 1;
+}
+
+static int snd_ensoniq_joy_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ensoniq_t *ensoniq = snd_kcontrol_chip(kcontrol);
+ unsigned int nval;
+ int change;
+
+ down(&ensoniq->joy_sem);
+ nval = ucontrol->value.integer.value[0] ? ES_JYSTK_EN : 0;
+ change = (ensoniq->ctrl & ES_JYSTK_EN) != nval; // spinlock shouldn't be needed because of joy_sem
+ if (change) {
+ if (nval) // enable
+ change = snd_ensoniq_joy_enable(ensoniq);
+ else change = snd_ensoniq_joy_disable(ensoniq);
+ }
+ up(&ensoniq->joy_sem);
+ return change;
+}
+
static snd_kcontrol_new_t snd_ensoniq_control_joystick __devinitdata =
-ENSONIQ_CONTROL("Joystick Enable", ES_JYSTK_EN);
+ENSONIQ_JOY_CONTROL("Joystick Enable", ES_JYSTK_EN);
#ifdef CHIP1371
@@ -1584,9 +1648,9 @@ static int snd_es1371_joystick_addr_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
- uinfo->value.enumerated.items = 3;
- if (uinfo->value.enumerated.item >= 3)
- uinfo->value.enumerated.item = 2;
+ uinfo->value.enumerated.items = 4;
+ if (uinfo->value.enumerated.item >= 4)
+ uinfo->value.enumerated.item = 3;
sprintf(uinfo->value.enumerated.name, "port 0x%x", (uinfo->value.enumerated.item * 8) + 0x200);
return 0;
}
@@ -1608,14 +1672,20 @@ static int snd_es1371_joystick_addr_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_
unsigned long flags;
unsigned int nval;
int change;
-
+
+ down(&ensoniq->joy_sem);
nval = ES_1371_JOY_ASEL(ucontrol->value.integer.value[0]);
spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ if (!(change = !(ensoniq->ctrl & ES_JYSTK_EN)))
+ goto no_change; // FIXME: now we allow change only when joystick is disabled
change = (ensoniq->ctrl & ES_1371_JOY_ASELM) != nval;
ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
ensoniq->ctrl |= nval;
outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
+ ensoniq->gameport.io = 0x200 + ES_1371_JOY_ASELI(nval) * 8;
+no_change:
spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ up(&ensoniq->joy_sem);
return change;
}
@@ -1679,6 +1749,8 @@ static void snd_ensoniq_proc_done(ensoniq_t * ensoniq)
static int snd_ensoniq_free(ensoniq_t *ensoniq)
{
+ if (ensoniq->ctrl & ES_JYSTK_EN)
+ snd_ensoniq_joy_disable(ensoniq);
snd_ensoniq_proc_done(ensoniq);
if (ensoniq->irq < 0)
goto __hw_end;
@@ -1759,6 +1831,7 @@ static int __devinit snd_ensoniq_create(snd_card_t * card,
if (ensoniq == NULL)
return -ENOMEM;
spin_lock_init(&ensoniq->reg_lock);
+ init_MUTEX(&ensoniq->joy_sem);
ensoniq->card = card;
ensoniq->pci = pci;
ensoniq->irq = -1;
@@ -1873,10 +1946,11 @@ static int __devinit snd_ensoniq_create(snd_card_t * card,
outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL));
outb(0x00, ES_REG(ensoniq, UART_RES));
outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
- snd_ctl_add(card, snd_ctl_new1(&snd_ensoniq_control_joystick, ensoniq));
#ifdef CHIP1371
snd_ctl_add(card, snd_ctl_new1(&snd_es1371_joystick_addr, ensoniq));
#endif
+ snd_ctl_add(card, snd_ctl_new1(&snd_ensoniq_control_joystick, ensoniq));
+ ensoniq->gameport.io = 0x200; // FIXME: is ES1371 configured like this above ?
synchronize_irq(ensoniq->irq);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops)) < 0) {
@@ -2181,10 +2255,10 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci,
return err;
}
#ifdef CHIP1370
- strcpy(card->driver, "ES1370");
+ strcpy(card->driver, "ENS1370");
#endif
#ifdef CHIP1371
- strcpy(card->driver, "ES1371");
+ strcpy(card->driver, "ENS1371");
#endif
strcpy(card->shortname, "Ensoniq AudioPCI");
sprintf(card->longname, "%s %s at 0x%lx, irq %i",
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 4a8f5af2a13b..268e4ac18f48 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -985,7 +985,7 @@ static void snd_es1938_free_pcm(snd_pcm_t *pcm)
snd_pcm_lib_preallocate_free_for_all(pcm);
}
-static int __init snd_es1938_new_pcm(es1938_t *chip, int device, snd_pcm_t ** rpcm)
+static int __devinit snd_es1938_new_pcm(es1938_t *chip, int device, snd_pcm_t ** rpcm)
{
snd_pcm_t *pcm;
int err;
@@ -1364,7 +1364,7 @@ static int snd_es1938_dev_free(snd_device_t *device)
return snd_es1938_free(chip);
}
-static int __init snd_es1938_create(snd_card_t * card,
+static int __devinit snd_es1938_create(snd_card_t * card,
struct pci_dev * pci,
unsigned long dma1size,
unsigned long dma2size,
@@ -1541,7 +1541,7 @@ static void snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#define ES1938_DMA_SIZE 64
-static int __init snd_es1938_mixer(snd_pcm_t *pcm)
+static int __devinit snd_es1938_mixer(snd_pcm_t *pcm)
{
snd_card_t *card;
es1938_t *chip;
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index dc36e2a8c7ed..29c94cbb229c 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -129,6 +129,7 @@ static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
static int clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
@@ -151,6 +152,9 @@ MODULE_PARM_SYNTAX(pcm_substreams_c, SNDRV_ENABLED ",allows:{{0,8}}");
MODULE_PARM(clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(clock, "Clock on " CARD_NAME " soundcard. (0 = auto-detect)");
MODULE_PARM_SYNTAX(clock, SNDRV_ENABLED);
+MODULE_PARM(use_pm, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(use_pm, "Toggle power-management. (0 = off, 1 = on, 2 = auto)");
+MODULE_PARM_SYNTAX(use_pm, SNDRV_ENABLED ",allows:{{0,1,2}},skill:advanced");
/* PCI Dev ID's */
@@ -493,6 +497,11 @@ enum snd_enum_apu_type {
ESM_APU_FREE
};
+/* chip type */
+enum {
+ TYPE_MAESTRO, TYPE_MAESTRO2, TYPE_MAESTRO2E
+};
+
/* DMA Hack! */
struct snd_esm_memory {
char *buf;
@@ -558,6 +567,7 @@ struct snd_es1968 {
struct pci_dev *pci;
snd_card_t *card;
snd_pcm_t *pcm;
+ int do_pm; /* power-management enabled */
/* DMA memory block */
struct list_head buf_list;
@@ -593,17 +603,13 @@ struct snd_es1968 {
static void snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-#define CARD_TYPE_ESS_ESOLDM1 0x12850100
-#define CARD_TYPE_ESS_ES1968 0x125d1968
-#define CARD_TYPE_ESS_ES1978 0x125d1978
-
static struct pci_device_id snd_es1968_ids[] __devinitdata = {
/* Maestro 1 */
- { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },
+ { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
/* Maestro 2 */
- { 0x125d, 0x1968, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },
+ { 0x125d, 0x1968, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO2 },
/* Maestro 2E */
- { 0x125d, 0x1978, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },
+ { 0x125d, 0x1978, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO2E },
{ 0, }
};
@@ -2411,6 +2417,9 @@ static void es1968_suspend(es1968_t *chip)
{
snd_card_t *card = chip->card;
+ if (! chip->do_pm)
+ return;
+
snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
goto __skip;
@@ -2426,6 +2435,9 @@ static void es1968_resume(es1968_t *chip)
{
snd_card_t *card = chip->card;
+ if (! chip->do_pm)
+ return;
+
snd_power_lock(card);
if (card->power_state == SNDRV_CTL_POWER_D0)
goto __skip;
@@ -2524,11 +2536,13 @@ static int snd_es1968_dev_free(snd_device_t *device)
}
static int __devinit snd_es1968_create(snd_card_t * card,
- struct pci_dev *pci,
- int total_bufsize,
- int play_streams,
- int capt_streams,
- es1968_t **chip_ret)
+ struct pci_dev *pci,
+ int total_bufsize,
+ int play_streams,
+ int capt_streams,
+ int chip_type,
+ int do_pm,
+ es1968_t **chip_ret)
{
static snd_device_ops_t ops = {
.dev_free = snd_es1968_dev_free,
@@ -2553,7 +2567,7 @@ static int __devinit snd_es1968_create(snd_card_t * card,
return -ENOMEM;
/* Set Vars */
- chip->type = (pci->vendor << 16) | pci->device;
+ chip->type = chip_type;
spin_lock_init(&chip->reg_lock);
spin_lock_init(&chip->substream_lock);
spin_lock_init(&chip->bob_lock);
@@ -2595,11 +2609,26 @@ static int __devinit snd_es1968_create(snd_card_t * card,
/* just to be sure */
pci_set_master(pci);
+ if (do_pm) {
+ /* disable power-management if not maestro2e or
+ * if not on the whitelist
+ */
+ unsigned int vend;
+ pci_read_config_dword(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend);
+ if (chip->type != TYPE_MAESTRO2E || (vend & 0xffff) != 0x1028) {
+ printk(KERN_INFO "es1968: not attempting power management.\n");
+ do_pm = 0;
+ }
+ }
+ chip->do_pm = do_pm;
+
snd_es1968_chip_init(chip);
#ifdef CONFIG_PM
- card->set_power_state = snd_es1968_set_power_state;
- card->power_state_private_data = chip;
+ if (chip->do_pm) {
+ card->set_power_state = snd_es1968_set_power_state;
+ card->power_state_private_data = chip;
+ }
#endif
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
@@ -2693,21 +2722,23 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
total_bufsize[dev] * 1024, /* in bytes */
pcm_substreams_p[dev],
pcm_substreams_c[dev],
+ pci_id->driver_data,
+ use_pm[dev],
&chip)) < 0) {
snd_card_free(card);
return err;
}
switch (chip->type) {
- case CARD_TYPE_ESS_ES1978:
+ case TYPE_MAESTRO2E:
strcpy(card->driver, "ES1978");
strcpy(card->shortname, "ESS ES1978 (Maestro 2E)");
break;
- case CARD_TYPE_ESS_ES1968:
+ case TYPE_MAESTRO2:
strcpy(card->driver, "ES1968");
strcpy(card->shortname, "ESS ES1968 (Maestro 2)");
break;
- case CARD_TYPE_ESS_ESOLDM1:
+ case TYPE_MAESTRO:
strcpy(card->driver, "ESM1");
strcpy(card->shortname, "ESS Maestro 1");
break;
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index a853dc617e4a..1b9216c6b758 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -164,7 +164,7 @@ struct _snd_fm801 {
};
static struct pci_device_id snd_fm801_ids[] __devinitdata = {
- { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* FM801 */
+ { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, }, /* FM801 */
{ 0, }
};
@@ -517,18 +517,18 @@ static snd_pcm_hardware_t snd_fm801_playback =
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
- formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
- rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
- rate_min: 5500,
- rate_max: 48000,
- channels_min: 1,
- channels_max: 2,
- buffer_bytes_max: (128*1024),
- period_bytes_min: 64,
- period_bytes_max: (128*1024),
- periods_min: 1,
- periods_max: 1024,
- fifo_size: 0,
+ .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
+ .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
+ .rate_min = 5500,
+ .rate_max = 48000,
+ .channels_min = 1,
+ .channels_max = 2,
+ .buffer_bytes_max = (128*1024),
+ .period_bytes_min = 64,
+ .period_bytes_max = (128*1024),
+ .periods_min = 1,
+ .periods_max = 1024,
+ .fifo_size = 0,
};
static snd_pcm_hardware_t snd_fm801_capture =
@@ -536,18 +536,18 @@ static snd_pcm_hardware_t snd_fm801_capture =
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
- formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
- rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
- rate_min: 5500,
- rate_max: 48000,
- channels_min: 1,
- channels_max: 2,
- buffer_bytes_max: (128*1024),
- period_bytes_min: 64,
- period_bytes_max: (128*1024),
- periods_min: 1,
- periods_max: 1024,
- fifo_size: 0,
+ .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
+ .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,
+ .rate_min = 5500,
+ .rate_max = 48000,
+ .channels_min = 1,
+ .channels_max = 2,
+ .buffer_bytes_max = (128*1024),
+ .period_bytes_min = 64,
+ .period_bytes_max = (128*1024),
+ .periods_min = 1,
+ .periods_max = 1024,
+ .fifo_size = 0,
};
static int snd_fm801_playback_open(snd_pcm_substream_t * substream)
@@ -834,7 +834,7 @@ static void snd_fm801_mixer_free_ac97(ac97_t *ac97)
}
}
-static int __init snd_fm801_mixer(fm801_t *chip)
+static int __devinit snd_fm801_mixer(fm801_t *chip)
{
ac97_t ac97;
int err, i;
@@ -907,7 +907,7 @@ static int __devinit snd_fm801_create(snd_card_t * card,
static snd_device_ops_t ops = {
.dev_free = snd_fm801_dev_free,
};
-
+
*rchip = NULL;
if ((err = pci_enable_device(pci)) < 0)
return err;
@@ -920,13 +920,13 @@ static int __devinit snd_fm801_create(snd_card_t * card,
chip->irq = -1;
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 0x80, "FM801")) == NULL) {
- snd_fm801_free(chip);
snd_printk("unable to grab region 0x%lx-0x%lx\n", chip->port, chip->port + 0x80 - 1);
+ snd_fm801_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_fm801_interrupt, SA_INTERRUPT|SA_SHIRQ, "FM801", (void *)chip)) {
- snd_fm801_free(chip);
snd_printk("unable to grab IRQ %d\n", chip->irq);
+ snd_fm801_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
@@ -1070,7 +1070,7 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
strcpy(card->driver, "FM801");
strcpy(card->shortname, "ForteMedia FM801-");
strcat(card->shortname, chip->multichannel ? "AU" : "AS");
@@ -1098,7 +1098,7 @@ static struct pci_driver driver = {
.probe = snd_card_fm801_probe,
.remove = __devexit_p(snd_card_fm801_remove),
};
-
+
static int __init alsa_card_fm801_init(void)
{
int err;
diff --git a/sound/pci/ice1712/Makefile b/sound/pci/ice1712/Makefile
index e482dbd74d26..ada825425e91 100644
--- a/sound/pci/ice1712/Makefile
+++ b/sound/pci/ice1712/Makefile
@@ -5,7 +5,7 @@
export-objs := ice1712.o
-snd-ice1712-objs := ice1712.o ak4524.o delta.o hoontech.o ews.o
+snd-ice1712-objs := ice1712.o ak4524.o delta.o hoontech.o ews.o amp.o
# Toplevel Module Dependency
obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o
diff --git a/sound/pci/ice1712/ak4524.c b/sound/pci/ice1712/ak4524.c
index fe2e2a061de4..37894701cd09 100644
--- a/sound/pci/ice1712/ak4524.c
+++ b/sound/pci/ice1712/ak4524.c
@@ -65,10 +65,8 @@ void snd_ice1712_ak4524_write(ice1712_t *ice, int chip,
tmp |= ak->cs_addr;
}
- addr &= 0x07;
/* build I2C address + data byte */
- /* assume C1=1, C0=0 */
- addrdata = 0xa000 | (addr << 8) | data;
+ addrdata = (ak->caddr << 14) | 0x2000 | ((addr & 0x0f) << 8) | data;
for (idx = 15; idx >= 0; idx--) {
tmp &= ~(ak->data_mask | ak->clk_mask);
if (addrdata & (1 << idx))
@@ -81,11 +79,14 @@ void snd_ice1712_ak4524_write(ice1712_t *ice, int chip,
udelay(1);
}
- if (ak->type == SND_AK4524) {
+ if (ak->type == SND_AK4524 || ak->type == SND_AK4528) {
if ((addr != 0x04 && addr != 0x05) || (data & 0x80) == 0)
ak->images[chip][addr] = data;
else
ak->ipga_gain[chip][addr-4] = data;
+ } else {
+ /* AK4529 */
+ ak->images[chip][addr] = data;
}
if (ak->cs_mask == ak->cs_addr) {
@@ -170,7 +171,7 @@ void __devinit snd_ice1712_ak4524_init(ice1712_t *ice)
static unsigned char inits_ak4529[] = {
0x09, 0x01, /* 9: ATS=0, RSTN=1 */
0x0a, 0x3f, /* A: all power up, no zero/overflow detection */
- 0x00, 0x08, /* 0: TDM=0, 24bit I2S, SMUTE=0 */
+ 0x00, 0x0c, /* 0: TDM=0, 24bit I2S, SMUTE=0 */
0x01, 0x00, /* 1: ACKS=0, ADC, loop off */
0x02, 0xff, /* 2: LOUT1 muted */
0x03, 0xff, /* 3: ROUT1 muted */
@@ -216,15 +217,20 @@ void __devinit snd_ice1712_ak4524_init(ice1712_t *ice)
#define AK_GET_CHIP(val) (((val) >> 8) & 0xff)
#define AK_GET_ADDR(val) ((val) & 0xff)
-#define AK_GET_SHIFT(val) (((val) >> 16) & 0xff)
-#define AK_COMPOSE(chip,addr,shift) (((chip) << 8) | (addr) | ((shift) << 16))
+#define AK_GET_SHIFT(val) (((val) >> 16) & 0x7f)
+#define AK_GET_INVERT(val) (((val) >> 23) & 1)
+#define AK_GET_MASK(val) (((val) >> 24) & 0xff)
+#define AK_COMPOSE(chip,addr,shift,mask) (((chip) << 8) | (addr) | ((shift) << 16) | ((mask) << 24))
+#define AK_INVERT (1<<23)
static int snd_ice1712_ak4524_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
+ unsigned int mask = AK_GET_MASK(kcontrol->private_value);
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = 0;
- uinfo->value.integer.max = 127;
+ uinfo->value.integer.max = mask;
return 0;
}
@@ -233,7 +239,11 @@ static int snd_ice1712_ak4524_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int chip = AK_GET_CHIP(kcontrol->private_value);
int addr = AK_GET_ADDR(kcontrol->private_value);
- ucontrol->value.integer.value[0] = ice->ak4524.images[chip][addr];
+ int invert = AK_GET_INVERT(kcontrol->private_value);
+ unsigned int mask = AK_GET_MASK(kcontrol->private_value);
+ unsigned char val = ice->ak4524.images[chip][addr];
+
+ ucontrol->value.integer.value[0] = invert ? mask - val : val;
return 0;
}
@@ -242,8 +252,14 @@ static int snd_ice1712_ak4524_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int chip = AK_GET_CHIP(kcontrol->private_value);
int addr = AK_GET_ADDR(kcontrol->private_value);
- unsigned char nval = ucontrol->value.integer.value[0];
- int change = ice->ak4524.images[chip][addr] != nval;
+ int invert = AK_GET_INVERT(kcontrol->private_value);
+ unsigned int mask = AK_GET_MASK(kcontrol->private_value);
+ unsigned char nval = ucontrol->value.integer.value[0] % (mask+1);
+ int change;
+
+ if (invert)
+ nval = mask - nval;
+ change = ice->ak4524.images[chip][addr] != nval;
if (change)
snd_ice1712_ak4524_write(ice, chip, addr, nval);
return change;
@@ -340,14 +356,14 @@ int __devinit snd_ice1712_ak4524_build_controls(ice1712_t *ice)
ctl.put = snd_ice1712_ak4524_volume_put;
switch (ak->type) {
case SND_AK4524:
- ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 6, 0); /* register 6 & 7 */
+ ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 6, 0, 127); /* register 6 & 7 */
break;
case SND_AK4528:
- ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */
+ ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0, 127); /* register 4 & 5 */
break;
case SND_AK4529: {
int val = idx < 6 ? idx + 2 : (idx - 6) + 0xb; /* registers 2-7 and b,c */
- ctl.private_value = AK_COMPOSE(0, val, 0);
+ ctl.private_value = AK_COMPOSE(0, val, 0, 255) | AK_INVERT;
break;
}
}
@@ -365,7 +381,7 @@ int __devinit snd_ice1712_ak4524_build_controls(ice1712_t *ice)
ctl.access = SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE;
ctl.get = snd_ice1712_ak4524_volume_get;
ctl.put = snd_ice1712_ak4524_volume_put;
- ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */
+ ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0, 127); /* register 4 & 5 */
ctl.private_data = ice;
if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0)
return err;
@@ -377,7 +393,7 @@ int __devinit snd_ice1712_ak4524_build_controls(ice1712_t *ice)
ctl.access = SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE;
ctl.get = snd_ice1712_ak4524_ipga_gain_get;
ctl.put = snd_ice1712_ak4524_ipga_gain_put;
- ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0); /* register 4 & 5 */
+ ctl.private_value = AK_COMPOSE(idx/2, (idx%2) + 4, 0, 0); /* register 4 & 5 */
ctl.private_data = ice;
if ((err = snd_ctl_add(ice->card, snd_ctl_new(&ctl))) < 0)
return err;
@@ -395,11 +411,11 @@ int __devinit snd_ice1712_ak4524_build_controls(ice1712_t *ice)
switch (ak->type) {
case SND_AK4524:
case SND_AK4528:
- ctl.private_value = AK_COMPOSE(idx, 3, 0); /* register 3 */
+ ctl.private_value = AK_COMPOSE(idx, 3, 0, 0); /* register 3 */
break;
case SND_AK4529: {
int shift = idx == 3 ? 6 : (2 - idx) * 2;
- ctl.private_value = AK_COMPOSE(0, 8, shift); /* register 8 with shift */
+ ctl.private_value = AK_COMPOSE(0, 8, shift, 0); /* register 8 with shift */
break;
}
}
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
new file mode 100644
index 000000000000..74ecc8150d33
--- /dev/null
+++ b/sound/pci/ice1712/amp.c
@@ -0,0 +1,55 @@
+/*
+ * ALSA driver for ICEnsemble VT1724 (Envy24HT)
+ *
+ * Lowlevel functions for Advanced Micro Peripherals Ltd AUDIO2000
+ *
+ * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
+ *
+ * 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 <sound/driver.h>
+#include <asm/io.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <sound/core.h>
+
+#include "ice1712.h"
+#include "amp.h"
+
+
+static int __devinit snd_vt1724_amp_init(ice1712_t *ice)
+{
+ /* only use basic functionality for now */
+
+ ice->num_total_dacs = 2; /* only PSDOUT0 is connected */
+
+ return 0;
+}
+
+
+/* entry point */
+struct snd_ice1712_card_info snd_vt1724_amp_cards[] __devinitdata = {
+ {
+ VT1724_SUBDEVICE_AUDIO2000,
+ "AMP Ltd AUDIO2000",
+ snd_vt1724_amp_init,
+ },
+ { } /* terminator */
+};
+
diff --git a/sound/pci/ice1712/amp.h b/sound/pci/ice1712/amp.h
new file mode 100644
index 000000000000..836aeae8fae6
--- /dev/null
+++ b/sound/pci/ice1712/amp.h
@@ -0,0 +1,34 @@
+#ifndef __SOUND_AMP_H
+#define __SOUND_AMP_H
+
+/*
+ * ALSA driver for VIA VT1724 (Envy24HT)
+ *
+ * Lowlevel functions for Advanced Micro Peripherals Ltd AUDIO2000
+ *
+ * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
+ *
+ * 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
+ *
+ */
+
+#define AMP_AUDIO2000_DEVICE_DESC "{AMP Ltd AUDIO2000},"
+
+#define VT1724_SUBDEVICE_AUDIO2000 0x12142417 /* Advanced Micro Peripherals Ltd AUDIO2000 */
+
+extern struct snd_ice1712_card_info snd_vt1724_amp_cards[];
+
+
+#endif /* __SOUND_AMP_H */
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index e4518ddab848..d4348e7b9150 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -189,19 +189,18 @@ static void delta_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucont
static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
unsigned int val;
int change;
val = snd_cs8403_encode_spdif_bits(&ucontrol->value.iec958);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
change = ice->spdif.cs8403_bits != val;
ice->spdif.cs8403_bits = val;
if (change && ice->playback_pro_substream == NULL) {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
snd_ice1712_delta_cs8403_spdif_write(ice, val);
} else {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
}
return change;
}
@@ -213,19 +212,18 @@ static void delta_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
unsigned int val;
int change;
val = snd_cs8403_encode_spdif_bits(&ucontrol->value.iec958);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
change = ice->spdif.cs8403_stream_bits != val;
ice->spdif.cs8403_stream_bits = val;
if (change && ice->playback_pro_substream != NULL) {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
snd_ice1712_delta_cs8403_spdif_write(ice, val);
} else {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
}
return change;
}
@@ -257,17 +255,20 @@ static int delta1010lt_ak4524_start(ice1712_t *ice, unsigned char *saved, int ch
/*
* change the rate of AK4524 on Delta 44/66, AP, 1010LT
*/
-static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned char val)
+static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned int rate)
{
unsigned char tmp, tmp2;
+ if (rate == 0) /* no hint - S/PDIF input is master, simply return */
+ return;
+
/* check before reset ak4524 to avoid unnecessary clicks */
down(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
up(&ice->gpio_mutex);
tmp2 = tmp;
tmp2 &= ~ICE1712_DELTA_DFS;
- if (val == 15 || val == 11 || val == 7)
+ if (rate > 48000)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp == tmp2)
return;
@@ -275,12 +276,9 @@ static void delta_ak4524_set_rate_val(ice1712_t *ice, unsigned char val)
/* do it again */
snd_ice1712_ak4524_reset(ice, 1);
down(&ice->gpio_mutex);
- tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
- if (val == 15 || val == 11 || val == 7) {
+ tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ~ICE1712_DELTA_DFS;
+ if (rate > 48000)
tmp |= ICE1712_DELTA_DFS;
- } else {
- tmp &= ~ICE1712_DELTA_DFS;
- }
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
up(&ice->gpio_mutex);
snd_ice1712_ak4524_reset(ice, 0);
@@ -385,9 +383,11 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA410:
ak->num_adcs = ak->num_dacs = 2;
ak->type = SND_AK4528;
+ ak->caddr = 2;
if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA410) {
ak->num_dacs = 8;
ak->type = SND_AK4529;
+ ak->caddr = 0;
}
ak->cif = 0; /* the default level of the CIF pin from AK4528/4529 */
ak->data_mask = ICE1712_DELTA_AP_DOUT;
@@ -402,6 +402,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA1010LT:
ak->num_adcs = ak->num_dacs = 8;
ak->type = SND_AK4524;
+ ak->caddr = 2;
ak->cif = 0; /* the default level of the CIF pin from AK4524 */
ak->data_mask = ICE1712_DELTA_1010LT_DOUT;
ak->clk_mask = ICE1712_DELTA_1010LT_CCLK;
@@ -417,6 +418,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DELTA44:
ak->num_adcs = ak->num_dacs = 4;
ak->type = SND_AK4524;
+ ak->caddr = 2;
ak->cif = 0; /* the default level of the CIF pin from AK4524 */
ak->data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA;
ak->clk_mask = ICE1712_DELTA_CODEC_SERIAL_CLOCK;
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h
new file mode 100644
index 000000000000..991a93672342
--- /dev/null
+++ b/sound/pci/ice1712/envy24ht.h
@@ -0,0 +1,203 @@
+#ifndef __SOUND_VT1724_H
+#define __SOUND_VT1724_H
+
+/*
+ * ALSA driver for ICEnsemble VT1724 (Envy24)
+ *
+ * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
+ *
+ * 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 <sound/control.h>
+#include <sound/ac97_codec.h>
+#include <sound/rawmidi.h>
+#include <sound/i2c.h>
+#include <sound/pcm.h>
+
+#include "ice1712.h"
+/*
+ * Direct registers
+ */
+
+#define ICEREG1724(ice, x) ((ice)->port + VT1724_REG_##x)
+
+#define VT1724_REG_CONTROL 0x00 /* byte */
+#define VT1724_RESET 0x80 /* reset whole chip */
+#define VT1724_REG_IRQMASK 0x01 /* byte */
+#define VT1724_IRQ_MPU_RX 0x80
+#define VT1724_IRQ_MPU_TX 0x20
+#define VT1724_IRQ_MTPCM 0x10
+#define VT1724_REG_IRQSTAT 0x02 /* byte */
+/* look to VT1724_IRQ_* */
+#define VT1724_REG_SYS_CFG 0x04 /* byte - system configuration PCI60 on Envy24*/
+#define VT1724_CFG_CLOCK 0xc0
+#define VT1724_CFG_CLOCK512 0x00 /* 22.5692Mhz, 44.1kHz*512 */
+#define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */
+#define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */
+#define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */
+#define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */
+
+#define VT1724_REG_AC97_CFG 0x05 /* byte */
+#define VT1724_CFG_PRO_I2S 0x80 /* multitrack converter: I2S or AC'97 */
+#define VT1724_CFG_AC97_PACKED 0x01 /* split or packed mode - AC'97 */
+
+#define VT1724_REG_I2S_FEATURES 0x06 /* byte */
+#define VT1724_CFG_I2S_VOLUME 0x80 /* volume/mute capability */
+#define VT1724_CFG_I2S_96KHZ 0x40 /* supports 96kHz sampling */
+#define VT1724_CFG_I2S_RESMASK 0x30 /* resolution mask, 16,18,20,24-bit */
+#define VT1724_CFG_I2S_192KHZ 0x08 /* supports 192kHz sampling */
+#define VT1724_CFG_I2S_OTHER 0x07 /* other I2S IDs */
+
+#define VT1724_REG_SPDIF_CFG 0x07 /* byte */
+#define VT1724_CFG_SPDIF_OUT_EN 0x80 /*Internal S/PDIF output is enabled*/
+#define VT1724_CFG_SPDIF_OUT_INT 0x40 /*Internal S/PDIF output is implemented*/
+#define VT1724_CFG_I2S_CHIPID 0x3c /* I2S chip ID */
+#define VT1724_CFG_SPDIF_IN 0x02 /* S/PDIF input is present */
+#define VT1724_CFG_SPDIF_OUT 0x01 /* External S/PDIF output is present */
+
+/*there is no consumer AC97 codec with the VT1724*/
+//#define VT1724_REG_AC97_INDEX 0x08 /* byte */
+//#define VT1724_REG_AC97_CMD 0x09 /* byte */
+#define VT1724_AC97_COLD 0x80 /* cold reset */
+#define VT1724_AC97_WARM 0x40 /* warm reset */
+#define VT1724_AC97_WRITE 0x20 /* W: write, R: write in progress */
+#define VT1724_AC97_READ 0x10 /* W: read, R: read in progress */
+#define VT1724_AC97_READY 0x08 /* codec ready status bit */
+#define VT1724_AC97_PBK_VSR 0x02 /* playback VSR */
+#define VT1724_AC97_CAP_VSR 0x01 /* capture VSR */
+
+#define VT1724_REG_MPU_TXFIFO 0x0a /*byte ro. number of bytes in TX fifo*/
+#define VT1724_REG_MPU_RXFIFO 0x0b /*byte ro. number of bytes in RX fifo*/
+
+//are these 2 the wrong way around? they don't seem to be used yet anyway
+#define VT1724_REG_MPU_CTRL 0x0c /* byte */
+#define VT1724_REG_MPU_DATA 0x0d /* byte */
+
+#define VT1724_REG_MPU_FIFO_WM 0x0e /*byte set the high/low watermarks for RX/TX fifos*/
+#define VT1724_MPU_RX_FIFO 0x20 //1=rx fifo watermark 0=tx fifo watermark
+#define VT1724_MPU_FIFO_MASK 0x1f
+
+#define VT1724_REG_I2C_DEV_ADDR 0x10 /* byte */
+#define VT1724_I2C_WRITE 0x01 /* write direction */
+#define VT1724_REG_I2C_BYTE_ADDR 0x11 /* byte */
+#define VT1724_REG_I2C_DATA 0x12 /* byte */
+#define VT1724_REG_I2C_CTRL 0x13 /* byte */
+#define VT1724_I2C_EEPROM 0x80 /* EEPROM exists */
+#define VT1724_I2C_BUSY 0x01 /* busy bit */
+
+#define VT1724_REG_GPIO_DATA 0x14 /* word */
+#define VT1724_REG_GPIO_WRITE_MASK 0x15 /* word */
+#define VT1724_REG_GPIO_DIRECTION 0x16 /* dword? (3 bytes) 0=input 1=output.
+ bit3 - during reset used for Eeprom power-on strapping
+ if TESTEN# pin active, bit 2 always input*/
+#define VT1724_REG_POWERDOWN 0x1c
+#define VT1724_REG_GPIO_DIRECTION_22 0x1e /* byte direction for GPIO 16:22 */
+#define VT1724_REG_GPIO_WRITE_MASK_22 0x1f /* byte write mask for GPIO 16:22 */
+
+
+/*
+ * Professional multi-track direct control registers
+ */
+
+#define ICEMT1724(ice, x) ((ice)->profi_port + VT1724_MT_##x)
+
+#define VT1724_MT_IRQ 0x00 /* byte - interrupt mask */
+#define VT1724_MULTI_PDMA4 0x80 /* SPDIF Out / PDMA4 */
+#define VT1724_MULTI_PDMA3 0x40 /* PDMA3 */
+#define VT1724_MULTI_PDMA2 0x20 /* PDMA2 */
+#define VT1724_MULTI_PDMA1 0x10 /* PDMA1 */
+#define VT1724_MULTI_FIFO_ERR 0x08 /* DMA FIFO underrun/overrun. */
+#define VT1724_MULTI_RDMA1 0x04 /* RDMA1 (S/PDIF input) */
+#define VT1724_MULTI_RDMA0 0x02 /* RMDA0 */
+#define VT1724_MULTI_PDMA0 0x01 /* MC Interleave/PDMA0 */
+
+#define VT1724_MT_RATE 0x01 /* byte - sampling rate select */
+#define VT1724_SPDIF_MASTER 0x10 /* S/PDIF input is master clock */
+#define VT1724_MT_I2S_FORMAT 0x02 /* byte - I2S data format */
+#define VT1724_MT_DMA_INT_MASK 0x03 /* byte -DMA Interrupt Mask */
+/* lool to VT1724_MULTI_* */
+#define VT1724_MT_AC97_INDEX 0x04 /* byte - AC'97 index */
+#define VT1724_MT_AC97_CMD 0x05 /* byte - AC'97 command & status */
+/* look to VT1724_AC97_* */
+#define VT1724_MT_AC97_DATA 0x06 /* word - AC'97 data */
+#define VT1724_MT_PLAYBACK_ADDR 0x10 /* dword - playback address */
+#define VT1724_MT_PLAYBACK_SIZE 0x14 /* dword - playback size */
+#define VT1724_MT_PLAYBACK_CONTROL 0x18 /* byte - control */
+#define VT1724_PDMA4_START 0x80 /* SPDIF out / PDMA4 start */
+#define VT1724_PDMA3_START 0x40 /* PDMA3 start */
+#define VT1724_PDMA2_START 0x20 /* PDMA2 start */
+#define VT1724_PDMA1_START 0x10 /* PDMA1 start */
+#define VT1724_RDMA1_START 0x04 /* RDMA1 start */
+#define VT1724_RDMA0_START 0x02 /* RMDA0 start */
+#define VT1724_PDMA0_START 0x01 /* MC Interleave / PDMA0 start */
+#define VT1724_MT_BURST 0x19 /* Interleaved playback DMA Active streams / PCI burst size */
+#define VT1724_MT_DMA_FIFO_ERR 0x1a /*Global playback and record DMA FIFO Underrun/Overrun */
+#define VT1724_PDMA4_UNDERRUN 0x80
+#define VT1724_PDMA2_UNDERRUN 0x40
+#define VT1724_PDMA3_UNDERRUN 0x20
+#define VT1724_PDMA1_UNDERRUN 0x10
+#define VT1724_RDMA1_UNDERRUN 0x04
+#define VT1724_RDMA0_UNDERRUN 0x02
+#define VT1724_PDMA0_UNDERRUN 0x01
+#define VT1724_MT_DMA_PAUSE 0x1b /*Global playback and record DMA FIFO pause/resume */
+#define VT1724_PDMA4_PAUSE 0x80
+#define VT1724_PDMA3_PAUSE 0x40
+#define VT1724_PDMA2_PAUSE 0x20
+#define VT1724_PDMA1_PAUSE 0x10
+#define VT1724_RDMA1_PAUSE 0x04
+#define VT1724_RDMA0_PAUSE 0x02
+#define VT1724_PDMA0_PAUSE 0x01
+#define VT1724_MT_PLAYBACK_COUNT 0x1c /* word - playback count */
+#define VT1724_MT_CAPTURE_ADDR 0x20 /* dword - capture address */
+#define VT1724_MT_CAPTURE_SIZE 0x24 /* word - capture size */
+#define VT1724_MT_CAPTURE_COUNT 0x26 /* word - capture count */
+
+#define VT1724_MT_RDMA1_ADDR 0x30 /* dword - RDMA1 capture address */
+#define VT1724_MT_RDMA1_SIZE 0x34 /* word - RDMA1 capture size */
+#define VT1724_MT_RDMA1_COUNT 0x36 /* word - RDMA1 capture count */
+
+#define VT1724_MT_ROUTE_PLAYBACK 0x2c /* word */
+//#define VT1724_MT_MONITOR_VOLUME 0x3f /* word */
+//#define VT1724_MT_MONITOR_INDEX 0x3e /* byte */
+
+
+#define VT1724_MT_PDMA4_ADDR 0x40 /* dword */
+#define VT7124_MT_PDMA4_SIZE 0x44 /* word */
+#define VT1724_MT_PDMA4_COUNT 0x46 /* word */
+#define VT1724_MT_PDMA3_ADDR 0x50 /* dword */
+#define VT7124_MT_PDMA3_SIZE 0x54 /* word */
+#define VT1724_MT_PDMA3_COUNT 0x56 /* word */
+#define VT1724_MT_PDMA2_ADDR 0x60 /* dword */
+#define VT7124_MT_PDMA2_SIZE 0x64 /* word */
+#define VT1724_MT_PDMA2_COUNT 0x66 /* word */
+#define VT1724_MT_PDMA1_ADDR 0x70 /* dword */
+#define VT7124_MT_PDMA1_SIZE 0x74 /* word */
+#define VT1724_MT_PDMA1_COUNT 0x76 /* word */
+
+
+//does VT1724 have these? don't think so
+//#define VT1724_MT_MONITOR_RATE 0x3b /* byte */
+//#define VT1724_MT_MONITOR_ROUTECTRL 0x3c /* byte */
+//#define VT1724_ROUTE_AC97 0x01 /* route digital mixer output to AC'97 */
+#define VT1724_MT_MONITOR_PEAKINDEX 0x3e /* byte */
+#define VT1724_MT_MONITOR_PEAKDATA 0x3f /* byte */
+
+
+
+
+
+#endif /* __SOUND_VT1724_H */
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 2195982175a0..ca121c7fae72 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -245,19 +245,18 @@ static void ews88_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucont
static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
unsigned int val;
int change;
val = snd_cs8404_encode_spdif_bits(&ucontrol->value.iec958);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
change = ice->spdif.cs8403_bits != val;
ice->spdif.cs8403_bits = val;
if (change && ice->playback_pro_substream == NULL) {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
snd_ice1712_ews_cs8404_spdif_write(ice, val);
} else {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
}
return change;
}
@@ -269,19 +268,18 @@ static void ews88_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
unsigned int val;
int change;
val = snd_cs8404_encode_spdif_bits(&ucontrol->value.iec958);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
change = ice->spdif.cs8403_stream_bits != val;
ice->spdif.cs8403_stream_bits = val;
if (change && ice->playback_pro_substream != NULL) {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
snd_ice1712_ews_cs8404_spdif_write(ice, val);
} else {
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
}
return change;
}
@@ -407,6 +405,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_EWS88MT:
ak->num_adcs = ak->num_dacs = 8;
ak->type = SND_AK4524;
+ ak->caddr = 2;
ak->cif = 1; /* CIF high */
ak->data_mask = ICE1712_EWS88_SERIAL_DATA;
ak->clk_mask = ICE1712_EWS88_SERIAL_CLOCK;
@@ -420,6 +419,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_EWX2496:
ak->num_adcs = ak->num_dacs = 2;
ak->type = SND_AK4524;
+ ak->caddr = 2;
ak->cif = 1; /* CIF high */
ak->data_mask = ICE1712_EWS88_SERIAL_DATA;
ak->clk_mask = ICE1712_EWS88_SERIAL_CLOCK;
@@ -433,6 +433,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
case ICE1712_SUBDEVICE_DMX6FIRE:
ak->num_adcs = ak->num_dacs = 6;
ak->type = SND_AK4524;
+ ak->caddr = 2;
ak->cif = 1; /* CIF high */
ak->data_mask = ICE1712_6FIRE_SERIAL_DATA;
ak->clk_mask = ICE1712_6FIRE_SERIAL_CLOCK;
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c
index 937ea0b9c177..16a7633a7cbd 100644
--- a/sound/pci/ice1712/hoontech.c
+++ b/sound/pci/ice1712/hoontech.c
@@ -218,6 +218,11 @@ struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = {
"Hoontech SoundTrack Audio DSP24",
snd_ice1712_hoontech_init,
},
+ {
+ ICE1712_SUBDEVICE_STDSP24_MEDIA7_1,
+ "Hoontech STA DSP24 Media 7.1",
+ snd_ice1712_hoontech_init,
+ },
{ } /* terminator */
};
diff --git a/sound/pci/ice1712/hoontech.h b/sound/pci/ice1712/hoontech.h
index 5f006f375f9a..e1fe25b3638a 100644
--- a/sound/pci/ice1712/hoontech.h
+++ b/sound/pci/ice1712/hoontech.h
@@ -24,9 +24,13 @@
*
*/
-#define HOONTECH_DEVICE_DESC "{Hoontech SoundTrack DSP 24},"
+#define HOONTECH_DEVICE_DESC \
+ "{Hoontech SoundTrack DSP 24}," \
+ "{Hoontech SoundTrack DSP 24 Value}," \
+ "{Hoontech SoundTrack DSP 24 Media 7.1}," \
-#define ICE1712_SUBDEVICE_STDSP24 0x12141217 /* Hoontech SoundTrack Audio DSP 24 */
+#define ICE1712_SUBDEVICE_STDSP24 0x12141217 /* Hoontech SoundTrack Audio DSP 24 */
+#define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217 /* Hoontech ST Audio DSP24 Media 7.1 */
extern struct snd_ice1712_card_info snd_ice1712_hoontech_cards[];
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index e1dba1ddbfcb..8133aa9796c3 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -32,6 +32,11 @@
* split the code to several files. each low-level routine
* is stored in the local file and called from registration
* function from card_info struct.
+ *
+ * 2002.11.26 James Stafford <jstafford@ampltd.com>
+ * Added support for VT1724 (Envy24HT)
+ * I have left out support for 176.4 and 192 KHz for the moment.
+ * I also haven't done anything with the internal S/PDIF transmitter or the MPU-401
*/
@@ -52,11 +57,13 @@
#include <sound/asoundef.h>
#include "ice1712.h"
+#include "envy24ht.h"
/* lowlevel routines */
#include "delta.h"
#include "ews.h"
#include "hoontech.h"
+#include "amp.h"
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("ICEnsemble ICE1712 (Envy24)");
@@ -66,8 +73,11 @@ MODULE_DEVICES("{"
HOONTECH_DEVICE_DESC
DELTA_DEVICE_DESC
EWS_DEVICE_DESC
+ AMP_AUDIO2000_DEVICE_DESC
"{ICEnsemble,Generic ICE1712},"
- "{ICEnsemble,Generic Envy24}}");
+ "{ICEnsemble,Generic Envy24},"
+ "{ICEnsemble,Generic ICE1724},"
+ "{ICEnsemble,Generic Envy24HT}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -93,9 +103,13 @@ MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
#ifndef PCI_DEVICE_ID_ICE_1712
#define PCI_DEVICE_ID_ICE_1712 0x1712
#endif
+#ifndef PCI_DEVICE_ID_VT1724
+#define PCI_DEVICE_ID_VT1724 0x1724
+#endif
static struct pci_device_id snd_ice1712_ids[] __devinitdata = {
{ PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* ICE1712 */
+ { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* VT1724 */
{ 0, }
};
@@ -104,10 +118,24 @@ MODULE_DEVICE_TABLE(pci, snd_ice1712_ids);
static int snd_ice1712_build_pro_mixer(ice1712_t *ice);
static int snd_ice1712_build_controls(ice1712_t *ice);
+static int PRO_RATE_LOCKED = 0;
+static int PRO_RATE_RESET = 1;
+static unsigned int PRO_RATE_DEFAULT = 44100;
+
/*
* Basic I/O
*/
+static inline int is_spdif_master(ice1712_t *ice)
+{
+ return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0;
+}
+
+static inline int is_pro_rate_locked(ice1712_t *ice)
+{
+ return is_spdif_master(ice) || PRO_RATE_LOCKED;
+}
+
static inline void snd_ice1712_ds_write(ice1712_t * ice, u8 channel, u8 addr, u32 data)
{
outb((channel << 4) | addr, ICEDS(ice, INDEX));
@@ -237,11 +265,8 @@ static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_
static int snd_ice1712_digmix_route_ac97_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
- spin_lock_irqsave(&ice->reg_lock, flags);
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0;
- spin_unlock_irqrestore(&ice->reg_lock, flags);
return 0;
}
@@ -249,14 +274,13 @@ static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_e
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
unsigned char val, nval;
- unsigned long flags;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
val = inb(ICEMT(ice, MONITOR_ROUTECTRL));
nval = val & ~ICE1712_ROUTE_AC97;
if (ucontrol->value.integer.value[0]) nval |= ICE1712_ROUTE_AC97;
outb(nval, ICEMT(ice, MONITOR_ROUTECTRL));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return val != nval;
}
@@ -276,26 +300,67 @@ static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
void snd_ice1712_gpio_write_bits(ice1712_t *ice, int mask, int bits)
{
ice->gpio_direction |= mask;
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->gpio_direction);
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask);
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, mask & bits);
+ if (ice->vt1724) {
+
+ outw(ice->gpio_direction, ICEREG1724(ice, GPIO_DIRECTION));
+ outb((ice->gpio_direction&0xff0000)>>16, ICEREG1724(ice, GPIO_DIRECTION_22));
+
+ outw(~mask, ICEREG1724(ice, GPIO_WRITE_MASK));
+ outb((~mask & 0xff0000)>>16, ICEREG1724(ice, GPIO_WRITE_MASK_22));
+
+ outl(mask & bits, ICEREG1724(ice, GPIO_DATA));
+
+ }
+ else {
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->gpio_direction);
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask);
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, mask & bits);
+ }
}
/*
*/
+/*
+ the VT1724 has 23 GPIO pins, so need 3 bytes for direction and 3 bytes for write mask
+ */
+
void snd_ice1712_save_gpio_status(ice1712_t *ice, unsigned char *tmp)
{
down(&ice->gpio_mutex);
- tmp[0] = ice->gpio_direction;
- tmp[1] = ice->gpio_write_mask;
+ if (ice->vt1724) {
+ tmp[0] = ice->gpio_direction & 0xff;
+ tmp[1] = (ice->gpio_direction &0xff00)>>8;
+ tmp[2] = (ice->gpio_direction &0xff0000)>>16;
+
+ tmp[3] = ice->gpio_write_mask & 0xff;
+ tmp[4] = (ice->gpio_write_mask &0xff00)>>8;
+ tmp[5] = (ice->gpio_write_mask &0xff0000)>>16;
+ }
+ else {
+ tmp[0] = ice->gpio_direction;
+ tmp[1] = ice->gpio_write_mask;
+ }
}
void snd_ice1712_restore_gpio_status(ice1712_t *ice, unsigned char *tmp)
{
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, tmp[0]);
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, tmp[1]);
- ice->gpio_direction = tmp[0];
- ice->gpio_write_mask = tmp[1];
+ if (ice->vt1724) {
+
+ outw(tmp[0] | ((tmp[1]&0xff00)<<8), ICEREG1724(ice, GPIO_DIRECTION));
+ outb(tmp[2], ICEREG1724(ice, GPIO_DIRECTION_22));
+
+ outw(tmp[3] | ((tmp[4]&0xff00)<<8), ICEREG1724(ice, GPIO_WRITE_MASK));
+ outb(tmp[5], ICEREG1724(ice, GPIO_WRITE_MASK_22));
+
+ ice->gpio_direction=tmp[0] | ((tmp[1]<<8)&0xff00) |((tmp[2]<<16)&0xff0000);
+ ice->gpio_write_mask=tmp[3] | ((tmp[4]<<8)&0xff00) |((tmp[5]<<16)&0xff0000);
+ }
+ else {
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, tmp[0]);
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, tmp[1]);
+ ice->gpio_direction = tmp[0];
+ ice->gpio_write_mask = tmp[1];
+ }
up(&ice->gpio_mutex);
}
@@ -449,6 +514,48 @@ static void snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
+static void snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return);
+ unsigned char status;
+
+ while (1) {
+ status = inb(ICEREG(ice, IRQSTAT));
+ if (status == 0)
+ break;
+
+ /* these should probably be separated at some point,
+ but as we don't currently have MPU support on the board I will leave it */
+ if ((status & VT1724_IRQ_MPU_RX)||(status & VT1724_IRQ_MPU_TX)) {
+ if (ice->rmidi[0])
+ snd_mpu401_uart_interrupt(irq, ice->rmidi[0]->private_data, regs);
+ outb(VT1724_IRQ_MPU_RX|VT1724_IRQ_MPU_TX, ICEREG(ice, IRQSTAT));
+ status &= ~(VT1724_IRQ_MPU_RX|VT1724_IRQ_MPU_TX);
+ }
+ if (status & VT1724_IRQ_MTPCM) {
+ unsigned char mtstat = inb(ICEMT(ice, IRQ));
+ if (mtstat & VT1724_MULTI_PDMA0) {
+ if (ice->playback_pro_substream)
+ snd_pcm_period_elapsed(ice->playback_pro_substream);
+ outb(VT1724_MULTI_PDMA0, ICEMT(ice, IRQ));
+ }
+ if (mtstat & VT1724_MULTI_RDMA0) {
+ if (ice->capture_pro_substream)
+ snd_pcm_period_elapsed(ice->capture_pro_substream);
+ outb(VT1724_MULTI_RDMA0, ICEMT(ice, IRQ));
+ }
+ /* ought to really handle this properly */
+ if (mtstat & VT1724_MULTI_FIFO_ERR) {
+ unsigned char fstat = inb(ICEMT1724(ice, DMA_FIFO_ERR));
+ outb(fstat, ICEMT1724(ice, DMA_FIFO_ERR));
+ outb(VT1724_MULTI_FIFO_ERR | inb(ICEMT1724(ice, DMA_INT_MASK)), ICEMT1724(ice, DMA_INT_MASK));
+ /* If I don't do this, I get machine lockup due to continual interrupts */
+ }
+
+ }
+ }
+}
+
/*
* PCM part - misc
*/
@@ -541,7 +648,6 @@ static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream,
static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream)
{
- unsigned long flags;
ice1712_t *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
u32 period_size, buf_size, rate, tmp;
@@ -556,7 +662,7 @@ static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream)
rate = (runtime->rate * 8192) / 375;
if (rate > 0x000fffff)
rate = 0x000fffff;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock(&ice->reg_lock);
outb(0, ice->ddma_port + 15);
outb(ICE1712_DMA_MODE_WRITE | ICE1712_DMA_AUTOINIT, ice->ddma_port + 0x0b);
outl(runtime->dma_addr, ice->ddma_port + 0);
@@ -569,13 +675,12 @@ static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream)
snd_ice1712_write(ice, ICE1712_IREG_PBK_COUNT_HI, period_size >> 8);
snd_ice1712_write(ice, ICE1712_IREG_PBK_LEFT, 0);
snd_ice1712_write(ice, ICE1712_IREG_PBK_RIGHT, 0);
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock(&ice->reg_lock);
return 0;
}
static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream)
{
- unsigned long flags;
ice1712_t *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
u32 period_size, buf_size, rate, tmp, chn;
@@ -593,7 +698,7 @@ static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream)
ice->playback_con_active_buf[substream->number] = 0;
ice->playback_con_virt_addr[substream->number] = runtime->dma_addr;
chn = substream->number * 2;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock(&ice->reg_lock);
snd_ice1712_ds_write(ice, chn, ICE1712_DSC_ADDR0, runtime->dma_addr);
snd_ice1712_ds_write(ice, chn, ICE1712_DSC_COUNT0, period_size);
snd_ice1712_ds_write(ice, chn, ICE1712_DSC_ADDR1, runtime->dma_addr + (runtime->periods > 1 ? period_size + 1 : 0));
@@ -605,13 +710,12 @@ static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream)
snd_ice1712_ds_write(ice, chn + 1, ICE1712_DSC_RATE, rate);
snd_ice1712_ds_write(ice, chn + 1, ICE1712_DSC_VOLUME, 0);
}
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock(&ice->reg_lock);
return 0;
}
static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream)
{
- unsigned long flags;
ice1712_t *ice = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
u32 period_size, buf_size;
@@ -624,13 +728,13 @@ static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream)
tmp &= ~0x04;
if (runtime->channels == 2)
tmp &= ~0x02;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock(&ice->reg_lock);
outl(ice->capture_con_virt_addr = runtime->dma_addr, ICEREG(ice, CONCAP_ADDR));
outw(buf_size, ICEREG(ice, CONCAP_COUNT));
snd_ice1712_write(ice, ICE1712_IREG_CAP_COUNT_HI, period_size >> 8);
snd_ice1712_write(ice, ICE1712_IREG_CAP_COUNT_LO, period_size & 0xff);
snd_ice1712_write(ice, ICE1712_IREG_CAP_CTRL, tmp);
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock(&ice->reg_lock);
snd_ac97_set_rate(ice->ac97, AC97_PCM_LR_ADC_RATE, runtime->rate);
return 0;
}
@@ -748,15 +852,14 @@ static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream);
- unsigned long flags;
u32 tmp;
ice->playback_con_substream_ds[substream->number] = substream;
runtime->hw = snd_ice1712_playback_ds;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
tmp = inw(ICEDS(ice, INTMASK)) & ~(1 << (substream->number * 2));
outw(tmp, ICEDS(ice, INTMASK));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return 0;
}
@@ -784,13 +887,12 @@ static int snd_ice1712_playback_close(snd_pcm_substream_t * substream)
static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream)
{
ice1712_t *ice = snd_pcm_substream_chip(substream);
- unsigned long flags;
u32 tmp;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
tmp = inw(ICEDS(ice, INTMASK)) | (3 << (substream->number * 2));
outw(tmp, ICEDS(ice, INTMASK));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
ice->playback_con_substream_ds[substream->number] = NULL;
return 0;
}
@@ -934,16 +1036,30 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
unsigned int old;
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
return -EINVAL;
- what = ICE1712_PLAYBACK_PAUSE;
- snd_pcm_trigger_done(substream, substream);
- spin_lock(&ice->reg_lock);
- old = inl(ICEMT(ice, PLAYBACK_CONTROL));
- if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH)
- old |= what;
- else
- old &= ~what;
- outl(old, ICEMT(ice, PLAYBACK_CONTROL));
- spin_unlock(&ice->reg_lock);
+ if (ice->vt1724) {
+ what = VT1724_PDMA0_PAUSE;
+ snd_pcm_trigger_done(substream, substream);
+ spin_lock(&ice->reg_lock);
+ old = inl(ICEMT1724(ice, DMA_PAUSE));
+ if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH)
+ old |= what;
+ else
+ old &= ~what;
+ outl(old, ICEMT1724(ice, DMA_PAUSE));
+ spin_unlock(&ice->reg_lock);
+ }
+ else {
+ what = ICE1712_PLAYBACK_PAUSE;
+ snd_pcm_trigger_done(substream, substream);
+ spin_lock(&ice->reg_lock);
+ old = inl(ICEMT(ice, PLAYBACK_CONTROL));
+ if (cmd == SNDRV_PCM_TRIGGER_PAUSE_PUSH)
+ old |= what;
+ else
+ old &= ~what;
+ outl(old, ICEMT(ice, PLAYBACK_CONTROL));
+ spin_unlock(&ice->reg_lock);
+ }
break;
}
case SNDRV_PCM_TRIGGER_START:
@@ -952,12 +1068,16 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
unsigned int what = 0;
unsigned int old;
snd_pcm_substream_t *s = substream;
+
do {
if (s == ice->playback_pro_substream) {
what |= ICE1712_PLAYBACK_START;
snd_pcm_trigger_done(s, substream);
} else if (s == ice->capture_pro_substream) {
- what |= ICE1712_CAPTURE_START_SHADOW;
+ if (ice->vt1724)
+ what |= VT1724_RDMA0_START;
+ else
+ what |= ICE1712_CAPTURE_START_SHADOW;
snd_pcm_trigger_done(s, substream);
}
s = s->link_next;
@@ -980,21 +1100,29 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
/*
*/
-static void snd_ice1712_set_pro_rate(ice1712_t *ice, snd_pcm_substream_t *substream)
+static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int force)
{
unsigned long flags;
- unsigned int rate;
unsigned char val;
spin_lock_irqsave(&ice->reg_lock, flags);
- if ((inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW|
- ICE1712_PLAYBACK_PAUSE|
- ICE1712_PLAYBACK_START)) ||
- (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) {
+ if (ice->vt1724 &&
+ ((inb(ICEMT(ice, PLAYBACK_CONTROL)) & (VT1724_RDMA0_START|ICE1712_PLAYBACK_START)) ||
+ (inb(ICEMT1724(ice, DMA_PAUSE) & VT1724_PDMA0_PAUSE)))) {
spin_unlock_irqrestore(&ice->reg_lock, flags);
return;
}
- rate = substream->runtime->rate;
+ else if (!ice->vt1724 && (inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW|
+ ICE1712_PLAYBACK_PAUSE|
+ ICE1712_PLAYBACK_START))) {
+ spin_unlock_irqrestore(&ice->reg_lock, flags);
+ return;
+ }
+ if (!force && is_pro_rate_locked(ice)) {
+ spin_unlock_irqrestore(&ice->reg_lock, flags);
+ return;
+ }
+
switch (rate) {
case 8000: val = 6; break;
case 9600: val = 3; break;
@@ -1015,24 +1143,46 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, snd_pcm_substream_t *substr
break;
}
outb(val, ICEMT(ice, RATE));
+
spin_unlock_irqrestore(&ice->reg_lock, flags);
if (ice->ak4524.ops.set_rate_val)
- ice->ak4524.ops.set_rate_val(ice, val);
+ ice->ak4524.ops.set_rate_val(ice, rate);
}
static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream)
{
- unsigned long flags;
ice1712_t *ice = snd_pcm_substream_chip(substream);
ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream);
- snd_ice1712_set_pro_rate(ice, substream);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ snd_ice1712_set_pro_rate(ice, substream->runtime->rate, 0);
+ spin_lock(&ice->reg_lock);
outl(substream->runtime->dma_addr, ICEMT(ice, PLAYBACK_ADDR));
- outw((ice->playback_pro_size >> 2) - 1, ICEMT(ice, PLAYBACK_SIZE));
- outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT(ice, PLAYBACK_COUNT));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ if (ice->vt1724) {
+ outl((ice->playback_pro_size >> 2) - 1, ICEMT(ice, PLAYBACK_SIZE));
+ outl((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT1724(ice, PLAYBACK_COUNT));
+
+ switch(substream->runtime->channels)
+ {
+ case 8:
+ outb(0, ICEMT1724(ice, BURST));
+ break;
+ case 6:
+ outb(1, ICEMT1724(ice, BURST));
+ break;
+ case 4:
+ outb(2, ICEMT1724(ice, BURST));
+ break;
+ case 2:
+ outb(3, ICEMT1724(ice, BURST));
+ break;
+ }
+ }
+ else {
+ outw((ice->playback_pro_size >> 2) - 1, ICEMT(ice, PLAYBACK_SIZE));
+ outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT(ice, PLAYBACK_COUNT));
+ }
+ spin_unlock(&ice->reg_lock);
if (ice->spdif.ops.setup)
ice->spdif.ops.setup(ice, substream);
@@ -1042,16 +1192,15 @@ static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream)
static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream)
{
- unsigned long flags;
ice1712_t *ice = snd_pcm_substream_chip(substream);
ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream);
- snd_ice1712_set_pro_rate(ice, substream);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ snd_ice1712_set_pro_rate(ice, substream->runtime->rate, 0);
+ spin_lock(&ice->reg_lock);
outl(substream->runtime->dma_addr, ICEMT(ice, CAPTURE_ADDR));
outw((ice->capture_pro_size >> 2) - 1, ICEMT(ice, CAPTURE_SIZE));
outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, ICEMT(ice, CAPTURE_COUNT));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock(&ice->reg_lock);
return 0;
}
@@ -1062,7 +1211,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t *
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START))
return 0;
- ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2);
+ if (ice->vt1724)
+ ptr = ice->playback_pro_size - ((inl(ICEMT(ice, PLAYBACK_SIZE))&0x7ffff) << 2);
+ else
+ ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2);
return bytes_to_frames(substream->runtime, ptr);
}
@@ -1097,6 +1249,27 @@ static snd_pcm_hardware_t snd_ice1712_playback_pro =
.fifo_size = 0,
};
+static snd_pcm_hardware_t snd_vt1724_playback_pro =
+{
+ .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_BLOCK_TRANSFER |
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,
+ .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
+ .rate_min = 4000,
+ .rate_max = 96000,
+ .channels_min = 2,
+ .channels_max = 8,
+ .buffer_bytes_max = 0x7ffff0, /* we have 18bits for the buffer size, in dwords */
+ .period_bytes_min = 8 * 4 * 2,
+ .period_bytes_max = 131040, /* do we have 18bits for terminal count?
+ Datasheets says bits 18:0 but only has 2 byte registers (1C-1Dh ) */
+ .periods_min = 1,
+ .periods_max = 1024,
+ .fifo_size = 0,
+};
+
static snd_pcm_hardware_t snd_ice1712_capture_pro =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
@@ -1117,13 +1290,36 @@ static snd_pcm_hardware_t snd_ice1712_capture_pro =
.fifo_size = 0,
};
+static snd_pcm_hardware_t snd_ice1724_capture_pro =
+{
+ .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_BLOCK_TRANSFER |
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,
+ .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,
+ .rate_min = 4000,
+ .rate_max = 96000,
+ .channels_min = 2,
+ .channels_max = 2,
+ .buffer_bytes_max = (256*1024),
+ .period_bytes_min = 2 * 4 * 2,
+ .period_bytes_max = 131040,
+ .periods_min = 1,
+ .periods_max = 1024,
+ .fifo_size = 0,
+};
+
static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream)
{
snd_pcm_runtime_t *runtime = substream->runtime;
ice1712_t *ice = snd_pcm_substream_chip(substream);
ice->playback_pro_substream = substream;
- runtime->hw = snd_ice1712_playback_pro;
+ if (ice->vt1724)
+ runtime->hw = snd_vt1724_playback_pro;
+ else
+ runtime->hw = snd_ice1712_playback_pro;
snd_pcm_set_sync(substream);
snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
@@ -1140,7 +1336,10 @@ static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
ice->capture_pro_substream = substream;
- runtime->hw = snd_ice1712_capture_pro;
+ if (ice->vt1724)
+ runtime->hw = snd_ice1724_capture_pro;
+ else
+ runtime->hw = snd_ice1712_capture_pro;
snd_pcm_set_sync(substream);
snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
@@ -1151,6 +1350,8 @@ static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream)
{
ice1712_t *ice = snd_pcm_substream_chip(substream);
+ if (PRO_RATE_RESET)
+ snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
ice->playback_pro_substream = NULL;
if (ice->spdif.ops.close)
ice->spdif.ops.close(ice, substream);
@@ -1162,6 +1363,8 @@ static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream)
{
ice1712_t *ice = snd_pcm_substream_chip(substream);
+ if (PRO_RATE_RESET)
+ snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
ice->capture_pro_substream = NULL;
return 0;
}
@@ -1261,31 +1464,29 @@ static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_e
static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
int index = kcontrol->private_value;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] = !((ice->pro_volumes[index] >> 15) & 1);
ucontrol->value.integer.value[1] = !((ice->pro_volumes[index] >> 31) & 1);
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return 0;
}
static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
unsigned int nval, change;
nval = (ucontrol->value.integer.value[0] ? 0 : 0x00008000) |
(ucontrol->value.integer.value[1] ? 0 : 0x80000000);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
nval |= ice->pro_volumes[index] & ~0x80008000;
change = nval != ice->pro_volumes[index];
ice->pro_volumes[index] = nval;
snd_ice1712_update_volume(ice, index);
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return change;
}
@@ -1301,36 +1502,34 @@ static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_e
static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
int index = kcontrol->private_value;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] = (ice->pro_volumes[index] >> 0) & 127;
ucontrol->value.integer.value[1] = (ice->pro_volumes[index] >> 16) & 127;
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return 0;
}
static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int index = kcontrol->private_value;
unsigned int nval, change;
nval = (ucontrol->value.integer.value[0] & 127) |
((ucontrol->value.integer.value[1] & 127) << 16);
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
nval |= ice->pro_volumes[index] & ~0x007f007f;
change = nval != ice->pro_volumes[index];
ice->pro_volumes[index] = nval;
snd_ice1712_update_volume(ice, index);
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return change;
}
-static int __init snd_ice1712_build_pro_mixer(ice1712_t *ice)
+static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
{
snd_card_t * card = ice->card;
snd_kcontrol_t ctl;
@@ -1475,6 +1674,20 @@ static void snd_ice1712_proc_read(snd_info_entry_t *entry,
snd_iprintf(buffer, " ADC ID #%i : 0x%x\n", idx, ice->eeprom.adcID[idx]);
for (idx = 0x1c; idx < ice->eeprom.size && idx < 0x1c + sizeof(ice->eeprom.extra); idx++)
snd_iprintf(buffer, " Extra #%02i : 0x%x\n", idx, ice->eeprom.extra[idx - 0x1c]);
+ snd_iprintf(buffer, "\nRegisters:\n");
+ if (ice->vt1724) {
+ snd_iprintf(buffer, " PSDOUT03 : 0x%08x\n", (unsigned)inl(ICEMT1724(ice, ROUTE_PLAYBACK)));
+ for (idx = 0x0; idx < 0x20 ; idx++)
+ snd_iprintf(buffer, " CCS%02x : 0x%02x\n", idx, inb(ice->port+idx));
+ for (idx = 0x0; idx < 0x30 ; idx++)
+ snd_iprintf(buffer, " MT%02x : 0x%02x\n", idx, inb(ice->profi_port+idx));
+
+ }
+ else {
+ snd_iprintf(buffer, " PSDOUT03 : 0x%04x\n", (unsigned)inw(ICEMT(ice, ROUTE_PSDOUT03)));
+ snd_iprintf(buffer, " CAPTURE : 0x%08x\n", inl(ICEMT(ice, ROUTE_CAPTURE)));
+ snd_iprintf(buffer, " SPDOUT : 0x%04x\n", (unsigned)inw(ICEMT(ice, ROUTE_SPDOUT)));
+ }
}
static void __devinit snd_ice1712_proc_init(ice1712_t * ice)
@@ -1668,10 +1881,13 @@ int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucont
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0;
- unsigned char saved[2];
+ unsigned char saved[6];
snd_ice1712_save_gpio_status(ice, saved);
- ucontrol->value.integer.value[0] = (snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & mask ? 1 : 0) ^ invert;
+ if (ice->vt1724)
+ ucontrol->value.integer.value[0] = (inb(ICEREG1724(ice, GPIO_DATA)) & mask ? 1 : 0) ^ invert;
+ else
+ ucontrol->value.integer.value[0] = (snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & mask ? 1 : 0) ^ invert;
snd_ice1712_restore_gpio_status(ice, saved);
return 0;
}
@@ -1681,67 +1897,186 @@ int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucont
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? mask : 0;
- unsigned char saved[2];
+ unsigned char saved[6];
int val, nval;
if (kcontrol->private_value & (1 << 31))
return -EPERM;
nval = (ucontrol->value.integer.value[0] ? mask : 0) ^ invert;
snd_ice1712_save_gpio_status(ice, saved);
- val = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
- nval |= val & ~mask;
- snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, nval);
+ if (ice->vt1724) {
+ val = inb(ICEREG1724(ice, GPIO_DATA));
+ nval |= val & ~mask;
+ outb(nval, ICEREG1724(ice, GPIO_DATA));
+ }
+ else {
+ val = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
+ nval |= val & ~mask;
+ snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, nval);
+ }
snd_ice1712_restore_gpio_status(ice, saved);
return val != nval;
}
-static int snd_ice1712_pro_spdif_master_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+/*
+ * rate
+ */
+static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
- uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ static char *texts[] = {
+ "8000", /* 0: 6 */
+ "9600", /* 1: 3 */
+ "11025", /* 2: 10 */
+ "12000", /* 3: 2 */
+ "16000", /* 4: 5 */
+ "22050", /* 5: 9 */
+ "24000", /* 6: 1 */
+ "32000", /* 7: 4 */
+ "44100", /* 8: 8 */
+ "48000", /* 9: 0 */
+ "64000", /* 10: 15 */
+ "88200", /* 11: 11 */
+ "96000", /* 12: 7 */
+ "IEC958 Input", /* 13: -- */
+ };
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = 1;
+ uinfo->value.enumerated.items = 14;
+ if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+ uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+ strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
}
-static int snd_ice1712_pro_spdif_master_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
+ static unsigned char xlate[16] = {
+ 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10
+ };
+ unsigned char val;
- spin_lock_irqsave(&ice->reg_lock, flags);
- ucontrol->value.integer.value[0] = inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER ? 1 : 0;
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
+ if (is_spdif_master(ice)) {
+ ucontrol->value.enumerated.item[0] = 13;
+ } else {
+ val = xlate[inb(ICEMT(ice, RATE)) & 15];
+ if (val == 255) {
+ snd_BUG();
+ val = 0;
+ }
+ ucontrol->value.enumerated.item[0] = val;
+ }
+ spin_unlock_irq(&ice->reg_lock);
return 0;
}
-static int snd_ice1712_pro_spdif_master_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- int nval, change;
+ static unsigned int xrate[13] = {
+ 8000, 9600, 11025, 12000, 1600, 22050, 24000,
+ 32000, 44100, 48000, 64000, 88200, 96000
+ };
+ unsigned char oval;
+ int change = 0;
- nval = ucontrol->value.integer.value[0] ? ICE1712_SPDIF_MASTER : 0;
- spin_lock_irqsave(&ice->reg_lock, flags);
- nval |= inb(ICEMT(ice, RATE)) & ~ICE1712_SPDIF_MASTER;
- change = inb(ICEMT(ice, RATE)) != nval;
- outb(nval, ICEMT(ice, RATE));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
+ oval = inb(ICEMT(ice, RATE));
+ if (ucontrol->value.enumerated.item[0] == 13) {
+ outb(oval | ICE1712_SPDIF_MASTER, ICEMT(ice, RATE));
+ } else {
+ PRO_RATE_DEFAULT = xrate[ucontrol->value.integer.value[0] % 13];
+ spin_unlock_irq(&ice->reg_lock);
+ snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 1);
+ spin_lock_irq(&ice->reg_lock);
+ }
+ change = inb(ICEMT(ice, RATE)) != oval;
+ spin_unlock_irq(&ice->reg_lock);
- if (ice->cs8427) {
+ if ((oval & ICE1712_SPDIF_MASTER) != (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) {
/* change CS8427 clock source too */
- snd_ice1712_cs8427_set_input_clock(ice, ucontrol->value.integer.value[0]);
+ if (ice->cs8427) {
+ snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice));
+ }
+ /* notify ak4524 chip as well */
+ if (is_spdif_master(ice) && ice->ak4524.ops.set_rate_val)
+ ice->ak4524.ops.set_rate_val(ice, 0);
}
return change;
}
-static snd_kcontrol_new_t snd_ice1712_pro_spdif_master __devinitdata = {
+static snd_kcontrol_new_t snd_ice1712_pro_internal_clock = __devinitdata {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Multi Track IEC958 Master",
- .info = snd_ice1712_pro_spdif_master_info,
- .get = snd_ice1712_pro_spdif_master_get,
- .put = snd_ice1712_pro_spdif_master_put
+ .name = "Multi Track Internal Clock",
+ .info = snd_ice1712_pro_internal_clock_info,
+ .get = snd_ice1712_pro_internal_clock_get,
+ .put = snd_ice1712_pro_internal_clock_put
+};
+
+static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int snd_ice1712_pro_rate_locking_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ucontrol->value.integer.value[0] = PRO_RATE_LOCKED ? 1 : 0;
+ return 0;
+}
+
+static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ int change = 0;
+
+ change = PRO_RATE_LOCKED ? 1 : 0 != ucontrol->value.integer.value[0] ? 1 : 0;
+ PRO_RATE_LOCKED = ucontrol->value.integer.value[0] ? 1 : 0;
+ return change;
+}
+
+static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Multi Track Rate Locking",
+ .info = snd_ice1712_pro_rate_locking_info,
+ .get = snd_ice1712_pro_rate_locking_get,
+ .put = snd_ice1712_pro_rate_locking_put
+};
+
+static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int snd_ice1712_pro_rate_reset_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ucontrol->value.integer.value[0] = PRO_RATE_RESET ? 1 : 0;
+ return 0;
+}
+
+static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ int change = 0;
+
+ change = PRO_RATE_LOCKED ? 1 : 0 != ucontrol->value.integer.value[0] ? 1 : 0;
+ PRO_RATE_RESET = ucontrol->value.integer.value[0] ? 1 : 0;
+ return change;
+}
+
+static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Multi Track Rate Reset",
+ .info = snd_ice1712_pro_rate_reset_info,
+ .get = snd_ice1712_pro_rate_reset_get,
+ .put = snd_ice1712_pro_rate_reset_put
};
/*
@@ -1771,10 +2106,14 @@ static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_e
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int idx = kcontrol->id.index;
unsigned int val, cval;
+
+ spin_lock_irq(&ice->reg_lock);
val = inw(ICEMT(ice, ROUTE_PSDOUT03));
+ cval = inl(ICEMT(ice, ROUTE_CAPTURE));
+ spin_unlock_irq(&ice->reg_lock);
+
val >>= ((idx % 2) * 8) + ((idx / 2) * 2);
val &= 3;
- cval = inl(ICEMT(ice, ROUTE_CAPTURE));
cval >>= ((idx / 2) * 8) + ((idx % 2) * 4);
if (val == 1 && idx < 2)
ucontrol->value.enumerated.item[0] = 11;
@@ -1804,16 +2143,19 @@ static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_e
else
nval = 0; /* pcm */
shift = ((idx % 2) * 8) + ((idx / 2) * 2);
+ spin_lock_irq(&ice->reg_lock);
val = old_val = inw(ICEMT(ice, ROUTE_PSDOUT03));
val &= ~(0x03 << shift);
val |= nval << shift;
change = val != old_val;
if (change)
outw(val, ICEMT(ice, ROUTE_PSDOUT03));
+ spin_unlock_irq(&ice->reg_lock);
if (nval < 2) /* dig mixer of pcm */
return change;
/* update CAPTURE */
+ spin_lock_irq(&ice->reg_lock);
val = old_val = inl(ICEMT(ice, ROUTE_CAPTURE));
shift = ((idx / 2) * 8) + ((idx % 2) * 4);
if (nval == 2) { /* analog in */
@@ -1829,6 +2171,7 @@ static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_e
change = 1;
outl(val, ICEMT(ice, ROUTE_CAPTURE));
}
+ spin_unlock_irq(&ice->reg_lock);
return change;
}
@@ -1859,6 +2202,7 @@ static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_el
unsigned int val, old_val, nval;
/* update SPDOUT */
+ spin_lock_irq(&ice->reg_lock);
val = old_val = inw(ICEMT(ice, ROUTE_SPDOUT));
if (ucontrol->value.enumerated.item[0] >= 11)
nval = 1;
@@ -1884,6 +2228,7 @@ static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_el
change = val != old_val;
if (change)
outw(val, ICEMT(ice, ROUTE_SPDOUT));
+ spin_unlock_irq(&ice->reg_lock);
return change;
}
@@ -1904,6 +2249,141 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = {
};
+static int snd_vt1724_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+ static char *texts[] = {
+ "PCM Out", /* 0 */
+ "H/W In 0", "H/W In 1", /* 1-2 */
+ "IEC958 In L", "IEC958 In R", /* 3-4 */
+ };
+
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+ uinfo->count = 1;
+ uinfo->value.enumerated.items = 5;//kcontrol->id.index < 2 ? 12 : 11;
+ if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+ uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+ strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+ return 0;
+}
+
+static int snd_vt1724_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+ int idx = kcontrol->id.index;
+ unsigned long val;
+ unsigned char eitem;
+ static unsigned char xlate[8] = {
+ 0, 255, 1, 2, 255, 255, 3, 4,
+ };
+
+ val = inl(ICEMT1724(ice, ROUTE_PLAYBACK));
+ val >>= ((idx % 2) * 12) + ((idx / 2) * 3)+8;
+ val &= 7; //we now have 3 bits per output
+ eitem=xlate[val];
+ if (eitem == 255) {
+ snd_BUG();
+ eitem = 0;
+ }
+ ucontrol->value.enumerated.item[0] = eitem;
+
+ return 0;
+}
+
+static int snd_vt1724_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+ int change, shift;
+ int idx = kcontrol->id.index;
+ unsigned int val, old_val, nval;
+ static unsigned char xroute[8] = {
+ 0, /* PCM */
+ 2, /* PSDIN0 Left */
+ 3, /* PSDIN0 Right */
+ 6, /* SPDIN Left */
+ 7, /* SPDIN Right */
+ };
+
+ /* update PSDOUT */
+
+ nval=xroute[ucontrol->value.enumerated.item[0]&7];
+ shift = ((idx % 2) * 12) + ((idx / 2) * 3) +8;
+ val = old_val = inw(ICEMT1724(ice, ROUTE_PLAYBACK));
+ val &= ~(0x07 << shift);
+ val |= nval << shift;
+ change = val != old_val;
+ if (change)
+ outw(val, ICEMT1724(ice, ROUTE_PLAYBACK));
+ return change;
+}
+
+static int snd_vt1724_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+ int idx = kcontrol->id.index;
+ unsigned long val;
+ unsigned char eitem;
+ static unsigned char xlate[8] = {
+ 0, 255, 1, 2, 255, 255, 3, 4,
+ };
+
+ val = inl(ICEMT1724(ice, ROUTE_PLAYBACK));
+ val >>= idx*3; //I hope this is right
+ val &= 7;
+
+ eitem=xlate[val];
+ if (eitem == 255) {
+ snd_BUG();
+ eitem = 0;
+ }
+ ucontrol->value.enumerated.item[0] = eitem;
+ return 0;
+}
+
+static int snd_vt1724_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+ ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+ int change, shift;
+ int idx = kcontrol->id.index;
+ unsigned long val, old_val, nval;
+ static unsigned char xroute[8] = {
+ 0, /* PCM */
+ 2, /* PSDIN0 Left */
+ 3, /* PSDIN0 Right */
+ 6, /* SPDIN Left */
+ 7, /* SPDIN Right */
+ };
+
+ /* update SPDOUT */
+ val = old_val = inl(ICEMT1724(ice, ROUTE_PLAYBACK));
+ nval = xroute[ucontrol->value.enumerated.item[0]&7];
+
+ shift = idx * 2;
+ val &= ~(0x07 << shift);
+ val |= nval << shift;
+ shift = idx * 4 + 8;
+ change = val != old_val;
+ if (change)
+ outl(val, ICEMT1724(ice, ROUTE_PLAYBACK));
+ return change;
+}
+
+static snd_kcontrol_new_t snd_vt1724_mixer_pro_analog_route __devinitdata = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "H/W Playback Route",
+ .info = snd_vt1724_pro_route_info,
+ .get = snd_vt1724_pro_route_analog_get,
+ .put = snd_vt1724_pro_route_analog_put,
+};
+
+static snd_kcontrol_new_t snd_vt1724_mixer_pro_spdif_route __devinitdata = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "IEC958 Playback Route",
+ .info = snd_vt1724_pro_route_info,
+ .get = snd_vt1724_pro_route_spdif_get,
+ .put = snd_vt1724_pro_route_spdif_put,
+};
+
+
static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -1916,24 +2396,20 @@ static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_el
static int snd_ice1712_pro_volume_rate_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
- spin_lock_irqsave(&ice->reg_lock, flags);
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
return 0;
}
static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
- unsigned long flags;
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
int change;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
change = inb(ICEMT(ice, MONITOR_RATE)) != ucontrol->value.integer.value[0];
outb(ucontrol->value.integer.value[0], ICEMT(ice, MONITOR_RATE));
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return change;
}
@@ -1957,15 +2433,14 @@ static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info
static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
ice1712_t *ice = snd_kcontrol_chip(kcontrol);
- unsigned long flags;
int idx;
- spin_lock_irqsave(&ice->reg_lock, flags);
+ spin_lock_irq(&ice->reg_lock);
for (idx = 0; idx < 22; idx++) {
outb(idx, ICEMT(ice, MONITOR_PEAKINDEX));
ucontrol->value.integer.value[idx] = inb(ICEMT(ice, MONITOR_PEAKDATA));
}
- spin_unlock_irqrestore(&ice->reg_lock, flags);
+ spin_unlock_irq(&ice->reg_lock);
return 0;
}
@@ -2017,9 +2492,13 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice)
return -EIO;
}
ice->eeprom.codec = snd_ice1712_read_i2c(ice, dev, 0x06);
+ if (ice->vt1724)
+ ice->eeprom.codec |= ICE1712_CFG_NO_CON_AC97; /* little hack here */
ice->eeprom.aclink = snd_ice1712_read_i2c(ice, dev, 0x07);
ice->eeprom.i2sID = snd_ice1712_read_i2c(ice, dev, 0x08);
ice->eeprom.spdif = snd_ice1712_read_i2c(ice, dev, 0x09);
+ if (ice->vt1724)
+ ice->eeprom.spdif &= ~VT1724_CFG_SPDIF_OUT_EN; /* little hack here */
ice->eeprom.gpiomask = snd_ice1712_read_i2c(ice, dev, 0x0a);
ice->eeprom.gpiostate = snd_ice1712_read_i2c(ice, dev, 0x0b);
ice->eeprom.gpiodir = snd_ice1712_read_i2c(ice, dev, 0x0c);
@@ -2076,6 +2555,27 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice)
return 0;
}
+static int __devinit snd_vt1724_chip_init(ice1712_t *ice)
+{
+ outb(VT1724_RESET , ICEREG(ice, CONTROL));
+ udelay(200);
+ outb(0, ICEREG(ice, CONTROL));
+ udelay(200);
+ outb(ice->eeprom.codec, ICEREG1724(ice, SYS_CFG));
+ outb(ice->eeprom.aclink&0x7f, ICEREG1724(ice, AC97_CFG));
+ outb(ice->eeprom.i2sID, ICEREG1724(ice, I2S_FEATURES));
+ outb(ice->eeprom.spdif, ICEREG1724(ice, SPDIF_CFG));
+
+ ice->gpio_write_mask = ice->eeprom.gpiomask;
+ ice->gpio_direction = ice->eeprom.gpiodir;
+ outb(ice->eeprom.gpiomask, ICEREG1724(ice, GPIO_WRITE_MASK));
+ outb(ice->eeprom.gpiodir, ICEREG1724(ice, GPIO_DIRECTION));
+ outb(ice->eeprom.gpiostate, ICEREG1724(ice, GPIO_DATA));
+
+ outb(0, ICEREG1724(ice, POWERDOWN));
+
+ return 0;
+}
int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice)
{
@@ -2113,33 +2613,67 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_eeprom, ice));
if (err < 0)
return err;
- err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_spdif_master, ice));
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_internal_clock, ice));
if (err < 0)
return err;
- for (idx = 0; idx < ice->num_total_dacs; idx++) {
- kctl = snd_ctl_new1(&snd_ice1712_mixer_pro_analog_route, ice);
- if (kctl == NULL)
- return -ENOMEM;
- kctl->id.index = idx;
- err = snd_ctl_add(ice->card, kctl);
+
+ if (ice->vt1724) {
+ for (idx = 0; idx < ice->num_total_dacs; idx++) {
+ kctl = snd_ctl_new1(&snd_vt1724_mixer_pro_analog_route, ice);
+ if (kctl == NULL)
+ return -ENOMEM;
+ kctl->id.index = idx;
+ err = snd_ctl_add(ice->card, kctl);
+ if (err < 0)
+ return err;
+ }
+ for (idx = 0; idx < 2; idx++) {
+ kctl = snd_ctl_new1(&snd_vt1724_mixer_pro_spdif_route, ice);
+ if (kctl == NULL)
+ return -ENOMEM;
+ kctl->id.index = idx;
+ err = snd_ctl_add(ice->card, kctl);
+ if (err < 0)
+ return err;
+ }
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_pro_peak, ice));
if (err < 0)
return err;
+
}
- for (idx = 0; idx < 2; idx++) {
- kctl = snd_ctl_new1(&snd_ice1712_mixer_pro_spdif_route, ice);
- if (kctl == NULL)
- return -ENOMEM;
- kctl->id.index = idx;
- err = snd_ctl_add(ice->card, kctl);
+ else {
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_rate_locking, ice));
+ if (err < 0)
+ return err;
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_rate_reset, ice));
+ if (err < 0)
+ return err;
+
+ for (idx = 0; idx < ice->num_total_dacs; idx++) {
+ kctl = snd_ctl_new1(&snd_ice1712_mixer_pro_analog_route, ice);
+ if (kctl == NULL)
+ return -ENOMEM;
+ kctl->id.index = idx;
+ err = snd_ctl_add(ice->card, kctl);
+ if (err < 0)
+ return err;
+ }
+ for (idx = 0; idx < 2; idx++) {
+ kctl = snd_ctl_new1(&snd_ice1712_mixer_pro_spdif_route, ice);
+ if (kctl == NULL)
+ return -ENOMEM;
+ kctl->id.index = idx;
+ err = snd_ctl_add(ice->card, kctl);
+ if (err < 0)
+ return err;
+ }
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_pro_volume_rate, ice));
+ if (err < 0)
+ return err;
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_pro_peak, ice));
if (err < 0)
return err;
}
- err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_pro_volume_rate, ice));
- if (err < 0)
- return err;
- err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_pro_peak, ice));
- if (err < 0)
- return err;
return 0;
}
@@ -2148,7 +2682,10 @@ static int snd_ice1712_free(ice1712_t *ice)
if (ice->res_port == NULL)
goto __hw_end;
/* mask all interrupts */
- outb(0xc0, ICEMT(ice, IRQ));
+ if (ice->vt1724)
+ outb(0xff, ICEMT1724(ice, DMA_INT_MASK));
+ else
+ outb(0xc0, ICEMT(ice, IRQ));
outb(0xff, ICEREG(ice, IRQMASK));
/* --- */
__hw_end:
@@ -2199,16 +2736,22 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
/* enable PCI device */
if ((err = pci_enable_device(pci)) < 0)
return err;
- /* check, if we can restrict PCI DMA transfers to 28 bits */
- if (!pci_dma_supported(pci, 0x0fffffff)) {
- snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
- return -ENXIO;
+ /* VT1724 does not have 28bit DMA transfer limit */
+ if (pci->device==PCI_DEVICE_ID_ICE_1712) {
+ /* check, if we can restrict PCI DMA transfers to 28 bits */
+ if (!pci_dma_supported(pci, 0x0fffffff)) {
+ snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
+ return -ENXIO;
+ }
+ pci_set_dma_mask(pci, 0x0fffffff);
}
- pci_set_dma_mask(pci, 0x0fffffff);
+ else pci_set_dma_mask(pci, 0xffffffff);
ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
if (ice == NULL)
return -ENOMEM;
+ if (pci->device==PCI_DEVICE_ID_VT1724)
+ ice->vt1724=1;
ice->omni = omni ? 1 : 0;
spin_lock_init(&ice->reg_lock);
init_MUTEX(&ice->gpio_mutex);
@@ -2220,60 +2763,105 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
ice->pci = pci;
ice->irq = -1;
ice->port = pci_resource_start(pci, 0);
- ice->ddma_port = pci_resource_start(pci, 1);
- ice->dmapath_port = pci_resource_start(pci, 2);
- ice->profi_port = pci_resource_start(pci, 3);
- pci_set_master(pci);
- pci_write_config_word(ice->pci, 0x40, 0x807f);
- pci_write_config_word(ice->pci, 0x42, 0x0006);
- snd_ice1712_proc_init(ice);
- synchronize_irq(pci->irq);
-
- if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
- snd_ice1712_free(ice);
- snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->port, ice->port + 32 - 1);
- return -EIO;
- }
- if ((ice->res_ddma_port = request_region(ice->ddma_port, 16, "ICE1712 - DDMA")) == NULL) {
- snd_ice1712_free(ice);
- snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->ddma_port, ice->ddma_port + 16 - 1);
- return -EIO;
- }
- if ((ice->res_dmapath_port = request_region(ice->dmapath_port, 16, "ICE1712 - DMA path")) == NULL) {
- snd_ice1712_free(ice);
- snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->dmapath_port, ice->dmapath_port + 16 - 1);
- return -EIO;
- }
- if ((ice->res_profi_port = request_region(ice->profi_port, 64, "ICE1712 - Professional")) == NULL) {
- snd_ice1712_free(ice);
- snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->profi_port, ice->profi_port + 16 - 1);
- return -EIO;
- }
- if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1712", (void *) ice)) {
- snd_ice1712_free(ice);
- snd_printk("unable to grab IRQ %d\n", pci->irq);
- return -EIO;
- }
- ice->irq = pci->irq;
+ if (ice->vt1724) {
+ ice->profi_port = pci_resource_start(pci, 1);
+ pci_set_master(pci);
+ snd_ice1712_proc_init(ice);
+ synchronize_irq(pci->irq);
+
+ if ((ice->res_port = request_region(ice->port, 32, "ICE1724 - Controller")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->port, ice->port + 32 - 1);
+ return -EIO;
+ }
- if (snd_ice1712_read_eeprom(ice) < 0) {
- snd_ice1712_free(ice);
- return -EIO;
- }
- if (snd_ice1712_chip_init(ice) < 0) {
- snd_ice1712_free(ice);
- return -EIO;
- }
+ if ((ice->res_profi_port = request_region(ice->profi_port, 128, "ICE1724 - Professional")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->profi_port, ice->profi_port + 16 - 1);
+ return -EIO;
+ }
+
+ if (request_irq(pci->irq, snd_vt1724_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1724", (void *) ice)) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab IRQ %d\n", pci->irq);
+ return -EIO;
+ }
+
+ ice->irq = pci->irq;
+
+ if (snd_ice1712_read_eeprom(ice) < 0) {
+ snd_ice1712_free(ice);
+ return -EIO;
+ }
+ if (snd_vt1724_chip_init(ice) < 0) {
+ snd_ice1712_free(ice);
+ return -EIO;
+ }
+
+ /* unmask used interrupts */
+ outb((ice->eeprom.codec & ICE1712_CFG_2xMPU401) == 0 ? (VT1724_IRQ_MPU_RX|VT1724_IRQ_MPU_TX) : 0 ,
+ ICEREG(ice, IRQMASK));
+ /* don't handle FIFO overrun/underruns (just yet), since they cause machine lockups */
+ outb(VT1724_MULTI_FIFO_ERR, ICEMT1724(ice, DMA_INT_MASK));
+ }
+ else {
+ ice->ddma_port = pci_resource_start(pci, 1);
+ ice->dmapath_port = pci_resource_start(pci, 2);
+ ice->profi_port = pci_resource_start(pci, 3);
+ pci_set_master(pci);
+ pci_write_config_word(ice->pci, 0x40, 0x807f);
+ pci_write_config_word(ice->pci, 0x42, 0x0006);
+ snd_ice1712_proc_init(ice);
+ synchronize_irq(pci->irq);
+
+
+ if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->port, ice->port + 32 - 1);
+ return -EIO;
+ }
+ if ((ice->res_ddma_port = request_region(ice->ddma_port, 16, "ICE1712 - DDMA")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->ddma_port, ice->ddma_port + 16 - 1);
+ return -EIO;
+ }
+ if ((ice->res_dmapath_port = request_region(ice->dmapath_port, 16, "ICE1712 - DMA path")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->dmapath_port, ice->dmapath_port + 16 - 1);
+ return -EIO;
+ }
+ if ((ice->res_profi_port = request_region(ice->profi_port, 64, "ICE1712 - Professional")) == NULL) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->profi_port, ice->profi_port + 16 - 1);
+ return -EIO;
+ }
+ if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1712", (void *) ice)) {
+ snd_ice1712_free(ice);
+ snd_printk("unable to grab IRQ %d\n", pci->irq);
+ return -EIO;
+ }
+
+ ice->irq = pci->irq;
+
+ if (snd_ice1712_read_eeprom(ice) < 0) {
+ snd_ice1712_free(ice);
+ return -EIO;
+ }
+ if (snd_ice1712_chip_init(ice) < 0) {
+ snd_ice1712_free(ice);
+ return -EIO;
+ }
- /* unmask used interrupts */
- outb((ice->eeprom.codec & ICE1712_CFG_2xMPU401) == 0 ? ICE1712_IRQ_MPU2 : 0 |
- (ice->eeprom.codec & ICE1712_CFG_NO_CON_AC97) ? ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0,
- ICEREG(ice, IRQMASK));
- outb(0x00, ICEMT(ice, IRQ));
+ /* unmask used interrupts */
+ outb((ice->eeprom.codec & ICE1712_CFG_2xMPU401) == 0 ? ICE1712_IRQ_MPU2 : 0 |
+ (ice->eeprom.codec & ICE1712_CFG_NO_CON_AC97) ? ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0,
+ ICEREG(ice, IRQMASK));
+ outb(0x00, ICEMT(ice, IRQ));
+ }
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops)) < 0) {
snd_ice1712_free(ice);
- return err;
+ return err;
}
*r_ice1712 = ice;
@@ -2283,7 +2871,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
/*
*
- * Registraton
+ * Registration
*
*/
@@ -2293,6 +2881,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
snd_ice1712_hoontech_cards,
snd_ice1712_delta_cards,
snd_ice1712_ews_cards,
+ snd_vt1724_amp_cards,
0,
};
@@ -2317,8 +2906,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
if (card == NULL)
return -ENOMEM;
- strcpy(card->driver, "ICE1712");
- strcpy(card->shortname, "ICEnsemble ICE1712");
+ if (pci->device==PCI_DEVICE_ID_ICE_1712) {
+ strcpy(card->driver, "ICE1712");
+ strcpy(card->shortname, "ICEnsemble ICE1712");
+ } else {
+ strcpy(card->driver, "ICE1724");
+ strcpy(card->shortname, "ICEnsemble ICE1724");
+ }
if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) {
snd_card_free(card);
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 3d6ae77c1d62..acbc30293ee5 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -248,6 +248,7 @@ struct snd_ak4524 {
unsigned int cif: 1;
unsigned char data_mask;
unsigned char clk_mask;
+ unsigned char caddr; /* C0 and C1 bits */
unsigned char cs_mask;
unsigned char cs_addr;
unsigned char cs_none;
@@ -256,7 +257,7 @@ struct snd_ak4524 {
struct snd_ak4524_ops {
int (*start)(ice1712_t *, unsigned char *, int);
void (*stop)(ice1712_t *, unsigned char *);
- void (*set_rate_val)(ice1712_t *, unsigned char);
+ void (*set_rate_val)(ice1712_t *, unsigned int);
} ops;
};
@@ -335,7 +336,8 @@ struct _snd_ice1712 {
snd_i2c_device_t *cs8427; /* CS8427 I2C device */
snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */
- unsigned char gpio_direction, gpio_write_mask;
+ unsigned int gpio_direction, gpio_write_mask;
+ int vt1724;
};
#define chip_t ice1712_t
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 35522c355a13..bf051b78385c 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -53,6 +53,7 @@ MODULE_DEVICES("{{Intel,82801AA-ICH},"
"{Intel,MX440},"
"{SiS,SI7012},"
"{NVidia,NForce Audio},"
+ "{NVidia,NForce2 Audio},"
"{AMD,AMD768},"
"{AMD,AMD8111},"
"{ALI,M5455}}");
@@ -127,6 +128,9 @@ MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x300}},dialog
#ifndef PCI_DEVICE_ID_NVIDIA_MCP_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP_AUDIO 0x01b1
#endif
+#ifndef PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO
+#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a
+#endif
enum { DEVICE_INTEL, DEVICE_INTEL_ICH4, DEVICE_SIS, DEVICE_ALI };
@@ -383,6 +387,7 @@ static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
{ 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 440MX */
{ 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_SIS }, /* SI7012 */
{ 0x10de, 0x01b1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* NFORCE */
+ { 0x10de, 0x006a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* NFORCE2 */
{ 0x1022, 0x746d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD8111 */
{ 0x1022, 0x7445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* AMD768 */
{ 0x10b9, 0x5455, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALI }, /* Ali5455 */
@@ -2298,6 +2303,7 @@ static struct shortname_table {
{ PCI_DEVICE_ID_INTEL_ICH4, "Intel 82801DB-ICH4" },
{ PCI_DEVICE_ID_SI_7012, "SiS SI7012" },
{ PCI_DEVICE_ID_NVIDIA_MCP_AUDIO, "NVidia NForce" },
+ { PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO, "NVidia NForce2" },
{ 0x746d, "AMD AMD8111" },
{ 0x7445, "AMD AMD768" },
{ 0x5455, "ALi M5455" },
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index c1cbdc975e5c..aa523b8b4b51 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -1894,7 +1894,7 @@ static void snd_korg1212_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *b
snd_iprintf(buffer, " Irq count: %ld\n", korg1212->irqcount);
}
-static void __init snd_korg1212_proc_init(korg1212_t *korg1212)
+static void __devinit snd_korg1212_proc_init(korg1212_t *korg1212)
{
snd_info_entry_t *entry;
@@ -1920,7 +1920,7 @@ static void snd_korg1212_proc_done(korg1212_t * korg1212)
}
}
-static int __init snd_korg1212_create(korg1212_t *korg1212)
+static int __devinit snd_korg1212_create(korg1212_t *korg1212)
{
struct pci_dev *pci = korg1212->pci;
int err;
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 70d7dd9d649a..b1f061459a3d 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -23,9 +23,38 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
- * ToDo: full duplex (32, 32/8, 32Pro)
+ * ****************************************************************************
+ *
+ * Note #1 "Sek'd models" ................................... martin 2002-12-07
+ *
+ * Identical soundcards by Sek'd were labeled:
+ * RME Digi 32 = Sek'd Prodif 32
+ * RME Digi 32 Pro = Sek'd Prodif 96
+ * RME Digi 32/8 = Sek'd Prodif Gold
+ *
+ * ****************************************************************************
+ *
+ * Note #2 "full duplex mode" ............................... martin 2002-12-07
+ *
+ * Full duplex doesn't work. All cards (32, 32/8, 32Pro) are working identical
+ * in this mode. Rec data and play data are using the same buffer therefore. At
+ * first you have got the playing bits in the buffer and then (after playing
+ * them) they were overwitten by the captured sound of the CS8412/14. Both
+ * modes (play/record) are running harmonically hand in hand in the same buffer
+ * and you have only one start bit plus one interrupt bit to control this
+ * paired action.
+ * This is opposite to the latter rme96 where playing and capturing is totally
+ * separated and so their full duplex mode is supported by alsa (using two
+ * start bits and two interrupts for two different buffers).
+ * But due to the wrong sequence of playing and capturing ALSA shows no solved
+ * full duplex support for the rme32 at the moment. That's bad, but I'm not
+ * able to solve it. Are you motivated enough to solve this problem now? Your
+ * patch would be welcome!
+ *
+ * ****************************************************************************
*/
+
#include <sound/driver.h>
#include <linux/delay.h>
#include <linux/init.h>
@@ -80,29 +109,29 @@ MODULE_DEVICES("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
#define RME32_IO_RESET_POS 0x20100
/* Write control register bits */
-#define RME32_WCR_START (1 << 0)
-#define RME32_WCR_MONO (1 << 1) /* 0: stereo, 1: mono
+#define RME32_WCR_START (1 << 0) /* startbit */
+#define RME32_WCR_MONO (1 << 1) /* 0=stereo, 1=mono
Setting the whole card to mono
- don't seems to be very useful.
+ doesn't seem to be very useful.
A software-solution can handle
full-duplex with one direction in
stereo and the other way in mono.
So, the hardware should work all
the time in stereo! */
-#define RME32_WCR_MODE24 (1 << 2)
-#define RME32_WCR_SEL (1 << 3)
-#define RME32_WCR_FREQ_0 (1 << 4)
+#define RME32_WCR_MODE24 (1 << 2) /* 0=16bit, 1=32bit */
+#define RME32_WCR_SEL (1 << 3) /* 0=input on output, 1=normal playback/capture */
+#define RME32_WCR_FREQ_0 (1 << 4) /* frequency (play) */
#define RME32_WCR_FREQ_1 (1 << 5)
-#define RME32_WCR_INP_0 (1 << 6)
+#define RME32_WCR_INP_0 (1 << 6) /* input switch */
#define RME32_WCR_INP_1 (1 << 7)
-#define RME32_WCR_RESET (1 << 8)
-#define RME32_WCR_MUTE (1 << 9)
-#define RME32_WCR_PRO (1 << 10)
-#define RME32_WCR_DS_BM (1 << 11) /* only PRO/Adat-Version */
-#define RME32_WCR_ADAT (1 << 12) /* only Adat-Version */
-#define RME32_WCR_AUTOSYNC (1 << 13)
-#define RME32_WCR_PD (1 << 14) /* only PRO-Version */
-#define RME32_WCR_EMP (1 << 15) /* only PRO-Version */
+#define RME32_WCR_RESET (1 << 8) /* Reset address */
+#define RME32_WCR_MUTE (1 << 9) /* digital mute for output */
+#define RME32_WCR_PRO (1 << 10) /* 1=professional, 0=consumer */
+#define RME32_WCR_DS_BM (1 << 11) /* 1=DoubleSpeed (only PRO-Version); 1=BlockMode (only Adat-Version) */
+#define RME32_WCR_ADAT (1 << 12) /* Adat Mode (only Adat-Version) */
+#define RME32_WCR_AUTOSYNC (1 << 13) /* AutoSync */
+#define RME32_WCR_PD (1 << 14) /* DAC Reset (only PRO-Version) */
+#define RME32_WCR_EMP (1 << 15) /* 1=Emphasis on (only PRO-Version) */
#define RME32_WCR_BITPOS_FREQ_0 4
#define RME32_WCR_BITPOS_FREQ_1 5
@@ -111,13 +140,13 @@ MODULE_DEVICES("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
/* Read control register bits */
#define RME32_RCR_AUDIO_ADDR_MASK 0x10001
-#define RME32_RCR_LOCK (1 << 23)
-#define RME32_RCR_ERF (1 << 26)
-#define RME32_RCR_FREQ_0 (1 << 27)
+#define RME32_RCR_LOCK (1 << 23) /* 1=locked, 0=not locked */
+#define RME32_RCR_ERF (1 << 26) /* 1=Error, 0=no Error */
+#define RME32_RCR_FREQ_0 (1 << 27) /* CS841x frequency (record) */
#define RME32_RCR_FREQ_1 (1 << 28)
#define RME32_RCR_FREQ_2 (1 << 29)
-#define RME32_RCR_KMODE (1 << 30)
-#define RME32_RCR_IRQ (1 << 31)
+#define RME32_RCR_KMODE (1 << 30) /* card mode: 1=PLL, 0=quartz */
+#define RME32_RCR_IRQ (1 << 31) /* interrupt */
#define RME32_RCR_BITPOS_F0 27
#define RME32_RCR_BITPOS_F1 28
@@ -153,12 +182,12 @@ MODULE_DEVICES("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
#ifndef PCI_DEVICE_ID_DIGI32
# define PCI_DEVICE_ID_DIGI32 0x9896
#endif
-#ifndef PCI_DEVICE_ID_DIGI32_8
-# define PCI_DEVICE_ID_DIGI32_8 0x9898
-#endif
#ifndef PCI_DEVICE_ID_DIGI32_PRO
# define PCI_DEVICE_ID_DIGI32_PRO 0x9897
#endif
+#ifndef PCI_DEVICE_ID_DIGI32_8
+# define PCI_DEVICE_ID_DIGI32_8 0x9898
+#endif
typedef struct snd_rme32 {
spinlock_t lock;
@@ -291,21 +320,21 @@ static snd_pcm_hardware_t snd_rme32_playback_spdif_info = {
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE),
- formats: (SNDRV_PCM_FMTBIT_S16_LE |
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
- rates: (SNDRV_PCM_RATE_32000 |
+ .rates = (SNDRV_PCM_RATE_32000 |
SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
- rate_min: 32000,
- rate_max: 48000,
- channels_min: 2,
- channels_max: 2,
- buffer_bytes_max: RME32_BUFFER_SIZE,
- period_bytes_min: RME32_BLOCK_SIZE,
- period_bytes_max: RME32_BLOCK_SIZE,
- periods_min: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- periods_max: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- fifo_size: 0,
+ .rate_min = 32000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ .buffer_bytes_max = RME32_BUFFER_SIZE,
+ .period_bytes_min = RME32_BLOCK_SIZE,
+ .period_bytes_max = RME32_BLOCK_SIZE,
+ .periods_min = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .periods_max = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .fifo_size = 0,
};
/*
@@ -314,20 +343,23 @@ static snd_pcm_hardware_t snd_rme32_playback_spdif_info = {
static snd_pcm_hardware_t snd_rme32_capture_spdif_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE),
- formats: (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE),
- rates: (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000),
- rate_min: 32000,
- rate_max: 48000,
- channels_min: 2,
- channels_max: 2,
- buffer_bytes_max: RME32_BUFFER_SIZE,
- period_bytes_min: RME32_BLOCK_SIZE,
- period_bytes_max: RME32_BLOCK_SIZE,
- periods_min: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- periods_max: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- fifo_size: 0,
+ SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_PAUSE),
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S32_LE),
+ .rates = (SNDRV_PCM_RATE_32000 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000),
+ .rate_min = 32000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ .buffer_bytes_max = RME32_BUFFER_SIZE,
+ .period_bytes_min = RME32_BLOCK_SIZE,
+ .period_bytes_max = RME32_BLOCK_SIZE,
+ .periods_min = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .periods_max = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .fifo_size = 0,
};
/*
@@ -339,19 +371,19 @@ static snd_pcm_hardware_t snd_rme32_playback_adat_info =
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE),
- formats: SNDRV_PCM_FMTBIT_S16_LE,
- rates: (SNDRV_PCM_RATE_44100 |
+ .formats= SNDRV_PCM_FMTBIT_S16_LE,
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
- rate_min: 44100,
- rate_max: 48000,
- channels_min: 8,
- channels_max: 8,
- buffer_bytes_max: RME32_BUFFER_SIZE,
- period_bytes_min: RME32_BLOCK_SIZE,
- period_bytes_max: RME32_BLOCK_SIZE,
- periods_min: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- periods_max: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- fifo_size: 0,
+ .rate_min = 44100,
+ .rate_max = 48000,
+ .channels_min = 8,
+ .channels_max = 8,
+ .buffer_bytes_max = RME32_BUFFER_SIZE,
+ .period_bytes_min = RME32_BLOCK_SIZE,
+ .period_bytes_max = RME32_BLOCK_SIZE,
+ .periods_min = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .periods_max = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .fifo_size = 0,
};
/*
@@ -363,19 +395,19 @@ static snd_pcm_hardware_t snd_rme32_capture_adat_info =
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE),
- formats: SNDRV_PCM_FMTBIT_S16_LE,
- rates: (SNDRV_PCM_RATE_44100 |
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
- rate_min: 44100,
- rate_max: 48000,
- channels_min: 8,
- channels_max: 8,
- buffer_bytes_max: RME32_BUFFER_SIZE,
- period_bytes_min: RME32_BLOCK_SIZE,
- period_bytes_max: RME32_BLOCK_SIZE,
- periods_min: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- periods_max: RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
- fifo_size: 0,
+ .rate_min = 44100,
+ .rate_max = 48000,
+ .channels_min = 8,
+ .channels_max = 8,
+ .buffer_bytes_max = RME32_BUFFER_SIZE,
+ .period_bytes_min = RME32_BLOCK_SIZE,
+ .period_bytes_max = RME32_BLOCK_SIZE,
+ .periods_min = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .periods_max = RME32_BUFFER_SIZE / RME32_BLOCK_SIZE,
+ .fifo_size = 0,
};
static void snd_rme32_reset_dac(rme32_t *rme32)
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 001dbe1d8625..65279749c7bf 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -305,7 +305,7 @@ snd_rme96_playback_pointer(snd_pcm_substream_t *substream);
static snd_pcm_uframes_t
snd_rme96_capture_pointer(snd_pcm_substream_t *substream);
-static void __init
+static void __devinit
snd_rme96_proc_init(rme96_t *rme96);
static void
@@ -1589,7 +1589,7 @@ snd_rme96_free_adat_pcm(snd_pcm_t *pcm)
snd_pcm_lib_preallocate_free_for_all(pcm);
}
-static int __init
+static int __devinit
snd_rme96_create(rme96_t *rme96)
{
struct pci_dev *pci = rme96->pci;
@@ -1838,7 +1838,7 @@ snd_rme96_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
}
}
-static void __init
+static void __devinit
snd_rme96_proc_init(rme96_t *rme96)
{
snd_info_entry_t *entry;
diff --git a/sound/pci/rme9652/hammerfall_mem.c b/sound/pci/rme9652/hammerfall_mem.c
index 0e44ba440acf..2705ca915220 100644
--- a/sound/pci/rme9652/hammerfall_mem.c
+++ b/sound/pci/rme9652/hammerfall_mem.c
@@ -178,7 +178,7 @@ void snd_hammerfall_free_buffer (struct pci_dev *pcidev, void *addr)
printk ("Hammerfall memory allocator: unknown buffer address or PCI device ID");
}
-static void hammerfall_free_buffers (void)
+static void __exit hammerfall_free_buffers (void)
{
int i;
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index e2426b38b62a..320a057bdfe2 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -2,6 +2,7 @@
* ALSA driver for RME Hammerfall DSP audio interface(s)
*
* Copyright (c) 2002 Paul Davis
+ * Marcus Andersson
*
* 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
@@ -81,7 +82,7 @@ typedef enum {
#define DIGIFACE_SS_CHANNELS 26
#define DIGIFACE_DS_CHANNELS 14
#define MULTIFACE_SS_CHANNELS 18
-#define MULTIFACE_DS_CHANNELS 10
+#define MULTIFACE_DS_CHANNELS 14
/* Write registers. These are defined as byte-offsets from the iobase value.
*/
@@ -687,6 +688,7 @@ static int hdsp_set_rate(hdsp_t *hdsp, int rate)
rate = HDSP_Frequency96KHz;
break;
default:
+ spin_unlock_irq(&hdsp->lock);
return -EINVAL;
}
@@ -747,10 +749,12 @@ static void hdsp_set_thru(hdsp_t *hdsp, int channel, int enable)
mapped_channel = hdsp->channel_map[channel];
+ snd_assert(mapped_channel > -1, return);
+
if (enable) {
- hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY(channel,channel), UNITY_GAIN);
+ hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY(mapped_channel,mapped_channel), UNITY_GAIN);
} else {
- hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY(channel,channel), MINUS_INFINITY_GAIN);
+ hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY(mapped_channel,mapped_channel), MINUS_INFINITY_GAIN);
}
}
}
@@ -1605,10 +1609,18 @@ static int snd_hdsp_get_playback_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_v
hdsp_t *hdsp = _snd_kcontrol_chip(kcontrol);
unsigned long flags;
int addr;
- int chn;
+ int channel;
+ int mapped_channel;
- chn = ucontrol->id.index - 1;
- addr = PLAYBACK_TO_OUTPUT_KEY(chn, chn);
+ channel = ucontrol->id.index - 1;
+
+ snd_assert(channel >= 0 || channel < HDSP_MAX_CHANNELS, return -EINVAL);
+
+ if ((mapped_channel = hdsp->channel_map[channel]) < 0) {
+ return -EINVAL;
+ }
+
+ addr = PLAYBACK_TO_OUTPUT_KEY(mapped_channel, mapped_channel);
spin_lock_irqsave(&hdsp->lock, flags);
ucontrol->value.integer.value[0] = hdsp_read_gain (hdsp, addr);
@@ -1622,14 +1634,22 @@ static int snd_hdsp_put_playback_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_v
unsigned long flags;
int change;
int addr;
- int chn;
+ int channel;
+ int mapped_channel;
int gain;
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
- chn = ucontrol->id.index - 1;
- addr = PLAYBACK_TO_OUTPUT_KEY(chn, chn);
+ channel = ucontrol->id.index - 1;
+
+ snd_assert(channel >= 0 || channel < HDSP_MAX_CHANNELS, return -EINVAL);
+
+ if ((mapped_channel = hdsp->channel_map[channel]) < 0) {
+ return -EINVAL;
+ }
+
+ addr = PLAYBACK_TO_OUTPUT_KEY(mapped_channel, mapped_channel);
gain = ucontrol->value.integer.value[0];
@@ -2434,15 +2454,15 @@ static int snd_hdsp_channel_info(snd_pcm_substream_t *substream,
snd_pcm_channel_info_t *info)
{
hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
- int chn;
+ int mapped_channel;
snd_assert(info->channel < HDSP_MAX_CHANNELS, return -EINVAL);
- if ((chn = hdsp->channel_map[info->channel]) < 0) {
+ if ((mapped_channel = hdsp->channel_map[info->channel]) < 0) {
return -EINVAL;
}
- info->offset = chn * HDSP_CHANNEL_BUFFER_BYTES;
+ info->offset = mapped_channel * HDSP_CHANNEL_BUFFER_BYTES;
info->first = 0;
info->step = 32;
return 0;
@@ -2567,7 +2587,7 @@ static snd_pcm_hardware_t snd_hdsp_playback_subinfo =
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
- .channels_min = 10,
+ .channels_min = 14,
.channels_max = HDSP_MAX_CHANNELS,
.buffer_bytes_max = 1024*1024,
.period_bytes_min = 1,
@@ -2592,7 +2612,7 @@ static snd_pcm_hardware_t snd_hdsp_capture_subinfo =
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
- .channels_min = 10,
+ .channels_min = 14,
.channels_max = HDSP_MAX_CHANNELS,
.buffer_bytes_max = 1024*1024,
.period_bytes_min = 1,
@@ -2902,11 +2922,15 @@ static int __devinit snd_hdsp_initialize_firmware (hdsp_t *hdsp)
}
}
- if (hdsp_fifo_wait (hdsp, 3, HDSP_LONG_WAIT)) {
+ if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
snd_printk ("timeout at end of firmware loading\n");
return -EIO;
}
+ hdsp_write (hdsp, HDSP_jtagReg, 0);
+ snd_printk ("finished firmware loading\n");
+ mdelay(3000);
+
} else {
/* firmware already loaded, but we need to know what type
@@ -3045,9 +3069,11 @@ static int __devinit snd_hdsp_create(snd_card_t *card,
static int snd_hdsp_free(hdsp_t *hdsp)
{
- /* stop the audio, and cancel all interrupts */
- hdsp->control_register &= ~(HDSP_Start|HDSP_AudioInterruptEnable|HDSP_Midi0InterruptEnable|HDSP_Midi1InterruptEnable);
- hdsp_write (hdsp, HDSP_controlRegister, hdsp->control_register);
+ if (hdsp->res_port) {
+ /* stop the audio, and cancel all interrupts */
+ hdsp->control_register &= ~(HDSP_Start|HDSP_AudioInterruptEnable|HDSP_Midi0InterruptEnable|HDSP_Midi1InterruptEnable);
+ hdsp_write (hdsp, HDSP_controlRegister, hdsp->control_register);
+ }
if (hdsp->irq >= 0)
free_irq(hdsp->irq, (void *)hdsp);
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index e14f607f053c..3c86c0d418f9 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -1799,7 +1799,7 @@ snd_rme9652_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
snd_iprintf(buffer, "\n");
}
-static void __init snd_rme9652_proc_init(rme9652_t *rme9652)
+static void __devinit snd_rme9652_proc_init(rme9652_t *rme9652)
{
snd_info_entry_t *entry;
@@ -1869,7 +1869,7 @@ static int snd_rme9652_free(rme9652_t *rme9652)
return 0;
}
-static int __init snd_rme9652_initialize_memory(rme9652_t *rme9652)
+static int __devinit snd_rme9652_initialize_memory(rme9652_t *rme9652)
{
void *pb, *cb;
dma_addr_t pb_addr, cb_addr;
@@ -2523,7 +2523,7 @@ static snd_pcm_ops_t snd_rme9652_capture_ops = {
.copy = snd_rme9652_capture_copy,
};
-static int __init snd_rme9652_create_pcm(snd_card_t *card,
+static int __devinit snd_rme9652_create_pcm(snd_card_t *card,
rme9652_t *rme9652)
{
snd_pcm_t *pcm;
@@ -2547,7 +2547,7 @@ static int __init snd_rme9652_create_pcm(snd_card_t *card,
return 0;
}
-static int __init snd_rme9652_create(snd_card_t *card,
+static int __devinit snd_rme9652_create(snd_card_t *card,
rme9652_t *rme9652,
int precise_ptr)
{
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index 6f19dae851b4..3efda7d475e3 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -85,7 +85,7 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
snd_card_t *card;
trident_t *trident;
const char *str;
- int err;
+ int err, pcm_dev = 0;
if (dev >= SNDRV_CARDS)
return -ENODEV;
@@ -106,21 +106,21 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
- if ((err = snd_trident_pcm(trident, 0, NULL)) < 0) {
+ if ((err = snd_trident_pcm(trident, pcm_dev++, NULL)) < 0) {
snd_card_free(card);
return err;
}
switch (trident->device) {
case TRIDENT_DEVICE_ID_DX:
case TRIDENT_DEVICE_ID_NX:
- if ((err = snd_trident_foldback_pcm(trident, 1, NULL)) < 0) {
+ if ((err = snd_trident_foldback_pcm(trident, pcm_dev++, NULL)) < 0) {
snd_card_free(card);
return err;
}
break;
}
- if (trident->device == TRIDENT_DEVICE_ID_NX) {
- if ((err = snd_trident_spdif_pcm(trident, 2, NULL)) < 0) {
+ if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ if ((err = snd_trident_spdif_pcm(trident, pcm_dev++, NULL)) < 0) {
snd_card_free(card);
return err;
}
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 5ec1fea1da56..c0e7811e086a 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -23,6 +23,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
+ *
+ * SiS7018 S/PDIF support by Thomas Winischhofer <thomas@winischhofer.net>
*/
#include <sound/driver.h>
@@ -52,6 +54,7 @@ static void snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs);
#ifdef CONFIG_PM
static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_state);
#endif
+static int snd_trident_sis_reset(trident_t *trident);
/*
* common I/O routines
@@ -149,7 +152,7 @@ static unsigned short snd_trident_codec_read(ac97_t *ac97, unsigned short reg)
} while (--count);
}
- if (count == 0) {
+ if (count == 0 && !trident->ac97_detect) {
snd_printk("ac97 codec read TIMEOUT [0x%x/0x%x]!!!\n", reg, data);
data = 0;
}
@@ -477,6 +480,15 @@ void snd_trident_write_voice_regs(trident_t * trident,
outl(regs[2], TRID_REG(trident, CH_START + 8));
outl(regs[3], TRID_REG(trident, CH_START + 12));
outl(regs[4], TRID_REG(trident, CH_START + 16));
+
+#if 0
+ printk("written %i channel:\n", voice->number);
+ printk(" regs[0] = 0x%x/0x%x\n", regs[0], inl(TRID_REG(trident, CH_START + 0)));
+ printk(" regs[1] = 0x%x/0x%x\n", regs[1], inl(TRID_REG(trident, CH_START + 4)));
+ printk(" regs[2] = 0x%x/0x%x\n", regs[2], inl(TRID_REG(trident, CH_START + 8)));
+ printk(" regs[3] = 0x%x/0x%x\n", regs[3], inl(TRID_REG(trident, CH_START + 12)));
+ printk(" regs[4] = 0x%x/0x%x\n", regs[4], inl(TRID_REG(trident, CH_START + 16)));
+#endif
}
/*---------------------------------------------------------------------------
@@ -727,9 +739,9 @@ static int snd_trident_ioctl(snd_pcm_substream_t * substream,
}
/*---------------------------------------------------------------------------
- snd_trident_playback_hw_params
+ snd_trident_allocate_pcm_mem
- Description: Set the hardware parameters for the playback device.
+ Description: Allocate PCM ring buffer for given substream
Parameters: substream - PCM substream class
hw_params - hardware parameters
@@ -738,14 +750,12 @@ static int snd_trident_ioctl(snd_pcm_substream_t * substream,
---------------------------------------------------------------------------*/
-static int snd_trident_playback_hw_params(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+int snd_trident_allocate_pcm_mem(snd_pcm_substream_t * substream,
+ snd_pcm_hw_params_t * hw_params)
{
trident_t *trident = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- snd_trident_voice_t *evoice = voice->extra;
- unsigned long flags;
int err;
if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
@@ -753,16 +763,38 @@ static int snd_trident_playback_hw_params(snd_pcm_substream_t * substream,
if (err > 0 && trident->tlb.entries) {
if (voice->memblk)
snd_trident_free_pages(trident, voice->memblk);
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock_irq(&trident->reg_lock);
voice->memblk = snd_trident_alloc_pages(trident, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock_irq(&trident->reg_lock);
if (voice->memblk == NULL)
return -ENOMEM;
}
+ return 0;
+}
+
+/*---------------------------------------------------------------------------
+ snd_trident_allocate_evoice
+
+ Description: Allocate extra voice as interrupt generator
+
+ Parameters: substream - PCM substream class
+ hw_params - hardware parameters
+
+ Returns: Error status
+
+ ---------------------------------------------------------------------------*/
+
+int snd_trident_allocate_evoice(snd_pcm_substream_t * substream,
+ snd_pcm_hw_params_t * hw_params)
+{
+ trident_t *trident = snd_pcm_substream_chip(substream);
+ snd_pcm_runtime_t *runtime = substream->runtime;
+ snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
+ snd_trident_voice_t *evoice = voice->extra;
/* voice management */
- if (params_buffer_size(hw_params) / 2 != params_period_size(hw_params)) {
+ if (params_buffer_size(hw_params) / 2 != params_buffer_size(hw_params)) {
if (evoice == NULL) {
evoice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
if (evoice == NULL)
@@ -781,6 +813,29 @@ static int snd_trident_playback_hw_params(snd_pcm_substream_t * substream,
}
/*---------------------------------------------------------------------------
+ snd_trident_hw_params
+
+ Description: Set the hardware parameters for the playback device.
+
+ Parameters: substream - PCM substream class
+ hw_params - hardware parameters
+
+ Returns: Error status
+
+ ---------------------------------------------------------------------------*/
+
+static int snd_trident_hw_params(snd_pcm_substream_t * substream,
+ snd_pcm_hw_params_t * hw_params)
+{
+ int err;
+
+ err = snd_trident_allocate_pcm_mem(substream, hw_params);
+ if (err >= 0)
+ err = snd_trident_allocate_evoice(substream, hw_params);
+ return err;
+}
+
+/*---------------------------------------------------------------------------
snd_trident_playback_hw_free
Description: Release the hardware resources for the playback device.
@@ -791,7 +846,7 @@ static int snd_trident_playback_hw_params(snd_pcm_substream_t * substream,
---------------------------------------------------------------------------*/
-static int snd_trident_playback_hw_free(snd_pcm_substream_t * substream)
+static int snd_trident_hw_free(snd_pcm_substream_t * substream)
{
trident_t *trident = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
@@ -828,9 +883,8 @@ static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
snd_trident_voice_t *evoice = voice->extra;
snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[substream->number];
- unsigned long flags;
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock(&trident->reg_lock);
/* set delta (rate) value */
voice->Delta = snd_trident_convert_rate(runtime->rate);
@@ -855,6 +909,12 @@ static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
voice->CVol = mix->cvol;
voice->Pan = mix->pan;
voice->Attribute = 0;
+#if 0
+ voice->Attribute = (1<<(30-16))|(2<<(26-16))|
+ (0<<(24-16))|(0x1f<<(19-16));
+#else
+ voice->Attribute = 0;
+#endif
snd_trident_write_voice_regs(trident, voice);
@@ -875,14 +935,14 @@ static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
evoice->Pan = 0x7f; /* mute */
#if 0
evoice->Attribute = (1<<(30-16))|(2<<(26-16))|
- (1<<(24-16))|(0x1f<<(19-16));
+ (0<<(24-16))|(0x1f<<(19-16));
#else
evoice->Attribute = 0;
#endif
snd_trident_write_voice_regs(trident, evoice);
}
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock(&trident->reg_lock);
return 0;
}
@@ -902,49 +962,7 @@ static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
static int snd_trident_capture_hw_params(snd_pcm_substream_t * substream,
snd_pcm_hw_params_t * hw_params)
{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- unsigned long flags;
- int err;
-
- if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
- return err;
- if (err > 0 && trident->tlb.entries) {
- if (voice->memblk)
- snd_trident_free_pages(trident, voice->memblk);
- spin_lock_irqsave(&trident->reg_lock, flags);
- voice->memblk = snd_trident_alloc_pages(trident, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
- spin_unlock_irqrestore(&trident->reg_lock, flags);
- if (voice->memblk == NULL)
- return -ENOMEM;
- }
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- snd_trident_capture_hw_free
-
- Description: Release the hardware resources for the capture device.
-
- Parameters: substream - PCM substream class
-
- Returns: Error status
-
- ---------------------------------------------------------------------------*/
-
-static int snd_trident_capture_hw_free(snd_pcm_substream_t * substream)
-{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
-
- if (trident->tlb.entries && voice && voice->memblk) {
- snd_trident_free_pages(trident, voice->memblk);
- voice->memblk = NULL;
- }
- snd_pcm_lib_free_pages(substream);
- return 0;
+ return snd_trident_allocate_pcm_mem(substream, hw_params);
}
/*---------------------------------------------------------------------------
@@ -964,9 +982,8 @@ static int snd_trident_capture_prepare(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
unsigned int val, ESO_bytes;
- unsigned long flags;
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock(&trident->reg_lock);
// Initilize the channel and set channel Mode
outb(0, TRID_REG(trident, LEGACY_DMAR15));
@@ -1037,7 +1054,7 @@ static int snd_trident_capture_prepare(snd_pcm_substream_t * substream)
snd_trident_write_voice_regs(trident, voice);
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock(&trident->reg_lock);
return 0;
}
@@ -1056,33 +1073,12 @@ static int snd_trident_capture_prepare(snd_pcm_substream_t * substream)
static int snd_trident_si7018_capture_hw_params(snd_pcm_substream_t * substream,
snd_pcm_hw_params_t * hw_params)
{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- snd_trident_voice_t *evoice = voice->extra;
int err;
if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
return err;
- /* voice management */
-
- if (params_buffer_size(hw_params) / 2 != params_period_size(hw_params)) {
- if (evoice == NULL) {
- evoice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
- if (evoice == NULL)
- return -ENOMEM;
- voice->extra = evoice;
- evoice->substream = substream;
- }
- } else {
- if (evoice != NULL) {
- snd_trident_free_voice(trident, evoice);
- voice->extra = evoice = NULL;
- }
- }
-
- return 0;
+ return snd_trident_allocate_evoice(substream, hw_params);
}
/*---------------------------------------------------------------------------
@@ -1128,9 +1124,8 @@ static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
snd_trident_voice_t *evoice = voice->extra;
- unsigned long flags;
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock(&trident->reg_lock);
voice->LBA = runtime->dma_addr;
voice->Delta = snd_trident_convert_adc_rate(runtime->rate);
@@ -1176,91 +1171,7 @@ static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream)
snd_trident_write_voice_regs(trident, evoice);
}
- spin_unlock_irqrestore(&trident->reg_lock, flags);
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- snd_trident_foldback_hw_params
-
- Description: Set the hardware parameters for the foldback device.
-
- Parameters: substream - PCM substream class
- hw_params - hardware parameters
-
- Returns: Error status
-
- ---------------------------------------------------------------------------*/
-
-static int snd_trident_foldback_hw_params(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
-{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- snd_trident_voice_t *evoice = voice->extra;
- unsigned long flags;
- int err;
-
- if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
- return err;
- if (err > 0 && trident->tlb.entries) {
- if (voice->memblk)
- snd_trident_free_pages(trident, voice->memblk);
- spin_lock_irqsave(&trident->reg_lock, flags);
- voice->memblk = snd_trident_alloc_pages(trident, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
- spin_unlock_irqrestore(&trident->reg_lock, flags);
- if (voice->memblk == NULL)
- return -ENOMEM;
- }
-
- /* voice management */
-
- if (params_buffer_size(hw_params) / 2 != params_buffer_size(hw_params)) {
- if (evoice == NULL) {
- evoice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
- if (evoice == NULL)
- return -ENOMEM;
- voice->extra = evoice;
- evoice->substream = substream;
- }
- } else {
- if (evoice != NULL) {
- snd_trident_free_voice(trident, evoice);
- voice->extra = evoice = NULL;
- }
- }
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- snd_trident_foldback_hw_free
-
- Description: Release the hardware resources for the foldback device.
-
- Parameters: substream - PCM substream class
-
- Returns: Error status
-
- ---------------------------------------------------------------------------*/
-
-static int snd_trident_foldback_hw_free(snd_pcm_substream_t * substream)
-{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- snd_trident_voice_t *evoice = voice ? voice->extra : NULL;
-
- if (trident->tlb.entries && voice && voice->memblk) {
- snd_trident_free_pages(trident, voice->memblk);
- voice->memblk = NULL;
- }
- snd_pcm_lib_free_pages(substream);
- if (evoice != NULL) {
- snd_trident_free_voice(trident, evoice);
- voice->extra = NULL;
- }
+ spin_unlock(&trident->reg_lock);
return 0;
}
@@ -1281,9 +1192,8 @@ static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
snd_trident_voice_t *evoice = voice->extra;
- unsigned long flags;
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock(&trident->reg_lock);
/* Set channel buffer Address */
if (voice->memblk)
@@ -1335,7 +1245,7 @@ static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream)
snd_trident_write_voice_regs(trident, evoice);
}
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock(&trident->reg_lock);
return 0;
}
@@ -1355,26 +1265,21 @@ static int snd_trident_spdif_hw_params(snd_pcm_substream_t * substream,
snd_pcm_hw_params_t * hw_params)
{
trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
- unsigned long flags;
unsigned int old_bits = 0, change = 0;
int err;
- if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
+ err = snd_trident_allocate_pcm_mem(substream, hw_params);
+ if (err < 0)
return err;
- if (err > 0 && trident->tlb.entries) {
- if (voice->memblk)
- snd_trident_free_pages(trident, voice->memblk);
- spin_lock_irqsave(&trident->reg_lock, flags);
- voice->memblk = snd_trident_alloc_pages(trident, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
- spin_unlock_irqrestore(&trident->reg_lock, flags);
- if (voice->memblk == NULL)
- return -ENOMEM;
+
+ if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ err = snd_trident_allocate_evoice(substream, hw_params);
+ if (err < 0)
+ return err;
}
/* prepare SPDIF channel */
- spin_lock_irqsave(&trident->reg_lock, flags);
+ spin_lock_irq(&trident->reg_lock);
old_bits = trident->spdif_pcm_bits;
if (old_bits & IEC958_AES0_PROFESSIONAL)
trident->spdif_pcm_bits &= ~IEC958_AES0_PRO_FS;
@@ -1402,7 +1307,7 @@ static int snd_trident_spdif_hw_params(snd_pcm_substream_t * substream,
(IEC958_AES3_CON_FS_32000 << 24);
}
change = old_bits != trident->spdif_pcm_bits;
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock_irq(&trident->reg_lock);
if (change)
snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE, &trident->spdif_pcm_ctl->id);
@@ -1411,31 +1316,6 @@ static int snd_trident_spdif_hw_params(snd_pcm_substream_t * substream,
}
/*---------------------------------------------------------------------------
- snd_trident_spdif_hw_free
-
- Description: Release the hardware resources for the spdif device.
-
- Parameters: substream - PCM substream class
-
- Returns: Error status
-
- ---------------------------------------------------------------------------*/
-
-static int snd_trident_spdif_hw_free(snd_pcm_substream_t * substream)
-{
- trident_t *trident = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
-
- if (trident->tlb.entries && voice && voice->memblk) {
- snd_trident_free_pages(trident, voice->memblk);
- voice->memblk = NULL;
- }
- snd_pcm_lib_free_pages(substream);
- return 0;
-}
-
-/*---------------------------------------------------------------------------
snd_trident_spdif_prepare
Description: Prepare SPDIF device for playback.
@@ -1451,55 +1331,116 @@ static int snd_trident_spdif_prepare(snd_pcm_substream_t * substream)
trident_t *trident = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime;
snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
+ snd_trident_voice_t *evoice = voice->extra;
+ snd_trident_pcm_mixer_t *mix = &trident->pcm_mixer[substream->number];
unsigned int RESO, LBAO;
- unsigned long flags;
-
- spin_lock_irqsave(&trident->reg_lock, flags);
+ unsigned int temp;
- /* set delta (rate) value */
- voice->Delta = snd_trident_convert_rate(runtime->rate);
- voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
+ spin_lock(&trident->reg_lock);
- /* set Loop Back Address */
- LBAO = runtime->dma_addr;
- if (voice->memblk)
- voice->LBA = voice->memblk->offset;
- else
- voice->LBA = LBAO;
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
- /* set target ESO for channel */
- RESO = runtime->buffer_size - 1;
- voice->ESO = (runtime->period_size * 2) - 1;
+ /* set delta (rate) value */
+ voice->Delta = snd_trident_convert_rate(runtime->rate);
+ voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
- /* set ctrl mode */
- voice->CTRL = snd_trident_control_mode(substream);
+ /* set Loop Back Address */
+ LBAO = runtime->dma_addr;
+ if (voice->memblk)
+ voice->LBA = voice->memblk->offset;
+ else
+ voice->LBA = LBAO;
+
+ /* set target ESO for channel */
+ RESO = runtime->buffer_size - 1;
+ voice->ESO = (runtime->period_size * 2) - 1;
+
+ /* set ctrl mode */
+ voice->CTRL = snd_trident_control_mode(substream);
+
+ voice->FMC = 3;
+ voice->RVol = 0x7f;
+ voice->CVol = 0x7f;
+ voice->GVSel = 1;
+ voice->Pan = 0x7f;
+ voice->Vol = 0x3ff;
+ voice->EC = 0;
+ voice->CSO = 0;
+ voice->Alpha = 0;
+ voice->FMS = 0;
+ voice->Attribute = 0;
+
+ /* prepare surrogate IRQ channel */
+ snd_trident_write_voice_regs(trident, voice);
+
+ outw((RESO & 0xffff), TRID_REG(trident, NX_SPESO));
+ outb((RESO >> 16), TRID_REG(trident, NX_SPESO + 2));
+ outl((LBAO & 0xfffffffc), TRID_REG(trident, NX_SPLBA));
+ outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO));
+ outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2));
+
+ /* set SPDIF setting */
+ outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
- voice->FMC = 3;
- voice->RVol = 0x7f;
- voice->CVol = 0x7f;
- voice->GVSel = 1;
- voice->Pan = 0x7f;
- voice->Vol = 0x3ff;
- voice->EC = 0;
- voice->CSO = 0;
- voice->Alpha = 0;
- voice->FMS = 0;
- voice->Attribute = 0;
+ } else { /* SiS */
+
+ /* set delta (rate) value */
+ voice->Delta = 0x800;
+ voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size);
- /* prepare surrogate IRQ channel */
- snd_trident_write_voice_regs(trident, voice);
+ /* set Loop Begin Address */
+ if (voice->memblk)
+ voice->LBA = voice->memblk->offset;
+ else
+ voice->LBA = runtime->dma_addr;
+
+ voice->CSO = 0;
+ voice->ESO = runtime->buffer_size - 1; /* in samples */
+ voice->CTRL = snd_trident_control_mode(substream);
+ voice->FMC = 3;
+ voice->GVSel = 1;
+ voice->EC = 0;
+ voice->Alpha = 0;
+ voice->FMS = 0;
+ voice->Vol = mix->vol;
+ voice->RVol = mix->rvol;
+ voice->CVol = mix->cvol;
+ voice->Pan = mix->pan;
+ voice->Attribute = (1<<(30-16))|(7<<(26-16))|
+ (0<<(24-16))|(0<<(19-16));
+
+ snd_trident_write_voice_regs(trident, voice);
- outw((RESO & 0xffff), TRID_REG(trident, NX_SPESO));
- outb((RESO >> 16), TRID_REG(trident, NX_SPESO + 2));
- outl((LBAO & 0xfffffffc), TRID_REG(trident, NX_SPLBA));
- outw((voice->CSO & 0xffff), TRID_REG(trident, NX_SPCTRL_SPCSO));
- outb((voice->CSO >> 16), TRID_REG(trident, NX_SPCTRL_SPCSO + 2));
+ if (evoice != NULL) {
+ evoice->Delta = voice->Delta;
+ evoice->spurious_threshold = voice->spurious_threshold;
+ evoice->LBA = voice->LBA;
+ evoice->CSO = 0;
+ evoice->ESO = (runtime->period_size * 2) - 1; /* in samples */
+ evoice->CTRL = voice->CTRL;
+ evoice->FMC = 3;
+ evoice->GVSel = trident->device == TRIDENT_DEVICE_ID_SI7018 ? 0 : 1;
+ evoice->EC = 0;
+ evoice->Alpha = 0;
+ evoice->FMS = 0;
+ evoice->Vol = 0x3ff; /* mute */
+ evoice->RVol = evoice->CVol = 0x7f; /* mute */
+ evoice->Pan = 0x7f; /* mute */
+ evoice->Attribute = 0;
+ snd_trident_write_voice_regs(trident, evoice);
+ }
- /* set SPDIF setting */
- outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
- outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
+ outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS));
+ temp = inl(TRID_REG(trident, T4D_LFO_GC_CIR));
+ temp &= ~(1<<19);
+ outl(temp, TRID_REG(trident, T4D_LFO_GC_CIR));
+ temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ temp |= SPDIF_EN;
+ outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ }
- spin_unlock_irqrestore(&trident->reg_lock, flags);
+ spin_unlock(&trident->reg_lock);
return 0;
}
@@ -1570,8 +1511,14 @@ static int snd_trident_trigger(snd_pcm_substream_t *substream,
s = s->link_next;
} while (s != substream);
if (spdif_flag) {
- outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
- outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
+ outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ } else {
+ outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS));
+ val = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) | SPDIF_EN;
+ outl(val, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ }
}
if (!go)
outl(what, TRID_REG(trident, T4D_STOP_B));
@@ -1584,7 +1531,7 @@ static int snd_trident_trigger(snd_pcm_substream_t *substream,
outl(val, TRID_REG(trident, T4D_AINTEN_B));
if (go) {
outl(what, TRID_REG(trident, T4D_START_B));
-
+
if (capture_flag && trident->device != TRIDENT_DEVICE_ID_SI7018)
outb(trident->bDMAStart, TRID_REG(trident, T4D_SBCTRL_SBE2R_SBDD));
} else {
@@ -1790,6 +1737,26 @@ static snd_pcm_hardware_t snd_trident_spdif =
.fifo_size = 0,
};
+static snd_pcm_hardware_t snd_trident_spdif_7018 =
+{
+ .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_BLOCK_TRANSFER |
+ SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
+ SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME),
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ .rates = SNDRV_PCM_RATE_48000,
+ .rate_min = 48000,
+ .rate_max = 48000,
+ .channels_min = 2,
+ .channels_max = 2,
+ .buffer_bytes_max = (128*1024),
+ .period_bytes_min = 64,
+ .period_bytes_max = (128*1024),
+ .periods_min = 1,
+ .periods_max = 1024,
+ .fifo_size = 0,
+};
+
static void snd_trident_pcm_free_substream(snd_pcm_runtime_t *runtime)
{
unsigned long flags;
@@ -1876,7 +1843,11 @@ static int snd_trident_spdif_open(snd_pcm_substream_t * substream)
runtime->private_data = voice;
runtime->private_free = snd_trident_pcm_free_substream;
- runtime->hw = snd_trident_spdif;
+ if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ runtime->hw = snd_trident_spdif;
+ } else {
+ runtime->hw = snd_trident_spdif_7018;
+ }
trident->spdif_pcm_ctl->access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE |
@@ -1899,11 +1870,23 @@ static int snd_trident_spdif_open(snd_pcm_substream_t * substream)
static int snd_trident_spdif_close(snd_pcm_substream_t * substream)
{
trident_t *trident = snd_pcm_substream_chip(substream);
+ unsigned int temp;
spin_lock_irq(&trident->reg_lock);
// restore default SPDIF setting
- outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
- outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
+ } else {
+ outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS));
+ temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ if (trident->spdif_ctrl) {
+ temp |= SPDIF_EN;
+ } else {
+ temp &= ~SPDIF_EN;
+ }
+ outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ }
spin_unlock_irq(&trident->reg_lock);
trident->spdif_pcm_ctl->access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
snd_ctl_notify(trident->card, SNDRV_CTL_EVENT_MASK_VALUE |
@@ -2031,8 +2014,8 @@ static snd_pcm_ops_t snd_trident_playback_ops = {
.open = snd_trident_playback_open,
.close = snd_trident_playback_close,
.ioctl = snd_trident_ioctl,
- .hw_params = snd_trident_playback_hw_params,
- .hw_free = snd_trident_playback_hw_free,
+ .hw_params = snd_trident_hw_params,
+ .hw_free = snd_trident_hw_free,
.prepare = snd_trident_playback_prepare,
.trigger = snd_trident_trigger,
.pointer = snd_trident_playback_pointer,
@@ -2043,7 +2026,7 @@ static snd_pcm_ops_t snd_trident_capture_ops = {
.close = snd_trident_capture_close,
.ioctl = snd_trident_ioctl,
.hw_params = snd_trident_capture_hw_params,
- .hw_free = snd_trident_capture_hw_free,
+ .hw_free = snd_trident_hw_free,
.prepare = snd_trident_capture_prepare,
.trigger = snd_trident_trigger,
.pointer = snd_trident_capture_pointer,
@@ -2064,8 +2047,8 @@ static snd_pcm_ops_t snd_trident_foldback_ops = {
.open = snd_trident_foldback_open,
.close = snd_trident_foldback_close,
.ioctl = snd_trident_ioctl,
- .hw_params = snd_trident_foldback_hw_params,
- .hw_free = snd_trident_foldback_hw_free,
+ .hw_params = snd_trident_hw_params,
+ .hw_free = snd_trident_hw_free,
.prepare = snd_trident_foldback_prepare,
.trigger = snd_trident_trigger,
.pointer = snd_trident_playback_pointer,
@@ -2076,12 +2059,23 @@ static snd_pcm_ops_t snd_trident_spdif_ops = {
.close = snd_trident_spdif_close,
.ioctl = snd_trident_ioctl,
.hw_params = snd_trident_spdif_hw_params,
- .hw_free = snd_trident_spdif_hw_free,
+ .hw_free = snd_trident_hw_free,
.prepare = snd_trident_spdif_prepare,
.trigger = snd_trident_trigger,
.pointer = snd_trident_spdif_pointer,
};
+static snd_pcm_ops_t snd_trident_spdif_7018_ops = {
+ .open = snd_trident_spdif_open,
+ .close = snd_trident_spdif_close,
+ .ioctl = snd_trident_ioctl,
+ .hw_params = snd_trident_spdif_hw_params,
+ .hw_free = snd_trident_hw_free,
+ .prepare = snd_trident_spdif_prepare,
+ .trigger = snd_trident_trigger,
+ .pointer = snd_trident_playback_pointer,
+};
+
/*---------------------------------------------------------------------------
snd_trident_pcm_free
@@ -2227,7 +2221,11 @@ int __devinit snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t *
spdif->private_data = trident;
spdif->private_free = snd_trident_spdif_pcm_free;
- snd_pcm_set_ops(spdif, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_spdif_ops);
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ snd_pcm_set_ops(spdif, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_spdif_ops);
+ } else {
+ snd_pcm_set_ops(spdif, SNDRV_PCM_STREAM_PLAYBACK, &snd_trident_spdif_7018_ops);
+ }
spdif->info_flags = 0;
strcpy(spdif->name, "Trident 4DWave IEC958");
trident->spdif = spdif;
@@ -2286,9 +2284,20 @@ static int snd_trident_spdif_control_put(snd_kcontrol_t * kcontrol,
/* S/PDIF C Channel bits 0-31 : 48khz, SCMS disabled */
change = trident->spdif_ctrl != val;
trident->spdif_ctrl = val;
- if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0) {
- outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
- outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0) {
+ outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
+ outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ }
+ } else {
+ if (trident->spdif == NULL) {
+ unsigned int temp;
+ outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS));
+ temp = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & ~SPDIF_EN;
+ if (val)
+ temp |= SPDIF_EN;
+ outl(temp, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ }
}
spin_unlock_irqrestore(&trident->reg_lock, flags);
return change;
@@ -2347,16 +2356,21 @@ static int snd_trident_spdif_default_put(snd_kcontrol_t * kcontrol,
spin_lock_irqsave(&trident->reg_lock, flags);
change = trident->spdif_bits != val;
trident->spdif_bits = val;
- if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0)
- outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ if ((inb(TRID_REG(trident, NX_SPCTRL_SPCSO + 3)) & 0x10) == 0)
+ outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
+ } else {
+ if (trident->spdif == NULL)
+ outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS));
+ }
spin_unlock_irqrestore(&trident->reg_lock, flags);
return change;
}
static snd_kcontrol_new_t snd_trident_spdif_default __devinitdata =
{
- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+ .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+ .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
.info = snd_trident_spdif_default_info,
.get = snd_trident_spdif_default_get,
.put = snd_trident_spdif_default_put
@@ -2437,8 +2451,13 @@ static int snd_trident_spdif_stream_put(snd_kcontrol_t * kcontrol,
spin_lock_irqsave(&trident->reg_lock, flags);
change = trident->spdif_pcm_bits != val;
trident->spdif_pcm_bits = val;
- if (trident->spdif != NULL)
- outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
+ if (trident->spdif != NULL) {
+ if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
+ outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
+ } else {
+ outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS));
+ }
+ }
spin_unlock_irqrestore(&trident->reg_lock, flags);
return change;
}
@@ -2873,7 +2892,7 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
snd_card_t * card = trident->card;
snd_kcontrol_t *kctl;
snd_ctl_elem_value_t uctl;
- int idx, err;
+ int idx, err, retries = 2;
memset(&uctl, 0, sizeof(uctl));
@@ -2881,8 +2900,19 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
_ac97.write = snd_trident_codec_write;
_ac97.read = snd_trident_codec_read;
_ac97.private_data = trident;
- if ((err = snd_ac97_mixer(trident->card, &_ac97, &ac97)) < 0)
+ trident->ac97_detect = 1;
+ __again:
+ if ((err = snd_ac97_mixer(trident->card, &_ac97, &ac97)) < 0) {
+ if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ if ((err = snd_trident_sis_reset(trident)) < 0)
+ return err;
+ if (retries-- > 0)
+ goto __again;
+ return -EIO;
+ }
return err;
+ }
+ trident->ac97_detect = 0;
if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident))) < 0)
@@ -2934,6 +2964,8 @@ static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device
if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident))) < 0)
return err;
kctl->put(kctl, &uctl);
+ }
+ if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) {
if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_spdif_control, trident))) < 0)
return err;
kctl->put(kctl, &uctl);
@@ -3046,6 +3078,55 @@ void __devinit snd_trident_gameport(trident_t *chip)
}
#endif
+/*
+ * SiS reset routine
+ */
+
+static int snd_trident_sis_reset(trident_t *trident)
+{
+ signed long end_time;
+ unsigned int i;
+ int r;
+
+ r = 2; /* count of retries */
+ __si7018_retry:
+ pci_write_config_byte(trident->pci, 0x46, 0x04); /* SOFTWARE RESET */
+ udelay(100);
+ pci_write_config_byte(trident->pci, 0x46, 0x00);
+ udelay(100);
+ /* disable AC97 GPIO interrupt */
+ outb(0x00, TRID_REG(trident, SI_AC97_GPIO));
+ /* initialize serial interface, force cold reset */
+ i = PCMOUT|SURROUT|CENTEROUT|LFEOUT|SECONDARY_ID|COLD_RESET;
+ outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ udelay(1000);
+ /* remove cold reset */
+ i &= ~COLD_RESET;
+ outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ udelay(2000);
+ /* wait, until the codec is ready */
+ end_time = (jiffies + (HZ * 3) / 4) + 1;
+ do {
+ if ((inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0)
+ goto __si7018_ok;
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(1);
+ } while (time_after_eq(end_time, jiffies));
+ snd_printk("AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)));
+ if (r-- > 0) {
+ end_time = jiffies + HZ;
+ do {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(1);
+ } while (time_after_eq(end_time, jiffies));
+ goto __si7018_retry;
+ }
+ __si7018_ok:
+ /* enable 64 channel mode */
+ outl(BANK_B_EN, TRID_REG(trident, T4D_LFO_GC_CIR));
+ return 0;
+}
+
/*
* /proc interface
*/
@@ -3072,8 +3153,9 @@ static void snd_trident_proc_read(snd_info_entry_t *entry,
snd_iprintf(buffer, "%s\n\n", s);
snd_iprintf(buffer, "Spurious IRQs : %d\n", trident->spurious_irq_count);
snd_iprintf(buffer, "Spurious IRQ dlta: %d\n", trident->spurious_irq_max_delta);
- if (trident->device == TRIDENT_DEVICE_ID_NX) {
+ if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018)
snd_iprintf(buffer, "IEC958 Mixer Out : %s\n", trident->spdif_ctrl == 0x28 ? "on" : "off");
+ if (trident->device == TRIDENT_DEVICE_ID_NX) {
snd_iprintf(buffer, "Rear Speakers : %s\n", trident->ac97_ctrl & 0x00000010 ? "on" : "off");
if (trident->tlb.entries) {
snd_iprintf(buffer,"\nVirtual Memory\n");
@@ -3318,35 +3400,10 @@ int __devinit snd_trident_create(snd_card_t * card,
outl(NX_SB_IRQ_DISABLE, TRID_REG(trident, T4D_MISCINT));
break;
case TRIDENT_DEVICE_ID_SI7018:
- pci_write_config_byte(pci, 0x46, 0x04); /* SOFTWARE RESET */
- udelay(100);
- pci_write_config_byte(pci, 0x46, 0x00);
- udelay(100);
- /* disable AC97 GPIO interrupt */
- outb(0x00, TRID_REG(trident, SI_AC97_GPIO));
- /* initialize serial interface, force cold reset */
- i = PCMOUT|SURROUT|CENTEROUT|LFEOUT|SECONDARY_ID|COLD_RESET;
- outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
- udelay(1000);
- /* remove cold reset */
- i &= ~COLD_RESET;
- outl(i, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
- udelay(2000);
- /* wait, until the codec is ready */
- end_time = (jiffies + (HZ * 3) / 4) + 1;
- do {
- if ((inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0)
- goto __si7018_ok;
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(1);
- } while (end_time - (signed long)jiffies >= 0);
- snd_printk("AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)));
- snd_trident_free(trident);
- return -EIO;
- __si7018_ok:
- /* enable 64 channel mode */
- outl(BANK_B_EN, TRID_REG(trident, T4D_LFO_GC_CIR));
- break;
+ if ((err = snd_trident_sis_reset(trident)) < 0) {
+ snd_trident_free(trident);
+ return err;
+ }
}
outl(0xffffffff, TRID_REG(trident, T4D_STOP_A));
@@ -3374,6 +3431,12 @@ int __devinit snd_trident_create(snd_card_t * card,
outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
}
+ if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ /* initialize S/PDIF */
+ trident->spdif_bits = trident->spdif_pcm_bits = SNDRV_PCM_DEFAULT_CON_SPDIF;
+ outl(trident->spdif_bits, TRID_REG(trident, SI_SPDIF_CS));
+ }
+
/* initialise synth voices */
for (i = 0; i < 64; i++) {
voice = &trident->synth.voices[i];
@@ -3429,6 +3492,9 @@ int snd_trident_free(trident_t *trident)
// Disable S/PDIF out
if (trident->device == TRIDENT_DEVICE_ID_NX)
outb(0x00, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
+ else if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
+ outl(0, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
+ }
snd_trident_proc_done(trident);
if (trident->tlb.buffer) {
outl(0, TRID_REG(trident, NX_TLBC));
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 3cff7ac49a53..8e431d5066fb 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -613,6 +613,9 @@ static int snd_via82xx_playback_prepare(snd_pcm_substream_t * substream)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_ac97_set_rate(chip->ac97, AC97_PCM_FRONT_DAC_RATE, runtime->rate);
+ snd_ac97_set_rate(chip->ac97, AC97_PCM_SURR_DAC_RATE, runtime->rate);
+ snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate);
+ snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate);
if (chip->chip_type == TYPE_VIA8233 &&
chip->playback.reg_offset != VIA_REG_MULTPLAY_STATUS) {
unsigned int tmp;
diff --git a/sound/synth/Makefile b/sound/synth/Makefile
index 45e502aa68e4..65909dddea39 100644
--- a/sound/synth/Makefile
+++ b/sound/synth/Makefile
@@ -12,6 +12,5 @@ obj-$(CONFIG_SND_EMU10K1) += snd-util-mem.o
obj-$(CONFIG_SND_TRIDENT) += snd-util-mem.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
obj-$(CONFIG_SND_SBAWE) += snd-util-mem.o
+ obj-$(CONFIG_SND) += emux/
endif
-
-obj-$(CONFIG_SND) += emux/
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig
index 09b608bf058d..da4afb3bb578 100644
--- a/sound/usb/Kconfig
+++ b/sound/usb/Kconfig
@@ -5,7 +5,7 @@ menu "ALSA USB devices"
config SND_USB_AUDIO
tristate "USB Audio/MIDI driver"
- depends on SND
+ depends on SND && USB
help
Say 'Y' or 'M' to include support for USB audio and USB MIDI devices.
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c57df395bc11..59eec43ef995 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -526,7 +526,11 @@ static struct snd_urb_ops audio_urb_ops[2] = {
/*
* complete callback from data urb
*/
+#ifndef OLD_USB
static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
+#else
+static void snd_complete_urb(struct urb *urb)
+#endif
{
snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
snd_usb_substream_t *subs = ctx->subs;
@@ -551,7 +555,11 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
/*
* complete callback from sync urb
*/
+#ifndef OLD_USB
static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs)
+#else
+static void snd_complete_sync_urb(struct urb *urb)
+#endif
{
snd_urb_ctx_t *ctx = (snd_urb_ctx_t *)urb->context;
snd_usb_substream_t *subs = ctx->subs;
@@ -583,6 +591,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs)
subs->running = 0;
+ if (subs->stream->chip->shutdown) /* to be sure... */
+ return 0;
+
#ifndef SND_USB_ASYNC_UNLINK
if (in_interrupt())
return 0;
@@ -870,7 +881,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
u->urb->number_of_packets = u->packets;
u->urb->context = u;
- u->urb->complete = snd_complete_urb;
+ u->urb->complete = (usb_complete_t)snd_complete_urb;
}
if (subs->syncpipe) {
@@ -892,7 +903,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u->urb->transfer_flags = URB_ISO_ASAP | UNLINK_FLAGS;
u->urb->number_of_packets = u->packets;
u->urb->context = u;
- u->urb->complete = snd_complete_sync_urb;
+ u->urb->complete = (usb_complete_t)snd_complete_sync_urb;
}
}
return 0;
@@ -1181,7 +1192,6 @@ static int snd_usb_pcm_open(snd_pcm_substream_t *substream, int direction,
runtime->private_data = subs;
subs->pcm_substream = substream;
setup_hw_info(runtime, subs);
-
return 0;
}
@@ -1189,6 +1199,7 @@ static int snd_usb_pcm_close(snd_pcm_substream_t *substream, int direction)
{
snd_usb_stream_t *as = snd_pcm_substream_chip(substream);
snd_usb_substream_t *subs = &as->substream[direction];
+
release_substream_urbs(subs);
if (subs->interface >= 0)
usb_set_interface(subs->dev, subs->interface, 0);
@@ -2171,6 +2182,10 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
for (i = 0; i < SNDRV_CARDS; i++) {
if (usb_chip[i] && usb_chip[i]->dev == dev) {
chip = usb_chip[i];
+ if (chip->shutdown) {
+ snd_printk(KERN_ERR "USB device is in the shutdown state, cannot create a card instance\n");
+ goto __error;
+ }
break;
}
}
@@ -2247,14 +2262,37 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
{
snd_usb_audio_t *chip;
+ snd_card_t *card;
+ struct list_head *p;
if (ptr == (void *)-1)
return;
chip = snd_magic_cast(snd_usb_audio_t, ptr, return);
+ card = chip->card;
+ down(&register_mutex);
+ chip->shutdown = 1;
chip->num_interfaces--;
- if (chip->num_interfaces <= 0)
- snd_card_free(chip->card);
+ if (chip->num_interfaces <= 0) {
+ snd_card_disconnect(card);
+ /* release the pcm resources */
+ list_for_each(p, &chip->pcm_list) {
+ snd_usb_stream_t *as;
+ int idx;
+ as = list_entry(p, snd_usb_stream_t, list);
+ for (idx = 0; idx < 2; idx++) {
+ snd_usb_substream_t *subs;
+ subs = &as->substream[idx];
+ if (!subs->num_formats)
+ continue;
+ release_substream_urbs(subs);
+ }
+ }
+ up(&register_mutex);
+ snd_card_free_in_thread(card);
+ } else {
+ up(&register_mutex);
+ }
}
@@ -2317,7 +2355,7 @@ module_exit(snd_usb_audio_cleanup);
#ifndef MODULE
/*
- * format is snd-usb-audio=enable,index,id
+ * format is snd-usb-audio=enable,index,id,vid,pid
*/
static int __init snd_usb_audio_module_setup(char* str)
{
@@ -2327,7 +2365,9 @@ static int __init snd_usb_audio_module_setup(char* str)
return 0;
(void)(get_option(&str, &enable[nr_dev]) == 2 &&
get_option(&str, &index[nr_dev]) == 2 &&
- get_id(&str, &id[nr_dev]) == 2);
+ get_id(&str, &id[nr_dev]) == 2 &&
+ get_option(&str, &vid[nr_dev]) == 2 &&
+ get_option(&str, &pid[nr_dev]) == 2);
++nr_dev;
return 1;
}
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 1f70895ea831..de9bdb965a7c 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -133,6 +133,7 @@ struct snd_usb_audio {
int index;
struct usb_device *dev;
snd_card_t *card;
+ int shutdown;
int num_interfaces;
struct list_head pcm_list; /* list of pcm streams */
@@ -171,7 +172,8 @@ struct snd_usb_midi_endpoint_info {
/* for QUIRK_MIDI_YAMAHA, data is NULL */
-/* for QUIRK_MIDI_MIDIMAN, data is the number of ports */
+/* for QUIRK_MIDI_MIDIMAN, data points to a snd_usb_midi_endpoint_info
+ * structure (out_cables and in_cables only) */
/* for QUIRK_ROLAND_UA100, data is NULL */
@@ -202,4 +204,8 @@ int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *i
#define get_cfg_desc(cfg) (&(cfg)->desc)
#endif
+#ifndef usb_pipe_needs_resubmit
+#define usb_pipe_needs_resubmit(pipe) 1
+#endif
+
#endif /* __USBAUDIO_H */
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 2abbffb0805a..a8a184b922bc 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -114,7 +114,6 @@ struct snd_usb_midi_in_endpoint {
struct urb* urb;
struct usbmidi_in_port {
snd_rawmidi_substream_t* substream;
- int active;
} ports[0x10];
};
@@ -159,7 +158,12 @@ static void snd_usbmidi_input_packet(snd_usb_midi_in_endpoint_t* ep,
int cable = packet[0] >> 4;
usbmidi_in_port_t* port = &ep->ports[cable];
- if (!port->active)
+ if (!port->substream) {
+ snd_printd("unexpected port %d!\n", cable);
+ return;
+ }
+ if (!port->substream->runtime ||
+ !port->substream->runtime->trigger)
return;
snd_rawmidi_receive(port->substream, &packet[1],
snd_usbmidi_cin_length[packet[0] & 0x0f]);
@@ -168,7 +172,11 @@ static void snd_usbmidi_input_packet(snd_usb_midi_in_endpoint_t* ep,
/*
* Processes the data read from the device.
*/
+#ifndef OLD_USB
static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs)
+#else
+static void snd_usbmidi_in_urb_complete(struct urb* urb)
+#endif
{
snd_usb_midi_in_endpoint_t* ep = snd_magic_cast(snd_usb_midi_in_endpoint_t, urb->context, return);
@@ -184,14 +192,20 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs)
return;
}
- urb->dev = ep->umidi->chip->dev;
- snd_usbmidi_submit_urb(urb, GFP_ATOMIC);
+ if (usb_pipe_needs_resubmit(urb->pipe)) {
+ urb->dev = ep->umidi->chip->dev;
+ snd_usbmidi_submit_urb(urb, GFP_ATOMIC);
+ }
}
/*
* Converts the data read from a Midiman device to standard USB MIDI packets.
*/
+#ifndef OLD_USB
static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *regs)
+#else
+static void snd_usbmidi_in_midiman_complete(struct urb* urb)
+#endif
{
if (urb->status == 0) {
uint8_t* buffer = (uint8_t*)urb->transfer_buffer;
@@ -217,10 +231,18 @@ static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *reg
}
}
}
+#ifndef OLD_USB
snd_usbmidi_in_urb_complete(urb, regs);
+#else
+ snd_usbmidi_in_urb_complete(urb);
+#endif
}
+#ifndef OLD_USB
static void snd_usbmidi_out_urb_complete(struct urb* urb, struct pt_regs *regs)
+#else
+static void snd_usbmidi_out_urb_complete(struct urb* urb)
+#endif
{
snd_usb_midi_out_endpoint_t* ep = snd_magic_cast(snd_usb_midi_out_endpoint_t, urb->context, return);
@@ -445,26 +467,14 @@ static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int u
usbmidi_out_port_t* port = (usbmidi_out_port_t*)substream->runtime->private_data;
port->active = up;
- if (up)
- tasklet_hi_schedule(&port->ep->tasklet);
+ if (up) {
+ if (! port->ep->umidi->chip->shutdown) /* to be sure... */
+ tasklet_hi_schedule(&port->ep->tasklet);
+ }
}
static int snd_usbmidi_input_open(snd_rawmidi_substream_t* substream)
{
- snd_usb_midi_t* umidi = snd_magic_cast(snd_usb_midi_t, substream->rmidi->private_data, return -ENXIO);
- usbmidi_in_port_t* port = NULL;
- int i, j;
-
- for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
- if (umidi->endpoints[i].in)
- for (j = 0; j < 0x10; ++j)
- if (umidi->endpoints[i].in->ports[j].substream == substream) {
- port = &umidi->endpoints[i].in->ports[j];
- break;
- }
- if (!port)
- return -ENXIO;
- substream->runtime->private_data = port;
return 0;
}
@@ -475,9 +485,6 @@ static int snd_usbmidi_input_close(snd_rawmidi_substream_t* substream)
static void snd_usbmidi_input_trigger(snd_rawmidi_substream_t* substream, int up)
{
- usbmidi_in_port_t* port = (usbmidi_in_port_t*)substream->runtime->private_data;
-
- port->active = up;
}
static snd_rawmidi_ops_t snd_usbmidi_output_ops = {
@@ -500,7 +507,8 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep)
{
if (ep->urb) {
if (ep->urb->transfer_buffer) {
- usb_unlink_urb(ep->urb);
+ if (! ep->umidi->chip->shutdown) /* to be sure */
+ usb_unlink_urb(ep->urb);
kfree(ep->urb->transfer_buffer);
}
usb_free_urb(ep->urb);
@@ -598,10 +606,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi,
}
if (int_epd)
usb_fill_int_urb(ep->urb, umidi->chip->dev, pipe, buffer, length,
- snd_usbmidi_in_urb_complete, ep, int_epd->bInterval);
+ (usb_complete_t)snd_usbmidi_in_urb_complete,
+ ep, int_epd->bInterval);
else
usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer, length,
- snd_usbmidi_in_urb_complete, ep);
+ (usb_complete_t)snd_usbmidi_in_urb_complete,
+ ep);
rep->in = ep;
return 0;
@@ -626,7 +636,8 @@ static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep)
tasklet_kill(&ep->tasklet);
if (ep->urb) {
if (ep->urb->transfer_buffer) {
- usb_unlink_urb(ep->urb);
+ if (! ep->umidi->chip->shutdown) /* to be sure */
+ usb_unlink_urb(ep->urb);
kfree(ep->urb->transfer_buffer);
}
usb_free_urb(ep->urb);
@@ -665,7 +676,8 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi,
return -ENOMEM;
}
usb_fill_bulk_urb(ep->urb, umidi->chip->dev, pipe, buffer,
- ep->max_transfer, snd_usbmidi_out_urb_complete, ep);
+ ep->max_transfer,
+ (usb_complete_t)snd_usbmidi_out_urb_complete, ep);
spin_lock_init(&ep->buffer_lock);
tasklet_init(&ep->tasklet, snd_usbmidi_out_tasklet, (unsigned long)ep);
@@ -903,7 +915,8 @@ static int snd_usbmidi_detect_yamaha(snd_usb_midi_t* umidi,
/*
* Creates the endpoints and their ports for Midiman devices.
*/
-static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports)
+static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi,
+ snd_usb_midi_endpoint_info_t* endpoint)
{
snd_usb_midi_endpoint_info_t ep_info;
struct usb_interface* intf;
@@ -917,7 +930,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports
return -ENOENT;
hostif = intf->altsetting;
intfd = get_iface_desc(hostif);
- if (intfd->bNumEndpoints < (ports > 1 ? 5 : 3)) {
+ if (intfd->bNumEndpoints < (endpoint->out_cables > 0x0001 ? 5 : 3)) {
snd_printdd(KERN_ERR "not enough endpoints\n");
return -ENOENT;
}
@@ -934,7 +947,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports
snd_printdd(KERN_ERR "endpoint[2] isn't bulk output\n");
return -ENXIO;
}
- if (ports > 1) {
+ if (endpoint->out_cables > 0x0001) {
epd = get_endpoint(hostif, 4);
if ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_OUT ||
(epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {
@@ -944,31 +957,33 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports
}
ep_info.epnum = get_endpoint(hostif, 2)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
- ep_info.out_cables = 0x5555 & ((1 << ports) - 1);
+ ep_info.out_cables = endpoint->out_cables & 0x5555;
err = snd_usbmidi_out_endpoint_create(umidi, &ep_info, &umidi->endpoints[0]);
if (err < 0)
return err;
ep_info.epnum = get_endpoint(hostif, 0)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
- ep_info.in_cables = (1 << ports) - 1;
+ ep_info.in_cables = endpoint->in_cables;
err = snd_usbmidi_in_endpoint_create(umidi, &ep_info, &umidi->endpoints[0]);
if (err < 0)
return err;
- umidi->endpoints[0].in->urb->complete = snd_usbmidi_in_midiman_complete;
+ umidi->endpoints[0].in->urb->complete = (usb_complete_t)snd_usbmidi_in_midiman_complete;
- if (ports > 1) {
+ if (endpoint->out_cables > 0x0001) {
ep_info.epnum = get_endpoint(hostif, 4)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
- ep_info.out_cables = 0xaaaa & ((1 << ports) - 1);
+ ep_info.out_cables = endpoint->out_cables & 0xaaaa;
err = snd_usbmidi_out_endpoint_create(umidi, &ep_info, &umidi->endpoints[1]);
if (err < 0)
return err;
}
- for (cable = 0; cable < ports; ++cable) {
- snd_usbmidi_init_substream(umidi, SNDRV_RAWMIDI_STREAM_OUTPUT, cable,
- &umidi->endpoints[cable & 1].out->ports[cable].substream);
- snd_usbmidi_init_substream(umidi, SNDRV_RAWMIDI_STREAM_INPUT, cable,
- &umidi->endpoints[0].in->ports[cable].substream);
+ for (cable = 0; cable < 0x10; ++cable) {
+ if (endpoint->out_cables & (1 << cable))
+ snd_usbmidi_init_substream(umidi, SNDRV_RAWMIDI_STREAM_OUTPUT, cable,
+ &umidi->endpoints[cable & 1].out->ports[cable].substream);
+ if (endpoint->in_cables & (1 << cable))
+ snd_usbmidi_init_substream(umidi, SNDRV_RAWMIDI_STREAM_INPUT, cable,
+ &umidi->endpoints[0].in->ports[cable].substream);
}
return 0;
}
@@ -1031,6 +1046,8 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip,
err = snd_usbmidi_detect_yamaha(umidi, &endpoints[0]);
break;
case QUIRK_MIDI_MIDIMAN:
+ memcpy(&endpoints[0], quirk->data,
+ sizeof(snd_usb_midi_endpoint_info_t));
err = 0;
break;
default:
@@ -1045,15 +1062,11 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip,
}
/* create rawmidi device */
- if (quirk && quirk->type == QUIRK_MIDI_MIDIMAN) {
- in_ports = out_ports = (int)quirk->data;
- } else {
- out_ports = 0;
- in_ports = 0;
- for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
- out_ports += snd_usbmidi_count_bits(endpoints[i].out_cables);
- in_ports += snd_usbmidi_count_bits(endpoints[i].in_cables);
- }
+ out_ports = 0;
+ in_ports = 0;
+ for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
+ out_ports += snd_usbmidi_count_bits(endpoints[i].out_cables);
+ in_ports += snd_usbmidi_count_bits(endpoints[i].in_cables);
}
err = snd_usbmidi_create_rawmidi(umidi, out_ports, in_ports);
if (err < 0) {
@@ -1063,7 +1076,7 @@ int snd_usb_create_midi_interface(snd_usb_audio_t* chip,
/* create endpoint/port structures */
if (quirk && quirk->type == QUIRK_MIDI_MIDIMAN)
- err = snd_usbmidi_create_endpoints_midiman(umidi, (int)quirk->data);
+ err = snd_usbmidi_create_endpoints_midiman(umidi, &endpoints[0]);
else
err = snd_usbmidi_create_endpoints(umidi, endpoints);
if (err < 0) {
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 6c7179967e96..1458c5180f88 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -65,6 +65,8 @@ struct usb_mixer_build {
unsigned char *buffer;
unsigned int buflen;
unsigned int ctrlif;
+ unsigned short vendor;
+ unsigned short product;
DECLARE_BITMAP(unitbitmap, 32*32);
usb_audio_term_t oterm;
const struct usbmix_name_map *map;
@@ -74,11 +76,11 @@ struct usb_mixer_elem_info {
snd_usb_audio_t *chip;
unsigned int ctrlif;
unsigned int id;
- unsigned int control;
+ unsigned int control; /* CS or ICN (high byte) */
unsigned int cmask; /* channel mask bitmap: 0 = master */
int channels;
int val_type;
- int min, max;
+ int min, max, res;
unsigned int initialized: 1;
};
@@ -250,18 +252,23 @@ static int convert_bytes_value(usb_mixer_elem_info_t *cval, int val)
static int get_relative_value(usb_mixer_elem_info_t *cval, int val)
{
+ if (! cval->res)
+ cval->res = 1;
if (val < cval->min)
return 0;
else if (val > cval->max)
- return cval->max - cval->min;
+ return (cval->max - cval->min) / cval->res;
else
- return val - cval->min;
+ return (val - cval->min) / cval->res;
}
static int get_abs_value(usb_mixer_elem_info_t *cval, int val)
{
if (val < 0)
return cval->min;
+ if (! cval->res)
+ cval->res = 1;
+ val *= cval->res;
val += cval->min;
if (val > cval->max)
return cval->max;
@@ -277,17 +284,20 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
{
unsigned char buf[2];
int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;
+ int timeout = 10;
- if (usb_control_msg(cval->chip->dev, usb_rcvctrlpipe(cval->chip->dev, 0),
- request,
- USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
- validx, cval->ctrlif | (cval->id << 8),
- buf, val_len, HZ) < 0) {
- snd_printdd(KERN_ERR "cannot get ctl value: req = 0x%x, idx = 0x%x, val = 0x%x, type = %d\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type);
- return -EINVAL;
+ while (timeout-- > 0) {
+ if (usb_control_msg(cval->chip->dev, usb_rcvctrlpipe(cval->chip->dev, 0),
+ request,
+ USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
+ validx, cval->ctrlif | (cval->id << 8),
+ buf, val_len, HZ / 10) >= 0) {
+ *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));
+ return 0;
+ }
}
- *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));
- return 0;
+ snd_printdd(KERN_ERR "cannot get ctl value: req = 0x%x, wValue = 0x%x, wIndex = 0x%x, type = %d\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type);
+ return -EINVAL;
}
static int get_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int *value)
@@ -309,15 +319,20 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
{
unsigned char buf[2];
int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;
+ int timeout = 10;
value_set = convert_bytes_value(cval, value_set);
buf[0] = value_set & 0xff;
buf[1] = (value_set >> 8) & 0xff;
- return usb_control_msg(cval->chip->dev, usb_sndctrlpipe(cval->chip->dev, 0),
- request,
- USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
- validx, cval->ctrlif | (cval->id << 8),
- buf, val_len, HZ);
+ while (timeout -- > 0)
+ if (usb_control_msg(cval->chip->dev, usb_sndctrlpipe(cval->chip->dev, 0),
+ request,
+ USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
+ validx, cval->ctrlif | (cval->id << 8),
+ buf, val_len, HZ / 10) >= 0)
+ return 0;
+ snd_printdd(KERN_ERR "cannot set ctl value: req = 0x%x, wValue = 0x%x, wIndex = 0x%x, type = %d, data = 0x%x/0x%x\n", request, validx, cval->ctrlif | (cval->id << 8), cval->val_type, buf[0], buf[1]);
+ return -EINVAL;
}
static int set_cur_ctl_value(usb_mixer_elem_info_t *cval, int validx, int value)
@@ -557,11 +572,12 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl)
/*
* retrieve the minimum and maximum values for the specified control
*/
-static int get_min_max(usb_mixer_elem_info_t *cval)
+static int get_min_max(usb_mixer_elem_info_t *cval, int default_min)
{
/* for failsafe */
- cval->min = 0;
- cval->max = 1;
+ cval->min = default_min;
+ cval->max = cval->min + 1;
+ cval->res = 1;
if (cval->val_type == USB_MIXER_BOOLEAN ||
cval->val_type == USB_MIXER_INV_BOOLEAN) {
@@ -581,6 +597,21 @@ static int get_min_max(usb_mixer_elem_info_t *cval)
snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", cval->id, cval->ctrlif, cval->control, cval->id);
return -EINVAL;
}
+ if (get_ctl_value(cval, GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) {
+ cval->res = 1;
+ } else {
+ int last_valid_res = cval->res;
+
+ while (cval->res > 1) {
+ if (set_ctl_value(cval, SET_RES, (cval->control << 8) | minchn, cval->res / 2) < 0)
+ break;
+ cval->res /= 2;
+ }
+ if (get_ctl_value(cval, GET_RES, (cval->control << 8) | minchn, &cval->res) < 0)
+ cval->res = last_valid_res;
+ }
+ if (cval->res == 0)
+ cval->res = 1;
cval->initialized = 1;
}
return 0;
@@ -604,9 +635,9 @@ static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
uinfo->value.integer.max = 1;
} else {
if (! cval->initialized)
- get_min_max(cval);
+ get_min_max(cval, 0);
uinfo->value.integer.min = 0;
- uinfo->value.integer.max = cval->max - cval->min;
+ uinfo->value.integer.max = (cval->max - cval->min) / cval->res;
}
return 0;
}
@@ -680,6 +711,7 @@ static int mixer_ctl_feature_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
set_cur_mix_value(cval, c + 1, val);
changed = 1;
}
+ get_cur_mix_value(cval, c + 1, &val);
cnt++;
}
}
@@ -753,7 +785,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc,
}
/* get min/max values */
- get_min_max(cval);
+ get_min_max(cval, 0);
kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);
if (! kctl) {
@@ -812,8 +844,19 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc,
break;
}
- snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d\n",
- cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
+ /* quirk for UDA1321/N101 */
+ /* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */
+ /* is not very clear from datasheets */
+ /* I hope that the min value is -15360 for newer firmware --jk */
+ if (((state->vendor == 0x471 && (state->product == 0x104 || state->product == 0x105 || state->product == 0x101)) ||
+ (state->vendor == 0x672 && state->product == 0x1041)) && !strcmp(kctl->id.name, "PCM Playback Volume") &&
+ cval->min == -15616) {
+ snd_printk("USB Audio: using volume control quirk for the UDA1321/N101 chip\n");
+ cval->max = -256;
+ }
+
+ snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
+ cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res);
add_control_to_empty(state->chip->card, kctl);
}
@@ -910,7 +953,7 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc,
}
/* get min/max values */
- get_min_max(cval);
+ get_min_max(cval, 0);
kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);
if (! kctl) {
@@ -965,7 +1008,7 @@ static int mixer_ctl_procunit_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
usb_mixer_elem_info_t *cval = snd_magic_cast(usb_mixer_elem_info_t, kcontrol->private_data, return -EINVAL);
int err, val;
- err = get_cur_ctl_value(cval, cval->control, &val);
+ err = get_cur_ctl_value(cval, cval->control << 8, &val);
#ifdef IGNORE_CTL_ERROR
if (err < 0) {
ucontrol->value.integer.value[0] = cval->min;
@@ -985,7 +1028,7 @@ static int mixer_ctl_procunit_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
usb_mixer_elem_info_t *cval = snd_magic_cast(usb_mixer_elem_info_t, kcontrol->private_data, return -EINVAL);
int val, oval, err;
- err = get_cur_ctl_value(cval, cval->control, &oval);
+ err = get_cur_ctl_value(cval, cval->control << 8, &oval);
#ifdef IGNORE_CTL_ERROR
if (err < 0)
return 0;
@@ -995,7 +1038,7 @@ static int mixer_ctl_procunit_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
val = ucontrol->value.integer.value[0];
val = get_abs_value(cval, val);
if (val != oval) {
- set_cur_ctl_value(cval, cval->control, val);
+ set_cur_ctl_value(cval, cval->control << 8, val);
return 1;
}
return 0;
@@ -1018,6 +1061,7 @@ struct procunit_value_info {
int control;
char *suffix;
int val_type;
+ int min_value;
};
struct procunit_info {
@@ -1028,12 +1072,12 @@ struct procunit_info {
static struct procunit_value_info updown_proc_info[] = {
{ USB_PROC_UPDOWN_SWITCH, "Switch", USB_MIXER_BOOLEAN },
- { USB_PROC_UPDOWN_MODE_SEL, "Mode Select", USB_MIXER_U8 },
+ { USB_PROC_UPDOWN_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 },
{ 0 }
};
static struct procunit_value_info prologic_proc_info[] = {
{ USB_PROC_PROLOGIC_SWITCH, "Switch", USB_MIXER_BOOLEAN },
- { USB_PROC_PROLOGIC_MODE_SEL, "Mode Select", USB_MIXER_U8 },
+ { USB_PROC_PROLOGIC_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 },
{ 0 }
};
static struct procunit_value_info threed_enh_proc_info[] = {
@@ -1131,7 +1175,7 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char
cval->channels = 1;
/* get min/max values */
- get_min_max(cval);
+ get_min_max(cval, valinfo->min_value);
kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
if (! kctl) {
@@ -1309,6 +1353,7 @@ static int parse_audio_selector_unit(mixer_build_t *state, int unitid, unsigned
cval->channels = 1;
cval->min = 1;
cval->max = num_ins;
+ cval->res = 1;
cval->initialized = 1;
namelist = kmalloc(sizeof(char *) * num_ins, GFP_KERNEL);
@@ -1430,6 +1475,8 @@ int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif, unsigned char *buffe
state.buffer = buffer;
state.buflen = buflen;
state.ctrlif = ctrlif;
+ state.vendor = dev->idVendor;
+ state.product = dev->idProduct;
/* check the mapping table */
for (map = usbmix_ctl_maps; map->vendor; map++) {
diff --git a/sound/usb/usbmixer_maps.c b/sound/usb/usbmixer_maps.c
index 4d9d53102a6b..713158129b5f 100644
--- a/sound/usb/usbmixer_maps.c
+++ b/sound/usb/usbmixer_maps.c
@@ -39,9 +39,9 @@ struct usbmix_ctl_map {
/*
* Topology of SB Extigy (see on the wide screen :)
-USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PE[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
+USB_IN[1] --->FU[2]------------------------------+->MU[16]-->PU[17]-+->FU[18]--+->EU[27]--+->EU[21]-->FU[22]--+->FU[23] > Dig_OUT[24]
^ | | | |
-USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PE[15]->+ | | | +->FU[25] > Dig_OUT[26]
+USB_IN[3] -+->SU[5]-->FU[6]--+->MU[14] ->PU[15]->+ | | | +->FU[25] > Dig_OUT[26]
^ ^ | | | |
Dig_IN[4] -+ | | | | +->FU[28]---------------------> Spk_OUT[19]
| | | |
@@ -69,9 +69,9 @@ static struct usbmix_name_map extigy_map[] = {
{ 12, "Capture" }, /* FU */
/* 13: OT pcm capture */
/* 14: MU (w/o controls) */
- /* 15: PE (3D enh) */
+ /* 15: PU (3D enh) */
/* 16: MU (w/o controls) */
- /* 17: PE (updown) */ /* FIXME: what control? */
+ /* 17: PU (updown) */ /* FIXME: what control? */
{ 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
{ 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
{ 18, "Master Playback" }, /* FU; others */
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index fa2f3b6ab36e..a64f0409a081 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -161,6 +161,60 @@
.type = QUIRK_MIDI_YAMAHA
}
},
+{
+ USB_DEVICE(0x0499, 0x1012),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "TYROS",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
+{
+ USB_DEVICE(0x0499, 0x1013),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "PF-500",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
+{
+ USB_DEVICE(0x0499, 0x1014),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "S90",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
+{
+ USB_DEVICE(0x0499, 0x5002),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "DME32",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
+{
+ USB_DEVICE(0x0499, 0x5003),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "DM2000",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
+{
+ USB_DEVICE(0x0499, 0x5004),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "Yamaha",
+ .product_name = "02R96",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_YAMAHA
+ }
+},
/*
* Once upon a time people thought, "Wouldn't it be nice if there was a
@@ -421,6 +475,20 @@
}
}
},
+{
+ USB_DEVICE(0x0582, 0x0033),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "EDIROL",
+ .product_name = "PCR",
+ .ifnum = 0,
+ .type = QUIRK_MIDI_FIXED_ENDPOINT,
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .epnum = -1,
+ .out_cables = 0x0003,
+ .in_cables = 0x0007
+ }
+ }
+},
/* Midiman/M-Audio devices */
{
@@ -430,7 +498,10 @@
.product_name = "MidiSport 2x2",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 2
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x0003,
+ .in_cables = 0x0003
+ }
}
},
{
@@ -440,7 +511,10 @@
.product_name = "MidiSport 1x1",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 1
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x0001,
+ .in_cables = 0x0001
+ }
}
},
{
@@ -450,7 +524,10 @@
.product_name = "Keystation",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 1
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x0001,
+ .in_cables = 0x0001
+ }
}
},
{
@@ -460,7 +537,10 @@
.product_name = "MidiSport 4x4",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 4
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x000f,
+ .in_cables = 0x000f
+ }
}
},
{
@@ -470,7 +550,23 @@
.product_name = "MidiSport 8x8",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 9
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x01ff,
+ .in_cables = 0x01ff
+ }
+ }
+},
+{
+ USB_DEVICE_VENDOR_SPEC(0x0763, 0x1041),
+ .driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+ .vendor_name = "M-Audio",
+ .product_name = "MidiSport 2x4",
+ .ifnum = QUIRK_ANY_INTERFACE,
+ .type = QUIRK_MIDI_MIDIMAN,
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x000f,
+ .in_cables = 0x0003
+ }
}
},
{
@@ -480,7 +576,10 @@
.product_name = "Quattro",
.ifnum = 9,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 1
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x0001,
+ .in_cables = 0x0001
+ }
}
},
{
@@ -490,7 +589,10 @@
.product_name = "AudioPhile",
.ifnum = 9,
.type = QUIRK_MIDI_MIDIMAN,
- .data = (void*) 1
+ .data = & (const snd_usb_midi_endpoint_info_t) {
+ .out_cables = 0x0001,
+ .in_cables = 0x0001
+ }
}
},