mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers changes
for 4.19, please pull the following:
- Doug updates the low-level suspend/resume code for ARM SoCs to support
the latest rev B3.0 memory controllers found on newer chips with an
appropriate match structure to perform the correct entry sequencing
- Florian updates the Device Tree binding document for these memory
controllers to list all possible compatible strings that exist given
the supported memory controllers.
- Stefan adds the GET_THROTTLED firmware property value that is required
for the Rasperry Pi voltage monitoring driver and updates the
Raspberry Pi firmware driver accordingly to register such a device
using the HWMON subsystem. Finally he adds support for reporting under
voltage conditions using a specialized HWMON driver.
-----BEGIN PGP SIGNATURE-----
iQIcBAABCAAGBQJbSLjCAAoJEIfQlpxEBwcEO6YP/1sS6bQvfxjDshjN4FloQ76W
NGZ9/OI9rAqDlt5Lv4WepChpoJXfn1yv38jOPPd2FdXBKThnIcTn3D89DieF4Fbf
X5IRAc+YzAaBkZbbbtN7A5v3jiDXJWW5yYg4TRCN8bAx5OosnEBdaRnp8S8Xl57B
iw5nvwZL+Pcf6dg1jYK0AkSLIZqtX65SPgl81cDfe1X7eFTl3Npe1XNYLqLD+g7K
iuMjGNzOr8NtrzvOo8rk2h7sWMMTJVWyM5znOyQlcleSa9qJu4UTD73LLvrsf0uR
2EavJ6i5KGQxpkvPwmmx6modxRXPC41Iq8URV9smiKrb+67NIfJKcCWct3GGsQ1b
y4BW/AqHlxnrIYsM/uaWAhVD0WNa/dhzZ97Hu1T4W2pivmQzybfh56fwlLtUaHeL
9oCs9nLigRSdZWAdMBwr9xsvrOK96jTMK+bfs2fOfKt7eppA9ffKvARm0OL7/vZ8
dDmmpuO+1kVioOw/iTFMOFkQQIBsgflzpVdZbPXYGUdfF2zgY/Wha+wDmtO7sIig
Gsy05wSin3EQey0GbPgyLJyymesrH7MY6W0U6YaNyMF1T4Ex0c+K9SrMjdAKP703
p4ogepiS1C9KK6sNxZXyaGrXvAUmak5Nnj5V0Mf7qX0wI+jcyWk/asKCzoW4zXbw
0F0hReuD/ry40ev7MCXV
=mYCv
-----END PGP SIGNATURE-----
Merge tag 'arm-soc/for-4.19/drivers' of https://github.com/Broadcom/stblinux into next/drivers
This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers changes
for 4.19, please pull the following:
- Doug updates the low-level suspend/resume code for ARM SoCs to support
the latest rev B3.0 memory controllers found on newer chips with an
appropriate match structure to perform the correct entry sequencing
- Florian updates the Device Tree binding document for these memory
controllers to list all possible compatible strings that exist given
the supported memory controllers.
- Stefan adds the GET_THROTTLED firmware property value that is required
for the Rasperry Pi voltage monitoring driver and updates the
Raspberry Pi firmware driver accordingly to register such a device
using the HWMON subsystem. Finally he adds support for reporting under
voltage conditions using a specialized HWMON driver.
* tag 'arm-soc/for-4.19/drivers' of https://github.com/Broadcom/stblinux:
firmware: raspberrypi: Remove VLA usage
firmware: raspberrypi: Register hwmon driver
hwmon: Add support for RPi voltage sensor
soc: bcm: brcmstb: Add missing DDR MEMC compatible strings
soc: bcm: brcmstb: pm: Add support for newer rev B3.0 controllers
ARM: bcm2835: Add GET_THROTTLED firmware property
Signed-off-by: Olof Johansson <[email protected]>
This commit is contained in:
commit
e541454a8f
8 changed files with 247 additions and 2 deletions
|
|
@ -21,6 +21,10 @@
|
|||
#define MBOX_DATA28(msg) ((msg) & ~0xf)
|
||||
#define MBOX_CHAN_PROPERTY 8
|
||||
|
||||
#define MAX_RPI_FW_PROP_BUF_SIZE 32
|
||||
|
||||
static struct platform_device *rpi_hwmon;
|
||||
|
||||
struct rpi_firmware {
|
||||
struct mbox_client cl;
|
||||
struct mbox_chan *chan; /* The property channel. */
|
||||
|
|
@ -143,18 +147,22 @@ int rpi_firmware_property(struct rpi_firmware *fw,
|
|||
/* Single tags are very small (generally 8 bytes), so the
|
||||
* stack should be safe.
|
||||
*/
|
||||
u8 data[buf_size + sizeof(struct rpi_firmware_property_tag_header)];
|
||||
u8 data[sizeof(struct rpi_firmware_property_tag_header) +
|
||||
MAX_RPI_FW_PROP_BUF_SIZE];
|
||||
struct rpi_firmware_property_tag_header *header =
|
||||
(struct rpi_firmware_property_tag_header *)data;
|
||||
int ret;
|
||||
|
||||
if (WARN_ON(buf_size > sizeof(data) - sizeof(*header)))
|
||||
return -EINVAL;
|
||||
|
||||
header->tag = tag;
|
||||
header->buf_size = buf_size;
|
||||
header->req_resp_size = 0;
|
||||
memcpy(data + sizeof(struct rpi_firmware_property_tag_header),
|
||||
tag_data, buf_size);
|
||||
|
||||
ret = rpi_firmware_property_list(fw, &data, sizeof(data));
|
||||
ret = rpi_firmware_property_list(fw, &data, buf_size + sizeof(*header));
|
||||
memcpy(tag_data,
|
||||
data + sizeof(struct rpi_firmware_property_tag_header),
|
||||
buf_size);
|
||||
|
|
@ -183,6 +191,20 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw)
|
||||
{
|
||||
u32 packet;
|
||||
int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED,
|
||||
&packet, sizeof(packet));
|
||||
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
rpi_hwmon = platform_device_register_data(dev, "raspberrypi-hwmon",
|
||||
-1, NULL, 0);
|
||||
}
|
||||
|
||||
static int rpi_firmware_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
|
|
@ -209,6 +231,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, fw);
|
||||
|
||||
rpi_firmware_print_firmware_revision(fw);
|
||||
rpi_register_hwmon_driver(dev, fw);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -217,6 +240,8 @@ static int rpi_firmware_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct rpi_firmware *fw = platform_get_drvdata(pdev);
|
||||
|
||||
platform_device_unregister(rpi_hwmon);
|
||||
rpi_hwmon = NULL;
|
||||
mbox_free_channel(fw->chan);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue