Commit Graph

787652 Commits

Author SHA1 Message Date
Dave Stevenson
cfca3e7e4e 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>
2019-04-02 12:55:50 +01:00
Dave Stevenson
8bd1e6102c staging: bcm2835-camera: Fix multiple line dereference errors
Fix checkpatch errors "Avoid multiple line dereference"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:49 +01:00
Dave Stevenson
3d76074960 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>
2019-04-02 12:55:49 +01:00
Dave Stevenson
74f756cbb9 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>
2019-04-02 12:55:49 +01:00
Dave Stevenson
8de86a5be3 staging: bcm2835-camera: Fix comment style violations.
Fix comment style violations in the header files.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:49 +01:00
Dave Stevenson
8d912f8fb8 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>
2019-04-02 12:55:48 +01:00
Dave Stevenson
822bd9a64a 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>
2019-04-02 12:55:48 +01:00
Dave Stevenson
fd4e876f10 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>
2019-04-02 12:55:48 +01:00
Dave Stevenson
f0b451409b staging: bcm2835-camera: Ensure H264 header bytes get a sensible timestamp
H264 header come from VC with 0 timestamps, which means they get a
strange timestamp when processed with VC/kernel start times,
particularly if used with the inline header option.
Remember the last frame timestamp and use that if set, or otherwise
use the kernel start time.

https://github.com/raspberrypi/linux/issues/1836

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:48 +01:00
Dave Stevenson
59f82e2291 staging: bcm2835-camera: Do not bulk receive from service thread
vchi_bulk_queue_receive will queue up to a default of 4
bulk receives on a connection before blocking.
If called from the VCHI service_callback thread, then
that thread is unable to service the VCHI_CALLBACK_BULK_RECEIVED
events that would enable the queue call to succeed.

Add a workqueue to schedule the call vchi_bulk_queue_receive
in an alternate context to avoid the lock up.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:48 +01:00
Dave Stevenson
a7d1e4ae74 staging: vchiq_arm: Improve error handling on loading drivers
The handling of loading platform drivers requires checking IS_ERR
for the pointer on unload.
If the driver fails to load, NULL the pointer during probe as
platform_device_unregister already checks for NULL.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:47 +01:00
Stefan Wahren
6dfeffebf5 staging: bcm2835: Don't probe if no camera is detected
It is a waste of resources to load the camera driver in case there isn't
a camera actually connected to the Raspberry Pi. This solution also
avoids a NULL ptr dereference of mmal instance on driver unload.

Fixes: 7b3ad5abf0 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:47 +01:00
Stefan Wahren
7085b0205f staging: bcm2835-camera: Add hint about possible faulty GPU mem config
As per default the GPU memory config of the Raspberry Pi isn't sufficient
for the camera usage. Even worse the bcm2835 camera doesn't provide a
helpful error message in this case. So let's add a hint to point the user
to the likely cause.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:47 +01:00
Stefan Wahren
d382027e92 staging: bcm2835-camera: Provide more specific probe error messages
Currently there is only a catch-all info message which print the
relevant error code without any context. So add more specific error
messages in order to narrow down possible issues.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:47 +01:00
Stefan Wahren
3a98a828af staging: bcm2835-audio: Drop DT dependency
Just like the bcm2835-video make this a platform driver which is probed
by vchiq. In order to change the number of channels use a module
parameter instead, but use the maximum as default.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:46 +01:00
Stefan Wahren
2356aa2e27 staging: bcm2835-audio: use module_platform_driver() macro
There is not much value behind this boilerplate, so use
module_platform_driver() instead.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:46 +01:00
Stefan Wahren
fe2c3888f6 staging: bcm2835-audio: Enable compile test
Enable the compilation test for bcm2835-audio.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:46 +01:00
Stefan Wahren
d001883b37 staging: vchiq_arm: Register a platform device for the audio driver
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:46 +01:00
Stefan Wahren
f86960feb0 staging: vchiq_arm: Fix camera device registration
Since the camera driver isn't probed via DT, we need to properly setup DMA.

Fixes: 37b7b3087a ("staging/vc04_services: Register a platform device for the camera driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:45 +01:00
Stefan Wahren
1ac5b14e0c staging: vchiq_arm: Fix platform device unregistration
In error case platform_device_register_data would return an ERR_PTR
instead of NULL. So we better check this before unregistration.

Fixes: 37b7b3087a ("staging/vc04_services: Register a platform device for the camera driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:45 +01:00
Stefan Wahren
d08d9f1447 staging: bcm2835-camera: Move module info to the end
In order to have this more consistent between the vc04 services move
the module information to the end of the file.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:45 +01:00
Stefan Wahren
e1cdadd6e8 staging: bcm2835-camera: fix module autoloading
In order to make the module bcm2835-camera load automatically, we need to
add a module alias.

Fixes: 4bebb0312e ("staging/bcm2835-camera: Set ourselves up as a platform driver.")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2019-04-02 12:55:45 +01:00
Dave Stevenson
20d2764a0e media: tc358743: Return an appropriate colorspace from tc358743_set_fmt
When calling tc358743_set_fmt, the code was calling tc358743_get_fmt
to choose a valid format. However that sets the colorspace
based on what was read back from the chip. When you set the format,
then the driver would choose and program the colorspace based
on the format code.

The result was that if you called try or set format for UYVY
when the current format was RGB3 then you would get told sRGB,
and try RGB3 when current was UYVY and you would get told
SMPTE170M.

The value programmed into the chip is determined by this driver,
therefore there is no need to read back the value. Return the
colorspace based on the format set/tried instead.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:45 +01:00
Dave Stevenson
007fd31b17 media: bcm2835-unicam: Pass through the colorspace on try_fmt
The current colorspace was always returned from try_fmt for no
good reason.
Return what the source subdevice returns instead.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:44 +01:00
popcornmix
8dd6033d3b lirc-rpi: Remove in favour of gpio-ir 2019-04-02 12:55:44 +01:00
Phil Elwell
6c4d084de7 dwc-otg: FIQ: Fix "bad mode in data abort handler"
Create a semi-static mapping for the USB registers early in the boot
process, before additional kernel threads are started, so all threads
will have the mappings from the start. This avoids the need for
data aborts to lazily update them.

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

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
2019-04-02 12:55:44 +01:00
Phil Elwell
1f836cf694 BCM270X_DT: Mark eth_downshift_after as an integer
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:43 +01:00
Phil Elwell
22fd374371 BCM270X_DT: Add new Ethernet DT parameters
Add "eth_downshift_after" DT parameter to allow the delay before the
downshift to be specified. The default is 2 auto-negotiation cycles,
and legal values are 2, 3, 4, 5 and 0 (disabled).

Add "eth_max_speed" DT parameter as a way of prohibiting 1000Mbps
links. This can be used to avoid the delay until the downshift mechanism
activates. Legal values are 10, 100 and 1000, where the default is
unlimited (effectively 1000Mbps).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:43 +01:00
Phil Elwell
066d5253f3 ARM: dts: bcm283x: Set downshift-after for Pi 3B+
Enable the auto-downshift feature on Raspberry Pi 3B+ so that a link
can eventually be established using a cable with pairs C and/or D
missing or broken in a 1000Mbps-capable port.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:43 +01:00
Phil Elwell
40d6d3996d dt-bindings: Document microchip,downshift-after
Document the optional downshift-after property of the lan78xx's PHY.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:43 +01:00
Phil Elwell
75e180ce38 net: lan78xx: Support auto-downshift to 100Mb/s
Ethernet cables with faulty or missing pairs (specifically pairs C and
D) allow auto-negotiation to 1000Mbs, but do not support the successful
establishment of a link. Add a DT property, "microchip,downshift-after",
to configure the number of auto-negotiation failures after which it
falls back to 100Mbs. Valid values are 2, 3, 4, 5 and 0, where 0 means
never downshift.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:42 +01:00
Phil Elwell
6664ab6817 ARM: dts: bcm283x: The lan7515 PHY node has moved
The DT node describing the LAN7800s PHY has now moved inside an "mdio"
node. Update the DT declarations accordingly.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:42 +01:00
Nicolas Saenz Julienne
508e7dc0ac BCM2710_DT: fix gpio expander bindings
The upstreamed driver for the GPIO expander expects to be a children of
the "firmware" node.

The patch also removes the "firmware" phandle as it's useless.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2019-04-02 12:55:42 +01:00
Nicolas Saenz Julienne
8e8fc129f1 BCM2708_DT: update firmware node binding
The upstreamed version of the firmware node has been updated to present
it as a "simple-bus". We need to get this in order to accomodate other
device bindings, namely RPi's firmware based gpio expander.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2019-04-02 12:55:42 +01:00
Phil Elwell
4d27757c20 overlays: Update upstream overlay
The vc4-kms-v3d overlay gained an extra fragment enabling the txp node,
so rebuild the upstream overlay to match.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:41 +01:00
Dave Stevenson
d8a14b2fe4 dtoverlays: Add i2c on 0&1 option to TC358743, ADV7282 and OV5647
Adds the option of configuring i2c0 to be on GPIOs 0&1 as
this is of use on the Compute Module.

Also fixes the ov5647 overlay where the override enabled the wrong
fragments.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:41 +01:00
Matthias Reichl
fcbc54a8d9 rpi-wm8804-soundcard: configure wm8804 clocks only on rate change
This should avoid clicks when stopping and immediately afterwards
starting a stream with the same samplerate as before.

Signed-off-by: Matthias Reichl <hias@horus.com>
2019-04-02 12:55:41 +01:00
Matthias Reichl
155f6366ff rpi-wm8804-soundcard: drop PWRDN register writes
Since kernel 4.0 the PWRDN register bits are under DAPM
control from the wm8804 driver.

Drop code that modifies that register to avoid interfering
with DAPM.

Signed-off-by: Matthias Reichl <hias@horus.com>
2019-04-02 12:55:41 +01:00
Matthias Reichl
dd4057029b Revert "ASoC: wm8804: MCLK configuration options, 32-bit"
This reverts commit 3b12dcf797f5a4635aecd7f5c090dc507b124ffd.

Despite the commit message being wrong idle_bias changes
were already reverted in the 4.14 tree.

So drop the commit to bring the wm8804 driver back in line with
the rpi-4.14.y and upstream linux trees.

Signed-off-by: Matthias Reichl <hias@horus.com>
2019-04-02 12:55:41 +01:00
Phil Elwell
db278699cc overlays: Remove superfluous #address/size-cells
Newer versions of dtc warn about unnecessary usage of #address-cells
and #size-cells, so remove them.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2019-04-02 12:55:40 +01:00
James Hughes
16bc2bcf9f Update README (#2750)
Small update to the DT blob docs to include the axiperf option.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
2019-04-02 12:55:40 +01:00
Dave Stevenson
79f7104c7f vcsm: Fix an NULL dereference in the import_dmabuf error path
resource was dereferenced even though it was NULL.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:40 +01:00
James Hughes
702c7e0701 Mailbox firmware calls now use kmalloc (#2749)
A previous change moved away from variable stack
allocation of a data buffer to a fixed maximum size.
However, some mailbox calls use larger data buffers
than the maximum allowed. This change moves from
stack storage to kmalloc to ensure all sizes are
catered for.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
2019-04-02 12:55:40 +01:00
Dave Stevenson
8e9948fce8 dtoverlays: Add support for ADV7280-M, ADV7281-M and ADV7281-MA chips.
The driver that supports the ADV7282-M also supports the ADV7280-M,
ADV7281-M, and ADV7281-MA.
The 7280-M exposes 8 analogue inputs. The 7281-M doesn't have the
I2P deinterlacing block. The 7281-MA has 8 inputs but no I2P.
Otherwise they are the same as ADV7282-M.

Adds a new overlay "adv728x" that includes the existing adv7282
overlay but adds several parameters to modify the behaviour.

Adds a new addr parameter to allow the I2C address to be changed.
(the chip has an address select pin to change between 0x20 and 0x21).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:39 +01:00
Dave Stevenson
1083585450 arm: dt: Add DT overlays for ADV7282M, OV5647, and TC358743
DT overlays to setup the above devices via i2c_arm and csi1.
(This currently does not use the i2c-mux-pinctrl driver to
dynamically switch the pinctrl)

tc358743 is tc358743 running at a default link frequency
of 972Mbit/s. This allows up to 1080P50 UYVY on 2 lanes.
There is a parameter to allow changing the link frequency,
but the only values supported by the driver are 297000000
for 594Mbit/s, and 486000000 for 972Mbit/s.
There is also a parameter to enable 4 lane mode (only
relevant to Compute Module (1 or 3) csi1).

tc358743-audio overlay enables I2S audio from the TC358743
to the Pi (SD to GPIO20, SCK to GPIO18, WFS to GPIO19).

ADV7282M is the Analog Devices analogue video to CSI bridge
chip.

OV5647 is the Pi V1.3 camera module. Currently the driver only
supports VGA 8bit Bayer and very few controls.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:39 +01:00
Dave Stevenson
4a12ba7547 BCM270X_DT: Add CSI defines for all the downstream Pi platforms
Adds the CSI device includes for the bcm27xx platform DTS files

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:39 +01:00
Dave Stevenson
540a9dc8c2 BCM283x DT: Add CSI nodes to the device tree.
Adds CSI nodes to all the upstream device tree configs

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:38 +01:00
Dave Stevenson
997b2614ae media: adv7180: Nasty hack to allow input selection.
Whilst the adv7180 driver support s_routing, nothing else
does, and there is a missing lump of framework code to
define the mapping from connectors on a board to the inputs
they represent on the ADV7180.

Add a nasty hack to take a module parameter that is passed in
to s_routing on any call to G_STD, or S_STD (or subdev
g_input_status call).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:38 +01:00
Dave Stevenson
a9547d0ed8 defconfig: Enable Unicam driver and various sources on Pi platforms.
Enable:
	VIDEO_V4L2_SUBDEV_API=y
	VIDEO_BCM2835_UNICAM=m
	VIDEO_TC358743=m
	VIDEO_ADV7180=m
	VIDEO_OV5647=m
so that we can receive CSI data from these devices.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
2019-04-02 12:55:38 +01:00
Dave Stevenson
4598040d93 MAINTAINERS: Add entry for BCM2835 Unicam driver
Adds entry for the new BCM2835 Unicam (CSI-2 receiver) driver

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