Commit Graph

199 Commits (46a00d83ffb0d040f18068234e0eda8332c1e798)

Author SHA1 Message Date
Paul Walmsley 59fb659b06 OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files
In preparation for adding OMAP4-specific PRCM accessor/mutator
functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific
files.  Most of what was in mach-omap2/{cm,prm}.{c,h} has now been
moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was
OMAP2xxx/3xxx-specific.

This process also requires the #includes in each of these files to be
changed to reference the new file name.  As part of doing so, add some
comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use
"sideways includes", to indicate that these users of the PRM/CM includes
should not be doing so.

Thanks to Felipe Contreras <felipe.contreras@gmail.com> for comments on this
patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Jarkko Nikula <jhnikula@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Rajendra Nayak <rnayak@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2010-12-21 20:01:55 -07: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
Felipe Contreras 50ad26f4c9 Revert "staging: tidspbridge: replace iommu custom for opensource implementation"
This reverts commit d95ec7e2fd.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:44 -06:00
Felipe Contreras 1cf3fb2d35 Revert "staging: tidspbridge - move shared memory iommu maps to tiomap3430.c"
This reverts commit 0c10e91b6c.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:44 -06:00
Felipe Contreras d0b345f3ee Revert "staging: tidspbridge - rename bridge_brd_mem_map/unmap to a proper name"
This reverts commit 4dd1944ab7.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:44 -06:00
Felipe Contreras ac8a139a14 Revert "staging: tidspbridge - remove custom mmu code from tiomap3430.c"
This reverts commit e7396e77d9.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:43 -06:00
Felipe Contreras 6c4c899ee2 Revert "staging: tidspbridge - fix mmufault support"
This reverts commit f265846db1.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:43 -06:00
Felipe Contreras 58c1ceb156 Revert "staging: tidspbridge - remove hw directory"
This reverts commit 053fdb85f5.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:43 -06:00
Felipe Contreras f5bd96bbe3 Revert "staging: tidspbridge - move all iommu related code to a new file"
This reverts commit f94378f9f9.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:43 -06:00
Felipe Contreras 9d4f81a722 Revert "staging: tidspbridge: remove dw_dmmu_base from cfg_hostres struct"
This reverts commit b5a4493923.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:43 -06:00
Felipe Contreras a28903501c Revert "staging: tidspbridge - remove reserved memory clean up"
This reverts commit db348ca36e.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:42 -06:00
Felipe Contreras 2fa28a5182 Revert "staging: tidspbridge - deprecate reserve/unreserve_memory funtions"
This reverts commit b1ced160af.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:42 -06:00
Felipe Contreras 677f2ded81 Revert "staging: tidspbridge - remove dmm custom module"
This reverts commit 2ab573487a.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:42 -06:00
Felipe Contreras 3fc59af631 Revert "staging: tidspbridge - update Kconfig to select IOMMU module"
This reverts commit ace5a3ce40.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:42 -06:00
Felipe Contreras a9db203674 staging: tidspbridge: hardcode SCM macros while fix is upstreamed
On 2.6.37-rc1, omap platform internals for SCM have changed,
so the build is broken again.

drivers/staging/tidspbridge/core/tiomap3430.c:26:
    fatal error: plat/control.h: No such file or directory

This is a totally ugly layer violation, but needed until
omap_ctrl_set_dsp_boot*() are provided.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
2010-11-10 18:34:18 -06:00
Greg Kroah-Hartman e4c5bf8e3d Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves
some conflicts that were present due to changes in other trees that were
affected by files here.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28 09:44:56 -07:00
Julia Lawall cc58cbb885 staging: tidspbridge: Clean up error-handling code
In the first hunk, 0 is returned on memory allocation failure, even though
other failures return -ENOMEM or other similar values.

In the second hunk, there was error handling code that returned without
freeing psz_path_name.

A simplified version of the semantic match that finds the first problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15 12:44:25 -07:00
Arnd Bergmann 6038f373a3 llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time.  Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
//   but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
   *off = E
|
   *off += E
|
   func(..., off, ...)
|
   E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
  *off = E
|
  *off += E
|
  func(..., off, ...)
|
  E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
 ...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
 .llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
 .read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
 .write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
 .open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
...  .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
...  .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
...  .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+	.llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
 .write = write_f,
 .read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
