- Jun 18, 2020
-
-
Akira Shimahara authored
commit e2c94d6f upstream. Adding device alarms settings by a dedicated sysfs entry alarms (RW): read or write TH and TL in the device RAM. Checking devices in alarm state could be performed using the master search command. As alarms temperature level are store in a 8 bit register on the device and are signed values, a safe cast shall be performed using the min and max temperature that device are able to measure. This is done by int_to_short inline function. A 'write_data' field is added in the device structure, to bind the correct writing function, as some devices may have 2 or 3 bytes RAM. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203801.411253-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit 67b392f7 upstream. Optimizing temperature reading by reducing waiting conversion time according to device resolution settings, as per device specification. This is device dependent as not all the devices supports resolution setting, so it has been added in device family structures. The process to read the temperature on the device has been adapted in a new function 'convert_t()', which replace the former 'read_therm()', is introduce to deal with this timing. Strong pull up is also applied during the required time, according to device power status needs and 'strong_pullup' module parameter. 'temperature_from_RAM()' function is introduced to get the correct temperature computation (device dependent) from device RAM data. An new sysfs entry has been added to ouptut only temperature. The old entry w1_slave has been kept for compatibility, without changing its output format. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203742.411039-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit 45d457a4 upstream. The driver implement 2 hardware functions to access device RAM: * copy_scratchpad * recall_scratchpad They act according to device specifications. As EEPROM operations are not device dependent (all w1_therm can perform EEPROM read/write operation following the same protocol), it is removed from device families structures. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203725.410844-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit 308bdb94 upstream. Adding resolution sysfs entry (RW) to get or set the device resolution Write values are managed as follow: * '9..12': resolution to set in bit * Anything else: do nothing Read values are : * '9..12': device resolution in bit * '-xx': xx is kernel error when reading the resolution Only supported devices will show the sysfs entry. A new family has been created for DS18S20 devices as they do not implement resolution feature. The resolution of each device is check when the device is discover by the bus master, in 'w1_therm_add_slave(struct w1_slave *)'. The status is stored in the device structure w1_therm_family_data so that the driver always knows the resolution of each device, which could be used later to determine the required conversion duration (resolution dependent). The resolution is re evaluate each time a user read or write the sysfs entry. To avoid looping through the w1_therm_families at run time, the pointer 'specific_functions' is set up to the correct 'w1_therm_family_converter' when the slave is added (which mean when it is discovered by the master). This initialization is done by a helper function 'device_family(struct w1_slave *sl)', and a dedicated macro 'SLAVE_SPECIFIC_FUNC(sl)' allow the access to the specific function of the slave device. 'read_scratchpad' and 'write_scratchpad' are the hardware functions to access the device RAM, as per protocol specification. It cancel the former 'precision' functions, which was only set and never read (so not stored in the device struct). Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203708.410649-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit b7bb6ca1 upstream. Adding ext_power sysfs entry (RO). Return the power status of the device: - 0: device parasite powered - 1: device externally powered - xx: xx is kernel error The power status of each device is check when the device is discover by the bus master, in 'w1_therm_add_slave(struct w1_slave *)'. The status is stored in the device structure w1_therm_family_data so that the driver always knows the power state of each device, which could be used later to determine the required strong pull up to apply on the line. The power status is re evaluate each time the sysfs ext_power read by a user. The hardware function 'read_powermode(struct w1_slave *sl)' act just as per device specifications, sending W1_READ_PSUPPLY command on the bus, and issue a read time slot, reading only one bit. A helper function 'bool bus_mutex_lock(struct mutex *lock)' is introduced. It try to aquire the bus mutex several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203650.410439-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit c8ad65f6 upstream. Fix reset_select_slave issue during devices discovery by the master on bus. The w1_reset_select_slave() from w1_io.c, which was previously used, assume that if the slave count is 1 there is only one slave attached on the bus. This is not always true. For example when discovering devices, when the first device is discover by the bus master, its slave count is 1, but some other slaves may be on the bus. In that case instead of adressing command to the attached slave the master throw a SKIP ROM command so that all slaves attached on the bus will answer simultenaously causing data collision. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203610.409975-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Akira Shimahara authored
commit 92b8d272 upstream. Adding code comments to split code in dedicated parts. After the global declarations (defines, macros and function declarations), code is organized as follow : - Device and family dependent structures and functions - Interfaces functions - Helpers functions - Hardware functions - Sysfs interface functions Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203535.409599-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The i2c-gpio driver expects to use a GPIO in open-drain mode. Failure to configure it in that way causes alarming warnings in the kernel log. The BCM283x and BCM2711 GPIO blocks don't support open-drain mode, but gpiolib can emulate it in software if configured correctly. Silence the warning by declaring the GPIOs as requiring open-drain mode, trusting gpiolib to manage the emulation. The previous incarnation of this patch took the other approach of telling the i2c-gpio driver that the GPIOs were configured for open-drain, but this had the effect of disabling the emulation. In some cases this appears to work, but examining the waveforms as analogue voltages shows contention, the success or failure depending on drive strengths. See: https://github.com/raspberrypi/firmware/issues/1381 See: https://github.com/raspberrypi/firmware/issues/1401 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
This reverts commit 907e08e6.
-
Dom Cobley authored
Currently we call cec_phys_addr_invalidate on a hotplug deassert. That may be due to a TV power cycling, or an AVR being switched on (and switching edid). This makes CEC unusable. Set it back up again on the hotplug assert. Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Phil Elwell authored
Commit "staging: vchiq_arm: Clean up 40-bit DMA support" failed to change one of the calls to dma_unmap_sg to pass in g_dma_dev (rather than g_dev). Correct that oversight. See: https://github.com/raspberrypi/linux/issues/3647 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Dom Cobley authored
Allows use of the same alsa conf file for hdmi1 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Phil Elwell authored
Enable the MAX98357A driver. See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=275919 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Kevin P. Fleming authored
While the RV-1805 is supported by the rtc-abx80x driver via auto-detection, in order for it to be initialized properly it must be explcitly selected. Signed-off-by: Kevin P. Fleming <kevin+linux@km6g.us>
-
David Plowman authored
The bytes per line numbers calculated by get_bytesperline was not matching the equivalent calculation being performed by the VideoCore (mostly by the calculate_pitch function there), resulting in failures to set the image format with some image width values. This patches up the RGB24 and YUYV type formats to match the VideoCore calculation. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
-
Hristo Venev authored
Things don't work too well when both the vc4 driver and the firmware driver are trying to control the same audio output: [ 763.569406] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5 Hence, when the vc4 HDMI driver is used, let it control audio. This is done by introducing a new device tree property to the audio node, and extending the vc4-kms-v3d overlays to set it appropriately. Signed-off-by: Hristo Venev <hristo@venev.name>
-
Phil Elwell authored
The abx80x implementation of the trickle-resistor-ohms parameter is missing the ":0" indicating that the target is an integer/cell value. See: https://github.com/raspberrypi/linux/issues/3642 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
David Lechner authored
This fixes a gcc warning about misleading whitespace. Signed-off-by: David Lechner <david@lechnology.com>
-
bjorn authored
Signed-off-by: Bjorn <beikeland@gmail.com>
-
Pali Rohár authored
Raspberry Pi 1 Model B rev 1 uses GPIO1 for power-up instead of GPIO3.
-
Pali Rohár authored
KeyboardSignal and kb::kbrequest can be used to call /sbin/shutdown
-
Phil Elwell authored
The abx80x implementation of the trickle-resistor-ohms parameter is missing the ":0" indicating that the target is an integer/cell value. See: https://github.com/raspberrypi/linux/issues/3642 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Chen-Yu Tsai authored
To expose thermal regions as hwmon devices, the HWMON core has to be built-in, so that THERMAL_HWMON can be enabled. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-
Chen-Yu Tsai authored
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-
David Plowman authored
Since the unicam driver was modified to write to a dummy buffer when no user-supplied buffer is available, it can now write to and return a buffer even when there's only a single one. Enable this by changing the min_buffers_needed in the vb2_queue; it will be useful for enabling still captures without allocating more memory than absolutely necessary. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
-
Phil Elwell authored
This reverts commit e5e8a221.
-
Phil Elwell authored
Now that the enhanced BCM2711 DMA controller is located by compatible string and used directly for generating bulk transfer addresses, remove the workaround of moving the vchiq node. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Manage the split between addresses for the VPU and addresses for the 40-bit DMA controller with a dedicated DMA device pointer that on non- BCM2711 platforms is the same as the main VCHIQ device. This allows the VCHIQ node to stay in the usual place in the DT, and removes the ugly VC_SAFE macros. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Naushir Patuck authored
The test should return -EIO if the register read id does not match the expected sensor id. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Dave Stevenson authored
Under FKMS, the firmware (via FKMS) also requires the VideoCore cache aliases for image planes, as defined by the dma-ranges under /soc. Add rpi-firmware-kms to the list of acceptable nodes to look for to copy dma config from. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
vc4_drv isn't necessarily under the /soc node in DT as it is a virtual device, but it is the one that does the allocations. The DMA addresses are consumed by primarily the HVS or V3D, and those require VideoCore cache alias address mapping, and so will be under /soc. During probe find the a suitable device node for HVS or V3D, and adopt the DMA configuration of that node. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Enabling zswap support in the kernel configuration costs about 1.5MB of RAM, even when zswap is not enabled at runtime. This cost can be reduced significantly by deferring initialisation (including pool creation) until the "enabled" parameter is set to true. There is a small cost to this in that some initialisation code has to remain in memory after the init phase, just in case they are needed later, but the total size increase is negligible. See: https://github.com/raspberrypi/linux/pull/3432 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The "compressor" and "zpool" parameters of the zswap module each has a custom setter function that calls __zswap_param_set with specific parameters, but the "zpool" setter uses parameters that are correct for the "compressor" parameter, and vice-versa. Fix this by swapping the function bodies over. Fixes: 90b0fc26 ("zswap: change zpool/compressor at runtime") Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Dave Stevenson authored
The change to retrieve the pixel format always on g_fmt didn't check whether the native or unpacked version of the format had been requested, and always returned the packed one. Correct this so that the packing setting is retained whereever possible. Fixes "9d59e89e media: bcm2835-unicam: Re-fetch mbus code from subdev on a g_fmt call" Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
j-schambacher authored
Replaces obsolete function snd_soc_dai_set_tdm_slot Signed-off-by: Joerg Schambacher <joerg@i2audio.com>
-
Phil Elwell authored
The CMA handling change broke the audio parameter - the fragment numbering has changed - so fix it. See: https://github.com/raspberrypi/linux/issues/2489 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The arm bcm2711_defconfig and the arm64 bcmrpi3_defconfig have been missing their NF_TABLES settings. Restore them. See: https://github.com/raspberrypi/linux/issues/3615 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-