dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

78 Commits

Author SHA1 Message Date
Paul Gortmaker 452962366c staging: Add module.h to more drivers implicitly using it.
This 2nd batch of implicit module.h users only appeared when we
removed the unnecessary module.h from include/linux/miscdevice.h
[The 1st batch is already present in Greg's staging tree.]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:32:10 -04:00
Paul Gortmaker 8e336a722b staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users.
Lots of drivers have in the past expected the presence of basic things
like THIS_MODULE and EXPORT_SYMBOL.  With the header cleanup, they wont
have these.  Call out the include explicitly.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:32:08 -04:00
Lu Guanqun eeca83a74f staging: intel_sst: fix compile error
include module.h to fix the following compile errors:

drivers/staging/intel_sst/intelmid.c:52: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:52: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:52: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/staging/intel_sst/intelmid.c:52: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:53: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:53: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:53: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/staging/intel_sst/intelmid.c:53: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:54: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:54: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:54: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/staging/intel_sst/intelmid.c:54: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:55: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:55: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:55: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/staging/intel_sst/intelmid.c:55: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:56: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:56: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:56: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
drivers/staging/intel_sst/intelmid.c:56: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:57: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:57: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:57: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/staging/intel_sst/intelmid.c:57: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:58: error: expected declaration specifiers or '...' before string constant
drivers/staging/intel_sst/intelmid.c:58: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:58: warning: type defaults to 'int' in declaration of 'MODULE_SUPPORTED_DEVICE'
drivers/staging/intel_sst/intelmid.c:58: warning: function declaration isn't a prototype
drivers/staging/intel_sst/intelmid.c:64: error: expected ')' before 'int'
drivers/staging/intel_sst/intelmid.c:65: error: expected ')' before string constant
drivers/staging/intel_sst/intelmid.c:66: error: expected ')' before numeric constant
drivers/staging/intel_sst/intelmid.c:67: error: expected ')' before string constant
drivers/staging/intel_sst/intelmid.c:461: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:461: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/staging/intel_sst/intelmid.c:461: warning: parameter names (without types) in function declaration
drivers/staging/intel_sst/intelmid.c:475: warning: data definition has no type or storage class
drivers/staging/intel_sst/intelmid.c:475: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
drivers/staging/intel_sst/intelmid.c:475: warning: parameter names (without types) in function declaration
drivers/staging/intel_sst/intelmid.c: In function 'snd_intelmad_probe':
drivers/staging/intel_sst/intelmid.c:859: error: 'THIS_MODULE' undeclared (first use in this function)
drivers/staging/intel_sst/intelmid.c:859: error: (Each undeclared identifier is reported only once
drivers/staging/intel_sst/intelmid.c:859: error: for each function it appears in.)
drivers/staging/intel_sst/intelmid.c: At top level:
drivers/staging/intel_sst/intelmid.c:989: error: 'THIS_MODULE' undeclared here (not in a function)

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 16:07:50 -07:00
Jaap Crezee 5bf8ebc5c6 Staging: intel_sst: instel_sst: fixed some coding style issues.
Fixed a coding style issue.

Signed-off-by: Jaap Crezee <jaap@jcz.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:29:30 -07:00
Mark Brown 25bb6c0a94 staging: intel_sst: fix comment typo
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-12 16:59:13 +02:00
Feng Tang 26af13f15a sst: avoid unnecessary firmware reloading for MRST
SST HW on MRST doesn't need to reload the firmware during suspend/resume
cycle, so remove the extra workload. This also fix a bug that the firmware
sample rate can't be modified when there is no active playback/capture
stream.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:02:25 -07:00
Lu Guanqun 35b5ddb646 sst: report correct jack event
The status of jack event is compared bitwise:

[in sound/core/jack.c:snd_jack_report()]
	for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++) {
		int testbit = 1 << i;
		if (jack->type & testbit)
			input_report_switch(jack->input_dev,
					    jack_switch_types[i],
					    status & testbit);
	}

