platform/kernel/linux-rpi.git
5 years agoASoC: pcm512x: Implement the digital_mute interface
Dimitris Papavasiliou [Sat, 24 Nov 2018 20:05:42 +0000 (22:05 +0200)]
ASoC: pcm512x: Implement the digital_mute interface

[ Upstream commit 3500f1c589e92e0b6b1f8d31b4084fbde08d49cb ]

Clicks and pops of various volumes can be produced while the device is
opened, closed, put into and taken out of standby, or reconfigured.
Fix this, by implementing the digital_mute interface, so that the
output is muted during such operations.

Signed-off-by: Dimitris Papavasiliou <dpapavas@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agobcm283x: Set the DISDEBUG flag for SD transfers
Phil Elwell [Fri, 20 Jul 2018 21:08:05 +0000 (22:08 +0100)]
bcm283x: Set the DISDEBUG flag for SD transfers

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agobcm2835-dma: Add support for per-channel flags
Phil Elwell [Fri, 20 Jul 2018 21:03:41 +0000 (22:03 +0100)]
bcm2835-dma: Add support for per-channel flags

Add the ability to interpret the high bits of the dreq specifier as
flags to be included in the DMA_CS register. The motivation for this
change is the ability to set the DISDEBUG flag for SD card transfers
to avoid corruption when using the VPU debugger.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agovideo: bcm2708_fb: Clean up coding style issues
Dave Stevenson [Fri, 25 Jan 2019 17:32:54 +0000 (17:32 +0000)]
video: bcm2708_fb: Clean up coding style issues

Now checkpatch clean except for 2 long lines, missing
SPDX header, and no DT documentation.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agovideo: bcm2708_fb: Fix warnings on 64 bit builds
Dave Stevenson [Fri, 25 Jan 2019 17:11:39 +0000 (17:11 +0000)]
video: bcm2708_fb: Fix warnings on 64 bit builds

Fix up logging lines where the wrong format specifiers were
being used.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agovideo: bcm2708_fb: Add compat_ioctl support.
Dave Stevenson [Fri, 25 Jan 2019 17:12:54 +0000 (17:12 +0000)]
video: bcm2708_fb: Add compat_ioctl support.

When using a 64 bit kernel with 32 bit userspace we need
compat ioctl handling for FBIODMACOPY as one of the
parameters is a pointer.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-codec: Fix potentially uninitialised vars
Dave Stevenson [Thu, 24 Jan 2019 16:36:19 +0000 (16:36 +0000)]
staging: bcm2835-codec: Fix potentially uninitialised vars

src_m2m_buf and dst_m2m_buf were printed in log messages
when there are code paths that don't initialise them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-codec: variable vb2 may be used uninitialised
Dave Stevenson [Thu, 24 Jan 2019 16:40:01 +0000 (16:40 +0000)]
staging: bcm2835-codec: variable vb2 may be used uninitialised

In op_buffer_cb, the failure path checked whether there was
an associated vb2 buffer before the variable vb2 had been
assigned.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Correct ctrl min/max/step/def to 64bit
Dave Stevenson [Thu, 24 Jan 2019 16:20:38 +0000 (16:20 +0000)]
staging: bcm2835-camera: Correct ctrl min/max/step/def to 64bit

The V4L2 control API was expanded to take 64 bit values in commit
0ba2aeb6dab (Apr 16 2014), but as this driver wasn't in the mainline
kernel at that point this was overlooked.

Update to use 64 bit values. This also fixes a couple of warnings
in 64 bit builds.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoaudioinjector-octo: revert to dummy supplies
Matt Flax [Tue, 29 Jan 2019 03:56:03 +0000 (14:56 +1100)]
audioinjector-octo: revert to dummy supplies

The Audio Injector Octo has had a lot of reports of not coming up on power cycles. By reverting to dummy supplies, the card comes up reliably.

5 years agomedia:bcm2835-unicam: Power on subdev on open/release, not streaming
Dave Stevenson [Tue, 29 Jan 2019 15:56:10 +0000 (15:56 +0000)]
media:bcm2835-unicam: Power on subdev on open/release, not streaming

The driver was powering on the source subdevice as part of STREAMON,
and powering it off in STREAMOFF. This isn't so great if there is a
significant amount of setup required for your device.

Copy the approach taken in the Atmel ISC driver where s_power(1) is called
on first file handle open, and s_power(0) is called on the last release.

See https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=232437

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: ov5647: Use gpiod_set_value_cansleep
Dave Stevenson [Tue, 18 Sep 2018 10:08:51 +0000 (11:08 +0100)]
media: ov5647: Use gpiod_set_value_cansleep

All calls to the gpio library are in contexts that can sleep,
therefore there is no issue with having those GPIOs controlled
by controllers which require sleeping (eg I2C GPIO expanders).

Switch to using gpiod_set_value_cansleep instead of gpiod_set_value
to avoid triggering the warning in gpiolib should the GPIO
controller need to sleep.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agodtoverlays: Correct DT handling camera GPIOs
Dave Stevenson [Tue, 18 Sep 2018 09:47:38 +0000 (10:47 +0100)]
dtoverlays: Correct DT handling camera GPIOs

The firmware has support for updating overrides with the correct
GPIO settings for the camera GPIOs, but the wrong device tree
setup ended up being merged.
Correct the DT configuration so that the firmware does set it
up correctly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoinput: rpi-ft5406: Clear build warning on 64 bit builds.
Dave Stevenson [Mon, 28 Jan 2019 14:42:34 +0000 (14:42 +0000)]
input: rpi-ft5406: Clear build warning on 64 bit builds.

