summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)Author
2017-03-30drivers: iio: chemical: replace comma with a semicolonArushi Singhal
Replace a comma between expression statements by a semicolon. This changes the semantics of the code, but given the current indentation appears to be what is intended. A simplified version of the Coccinelle semantic patch that performs this transformation is as follows: // <smpl> @r@ expression e1,e2; @@ e1 -, +; e2; // </smpl> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-30iio: adc: replace comma with a semicolonArushi Singhal
Replace a comma between expression statements by a semicolon. This changes the semantics of the code, but given the current indentation appears to be what is intended. A simplified version of the Coccinelle semantic patch that performs this transformation is as follows: // <smpl> @r@ expression e1,e2; @@ e1 -, +; e2; // </smpl> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: adc: ad799x: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 26051 464 0 26515 6793 drivers/iio/adc/ad799x.o File size after: text data bss dec hex filename 26115 400 0 26515 6793 drivers/iio/adc/ad799x.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: adc: max1363: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 36951 448 0 37399 9217 drivers/iio/adc/max1363.o File size after: text data bss dec hex filename 37015 384 0 37399 9217 drivers/iio/adc/max1363.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: dac: ad5504: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 3046 360 0 3406 d4e drivers/iio/dac/ad5504.o File size after: text data bss dec hex filename 3110 296 0 3406 d4e drivers/iio/dac/ad5504.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: adc: ad7280a: fix permission coding style issueOlivier Leveque
Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred. Consider using octal permissions '0644'. Found running checkpatch. Signed-off-by: Olivier Leveque <o_leveque@orange.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: accel: remove unneeded braces around single statementsMark Stenglein
Fixes three checkpatch warnings due to braces used when single statements are sufficient. Signed-off-by: Mark Stenglein <mark@stengle.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: tsl2x7x_core: Fix standard deviation calculationEva Rachel Retuya
Standard deviation is calculated as the square root of the variance where variance is the mean of sample_sum and length. Correct the computation of statP->stddev in accordance to the proper calculation. Fixes: 3c97c08b5735 ("staging: iio: add TAOS tsl2x7x driver") Reported-by: Abhiram Balasubramanian <abhiram@cs.utah.edu> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: hid: Add humidity sensor supportSong Hongyan
Environmental humidity sensor is a hid defined sensor, it shows raw humidity measurement of air. More information can be found in: http://www.usb.org/developers/hidpage/HUTRR39b.pdf According to IIO ABI definition, humidityrelative data output unit is milli percent. Add the unit convert from percent to milli percent. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: hid-sensor-attributes: Fix gravity sensor scale value not right issueSong Hongyan
Scale value include two parts: unit conversion and exponent conversion. Add gravity unit convert table to fix gravity sensor scale value not right issue. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio:light: Add support for STMicro VL6180 sensorManivannan Sadhasivam
This patch adds support for STMicro VL6180 - ALS, range and proximity sensor. Sensor is capable of measuring the light intensity as well as object distance using TOF (Time of Flight) technology. Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com> Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: Remove extra Parenthesis.Arushi Singhal
Remove the extra parenthesis remove the checkpatch issue. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: cros_ec_sensors: Use devm to setup the triggered buffer.Enric Balletbo i Serra
Use resourced managed function devm_iio_triggered_buffer_setup to make error path simpler and be able to get rid of the remove function. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: adc: meson-saradc: add calibrationHeiner Kallweit
This patch adds calibration for the Meson SAR ADC. Points 25% vref and 75% vref are used for calibration. It uses a simple linear calibration function: SCALE * val + BIAS Successfully tested on a Odroid C2. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIASGargi Sharma
adis16203_read_raw does not need lock for IIO_CHAN_INFO_CALIBBIAS since adis_read_reg_16 is already atomic and nothing else needs to be protected. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: cdc: ad7746: Fix alignment with paranthesisNarcisa Ana Maria Vasile
This was reported by checkpatch.pl: CHECK: Alignment should match open parenthesis Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: Add blank lines after function declarationsNarcisa Ana Maria Vasile
This was reported by checkpatch.pl: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: adt7136: Remove unnecessary blank linesNarcisa Ana Maria Vasile
This was reported by checkpatch.pl Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: ad7606: Replace mlock with driver private lockArushi Singhal
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: ade7753: Remove trailing whitespacessimran singhal
This patch removes trailing whitespaces in order to follow the Linux coding style. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: ade7754: Clean up #includessimran singhal
Alphabetize and separate kernel and subsystem headers. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: Replace a bit shift by a use of BIT.Arushi Singhal
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: adis16060: Remove iio_dev mlock and refactor codesimran singhal
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. In the driver, buf_lock protects both the adis16060_spi_write() and adis16060_spi_read() functions and both are always called in pair. First write, then read. Refactor the code to have one single function adis16060_spi_write_than_read() protected by the buf_lock. This removes the need for additional locking via mlock, so this locking is removed. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-22Merge tag 'iio-for-4.12b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd set of new device support, features and cleanups for IIO in the 4.12 cycle A good collection of outreachy related patches in here - mostly staging driver cleanup. Also a fair number of patches added explicit OF device ID tables for i2c drivers - a precursor to dropping (eventually) the implicit probing. New Device Support * Allwinner SoC ADC. - So far covers the sun4i-a10, sun5i-a13 and sun6i-a31 general purpose ADCs, including thermal side of things. This missed the last cycle due to my incompetence, so good to get in now, particularly as various patches dependent on it are appearing. * ltc2632 - new driver supporting ltc2632-l12, ltc2632-l10, ltc2632-l8, ltc2632-h12, ltc-2632-h10, ltc-2632-h8 dacs Cleanups * Documentation - drop a broken reference to i2c/trivial-devices * ad2s1200 - drop & from function pointers for consistency. * ad2s1210 - formatting fixes. * ad7152 - octal permissions instead of symbolic. - drop & from function pointers for consistent usage. * ad7192 - drop & from function pointers for consistent usage. * ad7280 - replace core mlock usage with a local lock as mlock is intended only to protect the current device state (direct reads, or triggered and buffered) * ad7746 - drop & from function pointers for consistent usage. - replace core mlock usage with a local lock as mlock is intended only to protect the current device state (direct reads, or triggered and buffered) * ad7754 - move contents of header file into source file as not used anywhere else. * ad7759 - move contents of header file into source file as not used anywhere else. * ad7780 - drop & from function pointers for consistent usage. * ad7832 - replace core mlock usage with a local lock as mlock is intended only to protect the current device state (direct reads, or triggered and buffered) * ad9834 - replace core mlock usage with a local lock as mlock is intended only to protect the current device state (direct reads, or triggered and buffered) - drop an unnecessary goto in favour of direct return. * adis16060 - drop & from function pointers as inconsistent. * adis16201 - drop a local mutex as the adis core already protects everything necessary. - drop & from function pointers for consistent usage. * adis16203 - drop & from function pointers for consistent usage. * adis16209 - drop a local mutex as the adis core already protects everything necessary. - use an enum for scan index giving slightly nicer code. - drop & from function pointers for consistent usage. * adis16240 - drop a local mutex as the adis core already protects everything necessary. - use an enum for scan index giving slightly nicer code. - drop & from function pointers for consistent usage. * apds9960 - add OF device ID table. * bma180 - add OF device ID table. - prefer unsigned int to bare use of unsigned. * bmc150_magn - add OF device ID table. * hmp03 - add OF device ID table. * ina2xx - add OF device ID table. * itg3200 - add OF device ID table. * mag3110 - add OF device ID table. * max11100 - remove .owner field as it is set by the spi core. * max5821 - add .of_match_table set to the ID table which was present but not used. * mcp4725 - add OF device ID table. * mlx96014 - add OF device ID table. * mma7455 - add OF device ID table. * mma7660 - add OF device ID table. * mpl3115 - add OF device ID table. * mpu6050 - add OF device ID table. * pc104 - mask pc104 drivers behind a global pc104 config option. * ti-ads1015 - add OF device ID table. * tsl2563 - add OF device ID table. * us5182d - add OF device ID table.
2017-03-21iio: dac: Add support for ltc2632 DACsMaxime Roussin-Belanger
Add support for Linear Technology LTC2632 (SPI) family of· dual 12- 10-, and 8-bits output DACs. Signed-off-by: Maxime Roussin-Belanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-21staging: ks7010: rename return value identifierTobin C. Harding
Driver uses multiple identifier names for the same task (retval, ret, rc). It would be easier to read the code if a single task is identified with a single name. 'ret' is the most common return value identifier name found in the kernel tree, following the principle of least surprise using 'ret' is a decent choice. Rename rc -> ret Rename retval -> ret Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: remove zero comparisonTobin C. Harding
Comparison, equal to zero, is redundant 'if (foo == 0)' is equal to 'if (!foo)' Typical kernel coding style is to use the shorter form. Remove unnecessary zero comparison. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: remove non-zero comparisonTobin C. Harding
Comparison, does not equal zero, is redundant 'if (foo != 0)' is equal to 'if (foo)' Typical kernel coding style is to use the shorter form. Remove unnecessary non-zero comparison. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: make goto labels uniformTobin C. Harding
Driver uses different label forms for similar purposes. It would be more clear if single use case has uniform label. 'out' is generic and adds no meaning to label. Documentation/process/coding-style.rst: Choose label names which say what the goto does or why the goto exists. Rename labels so as to better describe what they do. If an execution path only exists for the label on an error, prefix the label with 'err_'. If a non-error execution path exist do not use prefix. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: return directly on errorTobin C. Harding
Function uses goto label with no clean up code. In this case we should just return directly. Remove goto statement, return directly on error. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: fix checkpatch MULTIPLE_ASSIGNMENTSTobin C. Harding
Checkpatch emits CHECK: multiple assignments should be avoided. Move multiple line assignment to individual lines. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: fix checkpatch BRACESTobin C. Harding
Checkpatch emits CHECK: Unbalanced braces around else statement. Statements in question are single statements so we do not need braces. Checkpatch also warns about multiple line dereference for this code. Fix if/else/else if statement use of braces. Fix function argument layout at the same time since it is the same statement. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENTTobin C. Harding
Checkpatch emits CHECK: Alignment should match open parenthesis. Fix alignment to open parenthesis in line with kernel coding style. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: fix checkpatch SPACINGTobin C. Harding
Checkpatch emits CHECK: No space is necessary after a cast. Remove unnecessary space after cast. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: ks7010: fix checkpatch LINE_SPACINGTobin C. Harding
Checkpatch emits CHECK: Please use a blank line after function/struct/union/enum declarations. Add blank line after function definition. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: vchiq_arm: Fix MODULE_LICENSEStefan Wahren
Regarding to the header the driver is licensed under BSD and GPL. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21Staging: media: Unmap and release region obtained by ioremap_nocacheArvind Yadav
Free memory mapping, if vpfe_ipipe_init is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging:sm750fb: Code readability is improved.Arushi Singhal
New variables are added to make the code more readable. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: rtl8712: checkpatch: Avoid multiple line dereferencesDing-Chi Wang
"WARNING: Avoid multiple line dereference - prefer 'poid_par_priv->information_buf_len'" "WARNING: Avoid multiple line dereference - prefer 'padapter->registrypriv.dev_network.Configuration'" "WARNING: Avoid multiple line dereference - prefer 'Adapter->mppriv.workparam.io_value'" Signed-off-by: Ding-Chi Wang <dcwang.tw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: lustre: libcfs: Define pr_fmt() to include relevant nameNarcisa Ana Maria Vasile
Define a pr_fmt() for tracefile.c Remove redundant prefix 'Lustre' from pr_*() calls. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: lustre: libcfs: Replace printk() with pr_*()Narcisa Ana Maria Vasile
Convert printk() calls into corresponding pr_*() calls. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: fix build errors when PM is disabledJérémy Lefaure
The function atomisp_restore_iumit_reg is unused when PM is disabled. Adding __maybe_unused to the function definition avoids a warning. The function atomisp_mrfld_power_down is defined only when PM is enabled. So in atomisp_pci_probe, it should be called only when PM is enabled. Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: atomisp: remove useless condition in if-statementsDaeseok Youn
The css_pipe_id was checked with 'CSS_PIPE_ID_COPY' in previous if- statement. In this case, if the css_pipe_id equals to 'CSS_PIPE_ID_COPY', it could not enter the next if-statement. But the "next" if-statement has the condition to check whether the css_pipe_id equals to 'CSS_PIPE_ID_COPY' or not. It should be removed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Remove unnecessary braces.Varsha Rao
Remove braces which are not required to fix the check patch issue. The following coccinelle script is used to fix this issue. @@ expression e,e1; @@ if(e) -{ e1; -} Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Remove unnecessary blank lines.Varsha Rao
Remove multiple blank lines, which are not required. This patch fixes the following check patch issue: CHECK: Please don't use multiple blank lines Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Fix block comments warning.Varsha Rao
Use kernel preferred block commenting style, to fix the checkpatch issue. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: media: atomisp: Added spaces around arithmetic operators.Varsha Rao
Add spaces around arithmetic operators (/, +, -), to fix the checkpatch issue. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: bcm2835-audio: Add support for simultanous HDMI and Headphone audioMichael Zoran
The firmware for the Raspberry PI already supports simultanous output of audio through both the HDMI and the Headphone jack. The current implementation of ALSA doesn't expose this well to user mode since the firmware audio is represented as a single card. A newer approach is taken here and a virtual card is created for each output(HDMI, Headphones, and Traditional ALSA). The firmware has the concept of channels or streams for which the number to use is passed in the device tree. These streams are allocated to each of the virtual cards. As a side effect of this change, since each output is represented independenly it's now very easy to use PulseAudio to control the priorities of the outputs. Testing: Audacity and VLC were both loaded at the same time. Each application was assigned to a different card. With this change I was able to play different music files at the same time through the HDMI and Headphones jacks and control the audio independently. Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21bcm2835-v4l2: Fix buffer overflow problemDave Stevenson
https://github.com/raspberrypi/linux/issues/1447 port_parameter_get() failed to account for the header (u32 id and u32 size) in the size before memcpying the response into the response buffer, so overrunning the provided buffer by 8 bytes. Account for those bytes, and also a belt-and-braces check to ensure we never copy more than *value_size bytes into value. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Michael Zoran <mzoran@crowfest.net> Tested-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-21staging: vc04_services: make BCM_VIDEOCORE tristateArnd Bergmann
Adding the 'bool' symbol brought back a randconfig build bug that I had fixed before: drivers/staging/built-in.o: In function `vchiq_probe': (.text+0x1da30): undefined reference to `rpi_firmware_get' drivers/staging/built-in.o: In function `vchiq_platform_init': (.text+0x27494): undefined reference to `rpi_firmware_property' The problem is that when RASPBERRYPI_FIRMWARE is a loadable module, but BCM2835_VCHIQ can again be built-in. Making BCM_VIDEOCORE itself tristate will make Kconfig honor the dependency correctly. Fixes: 6bbfe4a76158 ("staging: vc04_services: Create new BCM_VIDEOCORE setting for VideoCore services.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>