Commit Graph

787652 Commits

Author SHA1 Message Date
Alexandre Belloni
3ee2af3c21 nvmem: add type attribute
commit 1668845366 upstream.

Add a type attribute so userspace is able to know how the data is stored as
this can help taking the correct decision when selecting which device to
use. This will also help program display the proper warnings when burning
fuses for example.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02 12:56:27 +01:00
Dave Stevenson
6bd64380d5 staging: bcm2835-codec: Refactor default resolution code
The default resolution code was different for each role
as compressed formats need to pass bytesperline as 0 and
set up customised buffer sizes.
This is common setup, therefore amend get_sizeimage and
get_bytesperline to do the correct thing whether compressed
or uncompressed.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:27 +01:00
Dave Stevenson
197b6c2cc9 media: bcm2835-unicam: Add support for enum framesizes and frameintervals
vidioc_enum_framesizes and vidioc_enum_frameintervals weren't implemented,
therefore clients couldn't enumerate the supported resolutions.

Implement them by forwarding on to the sensor driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:26 +01:00
P33M
3d529267d7 defconfigs: disable memory and IO cgroups (#2908)
Due to an upstream bug, memory is leaked in the inode cache when cgroups
are enabled. Disable as this is causing crashes.

See: https://github.com/raspberrypi/linux/issues/2829
2019-04-02 12:56:26 +01:00
Phil Elwell
71cd17852d overlays: Add max17040 support to i2c-sensor
See: https://github.com/raspberrypi/linux/issues/2906

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:26 +01:00
Phil Elwell
39d1f02cc0 configs: Add CONFIG_BATTERY_MAX17040
See: https://github.com/raspberrypi/linux/issues/2906

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:26 +01:00
Lukas Wunner
4d70e4b479 bcm2835-mmc: Deduplicate reset of driver data on remove
The BCM2835 MMC host driver sets the device's driver data pointer to
NULL on ->remove() even though the driver core subsequently does the
same in __device_release_driver().  Drop the duplicate assignment.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
2019-04-02 12:56:25 +01:00
Lukas Wunner
4ec21c4628 bcm2835-mmc: Handle mmc_add_host() errors
The BCM2835 MMC host driver calls mmc_add_host() but doesn't check its
return value.  Errors occurring in that function are therefore not
handled.  Fix it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
2019-04-02 12:56:25 +01:00
Lukas Wunner
2297c20410 bcm2835-mmc: Fix duplicate free_irq() on remove
The BCM2835 MMC host driver requests its interrupt as a device-managed
resource, so the interrupt is automatically freed after the driver is
unbound.

However on driver unbind, bcm2835_mmc_remove() frees the interrupt
explicitly to avoid invocation of the interrupt handler after driver
structures have been torn down.

The interrupt is thus freed twice, leading to a WARN splat in
__free_irq().  Fix by not requesting the interrupt as a device-managed
resource.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
2019-04-02 12:56:25 +01:00
Lukas Wunner
0a80e5c036 bcm2835-mmc: Fix struct mmc_host leak on probe
The BCM2835 MMC host driver requests the bus address of the host's
register map on probe.  If that fails, the driver leaks the struct
mmc_host allocated earlier.

Fix it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
2019-04-02 12:56:25 +01:00
Lukas Wunner
737dba8147 bcm2835-mmc: Fix DMA channel leak
The BCM2835 MMC host driver requests a DMA channel on probe but neglects
to release the channel in the probe error path and on driver unbind.

I'm seeing this happen on every boot of the Compute Module 3: On first
driver probe, DMA channel 2 is allocated and then leaked with a "could
not get clk, deferring probe" message. On second driver probe, channel 4
is allocated.

Fix it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
2019-04-02 12:56:24 +01:00
Phil Elwell
a59a0968fc configs: Re-enable CONFIG_NETFILTER_XT_MATCH_SOCKET
A Kconfig change in 4.10 caused the xt_socket module to no-longer be
included in Raspbian builds. Fix the defconfigs to re-enable it.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:24 +01:00
Phil Elwell
ef97a69cea overlays: Fix multiple-instantiation of sc16is7xx*
The registration of the fixed clocks uses the node name as the clock
name, causing a clash if two clock nodes have the same name, regardless
of the path to the node. Fix the issue by overwriting the clock node
names using the value of the "addr" parameter, providing a crude
disambiguation. (A bit of string pasting to form "sc16is752_clk_<addr>"
would have been nice, but that is outside the abilities of the overlay
parameter mechanism.)

Also give the sc16is750-i2c overlay the xtal parameter for symmetry.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:24 +01:00
Adrien RICCIARDI
48aeaec9b1 overlays: sdio: Added 4-bit support on GPIOs 34-39. (#2903) 2019-04-02 12:56:24 +01:00
Phil Elwell
a787898e8e bcm2835-sdhost: Allow for sg entries that cross pages
The dma_complete handling code calculates a virtual address for a page
then adds an offset, but if the offset is more than a page and HIGHMEM
is in use then the summed address could be in an unmapped (or just
incorrect) page.

The upstream SDHOST driver allows for this possibility - copy the code
that does so.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:24 +01:00
Stefan Wahren
e90495d174 configs: Enable MT76 USB wifi
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:56:23 +01:00
Dave Stevenson
fbb00dd009 staging: bcm2835_codec: Clean up logging on unloading the driver
The log line was missing a closing \n, so wasn't added to the
log immediately.
Adds the function of the V4L2 device that is being unregistered
too.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:23 +01:00
Dave Stevenson
e990942b23 staging: vc-sm-cma: Ensure mutex and idr are destroyed
map_lock and kernelid_map are created in probe, but not released
in release should the vcsm service not connect (eg running the
cutdown firmware).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:23 +01:00
Dave Stevenson
8c11f989d9 staging: vc-sm-cma: Don't fail if debugfs calls fail.
Return codes from debugfs calls should never alter the
flow of the main code.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:23 +01:00
Dave Stevenson
22a6b60fb1 staging: vc-sm-cma: Use devm_ allocs for sm_state.
Use managed allocations for sm_state, removing reliance on
manual management.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:22 +01:00
Dave Stevenson
f5fad2e7b6 staging: vc-sm-cma: Remove the debugfs directory on remove
Without removing that, reloading the driver fails.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:22 +01:00
Dave Stevenson
455676acd6 staging: bcm2835-codec: NULL component handle on queue_setup failure
queue_setup tries creating the relevant MMAL component and configures
the input and output ports as we're expecting to start streaming.
If the port configuration failed then it destroyed the component,
but failed to clear the component handle, therefore release tried
destroying the component again.
Adds some logging should the port config fail as well.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:22 +01:00
Kieran Bingham
bfed23fd5a vcsm: Reduce scope of local functions
The functions:

  vc_vchi_sm_send_msg
  vc_sm_ioctl_alloc
  vc_sm_ioctl_alloc_share
  vc_sm_ioctl_import_dmabuf

Are declared without a prototype. They are not used outside of this
module, thus - convert them to static functions.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-02 12:56:22 +01:00
Kieran Bingham
bf34c66381 vcsm: Remove set but unused variable
The 'success' variable is set by the call to vchi_service_close() but never checked.
Remove it, keeping the call in place.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-02 12:56:21 +01:00
Kieran Bingham
ea9e0370de vcsm: Fix makefile include on out-of-tree builds
The vc_sm module tries to include the 'fs' directory from the
$(srctree). $(srctree) is already provided by the build system, and
causes the include path to be duplicated.

With -Werror this fails to compile.

Remove the unnecessary variable.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-04-02 12:56:21 +01:00
Dave Stevenson
cb00ad2122 staging: vc_sm_cma: Remove erroneous misc_deregister
Code from the misc /dev node was still present in
bcm2835_vc_sm_cma_remove, which caused a NULL deref.
Remove it.

See #2885.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:21 +01:00
Dave Stevenson
2bb9dabaa0 video: bcm2708_fb: Try allocating on the ARM and passing to VPU
Currently the VPU allocates the contiguous buffer for the
framebuffer.
Try an alternate path first where we use dma_alloc_coherent
and pass the buffer to the VPU. Should the VPU firmware not
support that path, then free the buffer and revert to the
old behaviour of using the VPU allocation.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:21 +01:00
Phil Elwell
0e25932420 lan78xx: EEE support is now a PHY property
Now that EEE support is a property of the PHY, use the PHY's DT node
when querying the EEE-related properties.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:20 +01:00
Jaikumar
3871bc4da6 Added mute stream func
Signed-off-by: Jaikumar <jaikumar@cem-solutions.net>
2019-04-02 12:56:20 +01:00
Phil Elwell
11206b4566 config: Add CONFIG_FB_TFT_SH1106=m
See: https://github.com/raspberrypi/linux/issues/2876

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:20 +01:00
Giedrius
9d22e7ee22 Fix for Pisound kernel module in Real Time kernel configuration.
When handler of data_available interrupt is fired, queue_work ends up
getting called and it can block on a spin lock which is not allowed in
interrupt context. The fix was to run the handler from a thread context
instead.
2019-04-02 12:56:20 +01:00
Eric Anholt
7061cea6b6 drm/vc4: Don't wait for vblank on fkms cursor updates.
We don't use the same async update path between fkms and normal kms,
and the normal kms workaround ended up making us wait.  This became a
larger problem in rpi-4.14.y, as the USB HID update rate throttling
got (accidentally?) dropped.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-02 12:56:19 +01:00
Dave Stevenson
a6efa26514 staging: bcm2835_codec: Include timing info in SPS headers
Inserting timing information into the VUI block of the SPS is
optional with the VPU encoder.
GStreamer appears to require them when using V4L2 M2M, therefore
set the option to enable them from the encoder.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:19 +01:00
Dave Stevenson
616ae25eb0 staging: mmal-vchiq: Update mmal_parameters.h with recently defined params
mmal_parameters.h hasn't been updated to reflect additions made
over the last few years. Update it to reflect the currently
supported parameters.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:19 +01:00
Dave Stevenson
c391b1f8f2 staging: bcm2835_codec: Fix handling of VB2_MEMORY_DMABUF buffers
If the queue is configured as VB2_MEMORY_DMABUF then vb2_core_expbuf
fails as it ensures the queue is defined as VB2_MEMORY_MMAP.

Correct the handling so that we unmap the buffer from vcsm and the
VPU on cleanup, and then correctly get the dma buf of the new buffer.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:19 +01:00
Dave Stevenson
cb5ea9f2d8 staging: bcm2835_codec: Add an option for ignoring Bayer formats.
This is a workaround for GStreamer currently not identifying Bayer
as a raw format, therefore any device that supports it does not
match the criteria for v4l2convert.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:18 +01:00
Dave Stevenson
e87fd37098 staging: bcm2835_codec: Add support for the ISP as an M2M device
The MMAL ISP component can also use this same V4L2 wrapper to
provide a M2M format conversion and resizer.
Instantiate 3 V4L2 devices now, one for each of decode, encode,
and isp.
The ISP currently doesn't expose any controls via V4L2, but this
can be extended in the future.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:18 +01:00
Dave Stevenson
c93ff0f487 staging: bcm2835_codec: Query supported formats from the component
The driver was previously working with hard coded tables of
which video formats were supported by each component.
The components advertise this information via a MMAL parameter,
so retrieve the information from there during probe, and store
in the state structure for that device.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:18 +01:00
Dave Stevenson
0942781637 staging: mmal-vchiq: If the VPU returns an error, don't negate it
There is an enum for the errors that the VPU can return.
port_parameter_get was negating that value, but also using -EINVAL
from the Linux error codes.
Pass the VPU error code as positive values. Should the function
need to pass a Linux failure, then return that as negative.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:18 +01:00
Dave Stevenson
95f364233e staging: mmal-vchiq: Always return the param size from param_get
mmal-vchiq is a reimplementation of the userland library for MMAL.
When getting a parameter, the client provides the storage and
the size of the storage. The VPU then returns the size of the
parameter that it wished to return, and as much as possible of
that parameter is returned to the client.

The implementation previously only returned the size provided
by the VPU should it exceed the buffer size. So for parameters
such as the supported encodings list the client had no idea
how much of the provided storage had been populated.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:17 +01:00
Dave Stevenson
0e63dc9d73 staging: mmal_vchiq: Add in the Bayer encoding formats
The list of formats was copied before Bayer support was added.
The ISP supports Bayer and is being supported by the bcm2835_codec
driver, so add in the encodings for them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:17 +01:00
Dave Stevenson
e806977cd2 drm: vc4: Programming the CTM is conditional on running full KMS
vc4_ctm_commit writes to HVS registers, so this is only applicable
when in full KMS mode, not in firmware KMS mode. Add this conditional.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:17 +01:00
Dave Stevenson
32fdc4d40b gpu:vc4-fkms: Update driver to not use plane->crtc.
Following on from
commit 2f958af7fc ("drm/vc4: Stop updating plane->fb/crtc")
do the same in the firmwarekms driver and look at plane_state->crtc
instead.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:16 +01:00
Phil Elwell
054f10ae41 Revert "brcmfmac: Mute expected startup 'errors'"
This reverts commit 34eba9138c.

Upstream patch 26e537884a ("brcmfmac: Do not complain about country code "00")
fixes the same issue, so drop this downstream patch.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:16 +01:00
Zahari Petkov
a8012ee7ad configs: Add CONFIG_LEDS_PCA963X=m
Enable support for PCA963x I2C chip.

Needed for the balenaFin v1.1.0 carrier board for the
Raspberry Pi Compute Module 3/3+ Lite.

Signed-off-by: Zahari Petkov <zahari@balena.io>
2019-04-02 12:56:16 +01:00
Zahari Petkov
39eaf8d47c overlays: balenaFin v1.1.0 carrier board update
A backward compatible update for the balenaFin carrier board for the
Raspberry Pi Compute Module 3/3+ Lite.

The updated overlay includes:
  * support for the newly introduced RGB LEDs
  * i2c-gpio and SDIO improvements
  * DT based Marvell 88W8887 configuration

Signed-off-by: Zahari Petkov <zahari@balena.io>
2019-04-02 12:56:16 +01:00
Phil Elwell
f7385c2854 configs: Enable the AD193x codecs
See: https://github.com/raspberrypi/linux/issues/2850

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:56:15 +01:00
Dave Stevenson
b214a9f040 config: Add IPVLAN module to bcmrpi3_defconfig
It's built for the 32bit kernels, but not for the 64bit ones.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:15 +01:00
Dave Stevenson
3a7c93292f configs: Add V4L2 codec driver to bcmrpi3_defconfig
As this is now fixed to work with 64bit kernels, add it to the
defconfig.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:15 +01:00
Dave Stevenson
e0dcf2632f configs: Add VIDEO_BCM2835 to bcmrpi3_defconfig
This is now shown to work with 64 bit kernels, so add it to
the defconfig.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:56:15 +01:00