Jonathan Bell [Thu, 13 Jul 2023 14:06:54 +0000 (15:06 +0100)]
usb: xhci: borrow upstream TRB_FETCH quirk on VL805 hosts
This reimplements 5a57342 usb: xhci: add VLI_TRB_CACHE_BUG quirk
The downstream implementation required a fair bit of driver surgery to
allow for truncated ring segments, which needed to shrink by a small
amount to avoid the cache prefetcher from reading off the end of one
segment and into another.
An upstream implementation for a similar bug on a different controller
just doubles the size of the memory allocated for ring segments, which
is a bit more wasteful (+4K per allocation) but means less code churn.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Mon, 26 Oct 2020 14:03:35 +0000 (14:03 +0000)]
xhci: quirks: add link TRB quirk for VL805
The VL805 controller can't cope with the TR Dequeue Pointer for an endpoint
being set to a Link TRB. The hardware-maintained endpoint context ends up
stuck at the address of the Link TRB, leading to erroneous ring expansion
events whenever the enqueue pointer wraps to the dequeue position.
If the search for the end of the current TD and ring cycle state lands on
a Link TRB, move to the next segment.
Link: https://github.com/raspberrypi/linux/issues/3919
[6.5.y Fixup - move downstream quirk bits further along]
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Thu, 13 Jul 2023 13:43:21 +0000 (14:43 +0100)]
xhci: Use more event ring segment table entries
Users have reported log spam created by "Event Ring Full" xHC event
TRBs. These are caused by interrupt latency in conjunction with a very
busy set of devices on the bus. The errors are benign, but throughput
will suffer as the xHC will pause processing of transfers until the
event ring is drained by the kernel. Expand the number of event TRB slots
available by increasing the number of event ring segments in the ERST.
Controllers have a hardware-defined limit as to the number of ERST
entries they can process, so make the actual number in use
min(ERST_MAX_SEGS, hw_max).
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Lee Jackson [Tue, 30 May 2023 07:50:05 +0000 (15:50 +0800)]
media: i2c: arducam_64mp: Add PDAF support
Enable PDAF output for all modes, and also need to modify Embedded Line
Width to 11560 * 3 (two lines of Embedded Data + one line of PDAF).
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Lee Jackson [Fri, 5 May 2023 06:36:15 +0000 (14:36 +0800)]
media: i2c: arducam_64mp: Add 8000x6000 resolution
Added 8000x6000 10-bit (cropped) @ 3fps mode for Arducam 64MP
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Lee Jackson [Thu, 4 May 2023 03:14:04 +0000 (11:14 +0800)]
media: i2c: arducam_64mp: Modify the line length of 1280x720 resolution
Arducam 64MP has specific requirements for the line length, and if these
conditions are not met, the camera will not function properly. Under the
previous configuration, once a stream off operation is performed, the
camera will not output any data, even if a stream on operation is
performed. This prevents us from switching from 1280x720 to another
resolution.
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Naushir Patuck [Wed, 21 Jun 2023 07:45:02 +0000 (08:45 +0100)]
driver: media: i2c: imx477: Re-enable temperature sensor
The temperature sensor enable register write got lost at some point.
Re-enable it.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 16 Jun 2023 15:24:19 +0000 (16:24 +0100)]
drivers: media: bcm2835_unicam: Improve frame sequence count handling
Ensure that the frame sequence counter is incremented only if a previous
frame start interrupt has occurred, or a frame start + frame end has
occurred simultaneously.
This corresponds the sequence number with the actual number of frames
produced by the sensor, not the number of frame buffers dequeued back
to userland.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Tue, 13 Jun 2023 15:12:54 +0000 (16:12 +0100)]
serial: sc16is7xx: Read modem line state at startup
This patch sets the driver modem line state to the actual line state
at driver startup.
See: https://github.com/raspberrypi/linux/issues/5501
Signed-off-by: Earl Schmidt <schmidt.earl.f@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Jack Andersen [Fri, 26 May 2023 19:19:19 +0000 (12:19 -0700)]
panel-sitronix-st7701: Fix panel prepare over SPI
A DSI write is issued in st7701_prepare even when the probed panel
runs on SPI. In practice, this results in a panic with the
vc4-kms-dpi-hyperpixel2r overlay active.
Perform the equivalent write over SPI in this case.
Signed-off-by: Jack Andersen <jackoalan@gmail.com>
Naushir Patuck [Wed, 31 May 2023 14:51:58 +0000 (15:51 +0100)]
drivers: media: imx296: Disable 2x2 binned mode
Disable enumerating and setting of the 2x2 binned mode entirely as it
does not seem to work for either mono or colour sensor variants.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Mon, 22 May 2023 13:22:55 +0000 (14:22 +0100)]
pps: Compatibility hack should be X86-specific
As of [1], using PPS_FETCH on a 64-bit ARM kernel with a 32-bit userland
is broken, returning a timeout. This is because the requested 4-byte
alignment for struct pps_ktime_compat (illegal on arm64) results in the
timeout flags field being uninitialised.
Make the hack specific to X86_64 builds with CONFIG_COMPAT defined.
[1] commit
c2a49fe8eeef ("pps: fix padding issue with PPS_FETCH for
ioctl_compat")
See: https://github.com/raspberrypi/linux/issues/5430
Fixes:
c2a49fe8eeef ("pps: fix padding issue with PPS_FETCH for ioctl_compat")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Tue, 23 May 2023 13:31:03 +0000 (14:31 +0100)]
i2c-bcm2835: Implement I2C_M_IGNORE_NAK
Now that transfers aren't aborted immediately (and uncleanly) on
errors, and the FIFOs are always drained after all transfers, we
can implement I2C_M_IGNORE_NAK by ignoring the returned error
value.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 23 May 2023 13:14:05 +0000 (14:14 +0100)]
i2c-bcm2835: Do not abort transfers on ERR if still active
If a transaction is aborted immediately on ERR being reported,
then the bus is not returned to the STOP condition, and devices
generally get very upset.
Handle the ERR and CLKT conditions only when TA is not set.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 23 May 2023 13:11:52 +0000 (14:11 +0100)]
i2c-bcm2835: Flush FIFOs cleanly on error
On error condition, note the error return code, but still
handle the FIFOs in the normal way rather than relying on
C_CLEAR flushing everything cleanly.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dom Cobley [Fri, 21 Apr 2023 21:00:16 +0000 (22:00 +0100)]
drm/vc4: hdmi: Increase MAI fifo dreq threshold
Now we wait for write responses and have a burst
size of 4, we can set the fifo threshold much higher.
Set it to 28 (of the 32 entry size) to keep fifo
fuller and reduce chance of underflow.
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Phil Elwell [Thu, 11 May 2023 15:27:06 +0000 (16:27 +0100)]
spi: bcm2835: Use phys addresses for slave DMA config
Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 11 May 2023 15:25:46 +0000 (16:25 +0100)]
mmc: bcm2835: Use phys addresses for slave DMA config
Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 11 May 2023 15:08:15 +0000 (16:08 +0100)]
drm/vc4: Use phys addresses for slave DMA config
Slave addresses for DMA are meant to be supplied as physical addresses
(contrary to what struct snd_dmaengine_dai_dma_data does).
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Jose Maria Casanova Crespo [Tue, 7 Feb 2023 12:54:02 +0000 (13:54 +0100)]
drm/v3d: New debugfs end-points to query GPU usage stats.
Two new debugfs interfaces are implemented:
- gpu_usage: exposes the total runtime since boot of each
of the 5 scheduling queues available at V3D (BIN, RENDER,
CSD, TFU, CACHE_CLEAN). So if the interface is queried at
two different points of time the usage percentage of each
of the queues can be calculated.
- gpu_pid_usage: exposes the same information but to the
level of detail of each process using the V3D driver. The
runtime for process using the driver is stored. So the
percentages of usage by PID can be calculated with
measures at different timestamps.
The storage of gpu_pid_usage stats is only done if
the debugfs interface is polled during the last 70 seconds.
If a process does not submit a GPU job during last 70
seconds its stats will also be purged.
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Dave Stevenson [Tue, 15 Jun 2021 17:29:52 +0000 (18:29 +0100)]
media: i2c: imx258: Make HFLIP and VFLIP controls writable
The sensor supports H & V flips, but the controls were READ_ONLY.
Note that the Bayer order changes with these flips, therefore
they set the V4L2_CTRL_FLAG_MODIFY_LAYOUT property.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 21 Jun 2022 13:55:41 +0000 (14:55 +0100)]
media: i2c: imx258: Change register settings for variants of the sensor
Sony have advised that there are variants of the IMX258 sensor which
require slightly different register configuration to the mainline
imx258 driver defaults.
There is no available run-time detection for the variant, so add
configuration via the DT compatible string.
The Vision Components imx258 module supports PDAF, so add the
register differences for that variant
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 11 May 2023 14:44:21 +0000 (15:44 +0100)]
dt-bindings: media: imx258: Add alternate compatible strings
There are a number of variants of the imx258 modules that can not
be differentiated at runtime, so add compatible strings for them.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 11 May 2023 14:40:16 +0000 (15:40 +0100)]
dt-bindings: media: imx258: Rename to include vendor prefix
imx258.yaml doesn't include the vendor prefix of sony, so
rename to add it.
Update the id entry and MAINTAINERS to match.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 1 Apr 2022 17:56:54 +0000 (18:56 +0100)]
media: i2c: imx258: Support faster pixel rate on binned modes
With the binned modes, there is little point in faithfully
reproducing the horizontal line length of 5352 pixels on the CSI2
bus, and the FIFO between the pixel array and MIPI serialiser
allows us to remove that dependency.
Allow the pixel array to run with the normal settings, with the MIPI
serialiser at half the rate. This requires some additional
information for the link frequency to pixel rate function that
needs to be added to the configuration tables.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 1 Apr 2022 17:54:12 +0000 (18:54 +0100)]
media: i2c: imx258: Set pixel_rate range to the same as the value
With a read only control there is limited point in advertising
a minimum and maximum for the control, so change to set the
value, min, and max all to the selected pixel rate.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 31 Mar 2022 16:12:12 +0000 (17:12 +0100)]
media: i2c: imx258: Issue reset before starting streaming
Whilst not documented, register 0x0103 bit 0 is the soft
reset for the sensor, so send it before trying to configure
the sensor.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 31 Mar 2022 15:45:36 +0000 (16:45 +0100)]
media: i2c: imx258: Add support for long exposure modes
The sensor has a register CIT_LSHIFT which extends the exposure
and frame times by the specified power of 2 for longer
exposure times.
Add support for this by configuring this register via V4L2_CID_VBLANK
and extending the V4L2_CID_EXPOSURE range accordingly.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 31 Mar 2022 14:39:40 +0000 (15:39 +0100)]
media: i2c: imx258: Correct max FRM_LENGTH_LINES value
The data sheet states that the maximum value for registers
0x0340/0x0341 FRM_LENGTH_LINES is 65525(decimal), not the
0xFFFF defined in this driver. Correct this limit.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 31 Mar 2022 14:33:59 +0000 (15:33 +0100)]
media: i2c: imx258: Allow configuration of clock lane behaviour
The sensor supports the clock lane either remaining in HS mode
during frame blanking, or dropping to LP11.
Add configuration of the mode via V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 23 Mar 2022 15:48:49 +0000 (15:48 +0000)]
media: i2c: imx258: Add get_selection for pixel array information
Libcamera requires the cropping information for each mode, so
add this information to the driver.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 16 Jun 2021 16:19:17 +0000 (17:19 +0100)]
media: i2c: imx258: Follow normal V4L2 behaviours for clipping exposure
V4L2 sensor drivers are expected are expected to clip the supported
exposure range based on the VBLANK configured.
IMX258 wasn't doing that as register 0x350 (FRM_LENGTH_CTL)
switches it to a mode where frame length tracks coarse exposure time.
Disable this mode and clip the range for V4L2_CID_EXPOSURE appropriately
based on V4L2_CID_VBLANK.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 16 Jun 2021 15:27:06 +0000 (16:27 +0100)]
media: i2c: imx258: Add support for running on 2 CSI data lanes
Extends the driver to also support 2 data lanes.
Frame rates are obviously more restricted on 2 lanes, but some
hardware simply hasn't wired more up.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 16 Jun 2021 12:08:00 +0000 (13:08 +0100)]
media: i2c: imx258: Add support for 24MHz clock
There's no reason why the clock must be 19.2MHz and nothing
else (indeed this isn't even a frequency listed in the datasheet),
so add support for 24MHz as well.
The PLL settings result in slightly different link frequencies,
so parameterise those.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 15 Jun 2021 17:56:33 +0000 (18:56 +0100)]
media: i2c: imx258: Make V4L2_CID_VBLANK configurable.
The values and ranges of V4L2_CID_VBLANK are all computed,
so there is no reason for it to be a read only control.
Remove the register values from the mode lists, add the
handler, and remove the read only flag.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 15 Jun 2021 17:45:40 +0000 (18:45 +0100)]
media: i2c: imx258: Add regulator control
The device tree bindings define the relevant regulators for the
sensor, so update the driver to request the regulators and control
them at the appropriate times.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 15 Jun 2021 17:38:46 +0000 (18:38 +0100)]
media: i2c: imx258: Remove redundant I2C writes.
Registers 0x0202 and 0x0203 are written via the control handler
for V4L2_CID_EXPOSURE, so are not needed from the mode lists.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 30 Mar 2022 13:55:01 +0000 (14:55 +0100)]
media: i2c: imx258: Disable digital cropping on binned modes
The binned modes set DIG_CROP_X_OFFSET and DIG_CROP_IMAGE_WIDTH
to less than the full image, even though the image being captured
is meant to be a scaled version of the full array size.
Reduce X_OFFSET to 0, and increase IMAGE_WIDTH to the full array.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 15 Jun 2021 17:34:38 +0000 (18:34 +0100)]
media: i2c: imx258: Make image geometry meet sensor requirements
The output image is defined as being 4208x3118 pixels in size.
Y_ADD_STA register was set to 0, and Y_ADD_END to 3118, giving
3119 lines total.
The datasheet lists a requirement for Y_ADD_STA to be a multiple
of a power of 2 depending on binning/scaling mode (2 for full pixel,
4 for x2-bin/scale, 8 for (x2-bin)+(x2-subsample) or x4-bin, or 16
for (x4-bin)+(x2-subsample)).
(Y_ADD_END – Y_ADD_STA + 1) also has to be a similar power of 2.
The current configuration for the full res modes breaks that second
requirement, and we can't increase Y_ADD_STA to 1 to retain exactly
the same field of view as that then breaks the first requirement.
For the binned modes, they are worse off as 3118 is not a multiple of
4.
Increase the main mode to 4208x3120 so that it is the same FOV as the
binned modes, with Y_ADD_STA at 0.
Fix Y_ADD_STA and Y_ADD_END for the binned modes so that they meet the
sensor requirements.
This does change the Bayer order as the default configuration is for
H&V flips to be enabled, so readout is from Y_STA_END to Y_ADD_STA,
and this patch has changed Y_STA_END.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 15 Jun 2021 17:18:42 +0000 (18:18 +0100)]
media: i2c: imx258: Remove unused defines
The IMX258_FLL_* defines are unused. Remove them.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Fri, 5 May 2023 10:25:48 +0000 (11:25 +0100)]
pinctrl: bcm2835: Workaround for edge IRQ loss
It has been observed that edge events can be lost when GPIO edges occur
close to each other. Investigation suggests this is due to a hardware
bug, although no mechanism has been identified.
Work around the event loss by moving the IRQ acknowledgement into the
main ISR, adding missing events by explicit level-change detection.
See: https://forums.raspberrypi.com/viewtopic.php?t=350295
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 6 Apr 2023 09:38:40 +0000 (10:38 +0100)]
Bluetooth: hci_bcm: Add more invalid BDADDRs
The kernel needs to recognise the default BDADDRs used by the Bluetooth
modems, so add a few more that we care about.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 25 Apr 2023 10:49:41 +0000 (11:49 +0100)]
Bluetooth: hci_sync: Add fallback-bd-address prop
The kernel Bluetooth framework understands that devices may not
be programmed with valid Bluetooth addresses. It also has the ability
to override a Bluetooth address with the value of the local-bd-address
DT property, but it ignores the validity of the existing address when
doing so.
Add a new boolean property, fallback-bd-address, which indicates that
the given local-bd-address property should only be used if the device
does not already have a valid BDADDR.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 24 Apr 2023 10:48:31 +0000 (11:48 +0100)]
serial: 8250: Add NOMSI bug for bcm2835aux
The BCM2835 mini-UART has no modem status interrupt, causing all
transmission to stop, never to use, if a speed change ever happens
while the CTS signal is high.
Add a simple polling mechanism in order to allow recovery in that
situation.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Mon, 30 Jan 2023 14:46:16 +0000 (14:46 +0000)]
input: goodix: Add option to poll instead of relying on IRQ line
The interrupt line from the touch controller is not necessarily
connected to the SoC, so add the option to poll for touch info.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 14 Apr 2023 12:50:08 +0000 (13:50 +0100)]
drm/panel: Add panel driver for Waveshare DSI touchscreens
Waveshare sell a range of DSI panels of varying sizes, all
using a common MCU to control the panel and backlight.
Add a panel driver that supports these panels.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 28 Mar 2023 12:43:43 +0000 (13:43 +0100)]
media: bcm2835-unicam: Start and stop media_pipeline with same node
media_pipeline_start and media_pipeline_stop now validate that
the pipeline is being started and stopped with the same pipe
and pad handles.
When running with embedded metadata (eg imx477 and imx708), the
start typically happens from the metadata pad, whilst stop is
always from the image pad.
Always pass the image pad to media_pipeline_start to ensure
that the calls are balanced.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 11:02:09 +0000 (12:02 +0100)]
drives: media: imx708: Put HFLIP and VFLIP controls in a cluster
Create a cluster for the HVLIP and VFLIP controls so they are treated
as a single composite control.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 14:05:33 +0000 (15:05 +0100)]
drivers: media: imx708: Follow the standard devicetree labels
Switch the system clock name from "xclk" to "inclk".
Use lower case lables for all regulator names.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 10:52:25 +0000 (11:52 +0100)]
dt-bindings: media: i2c: Replace IMX708 sensor binding documentation file
Replace the existing imx708.yaml file with sony,imx708.yaml that follows
the latest devicetree conventions for camera sensors.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 09:33:51 +0000 (10:33 +0100)]
drivers: media: imx708: Tidy-ups to address upstream review comments
This commit addresses vaious tidy-ups requesed for upstreaming the
IMX708 driver. Notably:
- Remove #define IMX708_NUM_SUPPLIES and use ARRAY_SIZE() directly
- Use dev_err_probe where possible in imx708_probe()
- Fix error handling paths in imx708_probe()
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 09:07:26 +0000 (10:07 +0100)]
drivers: media: imx708: Remove unused control fields
Remove unused and redundant control fields from the state structure.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Fri, 31 Mar 2023 13:56:09 +0000 (14:56 +0100)]
drivers: media: imx708: Increase usable link frequencies
Add support for three different usable link frequencies (default 450Mhz,
447Mhz, and 453MHz) for the IMX708 camera sensor. The choice of
frequency is handled thorugh the "link-frequency" overlay parameter.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Wed, 29 Mar 2023 08:49:36 +0000 (09:49 +0100)]
fbdev: Don't cancel deferred work if pagelist empty
Since [1], the fbdev deferred IO framework is careful to cancel
pending updates on close to prevent dirty pages being accessed after
they may have been reused. However, this is not necessary in the case
that the pagelist is empty, and drivers that don't make use of the
pagelist may have wanted updates cancelled for no good reason.
Avoid penalising fbdev drivers that don't make use of the pagelist by
making the cancelling of deferred IO on close conditional on there
being a non-empty pagelist.
See: https://github.com/raspberrypi/linux/issues/5398
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1]
3efc61d95259 ("fbdev: Fix invalid page access after closing deferred I/O devices")
Phil Elwell [Wed, 22 Mar 2023 15:30:38 +0000 (15:30 +0000)]
hwrng: bcm2835 - sleep more intelligently
While waiting for random data, use sleeps that are proportional
to the amount of data expected. Prevent indefinite waits by
giving up if nothing is received for a second.
See: https://github.com/raspberrypi/linux/issues/5390
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 27 Mar 2023 09:25:25 +0000 (10:25 +0100)]
rpisense-fb: Add explicit fb_deferred_io_mmap hook
As of commit [1], introduced in 5.18, fbdev drivers that use
deferred IO and need mmap support must include an explicit fb_mmap
pointer to the fb_deferred_io_mmap.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1]
590558510327 ("fbdev: Put mmap for deferred I/O into drivers")
David Plowman [Wed, 22 Mar 2023 12:01:57 +0000 (12:01 +0000)]
drivers: media: i2c: imx708: Fix WIDE_DYNAMIC_RANGE control with long exposure
Setting V4L2_CID_WIDE_DYNAMIC_RANGE was causing the long exposure
shift count to be reset, which is incorrect if the user has already
changed the frame length to cause it to have a non-zero value.
Because it only updates control ranges and doesn't set any registers,
the control can also be applied when the sensor is not powered on.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Lee Jackson [Wed, 22 Mar 2023 08:19:13 +0000 (16:19 +0800)]
media: i2c: Add PDAF support for IMX519
Add PDAF support for IMX519, and reduce the pixel rate to
426666667,
link freq to
408000000.
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Maxime Ripard [Mon, 11 Jul 2022 13:58:36 +0000 (15:58 +0200)]
clk: bcm: rpi: Create helper to retrieve private data
The RaspberryPi firmware clocks driver uses in several instances a
container_of to retrieve the struct raspberrypi_clk_data from a pointer
to struct clk_hw. Let's create a small function to avoid duplicating it
all over the place.
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Dom Cobley [Tue, 14 Mar 2023 16:54:37 +0000 (16:54 +0000)]
ad5398_vcm: Fixup ad5398_probe prototype
David Plowman [Tue, 25 Jan 2022 15:48:53 +0000 (15:48 +0000)]
media: i2c: imx219: Correct the minimum vblanking value
The datasheet for this sensor documents the minimum vblanking as being
32 lines. It does fix some problems with occasional black lines at the
bottom of images (tested on Raspberry Pi).
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 21:49:30 +0000 (21:49 +0000)]
iio: light: veml6070: Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 21:48:54 +0000 (21:48 +0000)]
iio: light: tsl4531: Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 21:47:58 +0000 (21:47 +0000)]
hwmon: (sht3x) Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 20:51:53 +0000 (20:51 +0000)]
rtc: ds3232: Add DT compatible string for ds3234
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 12:12:36 +0000 (12:12 +0000)]
hwmon: (ds1621) Add DT compatible strings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 7 Mar 2023 11:52:36 +0000 (11:52 +0000)]
hwmon: (aht10): Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 6 Mar 2023 21:04:05 +0000 (21:04 +0000)]
gpio: pca953x: Add ti,tca9554 compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 6 Mar 2023 20:04:34 +0000 (20:04 +0000)]
iio: adc: mcp3422: Add correct compatible strings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Tue, 1 Feb 2022 15:27:01 +0000 (15:27 +0000)]
drm/panel/panel-sitronix-st7701: Support SPI config and RGB data
The ST7701 supports numerous different interface mechanisms for
MIPI DSI, RGB, or SPI. The driver was only implementing DSI input,
so add RGB parallel input with SPI configuration.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 20 Jan 2023 11:56:54 +0000 (11:56 +0000)]
media: bcm2835-unicam: Add support for RAW16 formats
With the RAW16 formats now having a defined CSI2 data type ID,
they can be added to the driver.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 20 Jan 2023 11:50:28 +0000 (11:50 +0000)]
media: bcm2835-unicam: Use mipi-csi2.h header for data type values
The MIPI CSI2 data type ID values are now defined in the
mipi-csi2.h header, so use those defines instead of hard
coding them in the driver.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
David Plowman [Tue, 10 Jan 2023 13:14:27 +0000 (13:14 +0000)]
drivers: media: i2c: imx708: Fix crop information
The 1536x864 mode contained incorrect crop information.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Naushir Patuck [Thu, 5 Jan 2023 14:44:48 +0000 (14:44 +0000)]
drivers: media: imx708: Enable long exposure mode
Enable long exposure modes by using the long exposure shift register setting
in the imx708 sensor.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Tue, 3 Jan 2023 16:00:21 +0000 (16:00 +0000)]
net: phy: broadcom: Make LEDs 3+4 shadow LEDs 1+2
CM4 uses BCM54210PE, which supports 2 additional LEDs, choosing LED3
for the amber LED because it shows activity by default (LED4 is not
connected). However, this makes it uncontrollable by the eth_led<n>
dtparams which target LEDs 1+2.
Solve the problem by making LEDs 3+4 mirror LEDs 1+2 (which is much
simpler than adding baseboard-specific overrides, but comes with a
risk of making one of the LEDs redundant).
See: https://github.com/raspberrypi/linux/issues/5289
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Nick Hollinghurst [Thu, 22 Dec 2022 13:59:33 +0000 (13:59 +0000)]
media/i2c: Add a driver for the Sony IMX708 image sensor
The imx708 is a 12MP MIPI sensor with a 16:9 aspect ratio, here using
two CSI-2 lanes. It is a "quad Bayer" sensor with all 3 modes offering
10-bit output:
12MP: 4608x2592 up to 14.35fps (full FoV)
1080p: 2304x1296 up to 56.02fps (full FoV)
720p: 1536x864 up to 120.12fps (cropped)
This imx708 sensor driver is based heavily on the imx477 driver and
has been tested on the Raspberry Pi platform using libcamera.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 22 Dec 2022 14:08:35 +0000 (14:08 +0000)]
dtbindings: media: i2c: Add IMX708 CMOS sensor binding
Add YAML devicetree binding for IMX708 CMOS image sensor.
Let's also add a MAINTAINERS entry for the binding and driver.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 3 Jan 2023 16:53:37 +0000 (16:53 +0000)]
media: dw9807-vcm: Smooth the first user movement of the lens
The power up/down sequence is already ramped. Extend this to
the first user movement as well, as this will generally avoid
the "tick" noises due to rapid movements and overshooting.
Subsequent movements are generally smaller and so don't cause
issues.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 3 Jan 2023 16:35:59 +0000 (16:35 +0000)]
media: dw9807-vcm: Add regulator support to the driver
Uses the regulator notifier framework so that the current
focus position will be restored whenever any user of the
regulator powers it up. This means that should the VCM
and sensor share a common regulator then starting the sensor
will automatically restore the default position. If they
have independent regulators then it will behave be powered
up when the VCM subdev is opened.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 3 Jan 2023 16:41:08 +0000 (16:41 +0000)]
media: dt-bindings: Add regulator to dw9807-vcm
The VCM driver will often be controlled via a regulator,
therefore add in the relevant DT hooks.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 3 Jan 2023 15:38:08 +0000 (15:38 +0000)]
media: dw9807-vcm: Add support for DW9817 bidirectional VCM driver
The DW9817 is effectively the same as DW9807 from a programming
interface, however it drives +/-100mA instead of 0-100mA. This means
that the power on ramp needs to take the lens from the midpoint, and
power off return it there. It also changes the default position for
the module.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 3 Jan 2023 15:44:10 +0000 (15:44 +0000)]
media: dt-bindings: Add DW9817 to DW9807 binding
The DW9817 is programmatically the same as DW9807, but
the output drive is a bi-directional -100 to +100mA
instead of 0-100mA.
Add the appropriate compativle string.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Mon, 19 Dec 2022 16:32:33 +0000 (16:32 +0000)]
drm/panel: simple: Add Innolux AT056tN53V1 5.6" VGA
Add support for the Innolux AT056tN53V1 5.6" VGA (640x480) TFT LCD
panel.
Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Wed, 14 Dec 2022 15:00:51 +0000 (15:00 +0000)]
net: bcmgenet: Add 'eee' module parameter
On some switches, having EEE enabled causes the link to become
unstable. With this patch, adding 'genet.eee=N' to the kernel command
line will cause EEE to be disabled on the link.
See: https://github.com/raspberrypi/linux/issues/4289
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Mark Williams [Thu, 8 Dec 2022 02:55:15 +0000 (19:55 -0700)]
drm/panel: panel-ilitek9881c: Crystalfontz support
Add support for Crystalfontz
CFAF7201280A0-050Tx panel.
Signed-off-by: Mark Williams <mwp@mwp.id.au>
Mark Williams [Thu, 8 Dec 2022 01:20:40 +0000 (18:20 -0700)]
drm/panel: panel-ilitek9881c: Use cansleep methods
Use cansleep version of gpiod_set_value so external IO drivers (like
via I2C) can be used.
Signed-off-by: Mark Williams <mwp@mwp.id.au>
Dave Stevenson [Mon, 14 Nov 2022 17:14:15 +0000 (17:14 +0000)]
README: Add README.md with CI kernel build status tags
This is a copy of README with the tags added.
You can not delete the file README as then checkpatch complains
you aren't in a kernel tree.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 1 Dec 2022 13:54:49 +0000 (13:54 +0000)]
media: i2c: ov7251: Add module param to select ext trig mode
As there isn't currently a defined mechanism for selecting an
external trigger mode on image sensors, copy the imx477
approach of using a module parameter to enable ext trig.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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>
Phil Elwell [Sat, 5 Nov 2022 11:46:08 +0000 (11:46 +0000)]
net: phy: BCM54210PE does not support PTP
BCM54213PE is an Ethernet PHY that supports PTP hardware timestamping.
BCM54210PW ia another Ethernet PHY, but one without PTP support.
Unfortunately the two PHYs return the same ID when queried, so some
extra information is required to determine whether the PHY is PTP-
capable.
There are two Raspberry Pi products that use these PHYs - Pi 4B and
CM4 - and fortunately they use different PHY addresses, so use that as
a differentiator. Choose to treat a PHY with the same ID but another
address as a BCM54210PE, which seems more common.
See: https://github.com/raspberrypi/linux/issues/5104
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Jonathan Bell [Wed, 26 Oct 2022 16:46:44 +0000 (17:46 +0100)]
drivers: dwc_otg: stop GCC from patching FIQ functions
Configuring GCC to use task stack protector canaries means it will
insert calls to check functions in FIQ code. This is bad, as a) the
FIQ's stack is banked and b) the failure invokes __stack_chk_fail which
eventually tries to call printk(). Printing to the console inside the
FIQ is generally fatal.
Add CFLAGS to stop this happening in FIQ code.
Also catch one function where notrace wasn't specified.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Tue, 25 Oct 2022 09:50:10 +0000 (10:50 +0100)]
drivers: usb: dwc_otg: fix reference passing when checking bandwidth
The pointer (struct usb_host_endpoint *)->hcpriv should contain a
reference to dwc_otg_qh_t if the driver has already seen a URB submitted
to this endpoint.
It then checks whether the qh exists and is already in a schedule in
order to decide whether to allocate periodic bandwidth or not. Passing a
pointer to an offset inside of struct usb_host_endpoint instead of just
the pointer means it dereferences bogus addresses.
Rationalise (delete) a variable while we're at it.
See https://github.com/raspberrypi/linux/issues/5189
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Dom Cobley [Mon, 24 Oct 2022 12:57:23 +0000 (13:57 +0100)]
media: bcm2835-unicam: Fix up start/stop api change
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Phil Elwell [Tue, 18 Oct 2022 15:36:47 +0000 (16:36 +0100)]
drm/panel: Rename GEM CMA helpers GEM DMA helpers
As a result of [1], DRM_GEM_CMA_HELPER has been replaced by
DRM_GEM_CMA_HELPER.
[1]
4a83c26a1d87 ("drm/gem: rename GEM CMA helpers to GEM DMA helpers")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 28 Oct 2021 14:03:16 +0000 (15:03 +0100)]
brcmfmac: Read alternative firmware names from DT
Add the ability to load the names of alternative firmwares from the
Device Tree node. This permits separate firmwares for 43436s and 43438
and allows downstream firmwares to coexist with upstream.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Fri, 2 Sep 2022 07:35:35 +0000 (08:35 +0100)]
media: bcm2835-unicam: Fix for possible dummy buffer overrun
The Unicam hardware has been observed to cause a buffer overrun when using the
dummy buffer as a circular buffer. The conditions that cause the overrun are not
fully known, but it seems to occur when the memory bus is heavily loaded.
To avoid the overrun, program the hardware with a buffer size of 0 when using
the dummy buffer. This will cause overrun into the allocated dummy buffer, but
avoid out of bounds writes.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Lee Jackson [Fri, 26 Aug 2022 03:41:49 +0000 (11:41 +0800)]
media: i2c: arducam-pivariety: Add custom controls
Add support for strobe_shift, strobe_width and mode custom controls.
Signed-off-by: Lee Jackson <info@arducam.com>
Dave Stevenson [Fri, 29 Jul 2022 16:46:49 +0000 (17:46 +0100)]
media: video-mux: Read CSI2 config from FW, and pass to receiver
There is no obligation for all source devices on a video-mux to
require the same bus configuration, so read the configuration
from the sink ports, and relay via get_mbus_config on the source
port.
If the sources support get_mbus_config, then call that first.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dom Cobley [Mon, 15 Aug 2022 18:42:38 +0000 (19:42 +0100)]
drm/panel-simple: hack ignore orientation
downstream removal of orientation plus upstream adding of new function
Naushir Patuck [Mon, 8 Aug 2022 09:01:41 +0000 (10:01 +0100)]
media: bcm2835-unicam: Correctly handle FS + FE ISR condtion
If we get a simultaneous FS + FE interrupt for the same frame, it cannot be
marked as completed and returned to userland as the framebuffer will be refilled
by Unicam on the next sensor frame. Additionally, the timestamp will be set to 0
as the FS interrupt handling code will not have run yet.
To avoid these problems, the frame is considered dropped in the FE handler,
and will be returned to userland on the subsequent sensor frame.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>