So in order to report the correct events, 3 should be passed instead of 1.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:02:24 -07:00
Andre Bartke 4b2b6d842b staging: intel_sst: Fix memory leak
In case of an error stream_bufs is not freed here.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:27:19 -07:00
Linus Torvalds 1f3a8e093f Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (970 commits)
  staging: usbip: replace usbip_u{dbg,err,info} and printk with dev_ and pr_
  staging:iio: Trivial kconfig reorganization and uniformity improvements.
  staging:iio:documenation partial update.
  staging:iio: use pollfunc allocation helpers in remaining drivers.
  staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify event code spitting out.
  staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
  staging:iio:meter:ade7758: Use private data space from iio_allocate_device
  staging:iio:accel:lis3l02dq make write_reg_8 take value not a pointer to value.
  staging:iio: ring core cleanups + check if read_last available in lis3l02dq
  staging:iio:core cleanup: squash tiny wrappers and use dev_set_name to handle creation of event interface name.
  staging:iio: poll func allocation clean up.
  staging:iio:ad7780 trivial unused header cleanup.
  staging:iio:adc: AD7780: Use private data space from iio_allocate_device + trivial fixes
  staging:iio:adc:AD7780: Convert to new channel registration method
  staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv()
  staging:iio:adc: AD7606: Consitently use indio_dev
  staging:iio: Rip out helper for software rings.
  staging:iio:adc:AD7298: Use private data space from iio_allocate_device
  staging:iio: rationalization of different buffer implementation hooks.
  staging:iio:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev.
  ...

Fix up trivial conflicts in
 - drivers/staging/intel_sst/intelmid.c: patches applied in both branches
 - drivers/staging/rt2860/common/cmm_data_{pci,usb}.c: removed vs spelling
 - drivers/staging/usbip/vhci_sysfs.c: trivial header file inclusion
2011-05-23 12:49:28 -07:00
Takashi Iwai 7ec298dfef Merge branch 'topic/asoc' into for-linus 2011-05-22 10:01:33 +02:00
Alan Cox 1dce160f02 sst: tweak the shared functions so we don't crash the ASoC driver
The ASoC driver is currently pulling bits from staging rather than its own
copy. Post all the merges and fixes we've put back an assumption that
crashes ASoC so we need to fix it differently.

(See 0ed625b2f2)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:01:45 -07:00
Lu Guanqun ca8f3525a5 intel_sst: fix output noises when it's not in playback
When the corresponding output device is not in playback, we can hear a little
noises.

Fix it by powering on the device only when it's in playback.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 13:00:53 -07:00
Lu Guanqun 2124f8dad0 intel_sst: internal speaker needs setting a GPIO line
On Moorestown platform, internal speaker's power line is connected to a GPIO
line, so we need to enable or disable it properly.

Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jeff Cheng <jeff_cheng@wistron.com>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 13:00:49 -07:00
Lu Guanqun b8df15b2a7 intel_sst: add Master Volume
With this patch, Master Volume will control AUDIOLVOL(0x10c) and
AUDIORVOL(0x10d); while PCM Volume will control HPLVOL(0x123) and
HPRVOL(0x124).

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:59:02 -07:00
Lu Guanqun e1bfee2673 intel_sst: set default output and input device
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:59:01 -07:00
Chandramouli Narayanan 231c63839f intel_sst: fix runtime pm issue
Use correct api for enabling/disabling runtime pm.  Additionally,
fix runtime suspend/resume to not duplicate pci core functions

Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Tested-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:59:00 -07:00
Andy CH Lin 5dda7f27c1 intel_sst: intelmid_v2_control: correct jack event type
Correct event type of audio jack while receiving long press event.

Signed-off-by: Andy CH Lin <andy_ch_lin@wistron.com>
Signed-off-by: Jekyll Lai <jekyll_lai@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:44 -07:00
Wu Fengguang a482050294 intel_sst: MRST can only do 16bit recording
Fix bug

	$ arecord -D dsnoop -r 48000 -f S16_LE 1.wav
	ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params
	ALSA lib pcm_dsnoop.c:604:(snd_pcm_dsnoop_open) unable to initialize slave
	arecord: main:654: audio open error: Interrupted system call

Root cause is, the driver is reporting 32-bit capture capability
that is not supported by the MRST hardware. So the dsnoop plugin
end up requesting 32-bit capture which fails.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:43 -07:00
Wu Fengguang 3ca13bdb3c intel_sst: MRST can only do mono recording
Fix bug

	$ arecord -Dplughw -c2
	Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Stereo
	arecord: set_params:1116: Unable to install hw params:
	ACCESS:  RW_INTERLEAVED
	FORMAT:  U8
	SUBFORMAT:  STD
	SAMPLE_BITS: 8
	FRAME_BITS: 16
	CHANNELS: 2
	[...]