Resolve 64 bit build warning over using %x with a dma_addr_t.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agogpu: vc4_firmware_kms: Fix up 64 bit compile warnings.
Dave Stevenson [Mon, 28 Jan 2019 14:40:16 +0000 (14:40 +0000)]
gpu: vc4_firmware_kms: Fix up 64 bit compile warnings.

Resolve two build warnings with regard using incorrectly
sized parameters in logging messages on 64 bit builds.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomfd: Add rpi_sense_core of compatible string
Serge Schneider [Tue, 29 Jan 2019 12:05:49 +0000 (12:05 +0000)]
mfd: Add rpi_sense_core of compatible string

5 years agoclk: clk-bcm2835: Use %zd when printing size_t
Dave Stevenson [Thu, 24 Jan 2019 15:09:28 +0000 (15:09 +0000)]
clk: clk-bcm2835: Use %zd when printing size_t

The debug text for how many clocks have been registered
uses "%d" with a size_t. Correct it to "%zd".

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agochar: vc_mem: Fix all coding style issues.
Dave Stevenson [Wed, 23 Jan 2019 18:37:29 +0000 (18:37 +0000)]
char: vc_mem: Fix all coding style issues.

Cleans up all checkpatch errors in vc_mem.c and vc_mem.h
No functional change to the code.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agochar: vc_mem: Fix up compat ioctls for 64bit kernel
Dave Stevenson [Wed, 23 Jan 2019 18:25:50 +0000 (18:25 +0000)]
char: vc_mem: Fix up compat ioctls for 64bit kernel

compat_ioctl wasn't defined, so 32bit user/64bit kernel
always failed.
VC_MEM_IOC_MEM_PHYS_ADDR was defined with parameter size
unsigned long, so the ioctl cmd changes between sizes.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Set the field value within each buffer
Dave Stevenson [Tue, 15 Jan 2019 16:32:33 +0000 (16:32 +0000)]
staging: bcm2835-camera: Set the field value within each buffer

Fixes a v4l2-compliance failure
v4l2-test-buffers.cpp(415): g_field() == V4L2_FIELD_ANY

The driver only ever produces progresive frames, so field should
always be set to V4L2_FIELD_NONE.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS
Dave Stevenson [Tue, 15 Jan 2019 15:35:24 +0000 (15:35 +0000)]
staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS

Fixes a v4l2-compliance failure when passed a buffer that is
too small.
queue_setup wasn't handling the case where !(*nplanes), as
used from CREATE_BUFS and requiring the driver to sanity
check the provided buffer parameters. It was assuming that
it was always being used in the REQBUFS case where it provides
the buffer properties.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Fix client_component for 64 bit kernel
Dave Stevenson [Tue, 22 Jan 2019 12:04:09 +0000 (12:04 +0000)]
staging: mmal-vchiq: Fix client_component for 64 bit kernel

The MMAL client_component field is used with the event
mechanism to allow the client to identify the component for
which the event is generated.
The field is only 32bits in size, therefore we can't use a
pointer to the component in a 64 bit kernel.

Component handles are already held in an array per VCHI
instance, so use the array index as the client_component handle
to avoid having to create a new IDR for this purpose.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agochar: vcio: Fail probe if rpi_firmware is not found.
Dave Stevenson [Thu, 24 Jan 2019 14:03:28 +0000 (14:03 +0000)]
char: vcio: Fail probe if rpi_firmware is not found.

Device Tree is now the only supported config mechanism, therefore
uncomment the block of code that fails the probe if the
firmware node can't be found.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agochar: vcio: Add compat ioctl handling
Dave Stevenson [Thu, 24 Jan 2019 13:56:30 +0000 (13:56 +0000)]
char: vcio: Add compat ioctl handling

There was no compat ioctl handler, so 32 bit userspace on a
64 bit kernel failed as IOCTL_MBOX_PROPERTY used the size
of char*.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agooverlays: Add mcp342x overlay
Phil Elwell [Mon, 21 Jan 2019 12:23:55 +0000 (12:23 +0000)]
overlays: Add mcp342x overlay

Support the MCP342x family of ADCs from Microchip.

See: https://github.com/raspberrypi/linux/issues/2819

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: mcp23017: Support the MCP23008
Phil Elwell [Mon, 21 Jan 2019 12:19:57 +0000 (12:19 +0000)]
overlays: mcp23017: Support the MCP23008

Add an 'mcp23008' parameter to enable support for the MCP23008 device.

See: https://github.com/raspberrypi/linux/issues/2818

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: Add ssd1306 overlay for OLED display
Phil Elwell [Mon, 21 Jan 2019 21:17:27 +0000 (21:17 +0000)]
overlays: Add ssd1306 overlay for OLED display

See: https://github.com/raspberrypi/firmware/issues/1098

Signed-off-by: mincepi <mincepi@gmail.com>
5 years agousb: dwc2: Fix disable all EP's on disconnect
Minas Harutyunyan [Mon, 10 Dec 2018 14:09:32 +0000 (18:09 +0400)]
usb: dwc2: Fix disable all EP's on disconnect

commit 4fe4f9fecc36956fd53c8edf96dd0c691ef98ff9 upstream.

Disabling all EP's allow to reset EP's to initial state.
Introduced new function dwc2_hsotg_ep_disable_lock() which
before calling dwc2_hsotg_ep_disable() function acquire
hsotg->lock and release on exiting.
From dwc2_hsotg_ep_disable() function removed acquiring
hsotg->lock.
In dwc2_hsotg_core_init_disconnected() function when USB
reset interrupt asserted disabling all ep’s by
dwc2_hsotg_ep_disable() function.
This updates eliminating sparse imbalance warnings.

Reverted changes in dwc2_hostg_disconnect() function.
Introduced new function dwc2_hsotg_ep_disable_lock().
Changed dwc2_hsotg_ep_ops. Now disable point to
dwc2_hsotg_ep_disable_lock() function.
In functions dwc2_hsotg_udc_stop() and dwc2_hsotg_suspend()
dwc2_hsotg_ep_disable() function replaced by
dwc2_hsotg_ep_disable_lock() function.
In dwc2_hsotg_ep_disable() function removed acquiring
of hsotg->lock.

Fixes: dccf1bad4be7 ("usb: dwc2: Disable all EP's on disconnect")
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
5 years agousb: dwc2: Disable all EP's on disconnect
Minas Harutyunyan [Wed, 19 Sep 2018 14:13:52 +0000 (18:13 +0400)]
usb: dwc2: Disable all EP's on disconnect

commit dccf1bad4be7eaa096c1f3697bd37883f9a08ecb upstream.

Disabling all EP's allow to reset EP's to initial state.
On disconnect disable all EP's instead of just killing
all requests. Because of some platform didn't catch
disconnect event, same stuff added to
dwc2_hsotg_core_init_disconnected() function when USB
reset detected on the bus.

Changed from version 1:
Changed lock acquire flow in dwc2_hsotg_ep_disable()
function.

Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
5 years agopwm: Send a uevent on the pwmchip device upon channel sysfs (un)export
Fabrice Gasnier [Mon, 1 Oct 2018 13:23:57 +0000 (15:23 +0200)]
pwm: Send a uevent on the pwmchip device upon channel sysfs (un)export

commit 552c02e3e7cfe2744b59de285aaea70021ae95c9 upstream.

This patch sends a uevent (KOBJ_CHANGE) on the pwmchipN device,
everytime a pwmX channel has been exported/unexported via sysfs. This
allows udev to implement rules on such events, like:

SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
        chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
        chown -R root:gpio
/sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770
/sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"

