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

78 Commits

Author SHA1 Message Date
Vinod Koul 79a35ad573 Staging: sst: Construct fw string name runtime
The firmware name for each platform is appended by PCI id of device.
This patch makes use of pci id to construct the string rather than
hardcode the string.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29 11:13:55 -08:00
Vinod Koul 964c6975e8 Staging: sst: Add runtime PM support
This adds runtime PM support for audio driver.
This also fixes LPA audio mode for moorestown platform

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29 11:13:32 -08:00
Greg Kroah-Hartman 8d7ee9c498 Merge branch 'master' into work 2010-11-29 10:44:22 -08:00
Vinod Koul b21bded7c0 sst: log error returned by scu ipc read/write
scu ipc driver fails sometimes to read/write. This add logs with register
addr and ret code when these errors occur.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-19 17:44:07 -08:00
Vinod Koul 90abe60b32 sst: Firmware error codes force number values
To avoid mismatch in driver and firmware error codes assign specfic values
to each enum.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-19 17:44:07 -08:00
Vinod Koul 6f6ffec188 sst: Change the SST driver PCM interface
The PCM interface in SST driver is cmds only, this patch changes the interface to open, close and cmd interface.
This allows SST driver to keep easy track of handles open

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-19 17:43:47 -08:00
Vinod Koul 24aee93c37 sst: remove rest of aava bits and aava related code
This removes the remaining bit of aava dependent and related bits from driver

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-17 13:16:34 -08:00
Arnd Bergmann 451a3c24b0 BKL: remove extraneous #include <smp_lock.h>
The big kernel lock has been removed from all these files at some point,
leaving only the #include.

Remove this too as a cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-17 08:59:32 -08:00
Dan Carpenter 3251627c94 Staging: intel_sst: fix memory leak
The original code set "str_info->decode_ibuf" to NULL so the kfree() is
no-op.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:25:53 -08:00
Joe Perches 859171ca92 drivers/staging: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Greg Kroah-Hartman 491acf0032 Staging: Merge 2.6.37-rc2 into staging-next
This was necessary in order  to resolve some conflicts that happened
between -rc1 and -rc2 with the following files:
	drivers/staging/bcm/Bcmchar.c
	drivers/staging/intel_sst/intel_sst_app_interface.c

All should be resolved now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 10:44:50 -08:00
Joe Perches d0f40c5041 Staging: intel_sst: Use pr_fmt, fix misspellings
Remove leading "sst: " from format strings.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Prefix is changed from "sst: " to "snd_intel_sst: "
Add missing newlines
Trim trailing spaces after newlines
Fix several different misspellings

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:14:38 -08:00
Dan Carpenter 4fc718a4b0 Staging: sst: add some __user anotations
This silences all the sparse warnings in intel_sst_app_interface.c.
It was just a matter of adding __user annotations, I didn't find any
real bugs here.  Quite a few of these were needed for stuff I added
earlier, sorry about that.

I removed a couple casts to (void *) that caused a warning like:
	drivers/staging/intel_sst/intel_sst_app_interface.c:606:27:
		warning: cast removes address space of expression
For example sst_drv_ctx->mailbox is already declared as
"void __iomem *mailbox" so casting it to void pointer isn't necessary
and it makes sparse complain because it removes the __user attribute.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:31:49 -08:00
Dan Carpenter 08da782b1a Staging: sst: user pointers in intel_sst_mmap_play_capture()
There were some places in intel_sst_mmap_play_capture() that
dereferenced user pointers instead of copying the data to the kernel.

I removed the BUG_ON(!mmap_buf) and BUG_ON(!buf_entry) since those are
never possible in the current code.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:31:48 -08:00
Dan Carpenter e9f25689a8 Staging: sst: fixups in SNDRV_SST_STREAM_DECODE
This is another patch about copying data to the kernel before using it.

SNDRV_SST_STREAM_DECODE is sort of tricky because we need to do a
copy_from_user() that gives us another two pointers and we have copy
those.  Those again give us some more pointers that we have to copy.

Besides those problems, the code had a stack overflow:
-	struct snd_sst_buff_entry ibuf_temp[param->ibufs->entries],
-		obuf_temp[param->obufs->entries];
param->ibufs->entries comes from the user.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:30:49 -08:00
Dan Carpenter bc704e31ed Staging: sst: more dereferencing user pointers
This is another patch about making a copy of the data into kernel space
before using it.  It is easy to trigger a kernel oops in the original
code.  If you passed a NULL to SNDRV_SST_SET_TARGET_DEVICE then it
called BUG_ON().  And SNDRV_SST_DRIVER_INFO would let you write the
information to arbitrary memory locations which is a security violation.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:30:48 -08:00
Dan Carpenter 3b97eed201 Staging: sst: dereferencing user pointers
This code dereferences user supplied pointers directly instead of doing
a copy_from_user().  Some kernel configs put user and kernel memory in
different address spaces so this code isn't portable.  Also the user
memory could be swapped out or in this case the pointer could just be
NULL leading to an oops.

Another thing is that it makes permission tests like this sort of
meaningless.
	if (minor == STREAM_MODULE && rec_mute->stream_id == 0) {
		retval = -EPERM;
		break;
	}
The user could set stream_id to 1 for the test and then change it later.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 13:30:48 -08:00
Dan Carpenter 388b2b97ba Staging: sst: more copy_to_user() changes
Vinod wanted the copy_to_user() calls in this format:
	if (copy_to_user())
		retval = -EFAULT;
instead of this:
	retval = copy_to_user();
	if (retval)
		retval = -EFAULt;

I've done that for the whole intel_sst_app_interface.c file.  In the
process I noticed a couple more places that returned -EBUSY or -EAGAIN
instead of -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15 15:42:26 -07:00
Dan Carpenter 9f407840bb Staging: intel_sst: off by one bug
This should be >= instead of > or we go passed the end of the array.

Also the arrays are declared with size MAX_NUM_STREAMS.  This is the
only place that uses MAX_NUM_STREAMS_MFLD.  It seems like asking for
trouble to use two variables for the same information.  I've changed
everything to use MAX_NUM_STREAMS.

This bug isn't really harmful.  In the worst case, if you enabled
debugging then you would see a message.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15 15:42:26 -07:00
Dan Carpenter 87b554a04a Staging: intel_sst: return -EFAULT if copy_to_user() fails
copy_to_user() returns the number of bytes remaining to be copied but we
want to return an error code.  And that error code is -EFAULT not -EIO.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15 15:41:36 -07:00
Dan Carpenter 81a2fff67a Staging: intel_sst: cleanup naming a little
&sst_drv_ctx->streams[str_id].lock and &stream->lock are the same.
The mutex_lock() uses &stream->lock so this makes things consistent and
it's nicer to read as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15 12:24:39 -07:00
Alan Cox 83cb1926e0 staging: sst: Remove the aava bits
We don't need these special cases any more.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-14 12:11:24 -07:00
Vinod Koul 88eea8de94 staging: sst: remove the kernel locking in ioctl
kernel locking in ioctl was introduced when ioctl function was
moved from ioctl to unlocked ioctl
This is no longer required hence removed

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-14 12:11:24 -07:00
Randy Dunlap 1dd8b73227 staging: intel_sst: include delay.h to fix build error
intel_sst_drv_interface.c uses msleep() so it needs to include delay.h:

drivers/staging/intel_sst/intel_sst_drv_interface.c:88: error: implicit declaration of function 'msleep'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-12 08:55:40 -07:00
Vasiliy Kulikov 801089e68e staging: intel_sst: use signed int for error codes
As retval stores error code, it should be signed int.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-10 11:25:00 -07:00
Vasiliy Kulikov 7915c0d4d2 staging: intel_sst: fix signess error
str_id was unsigned, so check for (str_id <= 0) made no sense.
Made it signed.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-10 11:25:00 -07:00
Tracey Dent 659bd8c1d5 Staging: intel_sst: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:48 -07:00
Vinod Koul fffa1cca3d Staging: sst: Intel SST audio driver
This is the Intel SST audio driver.

As compared to the previous versions it has all the printks and other stuff
noted cleaned up and more hardware support. The Aava support is disabled in
this patch (is_aava resolves to 0) because the Aava board detection logic
is not yet upstream.

The driver itself is a combination of a traditional ALSA driver and a
hardware assisted offload driver which can play audio while the processor
is asleep but which can't do all the more interactive stuff.

In the general case most software would use the ALSA interface, but the
other interface is needed for certain classes of use such as music playback
on highly power consumption sensitive devices.

This is going to staging primarily because it depends upon the staging memrar
driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
[Merged together and tweaked for -next]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 13:24:04 -07:00