2010-10-15 15:53:27 +02:00
Vasiliy Kulikov 2dff527957 staging: tidspbridge: fix signess error
i was unsigned, so check for (i < 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
Arnd Bergmann 9b24b8f941 staging: tidspbridge: add memory consistency to TODO list
This driver uses ioremap on regular memory to get an uncached mapping,
which causes problems on ARMv6 and higher due to aliasing with the
cached linar kernel mapping.

Make sure this gets fixed before the driver graduates from staging.

Cc: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-09 13:49:41 -07:00
Tracey Dent 574c1a6222 Staging: tidspbridge: 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:40 -07:00
Omar Ramirez Luna 95624b2d75 staging: tidspbridge: bind driver name to device name
Since the device name has changed use the new name to
bind the driver to it.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-07 10:09:49 -07:00
Fernando Guzman Lugo ace5a3ce40 staging: tidspbridge - update Kconfig to select IOMMU module
IOMMU module most be selected when using tidspbridge, because
now tidsbridge depends on iommu module.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 18:36:39 -07:00
Fernando Guzman Lugo 2ab573487a staging: tidspbridge - remove dmm custom module
Dmm custom module is not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:59 -07:00
Fernando Guzman Lugo b1ced160af staging: tidspbridge - deprecate reserve/unreserve_memory funtions
Now what iommu memory usage is kept track by iommu module
the functions reserve/unreserve_memory are not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:59 -07:00
Fernando Guzman Lugo db348ca36e staging: tidspbridge - remove reserved memory clean up
Now iommv module keeps track of iommu memory used,
we do not need resource cleanup for reserved
memories anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:58 -07:00
Fernando Guzman Lugo b5a4493923 staging: tidspbridge: remove dw_dmmu_base from cfg_hostres struct
We don't need to map iva2 iommu register base address
anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:58 -07:00
Fernando Guzman Lugo f94378f9f9 staging: tidspbridge - move all iommu related code to a new file
Create dsp-mmu module and moves all the iommu code related to
this module.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:58 -07:00
Fernando Guzman Lugo 053fdb85f5 staging: tidspbridge - remove hw directory
hw directory was only being used for custom iommu implementation
APIs, so after the iommu module migration this directory is not
needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:58 -07:00
Fernando Guzman Lugo f265846db1 staging: tidspbridge - fix mmufault support
With changes for iommu migration mmufault report and dsp track
dump is broken, this patch fixes that.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:57 -07:00
Fernando Guzman Lugo e7396e77d9 staging: tidspbridge - remove custom mmu code from tiomap3430.c
This patch removes all the custom mmu code remaining in
tiomap3430.c which is not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:57 -07:00
Fernando Guzman Lugo 4dd1944ab7 staging: tidspbridge - rename bridge_brd_mem_map/unmap to a proper name
Now these functions only map user space addresses to dsp virtual
addresses, so now the functions have a more meaningful name.
Also now user_to_dsp_map returns the mapped address.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:57 -07:00
Fernando Guzman Lugo 0c10e91b6c staging: tidspbridge - move shared memory iommu maps to tiomap3430.c
Now iommu maps of shared memory segments are done in
bridge_brd_start and unmaped in bridge_brd_stop.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 15:30:50 -07:00
Felipe Contreras 82d4b4776d staging: tidspbridge: use omap_dsp_platform_data
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 12:06:45 -07:00
Nicolas Kaiser d5ca053c8b staging: tidspbridge: remove duplicated include
Remove duplicated include.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 11:42:20 -07:00
Fernando Guzman Lugo d95ec7e2fd staging: tidspbridge: replace iommu custom for opensource implementation
Now the tidspbridge uses the API's from
iovmm module.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:54:40 -07:00
Ernesto Ramos 0ee5ab30d1 staging: ti dspbridge: disable all peripherals at bridge_brd_stop
DSP Bridge needs to disable the peripheral clocks when switches to
BRD_STOPPED since that would prevent the domain to enter in OFF state.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:52:09 -07:00
Ernesto Ramos d10009211c staging: ti dspbridge: Replace find_lcm with lcm kernel func
Resendig this patch since it was missed in the last merge...

Remove find_lcm within nldr.c and use standard
kernel function lcm().

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:52:08 -07:00
Ernesto Ramos 7d1d628344 staging: ti dspbridge: remove cmm_xlator_delete wrapper
Resending this patch since it was missed in the last merge...

Remove unnecessary cmm_xlator_delete function and use
kfree() kernel function directly.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:52:08 -07:00
Vasiliy Kulikov b04462a143 staging: tidspbridge: check return code of get_user
Function get_user may fail. Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-05 16:59:50 -07:00
Vasiliy Kulikov e5a7dc54ee staging: tidspbridge: check return code of kzalloc
Function kzalloc may fail. Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-05 16:59:49 -07:00
Uwe Kleine-König 9b0131cb24 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>
2010-09-04 21:23:26 -07:00
Uwe Kleine-König 25a606c36a staging/trivial: fix typos concerning "address"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:23:25 -07:00
Ivan Gomez Castellanos bd5dc30e3e staging: tidspbridge: Remove services.c and services.h
The services_init() and services_exit() functions don't do anything,
so they are removed, and as these are the only two functions defined
in services.c and services.h, then these files are also removed.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:17 -07:00
Ivan Gomez Castellanos 220344f254 staging: tidspbridge: Remove cfg.c and cfg.h files
So far, the cfg.c file is empty, and the function prototypes in cfg.h
are not used in any place. So they can be removed.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:16 -07:00
Ivan Gomez Castellanos b87561f748 staging: tidspbridge: Remove cfg_set_object()
As the services directory is going to be removed, the cfg_set_object
function has also to be removed.

Since the driver object handle is retrieved from the drv_data structure,
then the word "Registry" is replaced by "driver data" in the comments.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:16 -07:00
Ivan Gomez Castellanos a47d4deebf staging: tidspbridge: Remove cfg_set_dev_object()
As the services directory is going to be removed, the cfg_set_dev_object
function has also to be removed.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:16 -07:00
Ivan Gomez Castellanos 73b87a9166 staging: tidspbridge: Remove cfg_get_object()
As the services directory is going to be removed, the cfg_get_object
function has also to be removed.

Since the driver object handle is retrieved from the drv_data structure,
then the word "Registry" is replaced by "driver data" in the comments.

Also, the hdrv_obj is not used in function omap34_xx_bridge_remove(), so
it is removed.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:15 -07:00
Ivan Gomez Castellanos 315a1a20aa staging: tidspbridge: Remove cfg_get_exec_file()
As the services directory is going to be removed, the cfg_get_exec_file
function has also to be removed.

This patch also avoids a possible NULL pointer dereference in function
cfg_get_exec_file(), when drv_datap is checked for NULL and then pass
drv_datap->base_img as argument to strlen().

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:15 -07:00
Ivan Gomez Castellanos e8184e6c2d staging: tidspbridge: Remove cfg_get_dev_object() and do a trivial cleanup
The cfg_get_dev_object function is only used in one place and because of
its simplicity, it can be removed.

The parameter *value can be left uninitialized if the strcmp() returns a
nonzero value, so in the function dev_remove_device(), the hdev_obj could
be used uninitialized and could be dereferenced in dev_destroy_device().
This patch fixes this issue, and also removes the dev_obj pointer which
is not used.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:15 -07:00
Ivan Gomez Castellanos 345c8bec42 staging: tidspbridge: Remove cfg_init() and cfg_exit()
The functions cfg_init() and cfg_exit() do nothing, so they are removed.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:15 -07:00
Ivan Gomez Castellanos 4a6595625c staging: tidspbridge: Remove cfg_get_auto_start()
As the services directory is going to be removed, this patch is needed.

The function cfg_get_auto_start() only assigns a value to the flag
tmp, and it is only called by the function api_init_complete2(). So
the function cfg_get_auto_start() is not required.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:14 -07:00
Ivan Gomez Castellanos 27e7f23f64 staging: tidspbridge: Remove ntfy.c
As the services directory is going to be removed, this patch is needed.

ntfy.c only contained the function dsp_notifier_event(), and since this
function calls sync_set_event(), then the dsp_notifier_event() is moved
to the sync.c file.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:14 -07:00
Ivan Gomez Castellanos 3aa1e0e6c7 staging: tidspbridge: Move sync.c from services to core
As the services directory is going to be removed, the file sync.c is moved
from services to core.

Signed-off-by: Ivan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:23:14 -07:00
Andrea Gelmini 42cd0f56b7 drivers: staging: tidspbridge: gen: gb.c: Removed duplicated #include
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:22:18 -07:00
Ernesto Ramos 084f70ee09 staging: ti dspbridge: avoid errors if stream id is zero
As 'zero' can be a perfectly good id, it can be picked up as
a NULL from userspace, avoid issues in API and user apps if stream
handle is zero.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:03 -07:00
Ernesto Ramos 4ec09714a0 staging: ti dspbridge: use stream id instead of kernel address
Send stream ids to the user instead of handles, then when
the id is coming from user dspbridge can retrive the handle
using id and avoid using invalid handles.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:03 -07:00
Ernesto Ramos 6bcc9beed2 staging: ti dspbridge: use processor handle from context instead of user's
Make sure dspbridge driver uses a valid processor handle by
using the handle stored in process context.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:03 -07:00
Ernesto Ramos 8df327c390 staging: ti dspbridge: avoid errors if node handle is zero
As 'zero' can be a perfectly good id, it can be picked up as
a NULL from userspace, avoid issues in API and user apps if node
handle is zero.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:02 -07:00
Ernesto Ramos 0624f52f77 staging: ti dspbridge: use node id instead of kernel address
Use idr kernel library to send/receive node ids to the
user instead of kernel address.
This id will be use to access the node handles at the
kernel side, if id does not match to any handle
error -EFAULT is returned.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:02 -07:00
Ernesto Ramos 35f338e4f2 staging: ti dspbridge: avoid possible NULL dereference panic
When dsp_notifications array is received from user,
dspbridge verifies the array has valid pointers
and dsp_notification structures. However, these
structures contain pointers that need to be
checked for valid handles.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 17:11:00 -07:00
Ernesto Ramos 0c4a938ed4 staging:ti dspbridge: remove find_gcf from nldr.c
Remove find_gcf from nldr.c and use kernel function
gcd().

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:23:35 -07:00
Ernesto Ramos 7c9305b80c staging:ti dspbridge: remove bridge_brd_delete function
Remove bridge_brd_delete() function since it is
doing the same that bridge_brd_stop().

Signed-off-by: Ernesto Ramos <ernesto@ernesto-desktop.(none)>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:23:20 -07:00
Ernesto Ramos a2205e487e staging:ti dspbridge: make sure IVA2 is OFF when dev is created
Regardless the IVA2 power state before bridgedriver is
installed, the driver must ensure that IVA2 power
state is OFF when the device driver is created.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:23:20 -07:00
Ernesto Ramos cfccf244a7 staging:ti dspbridge: proc_load/start should set IVA2 to OFF in case of failure
When a base image is being loaded or started and by some reason
the process fails, the IVA2 should be switched OFF.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:23:20 -07:00
Ernesto Ramos a2c2272194 staging:ti dspbridge: fix bridge_brd_stop so IVA2 is set OFF
right now, bridge_brd_stop is not changing the IVA2 power state
to OFF since PM_PWSTST_IVA2 is not 0 after calling this function.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:23:19 -07:00
Ernesto Ramos 3a8965fda9 staging:ti dspbridge: remove DSP_FAILED macro definition
Since status succeeded is now 0 macro DSP_FAILED
is not necessary anymore. This patch removes this
define.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:43 -07:00
Ernesto Ramos 82f575e5bb staging:ti dspbridge: remove DSP_FAILED macro from services
Since status succeeded is 0, DSP_FAILED macro
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:43 -07:00
Ernesto Ramos b66e0986f9 staging:ti dspbridge: remove DSP_FAILED macro from rmgr
Since status succeeded is 0, DSP_FAILED macro
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:43 -07:00
Ernesto Ramos 51d5e099cc staging:ti dspbridge: remove DSP_FAILED macro from pmgr
Since status succeeded is 0, DSP_FAILED macro
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:43 -07:00
Ernesto Ramos d1b2216d13 staging:ti dspbridge: remove DSP_FAILED macro from core
Since status succeeded is 0, DSP_FAILED macro
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:43 -07:00
Ernesto Ramos 54621f031c staging:ti dspbridge: remove DSP_SUCCEEDED macro definition
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore. This patch removes this
define.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:42 -07:00
Ernesto Ramos 95bd64a893 staging:ti dspbridge: remove DSP_SUCCEEDED macro from services
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:42 -07:00
Ernesto Ramos a741ea6efc staging:ti dspbridge: remove DSP_SUCCEEDED macro from rmgr
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:42 -07:00
Ernesto Ramos 157990f0d7 staging:ti dspbridge: remove DSP_SUCCEEDED macro from pmgr
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:42 -07:00
Ernesto Ramos e6486d8cee staging:ti dspbridge: remove DSP_SUCCEEDED macro from core
Since status succeeded is now 0 macro DSP_SUCCEEDED
is not necessary anymore.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:41 -07:00
Ernesto Ramos ecd3d0ca40 staging:ti dspbridge: replace simple_strtoul by strict_strtoul
Replace simple_strtoul by strict_strtoul in atoi function.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:05 -07:00
Ernesto Ramos b3c8aef0a2 staging:ti dspbridge: remove unnecessary volatile variables
Remove unnecessary volatile variables; use accessor
functions __raw_readl/__raw_writel instead when applicable.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:04 -07:00
Ernesto Ramos 74ea8ff93b staging:ti dspbridge: remove function delete_strm_mgr
Remove function delete_strm_mgr in strm.c and
use kfree instead.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:04 -07:00
Ernesto Ramos 3448c5481c staging:ti dspbridge: remove unnecessary check for NULL pointer in cmm.c
Remove unnecessary check for NULL pointer in cmm.c.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:04 -07:00
Ernesto Ramos 3fee78f6be staging:ti dspbridge: remove unused typedef REG16
Remove unused typedef REG16 in dspbridge.

Signed-off-by: Ernesto Ramos <ernesto@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-28 08:22:04 -07:00
Armando Uribe 14de72b0aa staging: tidspbridge: Remove unused macros
This patch removes a couple of macros that are not
being used

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:21 -07:00
Armando Uribe bf968b0a52 staging: tidspbridge: Change macros to static inline functions
This patch changes preprocesing macros to static inline
funcions. Also the function is_equal_uuid (IS_EQUAL_UUID) now uses the
memcmp function.

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:20 -07:00
Armando Uribe 803cd75eff staging: tidspbridge: Remove macros used as cast
This patch removes those macros that are used to
perform casts

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:20 -07:00
Armando Uribe fe15ea8b86 staging: tidspbridge: Remove unused magic number
This patch removes an unused magic number from the cod_manager
structure.

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:19 -07:00
Armando Uribe 28eeb6a737 staging: tidspbridge: Remove redundant macro from cod.c
This patch removes a redundant macro from cod.c simply used
to verify that a field was not NULL

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:19 -07:00
Armando Uribe a563510fb2 staging: tidspbridge: Change macros to static inline functions used in cload
This patch changes the macros to static inline function used
in cload as well adds two definition of const to avoid using magic
numbers

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:19 -07:00
Armando Uribe c18c9c910d staging: tidspbridge: Change macros to static inline functions in io_sm
This patch change to macros to static inline functions, these
macros are used to perform write/read operations in shared memory

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:19 -07:00
Armando Uribe 9e342489d7 staging: tidspbridge: Remove redundant macros in io_sm.c
This patch removes 4 redundant macros used to perform
read/write operations in shared memory region from io_sm.c.

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:18 -07:00
Armando Uribe 8204bd3846 staging: tidspbridge: Remove Redundant wrappers
This patch removes redundant wrappers from io_sm.c file

Signed-off-by: Armando Uribe <x0095078@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-26 15:32:18 -07:00
Menon, Nishanth cfa6b29750 staging: tidspbridge: remove dbdefs.h
Remove yet another custom definition header

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:06 -07:00
Menon, Nishanth e6bf74f06f staging: tidspbridge: remove OUT define
Remove OUT modifier which makes no sense for linux kernel

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:04 -07:00
Menon, Nishanth 21aaf42ec9 staging: tidspbridge: remove OPTIONAL
OPTIONAL modifier makes no sense in linux kernel

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:04 -07:00
Menon, Nishanth 9d7d0a5261 staging: tidspbridge: remove IN modifier
IN modifier does not exist. remove it

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:04 -07:00
Menon, Nishanth cd4f13c02a staging: tidspbridge: replace CONST with c standard const
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:04 -07:00
Menon, Nishanth 38bf20a9b6 staging: tidspbridge: remove GlobalTypes.h
Remove custom globaltypes.h header

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:41:03 -07:00
Kulikov Vasiliy dd85c9911d staging: tidspbridge: check kmalloc() result
If kmalloc() fails then exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 10:54:03 -07:00
Nishanth Menon 4018e39651 staging: tidspbridge: remove RET_OK RET_FAIL
RET_OK is 0 and RET_FAIL is a -1, replace these custom returns with
a standard errno

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 10:52:00 -07:00
Nishanth Menon 7124cb1711 staging: tidspbridge: remove custom typedef reg_uword32
use readl, writel to get and set the register instead.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 10:50:15 -07:00
Nishanth Menon 2094f12d44 staging: tidspbridge: remove std.h
std.h introduces _TI_ _FLOAT_ _FIXED_ _TARGET_ ARG_TO_INT ARG_TO_PTR
which are no longer being used anywhere. we dont really need the
custom std.h header. remove it from the repo. where we need types,
introduce standard types.h

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 10:50:15 -07:00