Root cause is, the driver is reporting 2-channel capture capability
that is not supported by the MRST hardware. So the plughw plugin
end up requesting 2-channel capture which fails.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:43 -07:00
Feng Tang f2b5ea1feb intel_sst: make sure the sst_drop_stream() get called when needed
When "aplay test.wav", if we "ctrl+z" to suspend it, the last piece of
sound will be played endlessly. So we need make sure the drop_stream
is called in such a case.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:42 -07:00
Lu Guanqun e51a34f3e8 intel_sst: return correct output/input device id
Without this patch, the change of output/input device can't be reflected
correctly. The mismatch reflects insane design, and should be fixed when
switching to the ASoC framework.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:28 -07:00
Lu Guanqun 24298b0e66 intel_sst: move jack detection related configs to init time
The old policy will not enable MIC2BIAS on Moorstown platform
by default, it's only enabled when the user selects HS_MIC as input source.
Therefore when user selects DMIC and then inserts the jack,
no interrupt will be generated to notify the driver about the
jack insertion event and to take action to auto mute the speaker.

The new policy will enable this bit by default,
then no matter what the output device is, an interrupt will be generated.

This behaviour is more likely what a user expects.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:28 -07:00
xingchao 59bd2abe07 intel_sst: Headphone Automute support
When detected a Jack event, Audio sound routes between internal speaker
and headphone/headset automatically.

Signed-off-by: xingchao <xingchao.wang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:27 -07:00
Lu Guanqun 26d3b2d973 intel_sst: Enable recording via DMIC
We may need to make some of this board specific eventually

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:27 -07:00
Lu Guanqun 9d9bb3c3fb intel_sst: Enable recording via HS_MIC
We may need to make some of this board specific eventually.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:26 -07:00
Lu Guanqun cd573917c3 intel_sst: Set de-bounce time
In order to make jack detection behave properly, we have to set
the de-bounce time, otherwise, some weird events happens:
e.g. no plug-out event seen.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:26 -07:00
Ramesh Babu K V 8a251ff2fc intel_sst: rework jack implementation
This patch fixes the below issues w.r.t jack implementation

a) The current jack implementation in driver is implemented
   in intelmid.c. It has moved to vendor files for better managebility
b) Cleaned up jack reporting per upstream comments
c) Implemented jack for msic, added code to read adc and deduce jack
   type based on mic bias
d) Support detection of american headset

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
[Corrections]
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:58:09 -07:00
Sitanshu Nanavati eb02c700d2 intel_sst: DMIC routing
This patch adds support for configuring and routing the
DMICs (assigned HW route to DMICs)

Signed-off-by: Sitanshu Nanavati <sitanshu.nanavati@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:56 -07:00
Vinod Koul 2784a80c97 intel_sst: parameter tuning ioctl
This patch adds new IOCTL for application interface.

Using parameter tuning IOCTL, application can fine
tune the audio firmware for it's requirement.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:55 -07:00
Dharageswari R 5572a44829 intel_sst: Line out support
This patch adds the support for lineout. The
lineout input can be selected as any input channel
by using a new alsa mixer kcontrol.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:54 -07:00
Vinod Koul c3e25a24b5 intel_sst: ignore IRQ when suspended
The irq for audio is shared, so when device is supended driver should
not the read register and ignore the interrupt.

This patch ignores interrupts when device is suspended.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:54 -07:00
Vinod Koul 1bea302c2f intel_sst: fix unload bugs
The current driver remove was erroneous and causes
errors when unloading or loading second time

This patch fixes both of these issues

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:53 -07:00
Vinod Koul b06a584c21 intel_sst: MSIC codec power optimisation
This patch adds power optimization for the msic codec and ensure
codec is completely powered off when codec is idle.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:55:52 -07:00
Lu Guanqun 6c550053cb sst: fix compile error
Add several include files to fix the below compile error.

drivers/staging/intel_sst/intelmid.c: In function ‘snd_intelmad_sst_register’:
drivers/staging/intel_sst/intelmid.c:805:2: error: ‘sst_drv_ctx’ undeclared (first use in this function)
drivers/staging/intel_sst/intelmid.c:805:2: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:54:44 -07:00
Vinod Koul afe9194d58 intel_sst: Save audio state across D3 on Medfield
During suspend and runtime_suspend audio dsp will be in D3 state
and will loose its context.

This patch adds support in driver to save the dsp context
and restore this context during resume

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:52:10 -07:00
Lu Guanqun 31dea73851 sst: make register_sst_card more self-contained
register_sst_card is used in ASoC code with field `scard_ops` being NULL.
Without this patch, there will be NULL dereference.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 12:51:58 -07:00
Randy Dunlap b27b8ea853 staging: intel_sst: intelmid needs delay.h
intel_sst drivers need to #include <linux/delay.h> so that
they build cleanly:

