mirror of
https://github.com/ps5-linux/ps5-linux-patches.git
synced 2026-07-16 10:10:38 +00:00
Compare commits
7 Commits
kernel-7.1
...
kernel-7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf16f7e8b7 | ||
|
|
8fbb1b2057 | ||
|
|
935dc3e322 | ||
|
|
9ee33721e4 | ||
|
|
a57d783d89 | ||
|
|
07f9d7f847 | ||
|
|
6cfe53c6d3 |
2
.config
2
.config
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86 7.1.1 Kernel Configuration
|
||||
# Linux/x86 7.1.2 Kernel Configuration
|
||||
#
|
||||
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0"
|
||||
CONFIG_CC_IS_GCC=y
|
||||
|
||||
18
.github/workflows/build-kernel.yml
vendored
18
.github/workflows/build-kernel.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
description: 'Package format'
|
||||
default: 'all'
|
||||
type: choice
|
||||
options: [deb, arch, all]
|
||||
options: [deb, arch, rpm, all]
|
||||
patches_ref:
|
||||
description: 'Patches branch/tag/SHA (empty = default)'
|
||||
default: ''
|
||||
@@ -43,6 +43,18 @@ jobs:
|
||||
bash image/build_image.sh --kernel-only \
|
||||
--distro "$FORMAT" \
|
||||
--patches-ref "$PATCHES_REF"
|
||||
# build_image.sh's --distro all skips the rpm packager, and each
|
||||
# kernel-build call wipes image/linux-bin/. Stash the deb + pkg.tar.zst
|
||||
# from the "all" run before firing the rpm-producing "fedora" run,
|
||||
# then restore so the release ships all three formats.
|
||||
if [ "$FORMAT" = "all" ]; then
|
||||
mkdir -p /tmp/kernel-stash
|
||||
cp image/linux-bin/*.deb image/linux-bin/*.pkg.tar.zst /tmp/kernel-stash/
|
||||
bash image/build_image.sh --kernel-only \
|
||||
--distro fedora \
|
||||
--patches-ref "$PATCHES_REF"
|
||||
cp /tmp/kernel-stash/*.deb /tmp/kernel-stash/*.pkg.tar.zst image/linux-bin/
|
||||
fi
|
||||
|
||||
- name: Read kernel and patches version
|
||||
id: version
|
||||
@@ -61,6 +73,7 @@ jobs:
|
||||
path: |
|
||||
image/linux-bin/*.deb
|
||||
image/linux-bin/*.pkg.tar.zst
|
||||
image/linux-bin/*.rpm
|
||||
retention-days: 7
|
||||
|
||||
- name: Compute checksums
|
||||
@@ -68,7 +81,7 @@ jobs:
|
||||
run: |
|
||||
{
|
||||
echo 'sums<<SHAEOF'
|
||||
sha256sum image/linux-bin/*.deb image/linux-bin/*.pkg.tar.zst | sed 's|image/linux-bin/||'
|
||||
sha256sum image/linux-bin/*.deb image/linux-bin/*.pkg.tar.zst image/linux-bin/*.rpm 2>/dev/null | sed 's|image/linux-bin/||'
|
||||
echo 'SHAEOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -90,4 +103,5 @@ jobs:
|
||||
files: |
|
||||
image/linux-bin/*.deb
|
||||
image/linux-bin/*.pkg.tar.zst
|
||||
image/linux-bin/*.rpm
|
||||
make_latest: true
|
||||
|
||||
@@ -24,7 +24,6 @@ sudo make install
|
||||
## TODO
|
||||
|
||||
- amdgpu smu driver to show correct gpu frequency and temperature
|
||||
- xhci driver adjustment for 0x104d:0x9108 to enable bluetooth
|
||||
- hdmi converter improvments: hdr, rgb range, 120hz
|
||||
|
||||
## Bugs
|
||||
|
||||
805
linux.patch
805
linux.patch
@@ -1091,7 +1091,7 @@ index 000000000000..39cc76f39e06
|
||||
+
|
||||
+#endif
|
||||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
|
||||
index 830fefb342c6..f13155f049c4 100644
|
||||
index 830fefb342c6..380bc421583d 100644
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -67,6 +67,10 @@ static struct usb_driver btusb_driver;
|
||||
@@ -1112,10 +1112,10 @@ index 830fefb342c6..f13155f049c4 100644
|
||||
+ /* PS5 IW620 Bluetooth device */
|
||||
+ { USB_DEVICE(0x1286, 0x2059),
|
||||
+ .driver_info = BTUSB_MARVELL |
|
||||
+ BTUSB_IFNUM_0 |
|
||||
+ BTUSB_BROKEN_LE_DEFAULT_PHY |
|
||||
+ BTUSB_BROKEN_READ_LOCAL_NAME |
|
||||
+ BTUSB_NO_AUTOSUSPEND },
|
||||
+ BTUSB_IFNUM_0 |
|
||||
+ BTUSB_BROKEN_LE_DEFAULT_PHY |
|
||||
+ BTUSB_BROKEN_READ_LOCAL_NAME |
|
||||
+ BTUSB_NO_AUTOSUSPEND },
|
||||
+
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
@@ -1125,10 +1125,10 @@ index 830fefb342c6..f13155f049c4 100644
|
||||
{ USB_DEVICE(0x1286, 0x2046), .driver_info = BTUSB_MARVELL },
|
||||
{ USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL },
|
||||
+ { USB_DEVICE(0x1286, 0x2059), .driver_info = BTUSB_MARVELL |
|
||||
+ BTUSB_IFNUM_0 |
|
||||
+ BTUSB_BROKEN_LE_DEFAULT_PHY |
|
||||
+ BTUSB_BROKEN_READ_LOCAL_NAME |
|
||||
+ BTUSB_NO_AUTOSUSPEND },
|
||||
+ BTUSB_IFNUM_0 |
|
||||
+ BTUSB_BROKEN_LE_DEFAULT_PHY |
|
||||
+ BTUSB_BROKEN_READ_LOCAL_NAME |
|
||||
+ BTUSB_NO_AUTOSUSPEND },
|
||||
|
||||
/* Intel Bluetooth devices */
|
||||
{ USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_COMBINED },
|
||||
@@ -3409,11 +3409,12 @@ index b63cd0c310bc..495b2714838b 100644
|
||||
|
||||
diff --git a/drivers/ps5/Makefile b/drivers/ps5/Makefile
|
||||
new file mode 100644
|
||||
index 000000000000..36a3f5261a26
|
||||
index 000000000000..b4b42394aed9
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/Makefile
|
||||
@@ -0,0 +1 @@
|
||||
+obj-y += spcie.o tpcie.o hdmi.o mp1.o buzzer.o svm.o vmenter.o
|
||||
@@ -0,0 +1,2 @@
|
||||
+obj-y += spcie.o tpcie.o hdmi.o mp1.o buzzer.o svm.o vmenter.o fan.o
|
||||
+obj-y += led/
|
||||
diff --git a/drivers/ps5/autoservo_param.h b/drivers/ps5/autoservo_param.h
|
||||
new file mode 100644
|
||||
index 000000000000..d2c25e461bf7
|
||||
@@ -5619,6 +5620,205 @@ index 000000000000..f48ad6f92534
|
||||
+MODULE_AUTHOR("Armandas Kvietkus");
|
||||
+MODULE_DESCRIPTION("PlayStation 5 chassis piezo buzzer");
|
||||
+MODULE_LICENSE("GPL");
|
||||
diff --git a/drivers/ps5/fan.c b/drivers/ps5/fan.c
|
||||
new file mode 100644
|
||||
index 000000000000..33a48c664f73
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/fan.c
|
||||
@@ -0,0 +1,193 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/unaligned.h>
|
||||
+#include <linux/ps5.h>
|
||||
+#include "ps5-fan.h"
|
||||
+
|
||||
+static int icc_fan_txn(u8 svc, u16 mt, u16 len,
|
||||
+ const u8 *data, size_t dlen,
|
||||
+ u8 *reply_out, size_t rlen)
|
||||
+{
|
||||
+ u8 *buf;
|
||||
+ struct icc_msg *msg;
|
||||
+ int ret;
|
||||
+
|
||||
+ buf = kzalloc(ICC_MSG_MAX_SIZE, GFP_KERNEL);
|
||||
+ if (!buf)
|
||||
+ return -ENOMEM;
|
||||
+ msg = (struct icc_msg *)buf;
|
||||
+
|
||||
+ msg->service_id = svc;
|
||||
+ msg->msg_type = mt;
|
||||
+ msg->length = len;
|
||||
+ if (data && dlen)
|
||||
+ memcpy(msg->data, data, dlen);
|
||||
+
|
||||
+ ret = icc_query(buf, buf);
|
||||
+ if (!ret && reply_out && rlen)
|
||||
+ memcpy(reply_out, msg->data, rlen);
|
||||
+
|
||||
+ kfree(buf);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int icc_fan_get_curset(u8 zone, u32 out[PS5_CURSET_COUNT])
|
||||
+{
|
||||
+ u8 req[ICC_MSG_MAX_SIZE - sizeof(struct icc_msg)] = {};
|
||||
+ u8 reply[ICC_MSG_MIN_SIZE] = {};
|
||||
+ int ret, i;
|
||||
+
|
||||
+ req[PS5_FAN_ZONE_OFF] = zone;
|
||||
+
|
||||
+ ret = icc_fan_txn(ICC_SERVICE_ID_FAN, PS5_FAN_MT_CURSET_GET,
|
||||
+ PS5_FAN_CURSET_GET_LEN, req, sizeof(req),
|
||||
+ reply, sizeof(reply));
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ for (i = 0; i < PS5_CURSET_COUNT; i++)
|
||||
+ out[i] = get_unaligned_le32(reply +
|
||||
+ PS5_FAN_CURSET_GET_OFF + i * 4);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int icc_fan_set_curset(u8 zone, u8 config, const u32 in[PS5_CURSET_COUNT])
|
||||
+{
|
||||
+ u8 req[ICC_MSG_MAX_SIZE - sizeof(struct icc_msg)] = {};
|
||||
+ int i;
|
||||
+
|
||||
+ req[PS5_FAN_ZONE_OFF] = zone;
|
||||
+ req[PS5_FAN_CONFIG_OFF] = config;
|
||||
+ for (i = 0; i < PS5_CURSET_COUNT; i++)
|
||||
+ put_unaligned_le32(in[i], req + PS5_FAN_CURSET_SET_OFF + i * 4);
|
||||
+
|
||||
+ return icc_fan_txn(ICC_SERVICE_ID_FAN, PS5_FAN_MT_CURSET_SET,
|
||||
+ PS5_FAN_CURSET_SET_LEN, req, sizeof(req), NULL, 0);
|
||||
+}
|
||||
+
|
||||
+static DEFINE_MUTEX(fan_lock);
|
||||
+
|
||||
+static int fan_get_target_temp(u8 zone, u16 *celsius)
|
||||
+{
|
||||
+ u32 cs[PS5_CURSET_COUNT];
|
||||
+ int ret;
|
||||
+
|
||||
+ mutex_lock(&fan_lock);
|
||||
+ ret = icc_fan_get_curset(zone, cs);
|
||||
+ mutex_unlock(&fan_lock);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ *celsius = cs[PS5_CURSET_TARGETTEMP] >> PS5_TARGETTEMP_SHIFT;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fan_set_target_temp(u8 zone, u8 config, u16 celsius)
|
||||
+{
|
||||
+ u32 cs[PS5_CURSET_COUNT];
|
||||
+ int ret;
|
||||
+
|
||||
+ mutex_lock(&fan_lock);
|
||||
+ ret = icc_fan_get_curset(zone, cs);
|
||||
+ if (!ret) {
|
||||
+ cs[PS5_CURSET_TARGETTEMP] = (u32)celsius << PS5_TARGETTEMP_SHIFT;
|
||||
+ ret = icc_fan_set_curset(zone, config, cs);
|
||||
+ }
|
||||
+ mutex_unlock(&fan_lock);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static ssize_t target_temp_show(struct device *dev,
|
||||
+ struct device_attribute *attr, char *buf)
|
||||
+{
|
||||
+ u16 c;
|
||||
+ int ret = fan_get_target_temp(PS5_ZONE_MAINSOC, &c);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ return sysfs_emit(buf, "%u\n", c);
|
||||
+}
|
||||
+
|
||||
+static ssize_t target_temp_store(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf, size_t count)
|
||||
+{
|
||||
+ u16 c;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (kstrtou16(buf, 10, &c))
|
||||
+ return -EINVAL;
|
||||
+ if (c > 100)
|
||||
+ return -ERANGE;
|
||||
+
|
||||
+ ret = fan_set_target_temp(PS5_ZONE_MAINSOC, 0, c);
|
||||
+ return ret ? ret : count;
|
||||
+}
|
||||
+static DEVICE_ATTR_RW(target_temp);
|
||||
+
|
||||
+static struct attribute *ps5_fan_attrs[] = {
|
||||
+ &dev_attr_target_temp.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(ps5_fan);
|
||||
+
|
||||
+#define PS5_FAN_BOOT_TARGET_TEMP 75
|
||||
+
|
||||
+static int ps5_fan_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ int ret = icc_fan_update_autoservo_param();
|
||||
+
|
||||
+ if (ret)
|
||||
+ dev_warn(&pdev->dev, "autoservo param load failed: %d\n", ret);
|
||||
+
|
||||
+ ret = fan_set_target_temp(PS5_ZONE_MAINSOC, 0, PS5_FAN_BOOT_TARGET_TEMP);
|
||||
+ if (ret)
|
||||
+ dev_warn(&pdev->dev, "boot target temp set failed: %d\n", ret);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver ps5_fan_driver = {
|
||||
+ .probe = ps5_fan_probe,
|
||||
+ .driver = {
|
||||
+ .name = "ps5-fan",
|
||||
+ .dev_groups = ps5_fan_groups,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *ps5_fan_pdev;
|
||||
+
|
||||
+static int __init ps5_fan_init(void)
|
||||
+{
|
||||
+ int ret = platform_driver_register(&ps5_fan_driver);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ps5_fan_pdev = platform_device_register_simple("ps5-fan", -1, NULL, 0);
|
||||
+ if (IS_ERR(ps5_fan_pdev)) {
|
||||
+ ret = PTR_ERR(ps5_fan_pdev);
|
||||
+ platform_driver_unregister(&ps5_fan_driver);
|
||||
+ ps5_fan_pdev = NULL;
|
||||
+ return ret;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit ps5_fan_exit(void)
|
||||
+{
|
||||
+ if (ps5_fan_pdev)
|
||||
+ platform_device_unregister(ps5_fan_pdev);
|
||||
+ platform_driver_unregister(&ps5_fan_driver);
|
||||
+}
|
||||
+
|
||||
+module_init(ps5_fan_init);
|
||||
+module_exit(ps5_fan_exit);
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_DESCRIPTION("PS5 fan driver");
|
||||
+MODULE_ALIAS("platform:ps5-fan");
|
||||
diff --git a/drivers/ps5/hdmi.c b/drivers/ps5/hdmi.c
|
||||
new file mode 100644
|
||||
index 000000000000..8f094490d677
|
||||
@@ -6862,6 +7062,521 @@ index 000000000000..8f094490d677
|
||||
+ }
|
||||
+}
|
||||
+EXPORT_SYMBOL(hdmi_notification_handler);
|
||||
diff --git a/drivers/ps5/led.h b/drivers/ps5/led.h
|
||||
new file mode 100644
|
||||
index 000000000000..a1a205147478
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/led.h
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
+#ifndef _PS5_LED_H
|
||||
+#define _PS5_LED_H
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+int ps5_led_set_raw(u8 blue, u8 white, u8 orange);
|
||||
+int ps5_led_set_preset(const char *name);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/drivers/ps5/led/Makefile b/drivers/ps5/led/Makefile
|
||||
new file mode 100644
|
||||
index 000000000000..38cfacb315b2
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/led/Makefile
|
||||
@@ -0,0 +1 @@
|
||||
+obj-y += core.o presets.o
|
||||
diff --git a/drivers/ps5/led/core.c b/drivers/ps5/led/core.c
|
||||
new file mode 100644
|
||||
index 000000000000..796cc0edc859
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/led/core.c
|
||||
@@ -0,0 +1,158 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/leds.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/ps5.h>
|
||||
+#include "../led.h"
|
||||
+#include "presets.h"
|
||||
+
|
||||
+static const u8 ps5_led_off_payload[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+};
|
||||
+
|
||||
+struct ps5_led_node {
|
||||
+ struct led_classdev cdev;
|
||||
+ const u8 *payload;
|
||||
+ size_t size;
|
||||
+};
|
||||
+
|
||||
+static DEFINE_MUTEX(ps5_led_lock);
|
||||
+static const u8 *ps5_led_current;
|
||||
+
|
||||
+static int ps5_led_brightness_set(struct led_classdev *cdev,
|
||||
+ enum led_brightness value)
|
||||
+{
|
||||
+ struct ps5_led_node *node =
|
||||
+ container_of(cdev, struct ps5_led_node, cdev);
|
||||
+ const u8 *data = (value == LED_OFF) ? ps5_led_off_payload : node->payload;
|
||||
+ size_t size = (value == LED_OFF) ? sizeof(ps5_led_off_payload) : node->size;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!spcie_is_initialized())
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ mutex_lock(&ps5_led_lock);
|
||||
+
|
||||
+ if (ps5_led_current == data) {
|
||||
+ mutex_unlock(&ps5_led_lock);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (value != LED_OFF)
|
||||
+ icc_indicator_set_led(ps5_led_off_payload,
|
||||
+ sizeof(ps5_led_off_payload));
|
||||
+
|
||||
+ ret = icc_indicator_set_led(data, size);
|
||||
+ if (!ret)
|
||||
+ ps5_led_current = data;
|
||||
+
|
||||
+ mutex_unlock(&ps5_led_lock);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int ps5_led_set_raw(u8 blue, u8 white, u8 orange)
|
||||
+{
|
||||
+ u8 buf[25];
|
||||
+
|
||||
+ if (!spcie_is_initialized())
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ if (!blue && !white && !orange)
|
||||
+ return icc_indicator_set_led(ps5_led_off_payload,
|
||||
+ sizeof(ps5_led_off_payload));
|
||||
+
|
||||
+ buf[0] = 0x03; buf[1] = 0x00; buf[2] = 0x00; buf[3] = 0x00;
|
||||
+ buf[4] = 0x10; buf[5] = 0x01; buf[6] = 0x02; buf[7] = blue;
|
||||
+ buf[8] = 0x05; buf[9] = 0x03; buf[10] = 0x00;
|
||||
+ buf[11] = 0x11; buf[12] = 0x01; buf[13] = 0x02; buf[14] = white;
|
||||
+ buf[15] = 0x05; buf[16] = 0x03; buf[17] = 0x00;
|
||||
+ buf[18] = 0x12; buf[19] = 0x01; buf[20] = 0x02; buf[21] = orange;
|
||||
+ buf[22] = 0x05; buf[23] = 0x03; buf[24] = 0x00;
|
||||
+
|
||||
+ return icc_indicator_set_led(buf, sizeof(buf));
|
||||
+}
|
||||
+EXPORT_SYMBOL(ps5_led_set_raw);
|
||||
+
|
||||
+static int ps5_led_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ size_t i;
|
||||
+ int ret;
|
||||
+
|
||||
+ for (i = 0; i < ps5_num_presets; i++) {
|
||||
+ struct ps5_led_node *node;
|
||||
+ char *name;
|
||||
+
|
||||
+ node = devm_kzalloc(&pdev->dev, sizeof(*node), GFP_KERNEL);
|
||||
+ if (!node)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||
+ "ps5:%s:indicator",
|
||||
+ ps5_presets[i].name);
|
||||
+ if (!name)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ node->payload = ps5_presets[i].data;
|
||||
+ node->size = ps5_presets[i].size;
|
||||
+ node->cdev.name = name;
|
||||
+ node->cdev.max_brightness = 255;
|
||||
+ node->cdev.brightness_set_blocking = ps5_led_brightness_set;
|
||||
+ node->cdev.flags = LED_CORE_SUSPENDRESUME;
|
||||
+
|
||||
+ ret = devm_led_classdev_register(&pdev->dev, &node->cdev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver ps5_led_driver = {
|
||||
+ .probe = ps5_led_probe,
|
||||
+ .driver = {
|
||||
+ .name = "ps5-led",
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *ps5_led_pdev;
|
||||
+
|
||||
+static int __init ps5_led_init(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = platform_driver_register(&ps5_led_driver);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ps5_led_pdev = platform_device_register_simple("ps5-led", -1,
|
||||
+ NULL, 0);
|
||||
+ if (IS_ERR(ps5_led_pdev)) {
|
||||
+ ret = PTR_ERR(ps5_led_pdev);
|
||||
+ platform_driver_unregister(&ps5_led_driver);
|
||||
+ ps5_led_pdev = NULL;
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit ps5_led_exit(void)
|
||||
+{
|
||||
+ if (ps5_led_pdev)
|
||||
+ platform_device_unregister(ps5_led_pdev);
|
||||
+ platform_driver_unregister(&ps5_led_driver);
|
||||
+}
|
||||
+
|
||||
+module_init(ps5_led_init);
|
||||
+module_exit(ps5_led_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Armandas Kvietkus <armandas.kvietkus@proton.me>");
|
||||
+MODULE_DESCRIPTION("PlayStation 5 indicator LED driver");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS("platform:ps5-led");
|
||||
diff --git a/drivers/ps5/led/presets.c b/drivers/ps5/led/presets.c
|
||||
new file mode 100644
|
||||
index 000000000000..218da5ecb31e
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/led/presets.c
|
||||
@@ -0,0 +1,300 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/string.h>
|
||||
+#include <linux/ps5.h>
|
||||
+#include "../led.h"
|
||||
+#include "presets.h"
|
||||
+
|
||||
+
|
||||
+static const u8 payload_off[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x00, 0x05, 0x04, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_white_dim[] = {
|
||||
+ 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_white_medium[] = {
|
||||
+ 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x5f, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_white_bright[] = {
|
||||
+ 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_blue_rich[] = {
|
||||
+ 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_orange_dim[] = {
|
||||
+ 0x01, 0x00, 0x00, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_soft_blue_purple_1[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x40, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_soft_blue_purple_2[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0xc0, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_salmon_pink[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x30, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_pink_purple[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x18, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_warm_pink_dim[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x10, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_blue_hint_purple[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x80, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_purple[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x40, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_soft_purple[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x50, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_pink_violet_dim[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_purple_white[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x40, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_soft_orange_dim[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_purplish_blue_white[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0xff, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x80, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_dim_cool_white[] = {
|
||||
+ 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x40, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x40, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_all_dim_purplish[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+#define BREATHE_SLOW \
|
||||
+ 0x00, 0x00, 0x00, 0x56, 0x00, 0x02, 0x02, 0x02, 0x04, 0x01, \
|
||||
+ 0x02, 0x0e, 0x02, 0x03, 0x06, 0x02, 0x25, 0x04, 0x03, 0x05, \
|
||||
+ 0x02, 0x6c, 0x05, 0x03, 0x0d, 0x02, 0xb9, 0x03, 0x02, 0x18, \
|
||||
+ 0x02, 0xe7, 0x05, 0x04, 0x08, 0x02, 0xff, 0x03, 0x05, 0x08
|
||||
+
|
||||
+#define BREATHE_FAST \
|
||||
+ 0x00, 0x00, 0x00, 0x20, 0x00, 0x02, 0x02, 0x02, 0x04, 0x01, \
|
||||
+ 0x02, 0x0e, 0x02, 0x03, 0x06, 0x02, 0x25, 0x04, 0x03, 0x05, \
|
||||
+ 0x02, 0x6c, 0x05, 0x03, 0x0d, 0x02, 0xb9, 0x03, 0x02, 0x18, \
|
||||
+ 0x02, 0xe7, 0x05, 0x04, 0x08, 0x02, 0xff, 0x03, 0x05, 0x08
|
||||
+
|
||||
+static const u8 payload_blue_breathe[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x08, BREATHE_SLOW,
|
||||
+ 0x11, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x00, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_white_breathe[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x08, BREATHE_SLOW,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x00, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_orange_breathe[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x12, 0x08, BREATHE_SLOW,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x00, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_pink_breathe[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x12, 0x08, BREATHE_SLOW,
|
||||
+ 0x10, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x18, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_pink_breathe_fast[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x12, 0x08, BREATHE_FAST,
|
||||
+ 0x10, 0x01, 0x02, 0x20, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x18, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_salmon_pink_breathe[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x12, 0x08, BREATHE_SLOW,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x11, 0x01, 0x02, 0x30, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_blue_to_richblue[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x10, 0x08, BREATHE_SLOW,
|
||||
+ 0x11, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0xff, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_sunrise[] = {
|
||||
+ 0x03, 0x00, 0x00, 0x00,
|
||||
+ 0x11, 0x08, BREATHE_SLOW,
|
||||
+ 0x10, 0x01, 0x02, 0x00, 0x05, 0x03, 0x00,
|
||||
+ 0x12, 0x01, 0x02, 0x40, 0x06, 0x02, 0x15,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_blue_white_anim[] = {
|
||||
+ 0x02, 0x01, 0x00, 0x00,
|
||||
+ 0x10, 0x03, 0x02, 0x2d, 0x01, 0x01, 0xd1, 0x02, 0x12, 0x03,
|
||||
+ 0x05, 0x08, 0x02, 0x00, 0x02, 0x05, 0x08,
|
||||
+ 0x11, 0x05, 0x02, 0x21, 0x01, 0x04, 0x20, 0x02, 0x58, 0x02,
|
||||
+ 0x03, 0x1b, 0x02, 0xab, 0x05, 0x04, 0x10, 0x02, 0xe2, 0x05,
|
||||
+ 0x05, 0x0b, 0x02, 0xff, 0x01, 0x02, 0x1d,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static const u8 payload_zoneb_white_pulse[] = {
|
||||
+ 0x01, 0x01, 0x00, 0x00,
|
||||
+ 0x01, 0x08, 0x02, 0xd3, 0x02, 0x02, 0x16, 0x02, 0x5b, 0x05,
|
||||
+ 0x02, 0x18, 0x02, 0x18, 0x04, 0x02, 0x0f, 0x02, 0x11, 0x01,
|
||||
+ 0x01, 0x06, 0x02, 0x0d, 0x01, 0x02, 0x03, 0x02, 0x12, 0x02,
|
||||
+ 0x02, 0x02, 0x02, 0x42, 0x03, 0x01, 0x10, 0x02, 0xff, 0x0b,
|
||||
+ 0x02, 0x11,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_zoneb_orange_pulse[] = {
|
||||
+ 0x01, 0x01, 0x00, 0x00,
|
||||
+ 0x02, 0x08, 0x02, 0x18, 0x08, 0x03, 0x0d, 0x02, 0x11, 0x02,
|
||||
+ 0x01, 0x03, 0x02, 0x0d, 0x01, 0x02, 0x03, 0x02, 0x12, 0x01,
|
||||
+ 0x02, 0x04, 0x02, 0x41, 0x03, 0x01, 0x0e, 0x02, 0xff, 0x0e,
|
||||
+ 0x02, 0x0d, 0x02, 0xd5, 0x04, 0x04, 0x09, 0x02, 0x80, 0x03,
|
||||
+ 0x01, 0x1c,
|
||||
+};
|
||||
+
|
||||
+static const u8 payload_zoneb_both_pulse[] = {
|
||||
+ 0x02, 0x01, 0x00, 0x00,
|
||||
+ 0x01, 0x08, 0x02, 0xd3, 0x02, 0x02, 0x16, 0x02, 0x5b, 0x05,
|
||||
+ 0x02, 0x18, 0x02, 0x18, 0x04, 0x02, 0x0f, 0x02, 0x11, 0x01,
|
||||
+ 0x01, 0x06, 0x02, 0x0d, 0x01, 0x02, 0x03, 0x02, 0x12, 0x02,
|
||||
+ 0x02, 0x02, 0x02, 0x42, 0x03, 0x01, 0x10, 0x02, 0xff, 0x0b,
|
||||
+ 0x02, 0x11,
|
||||
+ 0x02, 0x08, 0x02, 0x18, 0x08, 0x03, 0x0d, 0x02, 0x11, 0x02,
|
||||
+ 0x01, 0x03, 0x02, 0x0d, 0x01, 0x02, 0x03, 0x02, 0x12, 0x01,
|
||||
+ 0x02, 0x04, 0x02, 0x41, 0x03, 0x01, 0x0e, 0x02, 0xff, 0x0e,
|
||||
+ 0x02, 0x0d, 0x02, 0xd5, 0x04, 0x04, 0x09, 0x02, 0x80, 0x03,
|
||||
+ 0x01, 0x1c,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+#define PRESET(n) { .name = #n, .data = payload_##n, .size = sizeof(payload_##n) }
|
||||
+
|
||||
+const struct ps5_led_preset ps5_presets[] = {
|
||||
+ PRESET(off),
|
||||
+ PRESET(white_dim),
|
||||
+ PRESET(white_medium),
|
||||
+ PRESET(white_bright),
|
||||
+ PRESET(blue_rich),
|
||||
+ PRESET(orange_dim),
|
||||
+ PRESET(soft_blue_purple_1),
|
||||
+ PRESET(soft_blue_purple_2),
|
||||
+ PRESET(salmon_pink),
|
||||
+ PRESET(pink_purple),
|
||||
+ PRESET(warm_pink_dim),
|
||||
+ PRESET(blue_hint_purple),
|
||||
+ PRESET(purple),
|
||||
+ PRESET(soft_purple),
|
||||
+ PRESET(pink_violet_dim),
|
||||
+ PRESET(purple_white),
|
||||
+ PRESET(soft_orange_dim),
|
||||
+ PRESET(purplish_blue_white),
|
||||
+ PRESET(dim_cool_white),
|
||||
+ PRESET(all_dim_purplish),
|
||||
+ PRESET(blue_breathe),
|
||||
+ PRESET(white_breathe),
|
||||
+ PRESET(orange_breathe),
|
||||
+ PRESET(pink_breathe),
|
||||
+ PRESET(pink_breathe_fast),
|
||||
+ PRESET(salmon_pink_breathe),
|
||||
+ PRESET(blue_to_richblue),
|
||||
+ PRESET(sunrise),
|
||||
+ PRESET(blue_white_anim),
|
||||
+ PRESET(zoneb_white_pulse),
|
||||
+ PRESET(zoneb_orange_pulse),
|
||||
+ PRESET(zoneb_both_pulse),
|
||||
+};
|
||||
+
|
||||
+const size_t ps5_num_presets = ARRAY_SIZE(ps5_presets);
|
||||
+
|
||||
+int ps5_led_set_preset(const char *name)
|
||||
+{
|
||||
+ size_t i;
|
||||
+
|
||||
+ if (!spcie_is_initialized())
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ for (i = 0; i < ps5_num_presets; i++) {
|
||||
+ if (!strcmp(ps5_presets[i].name, name)) {
|
||||
+ if (i != 0)
|
||||
+ icc_indicator_set_led(payload_off,
|
||||
+ sizeof(payload_off));
|
||||
+ return icc_indicator_set_led(ps5_presets[i].data,
|
||||
+ ps5_presets[i].size);
|
||||
+ }
|
||||
+ }
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+EXPORT_SYMBOL(ps5_led_set_preset);
|
||||
diff --git a/drivers/ps5/led/presets.h b/drivers/ps5/led/presets.h
|
||||
new file mode 100644
|
||||
index 000000000000..a234788e9990
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/led/presets.h
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
+#ifndef _PS5_LED_PRESETS_H
|
||||
+#define _PS5_LED_PRESETS_H
|
||||
+
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+struct ps5_led_preset {
|
||||
+ const char *name;
|
||||
+ const u8 *data;
|
||||
+ size_t size;
|
||||
+};
|
||||
+
|
||||
+extern const struct ps5_led_preset ps5_presets[];
|
||||
+extern const size_t ps5_num_presets;
|
||||
+
|
||||
+#endif
|
||||
diff --git a/drivers/ps5/mp1.c b/drivers/ps5/mp1.c
|
||||
new file mode 100644
|
||||
index 000000000000..4af890c842a7
|
||||
@@ -7356,12 +8071,71 @@ index 000000000000..4af890c842a7
|
||||
+MODULE_AUTHOR("Andy Nguyen");
|
||||
+MODULE_DESCRIPTION("PlayStation 5 MP1 SMU driver");
|
||||
+MODULE_LICENSE("GPL");
|
||||
diff --git a/drivers/ps5/ps5-fan.h b/drivers/ps5/ps5-fan.h
|
||||
new file mode 100644
|
||||
index 000000000000..5ea1519823c3
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/ps5-fan.h
|
||||
@@ -0,0 +1,53 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
+#ifndef _PS5_FAN_H
|
||||
+#define _PS5_FAN_H
|
||||
+
|
||||
+#include <linux/ps5.h>
|
||||
+
|
||||
+#define PS5_FAN_MT_MODE_SET 0x02
|
||||
+#define PS5_FAN_MT_MODE_GET 0x03
|
||||
+#define PS5_FAN_MT_CURSET_SET 0x06
|
||||
+#define PS5_FAN_MT_CURSET_GET 0x07
|
||||
+
|
||||
+#define PS5_FAN_CURSET_SET_LEN 0x40
|
||||
+#define PS5_FAN_CURSET_GET_LEN ICC_MSG_MIN_SIZE
|
||||
+
|
||||
+enum ps5_fan_zone {
|
||||
+ PS5_ZONE_MAINSOC = 0,
|
||||
+ PS5_ZONE_LOCAL1 = 1,
|
||||
+ PS5_ZONE_LOCAL2 = 2,
|
||||
+ PS5_ZONE_LOCAL3 = 3,
|
||||
+ PS5_ZONE_COUNT = 4,
|
||||
+};
|
||||
+
|
||||
+enum ps5_fan_mode {
|
||||
+ PS5_FAN_MODE_AUTO = 1,
|
||||
+ PS5_FAN_MODE_MAXIMUM = 2,
|
||||
+ PS5_FAN_MODE_MINIMUM = 3,
|
||||
+ PS5_FAN_MODE_MANUAL = 4,
|
||||
+ PS5_FAN_MODE_SP1 = 5,
|
||||
+};
|
||||
+#define PS5_FAN_MODE_MIN PS5_FAN_MODE_AUTO
|
||||
+#define PS5_FAN_MODE_MAX PS5_FAN_MODE_SP1
|
||||
+
|
||||
+enum ps5_curset_id {
|
||||
+ PS5_CURSET_TARGETTEMP = 0,
|
||||
+ PS5_CURSET_PGAIN = 1,
|
||||
+ PS5_CURSET_IGAIN = 2,
|
||||
+ PS5_CURSET_ILIMIT = 3,
|
||||
+ PS5_CURSET_ULIMIT = 4,
|
||||
+ PS5_CURSET_DLIMIT = 5,
|
||||
+ PS5_CURSET_COUNT = 6,
|
||||
+};
|
||||
+
|
||||
+#define PS5_FAN_ZONE_OFF 0
|
||||
+#define PS5_FAN_MODE_OFF 1
|
||||
+#define PS5_FAN_SETTING_OFF 1
|
||||
+#define PS5_FAN_CONFIG_OFF 1
|
||||
+#define PS5_FAN_CURSET_OFF 0x04
|
||||
+#define PS5_FAN_CURSET_GET_OFF PS5_FAN_CURSET_OFF
|
||||
+#define PS5_FAN_CURSET_SET_OFF PS5_FAN_CURSET_OFF
|
||||
+
|
||||
+#define PS5_TARGETTEMP_SHIFT 8
|
||||
+
|
||||
+#endif /* _PS5_FAN_H */
|
||||
diff --git a/drivers/ps5/spcie.c b/drivers/ps5/spcie.c
|
||||
new file mode 100644
|
||||
index 000000000000..e02c074ee0b1
|
||||
index 000000000000..4a28451f89eb
|
||||
--- /dev/null
|
||||
+++ b/drivers/ps5/spcie.c
|
||||
@@ -0,0 +1,1149 @@
|
||||
@@ -0,0 +1,1146 @@
|
||||
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
@@ -8193,9 +8967,6 @@ index 000000000000..e02c074ee0b1
|
||||
+ icc_button_enable_all_notifications(1);
|
||||
+ icc_thermal_enable_notification(1);
|
||||
+
|
||||
+ /* Update autoservo param */
|
||||
+ icc_fan_update_autoservo_param();
|
||||
+
|
||||
+ /* Set LED to white dim */
|
||||
+ icc_indicator_set_led_white(0);
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user