platform/kernel/linux-rpi3.git
5 years agodt-bindings: Document microchip,downshift-after
Phil Elwell [Wed, 28 Nov 2018 15:51:41 +0000 (15:51 +0000)]
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>
5 years agonet: lan78xx: Support auto-downshift to 100Mb/s
Phil Elwell [Mon, 26 Nov 2018 19:46:58 +0000 (19:46 +0000)]
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>
5 years agoARM: dts: bcm283x: The lan7515 PHY node has moved
Phil Elwell [Tue, 27 Nov 2018 16:33:31 +0000 (16:33 +0000)]
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>
5 years agoBCM2710_DT: fix gpio expander bindings
Nicolas Saenz Julienne [Tue, 27 Nov 2018 15:59:10 +0000 (16:59 +0100)]
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>
5 years agoBCM2708_DT: update firmware node binding
Nicolas Saenz Julienne [Wed, 28 Nov 2018 09:36:01 +0000 (10:36 +0100)]
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>
5 years agooverlays: Update upstream overlay
Phil Elwell [Mon, 26 Nov 2018 20:15:16 +0000 (20:15 +0000)]
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>
5 years agodtoverlays: Add i2c on 0&1 option to TC358743, ADV7282 and OV5647
Dave Stevenson [Mon, 26 Nov 2018 17:02:15 +0000 (17:02 +0000)]
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>
5 years agorpi-wm8804-soundcard: configure wm8804 clocks only on rate change
Matthias Reichl [Sun, 18 Nov 2018 14:32:28 +0000 (15:32 +0100)]
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>
5 years agorpi-wm8804-soundcard: drop PWRDN register writes
Matthias Reichl [Sun, 18 Nov 2018 14:24:16 +0000 (15:24 +0100)]
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>
5 years agoRevert "ASoC: wm8804: MCLK configuration options, 32-bit"
Matthias Reichl [Sun, 18 Nov 2018 12:21:26 +0000 (13:21 +0100)]
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>
5 years agooverlays: Remove superfluous #address/size-cells
Phil Elwell [Wed, 14 Nov 2018 09:53:25 +0000 (09:53 +0000)]
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>
5 years agoUpdate README (#2750)
James Hughes [Tue, 13 Nov 2018 16:51:21 +0000 (16:51 +0000)]
Update README (#2750)

Small update to the DT blob docs to include the axiperf option.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
5 years agovcsm: Fix an NULL dereference in the import_dmabuf error path
Dave Stevenson [Wed, 14 Nov 2018 11:54:46 +0000 (11:54 +0000)]
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>
5 years agoMailbox firmware calls now use kmalloc (#2749)
James Hughes [Tue, 13 Nov 2018 17:27:00 +0000 (17:27 +0000)]
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>
5 years agodtoverlays: Add support for ADV7280-M, ADV7281-M and ADV7281-MA chips.
Dave Stevenson [Wed, 31 Oct 2018 15:02:18 +0000 (15:02 +0000)]
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>
5 years agoarm: dt: Add DT overlays for ADV7282M, OV5647, and TC358743
Dave Stevenson [Wed, 31 Oct 2018 15:01:59 +0000 (15:01 +0000)]
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>
5 years agoBCM270X_DT: Add CSI defines for all the downstream Pi platforms
Dave Stevenson [Wed, 31 Oct 2018 15:00:45 +0000 (15:00 +0000)]
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>
5 years agoBCM283x DT: Add CSI nodes to the device tree.
Dave Stevenson [Wed, 31 Oct 2018 15:00:20 +0000 (15:00 +0000)]
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>
5 years agomedia: adv7180: Nasty hack to allow input selection.
Dave Stevenson [Wed, 31 Oct 2018 15:00:04 +0000 (15:00 +0000)]
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>
5 years agodefconfig: Enable Unicam driver and various sources on Pi platforms.
Dave Stevenson [Wed, 31 Oct 2018 14:59:51 +0000 (14:59 +0000)]
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>
5 years agoMAINTAINERS: Add entry for BCM2835 Unicam driver
Dave Stevenson [Wed, 31 Oct 2018 14:59:40 +0000 (14:59 +0000)]
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>
5 years agomedia: bcm2835-unicam: Driver for CCP2/CSI2 camera interface
Dave Stevenson [Wed, 31 Oct 2018 14:59:22 +0000 (14:59 +0000)]
media: bcm2835-unicam: Driver for CCP2/CSI2 camera interface

Add driver for the Unicam camera receiver block on
BCM283x processors.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agodt-bindings: Document BCM283x CSI2/CCP2 receiver
Dave Stevenson [Wed, 31 Oct 2018 14:59:06 +0000 (14:59 +0000)]
dt-bindings: Document BCM283x CSI2/CCP2 receiver

Document the DT bindings for the CSI2/CCP2 receiver peripheral
(known as Unicam) on BCM283x SoCs.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Acked-by: Rob Herring <robh@kernel.org>
5 years agomedia: videodev2: Add helper defines for printing FOURCCs
Dave Stevenson [Wed, 31 Oct 2018 14:58:08 +0000 (14:58 +0000)]
media: videodev2: Add helper defines for printing FOURCCs

New helper defines that allow printing of a FOURCC using
printf(V4L2_FOURCC_CONV, V4L2_FOURCC_CONV_ARGS(fourcc));

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: adv7180: Add YPrPb support for ADV7282M
Dave Stevenson [Wed, 31 Oct 2018 14:57:56 +0000 (14:57 +0000)]
media: adv7180: Add YPrPb support for ADV7282M

The ADV7282M can support YPbPr on AIN1-3, but this was
not selectable from the driver. Add it to the list of
supported input modes.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: adv7180: Default to the first valid input
Dave Stevenson [Wed, 31 Oct 2018 14:57:46 +0000 (14:57 +0000)]
media: adv7180: Default to the first valid input

The hardware default is differential CVBS on AIN1 & 2, which
isn't very useful.

Select the first input that is defined as valid for the
chip variant (typically CVBS_AIN1).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: tc358743: Check I2C succeeded during probe.
Dave Stevenson [Wed, 31 Oct 2018 14:57:34 +0000 (14:57 +0000)]
media: tc358743: Check I2C succeeded during probe.

The probe for the TC358743 reads the CHIPID register from
the device and compares it to the expected value of 0.
If the I2C request fails then that also returns 0, so
the driver loads thinking that the device is there.

Generally I2C communications are reliable so there is
limited need to check the return value on every transfer,
therefore only amend the one read during probe to check
for I2C errors.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: tc358743: Add support for 972Mbit/s link freq.
Dave Stevenson [Wed, 31 Oct 2018 14:57:21 +0000 (14:57 +0000)]
media: tc358743: Add support for 972Mbit/s link freq.

Adds register setups for running the CSI lanes at 972Mbit/s,
which allows 1080P50 UYVY down 2 lanes.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: tc358743: fix connected/active CSI-2 lane reporting
Philipp Zabel [Thu, 21 Sep 2017 15:30:24 +0000 (17:30 +0200)]
media: tc358743: fix connected/active CSI-2 lane reporting

g_mbus_config was supposed to indicate all supported lane numbers, not
only the number of those currently in active use. Since the TC358743
can dynamically reduce the number of active lanes if the required
bandwidth allows for it, report all lane numbers up to the connected
number of lanes as supported in pdata mode.
In device tree mode, do not report lane count and clock mode at all, as
the receiver driver can determine these from the device tree.

To allow communicating the number of currently active lanes, add a new
bitfield to the v4l2_mbus_config flags. This is a temporary fix, to be
used only until a better solution is found.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
5 years agomedia: tc358743: Increase FIFO level to 374.
Dave Stevenson [Wed, 31 Oct 2018 14:56:59 +0000 (14:56 +0000)]
media: tc358743: Increase FIFO level to 374.

The existing fixed value of 16 worked for UYVY 720P60 over
2 lanes at 594MHz, or UYVY 1080P60 over 4 lanes. (RGB888
1080P60 needs 6 lanes at 594MHz).
It doesn't allow for lower resolutions to work as the FIFO
underflows.

374 is required for 1080P24-30 UYVY over 2 lanes @ 972Mbit/s, but
>374 means that the FIFO underflows on 1080P50 UYVY over 2 lanes
@ 972Mbit/s.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: ov5647: Add support for non-continuous clock mode
Dave Stevenson [Wed, 31 Oct 2018 14:56:47 +0000 (14:56 +0000)]
media: ov5647: Add support for non-continuous clock mode

The driver was only supporting continuous clock mode
although this was not stated anywhere.
Non-continuous clock saves a small amount of power and
on some SoCs is easier to interface with.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: ov5647: Add support for PWDN GPIO.
Dave Stevenson [Wed, 31 Oct 2018 14:56:33 +0000 (14:56 +0000)]
media: ov5647: Add support for PWDN GPIO.

Add support for an optional GPIO connected to PWDN on the sensor.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years ago[media] Documentation: DT: add device tree for PWDN control
Dave Stevenson [Wed, 31 Oct 2018 14:55:59 +0000 (14:55 +0000)]
[media] Documentation: DT: add device tree for PWDN control

Add optional GPIO pwdn to connect to the PWDN line on the sensor.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agomedia: ov5647: Add set_fmt and get_fmt calls.
Dave Stevenson [Wed, 31 Oct 2018 14:55:37 +0000 (14:55 +0000)]
media: ov5647: Add set_fmt and get_fmt calls.

There's no way to query the subdevice for the supported
resolutions.
Add set_fmt and get_fmt implementations.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoFix warning in bcm2835-smi-nand
Phil Elwell [Mon, 12 Nov 2018 22:56:35 +0000 (22:56 +0000)]
Fix warning in bcm2835-smi-nand

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agommc: bcm2835-sdhost: Fix warnings on arm64
Phil Elwell [Mon, 12 Nov 2018 22:54:40 +0000 (22:54 +0000)]
mmc: bcm2835-sdhost: Fix warnings on arm64

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: uart0 - return GPIOs 14 and 15 to inputs
Phil Elwell [Wed, 7 Nov 2018 17:43:10 +0000 (17:43 +0000)]
overlays: uart0 - return GPIOs 14 and 15 to inputs

In the event that alternate pins are used (only useful on Compute
Modules), return the standard pins to inputs to avoid double-mapping
them.

See: https://www.raspberrypi.org/forums/viewtopic.php?p=1388713#p1316977

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoUpdate issue templates (#2736)
James Hughes [Fri, 2 Nov 2018 11:55:49 +0000 (11:55 +0000)]
Update issue templates (#2736)

5 years agoRevert "rtc: pcf8523: properly handle oscillator stop bit"
Phil Elwell [Mon, 29 Oct 2018 14:45:45 +0000 (14:45 +0000)]
Revert "rtc: pcf8523: properly handle oscillator stop bit"

This reverts commit ede44c908d44b166a5b6bd7caacd105c2ff5a70f.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: pi3-disable-bt: Clear out bt_pins node
Phil Elwell [Mon, 29 Oct 2018 10:38:31 +0000 (10:38 +0000)]
overlays: pi3-disable-bt: Clear out bt_pins node

The pi3-disable-bt overlay does not (and cannot) delete the bt_pins
node, but emptying its properties (including brcm,pins) is a way of
signalling to the hciuart systemd service that Bluetooth has been
disabled.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agommc/bcm2835-sdhost: Recover from MMC_SEND_EXT_CSD
Phil Elwell [Fri, 26 Oct 2018 16:29:51 +0000 (17:29 +0100)]
mmc/bcm2835-sdhost: Recover from MMC_SEND_EXT_CSD

If the user issues an "mmc extcsd read", the SD controller receives
what it thinks is a SEND_IF_COND command with an unexpected data block.
The resulting operations leave the FSM stuck in READWAIT, a state which
persists until the MMC framework resets the controller, by which point
the root filesystem is likely to have been unmounted.

A less heavyweight solution is to detect the condition and nudge the
FSM by asserting the (self-clearing) FORCE_DATA_MODE bit.

N.B. This workaround was essentially discovered by accident and without
a full understanding the inner workings of the controller, so it is
fortunate that the "fix" only modifies error paths.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfig: Add CONFIG_USBIP_VUDC
popcornmix [Thu, 25 Oct 2018 13:08:43 +0000 (14:08 +0100)]
config: Add CONFIG_USBIP_VUDC

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

5 years agoAdd hy28b 2017 model device tree overlay (#2721)
Hans-Wilhelm Warlo [Tue, 16 Oct 2018 16:20:48 +0000 (18:20 +0200)]
Add hy28b 2017 model device tree overlay (#2721)

The 2017 version of the hy28b display requires a different
initialisation sequence.

Signed-off-by: Hans-Wilhelm Warlo <hw@warlo.no>
5 years agooverlays: Add gpio-no-bank0-irq overlay
Phil Elwell [Wed, 18 Jul 2018 16:25:00 +0000 (17:25 +0100)]
overlays: Add gpio-no-bank0-irq overlay

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: add overrides for PoE HAT fan control
Serge Schneider [Tue, 2 Oct 2018 16:13:48 +0000 (17:13 +0100)]
overlays: add overrides for PoE HAT fan control

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
5 years agohwmon: adjust rpi-poe-fan overlay trip points
Serge Schneider [Wed, 26 Sep 2018 18:44:59 +0000 (19:44 +0100)]
hwmon: adjust rpi-poe-fan overlay trip points

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
5 years agodrivers: thermal: step_wise: avoid throttling at hysteresis temperature after droppin...
Serge Schneider [Tue, 2 Oct 2018 10:14:15 +0000 (11:14 +0100)]
drivers: thermal: step_wise: avoid throttling at hysteresis temperature after dropping below it

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
5 years agodrivers: thermal: step_wise: add support for hysteresis
Ram Chandrasekar [Mon, 7 May 2018 17:54:08 +0000 (11:54 -0600)]
drivers: thermal: step_wise: add support for hysteresis

From: Ram Chandrasekar <rkumbako@codeaurora.org>

Step wise governor increases the mitigation level when the temperature
goes above a threshold and will decrease the mitigation when the
temperature falls below the threshold. If it were a case, where the
temperature hovers around a threshold, the mitigation will be applied
and removed at every iteration. This reaction to the temperature is
inefficient for performance.

The use of hysteresis temperature could avoid this ping-pong of
mitigation by relaxing the mitigation to happen only when the
temperature goes below this lower hysteresis value.

Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
5 years agoUpdate gpio-fan-overlay.dts (#2711)
Paul [Thu, 11 Oct 2018 09:17:20 +0000 (12:17 +0300)]
Update gpio-fan-overlay.dts (#2711)

Add references, links, clear details, some typo correction.

5 years agoASoC: cs4265: Add a MIC pre. route (#2696)
Matt Flax [Fri, 28 Sep 2018 05:13:28 +0000 (15:13 +1000)]
ASoC: cs4265: Add a MIC pre. route (#2696)

Commit  b0ef5011b981ece1fde8063243a56d3038b87adb upstream.

The cs4265 driver is missing a microphone preamp enable.
This patch enables/disables the microphone preamp when mic
selection is made using the kcontrol.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoconfigs: Add CONFIG_HID_BIGBEN_FF=m
Phil Elwell [Mon, 24 Sep 2018 13:56:58 +0000 (14:56 +0100)]
configs: Add CONFIG_HID_BIGBEN_FF=m

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoHID: hid-bigbenff: driver for BigBen Interactive PS3OFMINIPAD gamepad
Hanno Zulla [Thu, 23 Aug 2018 15:03:38 +0000 (17:03 +0200)]
HID: hid-bigbenff: driver for BigBen Interactive PS3OFMINIPAD gamepad

commit 256a90ed9e46b270bbc4e15ef05216ff049c3721 upstream.

This is a driver to fix input mapping and add LED & force feedback
support for the "BigBen Interactive Kid-friendly Wired Controller
PS3OFMINIPAD SONY" gamepad with USB id 146b:0902. It was originally
sold as a PS3 accessory and makes a very nice gamepad for Retropie.

Signed-off-by: Hanno Zulla <kontakt@hanno.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
5 years agoBCM270X_DT: Add gpio-fan overlay
Phil Elwell [Tue, 18 Sep 2018 10:08:07 +0000 (11:08 +0100)]
BCM270X_DT: Add gpio-fan overlay

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfigs: Add SENSOR_GPIO_FAN=m
Phil Elwell [Tue, 18 Sep 2018 10:03:20 +0000 (11:03 +0100)]
configs: Add SENSOR_GPIO_FAN=m

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoASoC: cs4265: Add native 32bit I2S transport
Matt Flax [Wed, 29 Aug 2018 23:38:01 +0000 (09:38 +1000)]
ASoC: cs4265: Add native 32bit I2S transport

commit be47e75eb1419ffc1d9c26230963fd5fa3055097 upstream.

The cs4265 uses 32 bit transport on the I2S bus. This patch enables native
32 bit mode for machine drivers which use this sound card driver.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs4265: Add a S/PDIF enable switch
Matt Flax [Wed, 29 Aug 2018 23:38:02 +0000 (09:38 +1000)]
ASoC: cs4265: Add a S/PDIF enable switch

commit f853d6b3ba345297974d877d8ed0f4a91eaca739 upstream.

This patch adds a S/PDIF enable switch as a SOC_SINGLE.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoAdd support for audioinjector.net ultra soundcard. (#2664)
Matt Flax [Tue, 28 Aug 2018 08:42:13 +0000 (18:42 +1000)]
Add support for audioinjector.net ultra soundcard. (#2664)

Uses the simple-audio-card ALSA machine driver. Sets up the machine
driver in the device tree overlay file. The overlays/Makefile is
altered to add the audioinjector-ultra.dtbo dtb overlay.

Adds CONFIG_SND_SOC_CS4265 to the defconfig files.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
5 years agodevicetree: add RPi CM3 dts to arm64; mimic the RPi 3B arm64 dts implementation,...
Steve Pavao [Fri, 10 Aug 2018 21:09:50 +0000 (17:09 -0400)]
devicetree: add RPi CM3 dts to arm64; mimic the RPi 3B arm64 dts implementation, by referring to the actual dts file in the arm directory

5 years agospi: Make GPIO CSs honour the SPI_NO_CS flag
Phil Elwell [Tue, 3 Jul 2018 13:23:47 +0000 (14:23 +0100)]
spi: Make GPIO CSs honour the SPI_NO_CS flag

The SPI configuration state includes an SPI_NO_CS flag that disables
all CS line manipulation, for applications that want to manage their
own chip selects. However, this flag is ignored by the GPIO CS code
in the SPI framework.

Correct this omission with a trivial patch.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agooverlays: Remove stale notes about vc4's CMA alignment in the README.
Eric Anholt [Fri, 9 Mar 2018 21:26:33 +0000 (13:26 -0800)]
overlays: Remove stale notes about vc4's CMA alignment in the README.

We haven't needed alignment since
553c942f8b2cbc7394b4d4fa2f848b23a8f07451, and the current overlays
don't specify any.

Signed-off-by: Eric Anholt <eric@anholt.net>
5 years agooverlays: Add an overlay for the Adafruit Kippah with their 7" panel
Eric Anholt [Fri, 9 Mar 2018 21:20:21 +0000 (13:20 -0800)]
overlays: Add an overlay for the Adafruit Kippah with their 7" panel

Signed-off-by: Eric Anholt <eric@anholt.net>
5 years agoARM: BCM270X: Add the 18-bit DPI pinmux to the RPI DTs.
Eric Anholt [Fri, 9 Mar 2018 22:24:05 +0000 (14:24 -0800)]
ARM: BCM270X: Add the 18-bit DPI pinmux to the RPI DTs.

This doesn't do anything by default, but trying to put the node in an
overlay failed for me.

Signed-off-by: Eric Anholt <eric@anholt.net>
5 years agooverlays: Add addr parameter to i2c-rtc (& -gpio)
Phil Elwell [Mon, 9 Jul 2018 20:11:32 +0000 (21:11 +0100)]
overlays: Add addr parameter to i2c-rtc (& -gpio)

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoAdd hd44780 module to defconfig
Jasper Boomer [Mon, 2 Jul 2018 17:16:22 +0000 (13:16 -0400)]
Add hd44780 module to defconfig

5 years agoAdd device tree overlay for HD44780
Jasper Boomer [Sun, 24 Jun 2018 16:20:27 +0000 (12:20 -0400)]
Add device tree overlay for HD44780

5 years agoconfig: Add I2C_TINY_USB=m
Phil Elwell [Fri, 27 Apr 2018 15:21:33 +0000 (16:21 +0100)]
config: Add I2C_TINY_USB=m

Enable the I2C Tiny USB module.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfig: Add IPVLAN module
popcornmix [Thu, 29 Mar 2018 15:05:28 +0000 (16:05 +0100)]
config: Add IPVLAN module

5 years agoconfig: enable Audio Graph Card module
Matthias Reichl [Tue, 6 Feb 2018 14:37:22 +0000 (15:37 +0100)]
config: enable Audio Graph Card module

Signed-off-by: Matthias Reichl <hias@horus.com>
5 years agobrcmfmac: Disable ARP offloading when promiscuous
Phil Elwell [Thu, 24 Aug 2017 15:16:16 +0000 (16:16 +0100)]
brcmfmac: Disable ARP offloading when promiscuous

This is a test patch for brcmfmac from Franky Lin at Broadcom to disable
ARP offloading when in promiscuous mode, re-enabling the ability to
sniff ARP packets over WiFi.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoconfigs: Rebuild bcmrpi3_defconfig to fix warnings
Phil Elwell [Mon, 12 Nov 2018 21:42:00 +0000 (21:42 +0000)]
configs: Rebuild bcmrpi3_defconfig to fix warnings

Also disable CONFIG_MMC_BCM2835 to avoid a runtime conflict.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agosc16is7xx: Don't spin if no data received
Phil Elwell [Tue, 6 Nov 2018 12:57:48 +0000 (12:57 +0000)]
sc16is7xx: Don't spin if no data received

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoIncrease firmware call buffer size to 48 bytes
James Hughes [Wed, 31 Oct 2018 13:00:46 +0000 (13:00 +0000)]
Increase firmware call buffer size to 48 bytes

An assumption was made in commit a1547e0bc that 32 bytes
would be enough data buffer size for all firmware calls. However,
the axi performance monitor driver uses a call with 44 bytes
(RPI_FIRMWARE_GET_PERIPH_REG) to get the VC registers values.

Increase value to 48 to take this in to account.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
5 years agofirmware: raspberrypi: Add backward compatible get_throttled
Stefan Wahren [Sat, 13 Oct 2018 11:31:21 +0000 (13:31 +0200)]
firmware: raspberrypi: Add backward compatible get_throttled

Avoid a hard userspace ABI change by adding a compatible get_throttled
sysfs entry. Its value is now feed by the GET_THROTTLED requests of the
new hwmon driver. The first access to get_throttled will generate
a warning.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
5 years agohwmon: raspberrypi: Prevent voltage low warnings from filling log
Stefan Wahren [Sat, 6 Oct 2018 14:46:18 +0000 (16:46 +0200)]
hwmon: raspberrypi: Prevent voltage low warnings from filling log

Although the correct fix for low voltage warnings is to
improve the power supply, the current implementation
of the detection can fill the log if the warning
happens freqently. This replaces the logging with
slightly custom ratelimited logging.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
5 years agoconfig: Enable Raspberry Pi voltage monitor
Stefan Wahren [Sat, 6 Oct 2018 14:45:41 +0000 (16:45 +0200)]
config: Enable Raspberry Pi voltage monitor

This enables the Raspberry Pi voltage monitor as a replacement
for the get_trottled sysfs approach in the firmware driver.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
5 years agobcm2708-rpi: Disable txp interrupt unless using vc4-kms-v3d overlay
popcornmix [Wed, 17 Oct 2018 15:32:52 +0000 (16:32 +0100)]
bcm2708-rpi: Disable txp interrupt unless using vc4-kms-v3d overlay

Signed-off-by: popcornmix <popcornmix@gmail.com>
5 years agooverlays: Fix a few dtc warnings
Phil Elwell [Mon, 8 Oct 2018 16:16:28 +0000 (17:16 +0100)]
overlays: Fix a few dtc warnings

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoBCM2708_DT: Use upstreamed GPIO expander driver
Phil Elwell [Mon, 8 Oct 2018 11:20:36 +0000 (12:20 +0100)]
BCM2708_DT: Use upstreamed GPIO expander driver

The upstreamed driver for the GPIO expander has a different compatible
string. Change the relevant Device Tree files to match.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agovchiq_2835_arm: Implement a DMA pool for small bulk transfers (#2699)
detule [Tue, 2 Oct 2018 08:10:08 +0000 (04:10 -0400)]
vchiq_2835_arm: Implement a DMA pool for small bulk transfers (#2699)

During a bulk transfer we request a DMA allocation to hold the
scatter-gather list.  Most of the time, this allocation is small
(<< PAGE_SIZE), however it can be requested at a high enough frequency
to cause fragmentation and/or stress the CMA allocator (think time
spent in compaction here, or during allocations elsewhere).

Implement a pool to serve up small DMA allocations, falling back
to a coherent allocation if the request is greater than
VCHIQ_DMA_POOL_SIZE.

Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
5 years agobcm2835: interpolate audio delay
wm4 [Wed, 13 Jan 2016 18:44:47 +0000 (19:44 +0100)]
bcm2835: interpolate audio delay

It appears the GPU only sends us a message all 10ms to update
the playback progress. Other than this, the playback position
(what SNDRV_PCM_IOCTL_DELAY will return) is not updated at all.
Userspace will see jitter up to 10ms in the audio position.

Make this a bit nicer for userspace by interpolating the
position using the CPU clock.

I'm not sure if setting snd_pcm_runtime.delay is the right
approach for this. Or if there is maybe an already existing
mechanism for position interpolation in the ALSA core.

I only set SNDRV_PCM_INFO_BATCH because this appears to remove
at least one situation snd_pcm_runtime.delay is used, so I have
to worry less in which place I have to update this field, or
how it interacts with the rest of ALSA.

In the future, it might be nice to use VC_AUDIO_MSG_TYPE_LATENCY.
One problem is that it requires sending a videocore message, and
waiting for a reply, which could make the implementation much
harder due to locking and synchronization requirements.

5 years agocxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT
popcornmix [Mon, 17 Sep 2018 16:31:18 +0000 (17:31 +0100)]
cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT

5 years agoAdd rpi-poe-fan driver
Serge Schneider [Mon, 9 Jul 2018 11:54:25 +0000 (12:54 +0100)]
Add rpi-poe-fan driver

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
PoE HAT driver cleanup

* Fix undeclared variable in rpi_poe_fan_suspend
* Add SPDX-License-Identifier
* Expand PoE acronym in Kconfig help
* Give clearer error message on of_property_count_u32_elems fail
* Add documentation
* Add vendor to of_device_id compatible string.
* Rename m_data_s struct to fw_data_s
* Fix typos

Fixes: #2665

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
5 years agostaging/vc04_services: Derive g_cache_line_size
Phil Elwell [Tue, 28 Aug 2018 09:40:40 +0000 (10:40 +0100)]
staging/vc04_services: Derive g_cache_line_size

The ARM coprocessor registers include dcache line size, but there is no
function to expose this value. Rather than create a new one, use the
read_cpuid_id function to derive the correct value, which is 32 for
BCM2835 and 64 for BCM2836/7.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agolan78xx: Move enabling of EEE into PHY init code
Phil Elwell [Thu, 5 Apr 2018 13:46:11 +0000 (14:46 +0100)]
lan78xx: Move enabling of EEE into PHY init code

Enable EEE mode as soon as possible after connecting to the PHY, and
before phy_start. This avoids a second link negotiation, which speeds
up booting and stops the interface failing to become ready.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agobrcmfmac: Re-enable firmware roaming support
Phil Elwell [Wed, 20 Jun 2018 11:20:01 +0000 (12:20 +0100)]
brcmfmac: Re-enable firmware roaming support

As of 4.18, a firmware that implements the update_connect_params
method but doesn't claim to support roaming causes an error. We
disabled firmware roaming in 4.4 [1] because it appeared to
prevent disconnects, but let's try with the current firmware to see
if things have improved.

[1] https://github.com/raspberrypi/linux/commit/dd9188011786fb62a7960922f31e8e086fb2009b

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agonet: lan78xx: Disable TCP Segmentation Offload (TSO)
Dave Stevenson [Wed, 13 Jun 2018 14:21:10 +0000 (15:21 +0100)]
net: lan78xx: Disable TCP Segmentation Offload (TSO)

TSO seems to be having issues when packets are dropped and the
remote end uses Selective Acknowledge (SACK) to denote that
data is missing. The missing data is never resent, so the
connection eventually stalls.

There is a module parameter of enable_tso added to allow
further debugging without forcing a rebuild of the kernel.

https://github.com/raspberrypi/linux/issues/2449
https://github.com/raspberrypi/linux/issues/2482

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
5 years agoof: configfs: Use of_overlay_fdt_apply API call
Phil Elwell [Thu, 14 Jun 2018 14:07:26 +0000 (15:07 +0100)]
of: configfs: Use of_overlay_fdt_apply API call

The published API to the dynamic overlay application mechanism now
takes a Flattened Device Tree blob as input so that it can manage the
lifetime of the unflattened tree. Conveniently, the new API call -
of_overlay_fdt_apply - is virtually a drop-in replacement for
create_overlay, which can now be deleted.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoirqchip: irq-bcm2835: Calc. FIQ_START at boot-time
Phil Elwell [Thu, 14 Jun 2018 10:21:04 +0000 (11:21 +0100)]
irqchip: irq-bcm2835: Calc. FIQ_START at boot-time

ad83c7cb2f37 ("irqchip/irq-bcm2836: Add support for DT interrupt polarity")
changed the way that the BCM2836/7 local interrupts are mapped; instead
of being pre-mapped they are now mapped on-demand. A side effect of this
change is that the call to irq_of_parse_and_map from armctrl_of_init
creates a new mapping, forming a gap between the IRQs and the FIQs. This
 gap breaks the FIQ<->IRQ mapping which up to now has been done by assuming:

1) that the value of FIQ_START is the same as the number of normal IRQs
that will be mapped (still true), and

2) that this value is also the offset between an IRQ and its equivalent
FIQ (which is no longer the case).

Remove both assumptions by measuring the interval between the last IRQ
and the last FIQ, passing it as the parameter to init_FIQ().

Fixes: https://github.com/raspberrypi/linux/issues/2432

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agofirmware/raspberrypi: Notify firmware of a reboot
Phil Elwell [Sat, 12 May 2018 20:35:43 +0000 (21:35 +0100)]
firmware/raspberrypi: Notify firmware of a reboot

Register for reboot notifications, sending RPI_FIRMWARE_NOTIFY_REBOOT
over the mailbox interface on reception.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoAdd ability to export gpio used by gpio-poweroff
Nick Bulleid [Thu, 10 May 2018 20:57:02 +0000 (21:57 +0100)]
Add ability to export gpio used by gpio-poweroff

Signed-off-by: Nick Bulleid <nedbulleid@fastmail.com>
Added export feature to gpio-poweroff documentation

Signed-off-by: Nick Bulleid <nedbulleid@fastmail.com>
5 years agogpiolib: Don't prevent IRQ usage of output GPIOs
Phil Elwell [Tue, 24 Apr 2018 13:42:27 +0000 (14:42 +0100)]
gpiolib: Don't prevent IRQ usage of output GPIOs

Upstream Linux deems using output GPIOs to generate IRQs as a bogus
use case, even though the BCM2835 GPIO controller is capable of doing
so. A number of users would like to make use of this facility, so
disable the checks.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agohid: Reduce default mouse polling interval to 60Hz
popcornmix [Mon, 14 Jul 2014 21:02:09 +0000 (22:02 +0100)]
hid: Reduce default mouse polling interval to 60Hz

Reduces overhead when using X

5 years agolan78xx: Read initial EEE status from DT
Phil Elwell [Fri, 9 Mar 2018 12:01:00 +0000 (12:01 +0000)]
lan78xx: Read initial EEE status from DT

Add two new DT properties:
* microchip,eee-enabled  - a boolean to enable EEE
* microchip,tx-lpi-timer - time in microseconds to wait before entering
                           low power state

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agoadded capture_clear option to pps-gpio via dtoverlay (#2433)
hdoverobinson [Tue, 13 Mar 2018 10:58:39 +0000 (06:58 -0400)]
added capture_clear option to pps-gpio via dtoverlay (#2433)

5 years agosound: bcm: Fix memset dereference warning
Nathan Chancellor [Mon, 5 Mar 2018 00:20:25 +0000 (17:20 -0700)]
sound: bcm: Fix memset dereference warning

This warning appears with GCC 6.4.0 from toolchains.bootlin.com:

../sound/soc/bcm/allo-piano-dac-plus.c: In function ‘snd_allo_piano_dac_init’:
../sound/soc/bcm/allo-piano-dac-plus.c:711:30: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
  memset(glb_ptr, 0x00, sizeof(glb_ptr));
                              ^

Suggested-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
5 years agoi2c-gpio: Also set bus numbers from reg property
Phil Elwell [Tue, 20 Feb 2018 10:07:27 +0000 (10:07 +0000)]
i2c-gpio: Also set bus numbers from reg property

I2C busses can be assigned specific bus numbers using aliases in
Device Tree - string properties where the name is the alias and the
value is the path to the node. The current DT parameter mechanism
does not allow property names to be derived from a parameter value
in any way, so it isn't possible to generate unique or matching
aliases for nodes from an overlay that can generate multiple
instances, e.g. i2c-gpio.

Work around this limitation (at least temporarily) by allowing
the i2c adapter number to be initialised from the "reg" property
if present.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
5 years agohack: cache: Fix linker error
popcornmix [Tue, 20 Feb 2018 20:53:46 +0000 (20:53 +0000)]
hack: cache: Fix linker error

5 years agovc4_firmware_kms: fix build
popcornmix [Sun, 17 Jun 2018 12:22:07 +0000 (13:22 +0100)]
vc4_firmware_kms: fix build

5 years agodrm/vc4: Remove duplicate primary/cursor fields from FKMS driver.
Eric Anholt [Mon, 5 Feb 2018 18:22:03 +0000 (18:22 +0000)]
drm/vc4: Remove duplicate primary/cursor fields from FKMS driver.

The CRTC has those fields and we can just use them.

Signed-off-by: Eric Anholt <eric@anholt.net>
5 years agodrm/vc4: Skip SET_CURSOR_INFO when the cursor contents didn't change.
Eric Anholt [Mon, 5 Feb 2018 18:02:30 +0000 (18:02 +0000)]
drm/vc4: Skip SET_CURSOR_INFO when the cursor contents didn't change.

Signed-off-by: Eric Anholt <eric@anholt.net>