This is a replacement patch for commit 7e5d1fd75c3d ("pwm: Set class for
exported channels in sysfs"), see [1].

basic testing:
$ udevadm monitor --environment &
$ echo 0 > /sys/class/pwm/pwmchip0/export
KERNEL[197.321736] change   /devices/.../pwm/pwmchip0 (pwm)
ACTION=change
DEVPATH=/devices/.../pwm/pwmchip0
EXPORT=pwm0
SEQNUM=2045
SUBSYSTEM=pwm

[1] https://lkml.org/lkml/2018/9/25/713

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
5 years agoRevert "pwm: Set class for exported channels in sysfs"
Fabrice Gasnier [Mon, 1 Oct 2018 13:23:56 +0000 (15:23 +0200)]
Revert "pwm: Set class for exported channels in sysfs"

commit c289d6625237aa785b484b4e94c23b3b91ea7e60 upstream.

This reverts commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 ("pwm: Set
class for exported channels in sysfs") as it causes regression with
multiple pwm chip[1], when exporting a pwm channel (echo X > export):

- ABI (Documentation/ABI/testing/sysfs-class-pwm) states pwmX should be
  created in /sys/class/pwm/pwmchipN/pwmX
- Reverted patch causes new entry to be also created directly in
  /sys/class/pwm/pwmX
- 1st time, exporting pwmX will create an entry in /sys/class/pwm/pwmX
- class attributes are added under pwmX folder, such as export, unexport
  npwm, symlinks. This is wrong as it belongs to pwmchipN. It may cause
  bad behavior and report wrong values.
- when another export happens on another pwmchip, it can't be created
  (e.g. -EEXIST). This is causing the issue with multiple pwmchip.

Example on stm32 (stm32429i-eval) platform:
$ ls /sys/class/pwm
pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip0/
$ echo 0 > export
$ ls /sys/class/pwm
pwm0 pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip4/
$ echo 0 > export
sysfs: cannot create duplicate filename '/class/pwm/pwm0'
...Exception stack follows...

This is also seen on other platform [2]

[1] https://lkml.org/lkml/2018/9/25/713
[2] https://lkml.org/lkml/2018/9/25/447

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
Tested-by: Michal Vokáč <michal.vokac@ysoft.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
5 years agoAdded driver for the HiFiBerry DAC+ ADC (#2694)
HiFiBerry [Mon, 8 Oct 2018 16:10:12 +0000 (18:10 +0200)]
Added driver for the HiFiBerry DAC+ ADC (#2694)

Signed-off-by: Daniel Matuschek <daniel@hifiberry.com>
5 years agoconfigs: Add CONFIG_USB_UAS=m
Phil Elwell [Wed, 16 Jan 2019 21:26:13 +0000 (21:26 +0000)]
configs: Add CONFIG_USB_UAS=m

Enable support for USB-attached-SCSI devicess.

See: https://github.com/raspberrypi/linux/issues/2813

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agodwc_otg: fix bug with port_addr assignment for single-TT hubs
P33M [Wed, 16 Jan 2019 10:17:52 +0000 (10:17 +0000)]
dwc_otg: fix bug with port_addr assignment for single-TT hubs

See https://github.com/raspberrypi/linux/issues/2734

The "Hub Port" field in the split transaction packet was always set
to 1 for single-TT hubs. The majority of single-TT hub products
apparently ignore this field and broadcast to all downstream enabled
ports, which masked the issue. A subset of hub devices apparently
need the port number to be exact or split transactions will fail.

5 years agooverlays: sdio: Add enhanced 1-bit support
Phil Elwell [Thu, 10 Jan 2019 15:27:56 +0000 (15:27 +0000)]
overlays: sdio: Add enhanced 1-bit support

"dtoverlay=sdio,bus_width=1,gpios_22_25" is equivalent to the sdio-1bit
overlay, which is now deprecated.

"dtoverlay=sdio,bus_width=1,gpios_34_37" enables 1-bit mode on GPIOs 34-37.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfigs: Add CONFIG_USB_TMC=m
Phil Elwell [Mon, 14 Jan 2019 08:50:55 +0000 (08:50 +0000)]
configs: Add CONFIG_USB_TMC=m

Enable the Test & Measurement Class USB driver module.

See: https://github.com/raspberrypi/linux/firmware/issues/929

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfigs: Add CONFIG_SND_AUDIOSENSE_PI=m
b-ak [Thu, 3 Jan 2019 18:42:51 +0000 (00:12 +0530)]
configs: Add CONFIG_SND_AUDIOSENSE_PI=m

AudioSense-Pi add on soundcard configuration definitions

Signed-off-by: b-ak <anur.bhargav@gmail.com>
5 years agoBCM270X: Adding device tree support for AudioSense-Pi add-on soundcard
b-ak [Wed, 2 Jan 2019 18:59:14 +0000 (00:29 +0530)]
BCM270X: Adding device tree support for AudioSense-Pi add-on soundcard

Device tree overlay for AudioSense-Pi card.

To enable support for the hardware add the following
line to the RPi /boot/config.txt:

dtoverlay=audiosense-pi

More documentation @ arch/arm/boot/dts/overlays/README

Signed-off-by: b-ak <anur.bhargav@gmail.com>
5 years agoASoC: Add support for AudioSense-Pi add-on soundcard
b-ak [Wed, 2 Jan 2019 18:31:08 +0000 (00:01 +0530)]
ASoC: Add support for AudioSense-Pi add-on soundcard

AudioSense-Pi is a RPi HAT based on a TI's TLV320AIC32x4 stereo codec

This hardware provides multiple audio I/O capabilities to the RPi.
The codec connects to the RPi's SoC through the I2S Bus.

The following devices can be connected through a 3.5mm jack
1. Line-In: Plain old audio in from mobile phones, PCs, etc.,
2. Mic-In: Connect a microphone
3. Line-Out: Connect the output to a speaker
4. Headphones: Connect a Headphone w or w/o microphones

Multiple Inputs:
It supports the following combinations
1. Two stereo Line-Inputs and a microphone
2. One stereo Line-Input and two microphones
3. Two stereo Line-Inputs, a microphone and
one mono line-input (with h/w hack)
4. One stereo Line-Input, two microphones and
one mono line-input (with h/w hack)

Multiple Outputs:
Audio output can be routed to the headphones or
speakers (with additional hardware)

Signed-off-by: b-ak <anur.bhargav@gmail.com>
5 years agolan78xx: Debounce link events to minimize poll storm
Joshua Emele [Thu, 8 Nov 2018 00:07:40 +0000 (16:07 -0800)]
lan78xx: Debounce link events to minimize poll storm

The bInterval is set to 4 (i.e. 8 microframes => 1ms) and the only bit
that the driver pays attention to is "link was reset". If there's a
flapping status bit in that endpoint data, (such as if PHY negotiation
needs a few tries to get a stable link) then polling at a slower rate
would act as a de-bounce.

See: https://github.com/raspberrypi/linux/issues/2447

5 years agobcm2835_smi: re-add dereference to fix DMA transfers
Ezekiel Bethel [Wed, 12 Dec 2018 19:11:13 +0000 (19:11 +0000)]
bcm2835_smi: re-add dereference to fix DMA transfers

5 years agodtoverlays: fe-pi-audio: fix sgtl5000 compatible string
Ben Wolsieffer [Sun, 9 Dec 2018 21:46:00 +0000 (16:46 -0500)]
dtoverlays: fe-pi-audio: fix sgtl5000 compatible string

The compatible string was set to "fepi,sgtl5000", which worked for some
reason in 4.14, but does not work in 4.19, presumably due to some
change in the kernel matching logic. The correct string is
"fsl,sgtl5000".

Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
5 years agosc16is7xx: Fix for "Unexpected interrupt: 8"
Phil Elwell [Fri, 18 May 2018 09:26:59 +0000 (10:26 +0100)]
sc16is7xx: Fix for "Unexpected interrupt: 8"

The SC16IS752 has an Enhanced Feature Register which is aliased at the
same address as the Interrupt Identification Register; accessing it
requires that a magic value is written to the Line Configuration
Register. If an interrupt is raised while the EFR is mapped in then
the ISR won't be able to access the IIR, leading to the "Unexpected
interrupt" error messages.

Avoid the problem by claiming a mutex around accesses to the EFR
register, also claiming the mutex in the interrupt handler work
item (this is equivalent to disabling interrupts to interlock against
a non-threaded interrupt handler).

See: https://github.com/raspberrypi/linux/issues/2529

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoarm64: dts: broadcom: Enable fixups for overlays
Phil Elwell [Tue, 15 Jan 2019 09:56:41 +0000 (09:56 +0000)]
arm64: dts: broadcom: Enable fixups for overlays

See: https://github.com/raspberrypi/linux/pull/2733

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agofirmware: raspberrypi: Report the fw git hash during probe
Dave Stevenson [Thu, 10 Jan 2019 18:48:54 +0000 (18:48 +0000)]
firmware: raspberrypi: Report the fw git hash during probe

The firmware can now report the git hash from which it was built
via the mailbox, so report it during probe.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agofirmware: raspberrypi: Report the fw variant during probe
Dave Stevenson [Thu, 10 Jan 2019 17:58:06 +0000 (17:58 +0000)]
firmware: raspberrypi: Report the fw variant during probe

The driver already reported the firmware build date during probe.
The mailbox calls have been extended to also report the variant
 1 = standard start.elf
 2 = start_x.elf (includes camera stack)
 3 = start_db.elf (includes assert logging)
 4 = start_cd.elf (cutdown version for smallest memory footprint).
Log the variant during probe.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agogpio-ir: change default pull configuration to up
Matthias Reichl [Wed, 9 Jan 2019 13:51:01 +0000 (14:51 +0100)]
gpio-ir: change default pull configuration to up

IR receivers like the TSOP series from Vishay and compatible ones
have active-low open collector outputs with an internal pull up of
about 30k (according to the TSOP datasheets).

Activating a pull-down resistor on the GPIO will make it work against
the pull-up in the IR receiver and brings the idle input voltage down
to about 1.9V (measured on a RPi3B+ with a TSOP4438). While that's
usually enough to make the RPi see a high signal it's certainly not
optimal and may even fail when using an IR receiver with a weaker pull-up.

Switching the default GPIO pull to "up" results in an input voltage
level of about 3.3V and ensures that an idle state (high signal) will
be detected if no IR receiver is attached.

Signed-off-by: Matthias Reichl <hias@horus.com>
5 years agostaging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER (#2782)
6by9 [Tue, 11 Dec 2018 15:18:02 +0000 (15:18 +0000)]
staging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER (#2782)

When handling for V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER was added
the firmware would reject the setting if H264 hadn't already been
selected. This was fixed in the firmware at that point, but to
enable backwards compatibility the returned error was ignored.

That was Dec 2013, so the chances of having a firmware that still
has that issue is so close to zero that the workaround can be
removed.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agooverlays: Update README with removal of lirc-rpi
Phil Elwell [Wed, 5 Dec 2018 11:56:40 +0000 (11:56 +0000)]
overlays: Update README with removal of lirc-rpi

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoASoC: add driver for 3Dlab Nano soundcard (#2758)
dev-3Dlab [Wed, 5 Dec 2018 09:59:11 +0000 (10:59 +0100)]
ASoC: add driver for 3Dlab Nano soundcard (#2758)

Signed-off-by: GT <dev@3d-lab-av.com>
5 years agoRevert "staging: bcm2835-audio: Drop DT dependency"
Dave Stevenson [Tue, 4 Dec 2018 20:41:19 +0000 (20:41 +0000)]
Revert "staging: bcm2835-audio: Drop DT dependency"

This reverts commit 933bc853bb764e476b0b0f633588f46d20f1f76a.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoRevert "staging: vchiq_arm: Register a platform device for the audio driver"
Dave Stevenson [Tue, 4 Dec 2018 19:40:12 +0000 (19:40 +0000)]
Revert "staging: vchiq_arm: Register a platform device for the audio driver"

This reverts commit ab59590ed562b89db51fe46cee5db96b9bc5abd8.

Issues have been observed in LibreElec as this was unconditionally
loading the audio driver instead of having the DT parameter to
enable it.

Includes a partial revert of 2147700eb7a1b9e55e0684f0749114ce35d61571
which fixed up the error handling.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoAdd overlay for SLB9760 Iridium /LetsTrust TPM
Peter Huewe [Thu, 14 Jun 2018 20:51:24 +0000 (22:51 +0200)]
Add overlay for SLB9760 Iridium /LetsTrust TPM

Device Tree overlay for the Infineon SLB9670 Trusted Platform Module add-on
boards, which can be used as a secure key storage and hwrng.
available as "Iridium SLB9670" by Infineon and "LetsTrust TPM" by
pi3g.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
5 years agoEnable TPM TIS SPI support for TPM1.2 and TPM2.0 chips
Peter Huewe [Thu, 14 Jun 2018 20:42:18 +0000 (22:42 +0200)]
Enable TPM TIS SPI support for TPM1.2 and TPM2.0 chips

This patch enables the support for SPI TPMs which follow the TCG TIS
FIFO/PTP specification like the SLB9670.
In order to decrease ram usage the weak dependency on CONFIG_SECURITFS
is explictly set to 'n'.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
5 years agotpm: Make SECURITYFS a weak dependency
Peter Huewe [Mon, 3 Sep 2018 19:51:51 +0000 (21:51 +0200)]
tpm: Make SECURITYFS a weak dependency

commit 2f7d8dbb11287cbe9da6380ca14ed5d38c9ed91f upstream.

While having SECURITYFS enabled for the tpm subsystem is beneficial in
most cases, it is not strictly necessary to have it enabled at all.
Especially on platforms without any boot firmware integration of the TPM
(e.g. raspberry pi) it does not add any value for the tpm subsystem,
as there is no eventlog present.

By turning it from 'select' to 'imply' it still gets selected per
default, but enables users who want to save some kb of ram by turning
SECURITYFS off.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
5 years agomedia: vb2: Allow reqbufs(0) with "in use" MMAP buffers
John Sheu [Thu, 15 Oct 2015 09:05:25 +0000 (18:05 +0900)]
media: vb2: Allow reqbufs(0) with "in use" MMAP buffers

Videobuf2 presently does not allow VIDIOC_REQBUFS to destroy outstanding
buffers if the queue is of type V4L2_MEMORY_MMAP, and if the buffers are
considered "in use".  This is different behavior than for other memory
types and prevents us from deallocating buffers in following two cases:

1) There are outstanding mmap()ed views on the buffer. However even if
   we put the buffer in reqbufs(0), there will be remaining references,
   due to vma .open/close() adjusting vb2 buffer refcount appropriately.
   This means that the buffer will be in fact freed only when the last
   mmap()ed view is unmapped.

2) Buffer has been exported as a DMABUF. Refcount of the vb2 buffer
   is managed properly by VB2 DMABUF ops, i.e. incremented on DMABUF
   get and decremented on DMABUF release. This means that the buffer
   will be alive until all importers release it.

Considering both cases above, there does not seem to be any need to
prevent reqbufs(0) operation, because buffer lifetime is already
properly managed by both mmap() and DMABUF code paths. Let's remove it
and allow userspace freeing the queue (and potentially allocating a new
one) even though old buffers might be still in processing.

Signed-off-by: John Sheu <sheu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
5 years agostaging: bcm2835-camera: Fix stride on RGB3/BGR3 formats
Dave Stevenson [Fri, 30 Nov 2018 16:00:54 +0000 (16:00 +0000)]
staging: bcm2835-camera: Fix stride on RGB3/BGR3 formats

RGB3/BGR3 end up being 3 bytes per pixel, which meant that
the alignment code ended up trying to align using bitmasking
with a mask of 96.
That doesn't work, so switch to an arithmetic alignment for
those formats.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoconfig: Add bcm2835-codec to Pi defconfigs.
Dave Stevenson [Tue, 30 Oct 2018 12:23:26 +0000 (12:23 +0000)]
config: Add bcm2835-codec to Pi defconfigs.

Adds the V4L2 M2M codec driver to the config.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoARM: bcm2835_defconfig: Enable bcm2835-codec
Dave Stevenson [Mon, 29 Oct 2018 17:49:04 +0000 (17:49 +0000)]
ARM: bcm2835_defconfig: Enable bcm2835-codec

Enables the V4L2 M2M codec driver as a module.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vchiq_arm: Register vcsm-cma as a platform driver
Dave Stevenson [Fri, 26 Oct 2018 14:19:40 +0000 (15:19 +0100)]
staging: vchiq_arm: Register vcsm-cma as a platform driver

Following the same pattern as bcm2835-camera and bcm2835-audio,
register the vcsm-cma driver as a platform driver

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vchiq_arm: Register bcm2835-codec as a platform driver
Dave Stevenson [Fri, 26 Oct 2018 14:14:16 +0000 (15:14 +0100)]
staging: vchiq_arm: Register bcm2835-codec as a platform driver

Following the same pattern as bcm2835-camera and bcm2835-audio,
register the V4L2 codec driver as a platform driver

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Add a V4L2 M2M codec driver
Dave Stevenson [Tue, 25 Sep 2018 13:53:49 +0000 (14:53 +0100)]
staging: vc04_services: Add a V4L2 M2M codec driver

This adds a V4L2 memory to memory device that wraps the MMAL
video decode and video_encode components for H264 and MJPEG encode
and decode, MPEG4, H263, and VP8 decode (and MPEG2 decode
if the appropriate licence has been purchased).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: videobuf2: Allow exporting of a struct dmabuf
Dave Stevenson [Mon, 29 Oct 2018 17:57:45 +0000 (17:57 +0000)]
media: videobuf2: Allow exporting of a struct dmabuf

videobuf2 only allowed exporting a dmabuf as a file descriptor,
but there are instances where having the struct dma_buf is
useful within the kernel.

Split the current implementation into two, one step which
exports a struct dma_buf, and the second which converts that
into an fd.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Use vc-sm-cma to support zero copy
Dave Stevenson [Tue, 25 Sep 2018 15:07:55 +0000 (16:07 +0100)]
staging: vc04_services: Use vc-sm-cma to support zero copy

With the vc-sm-cma driver we can support zero copy of buffers between
the kernel and VPU. Add this support to vchiq-mmal.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc-sm-cma: Fixup driver for older VCHI APIs
Dave Stevenson [Tue, 30 Oct 2018 11:42:48 +0000 (11:42 +0000)]
staging: vc-sm-cma: Fixup driver for older VCHI APIs

Original patch was based off staging which included some cleanups
of the VCHI APIs. Those aren't present here, so switch back to
the older API.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Add new vc-sm-cma driver
Dave Stevenson [Tue, 25 Sep 2018 09:27:11 +0000 (10:27 +0100)]
staging: vc04_services: Add new vc-sm-cma driver

This new driver allows contiguous memory blocks to be imported
into the VideoCore VPU memory map, and manages the lifetime of
those objects, only releasing the source dmabuf once the VPU has
confirmed it has finished with it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Fixup vchiq-mmal include ordering
Dave Stevenson [Tue, 25 Sep 2018 15:57:40 +0000 (16:57 +0100)]
staging: vc04_services: Fixup vchiq-mmal include ordering

There were dependencies on including the headers in the correct
order. Fix up the headers so that they include the other
headers that they depend on themselves.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Support sending data to MMAL ports
Dave Stevenson [Mon, 24 Sep 2018 17:26:02 +0000 (18:26 +0100)]
staging: vc04_services: Support sending data to MMAL ports

Add the ability to send data to ports. This only supports
zero copy mode as the required bulk transfer setup calls
are not done.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Add support for event callbacks.
Dave Stevenson [Mon, 24 Sep 2018 17:15:38 +0000 (18:15 +0100)]
staging: mmal-vchiq: Add support for event callbacks.

(Preparation for the codec driver).
The codec uses the event mechanism to report things such as
resolution changes. It is signalled by the cmd field of the buffer
being non-zero.

Add support for passing this information out to the client.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Make a mmal_buf struct for passing parameters
Dave Stevenson [Mon, 24 Sep 2018 16:33:37 +0000 (17:33 +0100)]
staging: mmal-vchiq: Make a mmal_buf struct for passing parameters

The callback from vchi_mmal to the client was growing lots of extra
parameters. Consolidate them into a single struct instead of
growing the list further.
The struct is associated with the client buffer, therefore there
are various changes to setup various containers for the struct,
and pass the appropriate members.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Make timeout a defined parameter
Dave Stevenson [Mon, 24 Sep 2018 15:57:09 +0000 (16:57 +0100)]
staging: mmal-vchiq: Make timeout a defined parameter

The timeout period for VPU communications is a useful thing
to extend when debugging.
Set it via a define, rather than a magic number buried in the code.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Avoid use of bool in structures
Dave Stevenson [Mon, 29 Oct 2018 16:20:46 +0000 (16:20 +0000)]
staging: mmal-vchiq: Avoid use of bool in structures

Fixes up a checkpatch error "Avoid using bool structure members
because of possible alignment issues".

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: mmal-vchiq: Allocate and free components as required
Dave Stevenson [Mon, 24 Sep 2018 15:51:13 +0000 (16:51 +0100)]
staging: mmal-vchiq: Allocate and free components as required

The existing code assumed that there would only ever be 4 components,
and never freed the entries once used.
Allow arbitrary creation and destruction of components.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: vc04_services: Split vchiq-mmal into a module
Dave Stevenson [Mon, 24 Sep 2018 15:30:37 +0000 (16:30 +0100)]
staging: vc04_services: Split vchiq-mmal into a module

In preparation for adding a video codec V4L2 module which also
wants to use vchiq-mmal functions, split it out into an
independent module.
The minimum number of changes have been made to achieve this
(eg straight moves where possible) so existing checkpatch
errors will still be present.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Remove/amend some obsolete comments
Dave Stevenson [Fri, 28 Sep 2018 09:22:26 +0000 (10:22 +0100)]
staging: bcm2835-camera: Remove/amend some obsolete comments

Remove a todo which has been done.
Remove a template line that was redundant.
Make a comment clearer as to the non-obvious meaning of a field.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Correct V4L2_CID_COLORFX_CBCR behaviour
Dave Stevenson [Mon, 8 Oct 2018 17:26:15 +0000 (18:26 +0100)]
staging: bcm2835-camera: Correct V4L2_CID_COLORFX_CBCR behaviour

With V4L2_CID_COLORFX_CBCR calling ctrl_set_colfx it was incorrectly
assigning the colour values to the enable field of dev->colourfx
instead of the u and v fields.

Correct the assignments.

Reported as a Coverity issue
Detected by CoverityScan CID#1419711 ("Unused value")

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Use enums for max value in controls
Dave Stevenson [Fri, 28 Sep 2018 09:17:11 +0000 (10:17 +0100)]
staging: bcm2835-camera: Use enums for max value in controls

Controls of type MMAL_CONTROL_TYPE_STD_MENU call v4l2_ctrl_new_std_menu
with a max value and a mask. The max value is one of the defined
values for the control, however in the config array there are several
entries where raw numbers have been used instead. Replace these
with the appropriate enum.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix up all formatting in mmal-paramters.h
Dave Stevenson [Mon, 29 Oct 2018 16:08:41 +0000 (16:08 +0000)]
staging: bcm2835-camera: Fix up all formatting in mmal-paramters.h

Fixes up all checkpatch errors in mmal-parameters.h

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix multiple assignments should be avoided
Dave Stevenson [Mon, 29 Oct 2018 15:58:14 +0000 (15:58 +0000)]
staging: bcm2835-camera: Fix multiple assignments should be avoided

Clear checkpatch complaints of "multiple assignments should be avoided"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix alignment should match open parenthesis
Dave Stevenson [Mon, 29 Oct 2018 15:55:42 +0000 (15:55 +0000)]
staging: bcm2835-camera: Fix alignment should match open parenthesis

Fix up checkpatch "Alignment should match open parenthesis" errors

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoARM: bcm2835_defconfig: Enable bcm2835-camera
Dave Stevenson [Mon, 29 Oct 2018 15:50:50 +0000 (15:50 +0000)]
ARM: bcm2835_defconfig: Enable bcm2835-camera

Enables the V4L2 camera driver as a module.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Unify header inclusion defines
Dave Stevenson [Mon, 3 Dec 2018 13:15:20 +0000 (13:15 +0000)]
staging: bcm2835-camera: Unify header inclusion defines

Most of the headers use ifndef FOO_H, whilst mmal-parameters.h
used ifndef __FOO_H.

Revise mmal-parameters.h to drop the underscores and make the
headers all consistent.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Add multiple inclusion protection to headers
Dave Stevenson [Mon, 24 Sep 2018 15:21:06 +0000 (16:21 +0100)]
staging: bcm2835-camera: Add multiple inclusion protection to headers

mmal-common.h and mmal-msg.h didn't have the normal
ifndef FOO / define FOO / endif protection to stop it being
included multiple times. Add it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Avoid unneeded internal declaration warning
Nathan Chancellor [Fri, 28 Sep 2018 00:50:39 +0000 (17:50 -0700)]
staging: bcm2835-camera: Avoid unneeded internal declaration warning

Clang warns:

drivers/staging/vc04_services/bcm2835-camera/controls.c:59:18: warning:
variable 'mains_freq_qmenu' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static const s64 mains_freq_qmenu[] = {
                 ^
1 warning generated.

This is because mains_freq_qmenu is currently only used in an ARRAY_SIZE
macro, which is a compile time evaluation in this case. Avoid this by
adding mains_freq_qmenu as the imenu member of this structure, which
matches all other controls that uses the ARRAY_SIZE macro in v4l2_ctrls.
This turns out to be a no-op because V4L2_CID_MPEG_VIDEO_BITRATE_MODE is
defined as a MMAL_CONTROL_TYPE_STD_MENU, which does not pass the imenu
definition along to v4l2_ctrl_new in bm2835_mmal_init_controls.

Link: https://github.com/ClangBuiltLinux/linux/issues/122
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: bcm2835-camera: Ensure timestamps never go backwards.
Dave Stevenson [Tue, 24 Jul 2018 11:08:29 +0000 (12:08 +0100)]
staging: bcm2835-camera: Ensure timestamps never go backwards.

There is an awkward situation with H264 header bytes. Currently
they are returned with a PTS of 0 because they aren't associated
with a timestamped frame to encode. These are handled by either
returning the timestamp of the last buffer to have been received,
or in the case of the first buffer the timestamp taken at
start_streaming.
This results in a race where the current frame may have started
before we take the start time, which results in the first encoded
frame having an earlier timestamp than the header bytes.

Ensure that we never return a negative delta to the user by checking
against the previous timestamp.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Set sequence number correctly
Dave Stevenson [Thu, 21 Jun 2018 16:02:14 +0000 (17:02 +0100)]
staging: bcm2835-camera: Set sequence number correctly

Set the sequence number in vb2_v4l2_buffer mainly so the
latest v4l2-ctl reports the frame rate correctly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Handle empty EOS buffers whilst streaming
Dave Stevenson [Thu, 5 Jul 2018 15:17:03 +0000 (16:17 +0100)]
staging: bcm2835-camera: Handle empty EOS buffers whilst streaming

The change to mapping V4L2 to MMAL buffers 1:1 didn't handle
the condition we get with raw pixel buffers (eg YUV and RGB)
direct from the camera's stills port. That sends the pixel buffer
and then an empty buffer with the EOS flag set. The EOS buffer
wasn't handled and returned an error up the stack.

Handle the condition correctly by returning it to the component
if streaming, or returning with an error if stopping streaming.

Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Remove check of the number of buffers supplied
Dave Stevenson [Wed, 4 Jul 2018 16:01:15 +0000 (17:01 +0100)]
staging: bcm2835-camera: Remove check of the number of buffers supplied

Before 9384167 there was a need to ensure that there were sufficient
buffers supplied from the user to cover those being sent to the VPU
(always 1).
With 9384167 the buffers are linked 1:1 between MMAL and V4L2,
therefore there is no need for that check, and indeed it is wrong
as there is no need to submit all the buffers before starting streaming.

Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835_camera: Ensure all buffers are returned on disable
Dave Stevenson [Thu, 28 Jun 2018 14:57:25 +0000 (15:57 +0100)]
staging: bcm2835_camera: Ensure all buffers are returned on disable

With the recent change to match MMAL and V4L2 buffers there
is a need to wait for all MMAL buffers to be returned during
stop_streaming.

Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix open parenthesis alignment
Dave Stevenson [Wed, 21 Feb 2018 15:53:59 +0000 (15:53 +0000)]
staging: bcm2835-camera: Fix open parenthesis alignment

Fix checkpatch "Alignment should match open parenthesis"
errors.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix logical continuation splits
Dave Stevenson [Wed, 21 Feb 2018 15:48:54 +0000 (15:48 +0000)]
staging: bcm2835-camera: Fix logical continuation splits

Fix checkpatch errors for "Logical continuations should be
on the previous line".

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix missing lines between items
Dave Stevenson [Wed, 21 Feb 2018 15:39:26 +0000 (15:39 +0000)]
staging: bcm2835-camera: Fix missing lines between items

Fix checkpatch errors for missing blank lines after variable
or structure declarations.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix brace style issues.
Dave Stevenson [Wed, 21 Feb 2018 15:37:11 +0000 (15:37 +0000)]
staging: bcm2835-camera: Fix brace style issues.

Fix mismatched or missing brace issues flagged by checkpatch.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix multiple line dereference errors
Dave Stevenson [Wed, 21 Feb 2018 15:28:07 +0000 (15:28 +0000)]
staging: bcm2835-camera: Fix multiple line dereference errors

Fix checkpatch errors "Avoid multiple line dereference"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Reduce length of enum names
Dave Stevenson [Wed, 21 Feb 2018 15:23:35 +0000 (15:23 +0000)]
staging: bcm2835-camera: Reduce length of enum names

We have numerous lines over 80 chars, or oddly split. Many
of these are due to using long enum names such as
MMAL_COMPONENT_CAMERA.
Reduce the length of these enum names.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix spacing around operators
Dave Stevenson [Wed, 21 Feb 2018 14:13:03 +0000 (14:13 +0000)]
staging: bcm2835-camera: Fix spacing around operators

Fix checkpatch warnings over spaces around operators.
Many were around operations that can be replaced with the
BIT(x) macro, so replace with that where appropriate.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Fix comment style violations.
Dave Stevenson [Wed, 21 Feb 2018 13:49:32 +0000 (13:49 +0000)]
staging: bcm2835-camera: Fix comment style violations.

Fix comment style violations in the header files.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Remove dead email addresses
Dave Stevenson [Fri, 10 Mar 2017 17:35:38 +0000 (17:35 +0000)]
staging: bcm2835-camera: Remove dead email addresses

None of the listed author email addresses were valid.
Keep list of authors and the companies they represented.
Update my email address.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Return early on errors
Dave Stevenson [Fri, 10 Mar 2017 17:27:56 +0000 (17:27 +0000)]
staging: bcm2835-camera: Return early on errors

Fix several instances where it is easier to return
early on error conditions than handle it as an else
clause.
As requested by Mauro.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agostaging: bcm2835-camera: Correctly denote key frames in encoded data
Dave Stevenson [Mon, 13 Feb 2017 13:11:41 +0000 (13:11 +0000)]
staging: bcm2835-camera: Correctly denote key frames in encoded data

Forward MMAL key frame flags to the V4L2 buffers.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>