aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/goldfish (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-05-20Staging: goldfish: Kconfig: fixed code style issueankit patel1-1/+1
Style fix: config GOLDFISH_AUDIO containing "--help--" to "help" Signed-off-by: ankit patel <ankit.mayurbhai.patel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-20Delete the goldfish_nand driver.Roman Kiryanov4-525/+0
This driver was inherited from qemu1 and not used anymore. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-21mtd: Stop updating erase_info->state and calling mtd_erase_callback()Boris Brezillon1-3/+0
MTD users are no longer checking erase_info->state to determine if the erase operation failed or succeeded. Moreover, mtd_erase_callback() is now a NOP. We can safely get rid of all mtd_erase_callback() calls and all erase_info->state assignments. While at it, get rid of the erase_info->state field, all MTD_ERASE_XXX definitions and the mtd_erase_callback() function. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Richard Weinberger <richard@nod.at> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Bert Kenward <bkenward@solarflare.com> --- Changes in v2: - Address a few coding style issues (reported by Miquel) - Remove comments that are no longer valid (reported by Miquel)
2017-08-31staging: goldfish: (Coding Style) Fixed parenthesis alignment.Edvard Holst1-2/+2
Fixed paranthesis alignment for compliance with checkpatch. Signed-off-by: Edvard Holst <edvard.holst@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30staging: goldfish: Use __func__ instead of function nameChris Coffey1-10/+10
Replace hard-coded function names in strings with "%s", __func__ in the goldfish_nand.c file. Issue found by checkpatch.pl. Signed-off-by: Chris Coffey <cmc@babblebit.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-17Staging: goldfish: use __func__ instead of embedded function namesMohsin Shan1-8/+8
Embedded function names are less appropriate to use when refactoring, can cause function renaming. Prefer the use of "%s", __func__ to embedded function names Signed-off-by: Mohsin Shan <mohsinshan1k@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: goldfish: audio: fix compiliation on armGreg Hackmann1-0/+1
We do actually need slab.h, by luck we get it on other platforms but not always on ARM. Include it properly. Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Jin Qian <jinqian@android.com> Signed-off-by: Alan <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: goldfish: audio: add devicetree bindingsGreg Hackmann1-1/+8
Introduce devicetree bindings to the Goldfish staging audio driver. Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Jin Qian <jinqian@android.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: goldfish: (coding style) Rewrite comparisons to NULL as "!data->reg_base"Christian Colic1-3/+3
Rewrite comparisons to NULL "data->reg_base == NULL" as "!data->reg_base" to conform to checkpatch. Signed-off-by: Christian Colic <colic.christian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: goldfish: (coding style) Add spaces around the "+" to conform to checkpatchChristian Colic1-1/+1
Added a space around the "+" at: "reg_base+addr2" to clear up a checkpatch check. Signed-off-by: Christian Colic <colic.christian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: goldfish: use div64_s64 instead of do_divArnd Bergmann1-15/+15
The goldfish nand driver divides a signed 64-bit number (loff_t) in multiple places using the do_div() function. This has always been unreliable but now produces a compiler warning (since 4.5-rc1): goldfish/goldfish_nand.c: In function 'goldfish_nand_erase': goldfish/goldfish_nand.c:107:91: error: comparison of distinct pointer types lacks a cast [-Werror] goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob': goldfish/goldfish_nand.c:145:91: error: comparison of distinct pointer types lacks a cast [-Werror] This changes the code to the equivalent div_s64{,_rem} that works correctly for negative numbers (which we should never get here). The warning has shown up on ARM allmodconfig builds after the goldfish bus driver has become visible on ARM. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: bd2f348db503 ("goldfish: refactor goldfish platform configs") Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-28Staging: goldfish: goldfish_nand: Add DMA Support using dmam_alloc_coherentShraddha Barke1-9/+11
Function nand_setup_cmd_params has 2 goals- -Initialize the cmd_params field so that it can be used to send and read commands from the device. -Get a bus address for the allocated memory to transfer to the device. Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. Coherent mapping guarantees that the device and CPU are in sync. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: goldfish: Prefer kernel type u32 over uint32_tRavi Teja Darbha1-5/+5
Prefer kernel type u32 over uint32_t to maintain uniformity. Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: goldfish: Fix NULL comparison styleRavi Teja Darbha1-2/+2
Fixed NULL comparison style as suggested by checkpatch.pl with --strict option. Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: goldfish: Fix pointer cast for 32 bitsPeter Senna Tschudin2-2/+2
As the first argument of gf_write64() was of type unsigned long, and as some calls to gf_write64() were casting the first argument from void * to u64 the compiler and/or sparse were printing warnings for casts of wrong sizes when compiling for i386. This patch changes the type of the first argument of gf_write64() to const void *, and update calls to the function. This change fixed the warnings and allowed to remove casts from 3 calls to gf_write64(). In addition gf_write64() was renamed to gf_write_ptr() as the name was misleading because it only writes 32 bits on 32 bit systems. gf_write_dma_addr() was added to handle dma_addr_t values which is used at drivers/staging/goldfish/goldfish_audio.c. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging/goldfish/goldfish_audio: Fix annotationsRicardo Ribalda Delgado1-5/+5
dmam_alloc_coherent does not return a __iomem pointer. here is its prototype: void * dmam_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) This fixes these sparse warnings: drivers/staging/goldfish/goldfish_audio.c:134:43: warning: incorrect type in argument 2 (different address spaces) drivers/staging/goldfish/goldfish_audio.c:134:43: expected void const *from drivers/staging/goldfish/goldfish_audio.c:134:43: got char [noderef] <asn:2>*read_buffer drivers/staging/goldfish/goldfish_audio.c:167:36: warning: incorrect type in argument 1 (different address spaces) drivers/staging/goldfish/goldfish_audio.c:167:36: expected void *to drivers/staging/goldfish/goldfish_audio.c:167:36: got char [noderef] <asn:2>*[assigned] kbuf drivers/staging/goldfish/goldfish_audio.c:296:27: warning: incorrect type in assignment (different address spaces) drivers/staging/goldfish/goldfish_audio.c:296:27: expected char [noderef] <asn:2>*buffer_virt drivers/staging/goldfish/goldfish_audio.c:296:27: got void * Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: goldfish: use !x instead of x == NULLSomya Anand2-4/+4
Functions like devm_kzalloc, kmalloc_array, devm_ioremap, usb_alloc_urb, alloc_netdev return NULL as a return value on failure. Generally, When NULL represents failure, !x is commonly used. This patch cleans up the tests on the results of these functions, thereby using !x instead of x == NULL or NULL == x. This is done via following coccinelle script: @prob_7@ identifier x; statement S; @@ ( x = devm_kzalloc(...); | x = usb_alloc_urb(...); | x = kmalloc_array(...); | x = devm_ioremap(...); | x = alloc_netdev(...); ) ... - if(NULL == x) + if(!x) S Further we have used isomorphism characteristics of coccinelle to indicate x == NULL and NULL == x are equivalent. This is done via following iso script. Expression @ is_null @ expression X; @@ X == NULL <=> NULL == X Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15staging: goldfish: remove extra parentheses around function argumentsAya Mahfouz1-4/+4
Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script: @@ expression e; identifier f; @@ f(..., -( e -) ,...) Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: avoid multiple assignmentsLoic Pefferkorn1-1/+2
Coding style: avoid multiple assignments Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: document mutex usageLoic Pefferkorn1-0/+1
Coding style: document mutex usage Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: fix alignment to match open parenthesisLoic Pefferkorn2-29/+28
Coding style: fix alignment to match open parenthesis Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: document spinlock usageLoic Pefferkorn1-0/+1
Coding style: document spinlock usage Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: remove useless space after a castLoic Pefferkorn1-1/+1
Coding style: remove useless space after a cast Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06staging: goldfish: suppress consecutive blank linesLoic Pefferkorn1-2/+0
Coding style: suppress consecutive blank lines Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-23staging/goldfish/goldfish_audio: fix a sparse warningRobin Schroer1-1/+1
Fix a pointer check to use NULL instead of 0 Warning: drivers/staging/goldfish/goldfish_audio.c:300:34: warning: Using plain integer as NULL pointer Signed-off-by: Robin Schroer <sulamiification@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: goldfish: Introduce the use of managed interfacesHimangi Saraogi1-40/+13
This patch introduces the use of managed interfaces like devm_kzalloc, devm_ioremap, dmam_alloc_coherent, devm_request_irq and does away with the calls to functions to free the allocated memory in the probe and remove functions. Also, the labels are removed in the probe function. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18staging: goldfish: fix coding style.Hoang Tran1-5/+5
Using an else following a break or return can unnecessarily indent code blocks. This patch fixes coding style reported by checkpatch.pl, a part of eudyptula challenge. Signed-off-by: Hoang Tran <hoangtran.gwr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15goldfish: clean up staging ifdefsAlan3-40/+13
Use the write helpers and add an audio helper Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15goldfish_nand.c: remove length restrictionsNick Kralevich1-4/+0
Remove limitations on the size of a read / write request. AFAIK, there's no consequence to allowing the upper layers to specify different read / write sizes. This is needed to support running ext4 on goldfish. Bug: https://code.google.com/p/android/issues/detail?id=38561 Signed-off-by: Nick Kralevich <nnk@google.com> Signed-off-by: Jun Tian <jun.j.tian@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03goldfish: 64-bit nand driver for goldfish platformJun Tian2-2/+8
Enable the 64-bit nand data support in the goldfish nand driver. Signed-off-by: Jun Tian <jun.j.tian@intel.com> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03goldfish: 64-bit audio driver for goldfish platformJun Tian1-0/+33
Enable the 64-bit goldfish audio driver. Support 64-bit buffer address and data read/write. Signed-off-by: Jun Tian <jun.j.tian@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-22Merge 3.15-rc2 into staging-nextGreg Kroah-Hartman1-0/+1
This resolves a bunch of merge errors with other fixes that are already in Linus's tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16staging: goldfish: Fix missing blank linesGarret Kelly2-0/+2
Fix two instances of the following checkpatch warning: WARNING: Missing a blank line after declarations Signed-off-by: Garret Kelly <garret.kelly@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16staging: goldfish: switch from spinlock to mutexKristina Martšenko2-9/+7
Use a mutex instead of a spinlock in goldfish_nand.c, as suggested by the TODO list. Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16staging: goldfish: Call free_irq in error pathTuomas Tynkkynen1-0/+1
If misc_register failed in goldfish_audio_probe, the already requested IRQ wouldn't get freed. Add a call to free_irq() like there is in goldfish_audio_remove(). Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17staging: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21staging/goldfish: Fixed up incorrect formatted comments.Sara Bird2-25/+34
The existing comments are using an odd style. Fixed them up to adhereto the StyleGuide. No code changes. Signed-off-by: Sara Bird <sara.bird.iar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: goldfish: Fixed line over 80 charactersHema Prathaban2-3/+6
Fixes the following checkpatch warning: WARNING: line over 80 characters Signed-off-by: Hema Prathaban <hemaklnce@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: goldfish: Fixed Trailing WhitespaceHema Prathaban1-4/+4
Fixes the following checkpatch Error: Error: trailing whitespace Signed-off-by: Hema Prathaban <hemaklnce@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07staging/goldfish: Add MTD dependency to KCONFIGPeter Huewe1-0/+1
If CONFIG_MTD is not set goldfish_nand fails to compile with the following linker warnings: drivers/built-in.o: In function `goldfish_nand_remove': goldfish_nand.c:(.text+0x6e7d0e): undefined reference to `mtd_device_unregister' drivers/built-in.o: In function `goldfish_nand_erase': goldfish_nand.c:(.text+0x6e8ba2): undefined reference to `mtd_erase_callback' drivers/built-in.o: In function `goldfish_nand_init_device': goldfish_nand.c:(.text+0x6e8eba): undefined reference to `mtd_device_parse_register' Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07staging/goldfish: Use %zx for printing size_t variablesPeter Huewe1-4/+4
When building the driver, gcc emits the following warnings: .../drivers/staging/goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob': goldfish_nand.c:159:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] goldfish_nand.c:159:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' [-Wformat] In function 'goldfish_nand_write_oob': goldfish_nand.c:191:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] goldfish_nand.c:191:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' [-Wformat] In function 'goldfish_nand_read': goldfish_nand.c:215:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] In function 'goldfish_nand_write': goldfish_nand.c:239:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'size_t' [-Wformat] -> As defined in the printk-formats use %zx for size_t variables Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-24goldfish: NAND flash driverArve Hjønnevåg5-0/+533
Fold together the NAND driver for Goldfish from Arve with cleanups by Jun Nakajima and a tidy up to 3.7 and checkpatch. This provides a virtual flash driver for the Goldfish Android Virtual Platform, and which is normally used as the root file system when testing emulated devices. Signed-off-by: Mike A. Chan <mikechan@google.com> Signed-off-by: Arve Hjønnevåg <arve@android.com> [Ported to handle x86] Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> [Ported to 3.4] Signed-off-by: Tom Keel <thomas.keel@intel.com> [Ported to 3.7 and tided for checkpatch etc] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-24goldfish: audio supportAlan Cox4-0/+376
(remove change to another file that escaped into the patch set) From: Mike Lockwood <lockwood@google.com> Provide a simple audio channel between the kernel and the emulator that host sit. Queued for staging right now as this ought to be an ALSA driver not just a dumb device of its own making. Signed-off-by: Mike A. Chan <mikechan@google.com> [x86 support] Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> [Clean up] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>