drivers/staging/intel_sst/intelmid_v1_control.c:188: error: implicit declaration of function 'msleep'
drivers/staging/intel_sst/intelmid_v2_control.c:172: error: implicit declaration of function 'msleep'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Harsha Priya <priya.harsha@intel.com>
Cc: KP Jeeja <jeeja.kp@intel.com>
Cc: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:44:09 -07:00
Joe Perches 9fc86028fa staging: Remove unnecessary semicolons when if (foo) {...};
Done via perl script:

$ cat remove_semi_if.pl
my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
    my $f;
    my $text;
    my $oldtext;

    next if ((-d $file));

    open($f, '<', $file)
	or die "$P: Can't open $file for read\n";
    $oldtext = do { local($/) ; <$f> };
    close($f);

    next if ($oldtext eq "");

    $text = $oldtext;

    my $count = 0;
    do {
	$count = 0;
	$count += $text =~ s@\b(if\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
    } while ($count > 0);

    if ($text ne $oldtext) {
	my $newfile = $file;

	open($f, '>', $newfile)
	    or die "$P: Can't open $newfile for write\n";
	print $f $text;
	close($f);
    }
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 16:58:34 -07:00
Julia Lawall 48c59f4b91 drivers/staging/intel_sst/intel_sst_app_interface.c: introduce missing kfree
Stream_bufs is initialized at the beginning of the function, and then the
#ifdef code declares a new variable with the same name and initializes
that.  If the if in the ifdef is taken, the then branch returns, implying
that the first stream_bufs is never used and is leaked.  The first
initialization is thus moved down after the ifdef.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 14:11:45 -07:00
Mark Brown d5381e42f6 ASoC: Merge branch 'for-2.6.39' into for-2.6.40
Fix trivial conflict caused by silly spelling fix patch.

Conflicts:
	sound/soc/codecs/wm8994.c
2011-04-18 18:07:43 +01:00
Lu Guanqun 774fd7baf8 sst: fix compile error
Add several include files to fix the below compile error.

drivers/staging/intel_sst/intelmid.c: In function ‘snd_intelmad_sst_register’:
drivers/staging/intel_sst/intelmid.c:805:2: error: ‘sst_drv_ctx’ undeclared (first use in this function)
drivers/staging/intel_sst/intelmid.c:805:2: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-08 09:47:14 +09:00
Lu Guanqun 0ed625b2f2 sst: make register_sst_card more self-contained
register_sst_card is used in ASoC code with field `scard_ops` being NULL.
Without this patch, there will be NULL dereference.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-06 23:15:23 +09:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Uwe Kleine-König 3173a5ecd8 staging/trivial: fix typos concerning "select"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:30:12 -08:00
Uwe Kleine-König d9fed669ac staging/trivial: fix typos concerning "initiali[zs]e"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:30:11 -08:00
Uwe Kleine-König 1bf8240c07 staging/trivial: fix typos concerning "function"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18 13:30:10 -08:00
Harsha Priya 454f1419f1 staging: sst: Fix for dmic capture on v2 pmic
currently capture through dmic captures only silence

This patch configurs the dmic registers to capture properly

Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-02 15:06:14 -08:00
Greg Kroah-Hartman ea3398a1ae Staging: Merge 2.6.37-rc5 into staging-next
This was done to handle a number of conflicts in the batman-adv
and winbond drivers properly.  It also now allows us to fix up the sysfs
attributes properly that were not in the .37 release due to them being
only in this tree at the time.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-07 10:47:56 -08:00
Randy Dunlap 8956110dbb staging: fix intel_sst/intelmid sound build
SND_INTELMID selects 3 SND_* kconfig symbols, but that is useless
if the SOUND & SND symbols in their hierarchy are not enabled,
so make this symbol depend on SOUND & SND.

ERROR: "snd_pcm_period_elapsed" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_card_create" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_hw_constraint_integer" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_device_new" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_set_ops" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_jack_new" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_lib_free_pages" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_lib_ioctl" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_lib_malloc_pages" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_ctl_new1" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_lib_preallocate_pages_for_all" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_card_free" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_card_register" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_jack_report" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_pcm_new" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!
ERROR: "snd_ctl_add" [drivers/staging/intel_sst/snd-intelmid.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29 11:38:50 -08:00
Vinod Koul 62877913ba Staging: sst: add ioctls for post processing algorithm interface
This patch adds two new ioctls to intel_sst_ctrl device.
This i/f can be used by application to send algorithm parameters

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
[This will need further discussion in the context of the final ALSA interface
 but is fine for staging, ie anyone who relies on it should expect changes
 Also fixed a missing kmalloc fail check]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29 11:14:05 -08:00