* [PATCH 1/3] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()
2023-12-20 7:00 [PATCH 0/3] Add new SFH interfaces Basavaraj Natikar
@ 2023-12-20 7:00 ` Basavaraj Natikar
2023-12-20 7:00 ` [PATCH 2/3] HID: amd_sfh: Add a new interface for exporting HPD data Basavaraj Natikar
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Basavaraj Natikar @ 2023-12-20 7:00 UTC (permalink / raw)
To: jikos, benjamin.tissoires, hdegoede, ilpo.jarvinen,
mario.limonciello, Shyam-sundar.S-k, linux-input
Cc: Basavaraj Natikar
Current amd_sfh driver has float_to_int() to convert units from
float to int. This is fine until this function gets called outside of
the current scope of file.
Add a prefix "amd_sfh" to float_to_int() so that function represents
the driver name. This function will be called by multiple callers in the
next patch.
Link: https://lore.kernel.org/all/ad064333-48a4-4cfa-9428-69e8a7c44667@redhat.com/
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Co-developed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | 28 ++++++++++---------
.../amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 1 +
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c
index 8a037de08e92..33fbdde8aff0 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c
@@ -132,7 +132,7 @@ static void get_common_inputs(struct common_input_property *common, int report_i
common->event_type = HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM;
}
-static int float_to_int(u32 flt32_val)
+int amd_sfh_float_to_int(u32 flt32_val)
{
int fraction, shift, mantissa, sign, exp, zeropre;
@@ -201,9 +201,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
OFFSET_SENSOR_DATA_DEFAULT;
memcpy_fromio(&accel_data, sensoraddr, sizeof(struct sfh_accel_data));
get_common_inputs(&acc_input.common_property, report_id);
- acc_input.in_accel_x_value = float_to_int(accel_data.acceldata.x) / 100;
- acc_input.in_accel_y_value = float_to_int(accel_data.acceldata.y) / 100;
- acc_input.in_accel_z_value = float_to_int(accel_data.acceldata.z) / 100;
+ acc_input.in_accel_x_value = amd_sfh_float_to_int(accel_data.acceldata.x) / 100;
+ acc_input.in_accel_y_value = amd_sfh_float_to_int(accel_data.acceldata.y) / 100;
+ acc_input.in_accel_z_value = amd_sfh_float_to_int(accel_data.acceldata.z) / 100;
memcpy(input_report, &acc_input, sizeof(acc_input));
report_size = sizeof(acc_input);
break;
@@ -212,9 +212,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
OFFSET_SENSOR_DATA_DEFAULT;
memcpy_fromio(&gyro_data, sensoraddr, sizeof(struct sfh_gyro_data));
get_common_inputs(&gyro_input.common_property, report_id);
- gyro_input.in_angel_x_value = float_to_int(gyro_data.gyrodata.x) / 1000;
- gyro_input.in_angel_y_value = float_to_int(gyro_data.gyrodata.y) / 1000;
- gyro_input.in_angel_z_value = float_to_int(gyro_data.gyrodata.z) / 1000;
+ gyro_input.in_angel_x_value = amd_sfh_float_to_int(gyro_data.gyrodata.x) / 1000;
+ gyro_input.in_angel_y_value = amd_sfh_float_to_int(gyro_data.gyrodata.y) / 1000;
+ gyro_input.in_angel_z_value = amd_sfh_float_to_int(gyro_data.gyrodata.z) / 1000;
memcpy(input_report, &gyro_input, sizeof(gyro_input));
report_size = sizeof(gyro_input);
break;
@@ -223,9 +223,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
OFFSET_SENSOR_DATA_DEFAULT;
memcpy_fromio(&mag_data, sensoraddr, sizeof(struct sfh_mag_data));
get_common_inputs(&magno_input.common_property, report_id);
- magno_input.in_magno_x = float_to_int(mag_data.magdata.x) / 100;
- magno_input.in_magno_y = float_to_int(mag_data.magdata.y) / 100;
- magno_input.in_magno_z = float_to_int(mag_data.magdata.z) / 100;
+ magno_input.in_magno_x = amd_sfh_float_to_int(mag_data.magdata.x) / 100;
+ magno_input.in_magno_y = amd_sfh_float_to_int(mag_data.magdata.y) / 100;
+ magno_input.in_magno_z = amd_sfh_float_to_int(mag_data.magdata.z) / 100;
magno_input.in_magno_accuracy = mag_data.accuracy / 100;
memcpy(input_report, &magno_input, sizeof(magno_input));
report_size = sizeof(magno_input);
@@ -235,13 +235,15 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
OFFSET_SENSOR_DATA_DEFAULT;
memcpy_fromio(&als_data, sensoraddr, sizeof(struct sfh_als_data));
get_common_inputs(&als_input.common_property, report_id);
- als_input.illuminance_value = float_to_int(als_data.lux);
+ als_input.illuminance_value = amd_sfh_float_to_int(als_data.lux);
memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info));
if (binfo.sbase.s_prop[ALS_IDX].sf.feat & 0x2) {
als_input.light_color_temp = als_data.light_color_temp;
- als_input.chromaticity_x_value = float_to_int(als_data.chromaticity_x);
- als_input.chromaticity_y_value = float_to_int(als_data.chromaticity_y);
+ als_input.chromaticity_x_value =
+ amd_sfh_float_to_int(als_data.chromaticity_x);
+ als_input.chromaticity_y_value =
+ amd_sfh_float_to_int(als_data.chromaticity_y);
}
report_size = sizeof(als_input);
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
index 656c3e95ef8c..75267b0fec70 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
@@ -166,4 +166,5 @@ struct hpd_status {
void sfh_interface_init(struct amd_mp2_dev *mp2);
void amd_sfh1_1_set_desc_ops(struct amd_mp2_ops *mp2_ops);
+int amd_sfh_float_to_int(u32 flt32_val);
#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/3] HID: amd_sfh: Add a new interface for exporting HPD data
2023-12-20 7:00 [PATCH 0/3] Add new SFH interfaces Basavaraj Natikar
2023-12-20 7:00 ` [PATCH 1/3] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int() Basavaraj Natikar
@ 2023-12-20 7:00 ` Basavaraj Natikar
2023-12-20 7:00 ` [PATCH 3/3] HID: amd_sfh: Add a new interface for exporting ALS data Basavaraj Natikar
2024-01-02 10:23 ` [PATCH 0/3] Add new SFH interfaces Jiri Kosina
3 siblings, 0 replies; 8+ messages in thread
From: Basavaraj Natikar @ 2023-12-20 7:00 UTC (permalink / raw)
To: jikos, benjamin.tissoires, hdegoede, ilpo.jarvinen,
mario.limonciello, Shyam-sundar.S-k, linux-input
Cc: Basavaraj Natikar
AMDSFH has information about the User presence information via the Human
Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub.
Add a new interface to export this information, where other drivers like
PMF can use this information to enhance user experiences.
Link: https://lore.kernel.org/all/ad064333-48a4-4cfa-9428-69e8a7c44667@redhat.com/
Co-developed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/amd_sfh_common.h | 5 ++
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 14 ++++++
.../amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 37 +++++++++++++++
.../amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 1 +
include/linux/amd-pmf-io.h | 46 +++++++++++++++++++
5 files changed, 103 insertions(+)
create mode 100644 include/linux/amd-pmf-io.h
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
index 2643bb14fee2..cd57037bf217 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
@@ -37,6 +37,10 @@ struct amd_mp2_sensor_info {
dma_addr_t dma_address;
};
+struct sfh_dev_status {
+ bool is_hpd_present;
+};
+
struct amd_mp2_dev {
struct pci_dev *pdev;
struct amdtp_cl_data *cl_data;
@@ -47,6 +51,7 @@ struct amd_mp2_dev {
struct amd_input_data in_data;
/* mp2 active control status */
u32 mp2_acs;
+ struct sfh_dev_status dev_en;
};
struct amd_mp2_ops {
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
index e9c6413af24a..0351b0fd394a 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
@@ -73,6 +73,12 @@ static int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
int i, status;
for (i = 0; i < cl_data->num_hid_devices; i++) {
+ switch (cl_data->sensor_idx[i]) {
+ case HPD_IDX:
+ privdata->dev_en.is_hpd_present = false;
+ break;
+ }
+
if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
privdata->mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
status = amd_sfh_wait_for_response
@@ -178,6 +184,11 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
rc = amdtp_hid_probe(i, cl_data);
if (rc)
goto cleanup;
+ switch (cl_data->sensor_idx[i]) {
+ case HPD_IDX:
+ privdata->dev_en.is_hpd_present = true;
+ break;
+ }
}
dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
@@ -259,6 +270,7 @@ static void amd_mp2_pci_remove(void *privdata)
{
struct amd_mp2_dev *mp2 = privdata;
+ sfh_deinit_emp2();
amd_sfh_hid_client_deinit(privdata);
mp2->mp2_ops->stop_all(mp2);
pci_intx(mp2->pdev, false);
@@ -311,12 +323,14 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2)
rc = amd_sfh_irq_init(mp2);
if (rc) {
+ sfh_deinit_emp2();
dev_err(dev, "amd_sfh_irq_init failed\n");
return rc;
}
rc = amd_sfh1_1_hid_client_init(mp2);
if (rc) {
+ sfh_deinit_emp2();
dev_err(dev, "amd_sfh1_1_hid_client_init failed\n");
return rc;
}
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
index 4f81ef2d4f56..197b828fc6a0 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
@@ -7,11 +7,14 @@
*
* Author: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
+#include <linux/amd-pmf-io.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/iopoll.h>
#include "amd_sfh_interface.h"
+static struct amd_mp2_dev *emp2;
+
static int amd_sfh_wait_response(struct amd_mp2_dev *mp2, u8 sid, u32 cmd_id)
{
struct sfh_cmd_response cmd_resp;
@@ -73,7 +76,41 @@ static struct amd_mp2_ops amd_sfh_ops = {
.response = amd_sfh_wait_response,
};
+void sfh_deinit_emp2(void)
+{
+ emp2 = NULL;
+}
+
void sfh_interface_init(struct amd_mp2_dev *mp2)
{
mp2->mp2_ops = &amd_sfh_ops;
+ emp2 = mp2;
+}
+
+static int amd_sfh_hpd_info(u8 *user_present)
+{
+ struct hpd_status hpdstatus;
+
+ if (!user_present)
+ return -EINVAL;
+
+ if (!emp2 || !emp2->dev_en.is_hpd_present)
+ return -ENODEV;
+
+ hpdstatus.val = readl(emp2->mmio + AMD_C2P_MSG(4));
+ *user_present = hpdstatus.shpd.presence;
+
+ return 0;
+}
+
+int amd_get_sfh_info(struct amd_sfh_info *sfh_info, enum sfh_message_type op)
+{
+ if (sfh_info) {
+ switch (op) {
+ case MT_HPD:
+ return amd_sfh_hpd_info(&sfh_info->user_present);
+ }
+ }
+ return -EINVAL;
}
+EXPORT_SYMBOL_GPL(amd_get_sfh_info);
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
index 75267b0fec70..2c211d28764d 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h
@@ -165,6 +165,7 @@ struct hpd_status {
};
void sfh_interface_init(struct amd_mp2_dev *mp2);
+void sfh_deinit_emp2(void);
void amd_sfh1_1_set_desc_ops(struct amd_mp2_ops *mp2_ops);
int amd_sfh_float_to_int(u32 flt32_val);
#endif
diff --git a/include/linux/amd-pmf-io.h b/include/linux/amd-pmf-io.h
new file mode 100644
index 000000000000..5b6d29d36922
--- /dev/null
+++ b/include/linux/amd-pmf-io.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * AMD Platform Management Framework Interface
+ *
+ * Copyright (c) 2023, Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
+ * Basavaraj Natikar <Basavaraj.Natikar@amd.com>
+ */
+
+#ifndef AMD_PMF_IO_H
+#define AMD_PMF_IO_H
+
+#include <linux/types.h>
+
+/**
+ * enum sfh_message_type - Query the SFH message type
+ * @MT_HPD: Message ID to know the Human presence info from MP2 FW
+ */
+enum sfh_message_type {
+ MT_HPD,
+};
+
+/**
+ * enum sfh_hpd_info - Query the Human presence information
+ * @SFH_NOT_DETECTED: Check the HPD connection information from MP2 FW
+ * @SFH_USER_PRESENT: Check if the user is present from HPD sensor
+ * @SFH_USER_AWAY: Check if the user is away from HPD sensor
+ */
+enum sfh_hpd_info {
+ SFH_NOT_DETECTED,
+ SFH_USER_PRESENT,
+ SFH_USER_AWAY,
+};
+
+/**
+ * struct amd_sfh_info - get HPD sensor info from MP2 FW
+ * @user_present: Populates the user presence information
+ */
+struct amd_sfh_info {
+ u8 user_present;
+};
+
+int amd_get_sfh_info(struct amd_sfh_info *sfh_info, enum sfh_message_type op);
+#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/3] HID: amd_sfh: Add a new interface for exporting ALS data
2023-12-20 7:00 [PATCH 0/3] Add new SFH interfaces Basavaraj Natikar
2023-12-20 7:00 ` [PATCH 1/3] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int() Basavaraj Natikar
2023-12-20 7:00 ` [PATCH 2/3] HID: amd_sfh: Add a new interface for exporting HPD data Basavaraj Natikar
@ 2023-12-20 7:00 ` Basavaraj Natikar
2024-01-02 10:23 ` [PATCH 0/3] Add new SFH interfaces Jiri Kosina
3 siblings, 0 replies; 8+ messages in thread
From: Basavaraj Natikar @ 2023-12-20 7:00 UTC (permalink / raw)
To: jikos, benjamin.tissoires, hdegoede, ilpo.jarvinen,
mario.limonciello, Shyam-sundar.S-k, linux-input
Cc: Basavaraj Natikar
AMDSFH has information about the Ambient light via the Ambient
Light Sensor (ALS) which is part of the AMD sensor fusion hub.
Add a new interface to export this information, where other drivers like
PMF can use this information to enhance user experiences.
Link: https://lore.kernel.org/all/ad064333-48a4-4cfa-9428-69e8a7c44667@redhat.com/
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Co-developed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/amd_sfh_common.h | 1 +
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 6 +++++
.../amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 22 +++++++++++++++++++
include/linux/amd-pmf-io.h | 4 ++++
4 files changed, 33 insertions(+)
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
index cd57037bf217..a1950bc6e6ce 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
@@ -39,6 +39,7 @@ struct amd_mp2_sensor_info {
struct sfh_dev_status {
bool is_hpd_present;
+ bool is_als_present;
};
struct amd_mp2_dev {
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
index 0351b0fd394a..9dbe6f4cb294 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
@@ -77,6 +77,9 @@ static int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
case HPD_IDX:
privdata->dev_en.is_hpd_present = false;
break;
+ case ALS_IDX:
+ privdata->dev_en.is_als_present = false;
+ break;
}
if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
@@ -188,6 +191,9 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
case HPD_IDX:
privdata->dev_en.is_hpd_present = true;
break;
+ case ALS_IDX:
+ privdata->dev_en.is_als_present = true;
+ break;
}
}
dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
index 197b828fc6a0..ae36312bc236 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c
@@ -103,12 +103,34 @@ static int amd_sfh_hpd_info(u8 *user_present)
return 0;
}
+static int amd_sfh_als_info(u32 *ambient_light)
+{
+ struct sfh_als_data als_data;
+ void __iomem *sensoraddr;
+
+ if (!ambient_light)
+ return -EINVAL;
+
+ if (!emp2 || !emp2->dev_en.is_als_present)
+ return -ENODEV;
+
+ sensoraddr = emp2->vsbase +
+ (ALS_IDX * SENSOR_DATA_MEM_SIZE_DEFAULT) +
+ OFFSET_SENSOR_DATA_DEFAULT;
+ memcpy_fromio(&als_data, sensoraddr, sizeof(struct sfh_als_data));
+ *ambient_light = amd_sfh_float_to_int(als_data.lux);
+
+ return 0;
+}
+
int amd_get_sfh_info(struct amd_sfh_info *sfh_info, enum sfh_message_type op)
{
if (sfh_info) {
switch (op) {
case MT_HPD:
return amd_sfh_hpd_info(&sfh_info->user_present);
+ case MT_ALS:
+ return amd_sfh_als_info(&sfh_info->ambient_light);
}
}
return -EINVAL;
diff --git a/include/linux/amd-pmf-io.h b/include/linux/amd-pmf-io.h
index 5b6d29d36922..b4f818205216 100644
--- a/include/linux/amd-pmf-io.h
+++ b/include/linux/amd-pmf-io.h
@@ -17,9 +17,11 @@
/**
* enum sfh_message_type - Query the SFH message type
* @MT_HPD: Message ID to know the Human presence info from MP2 FW
+ * @MT_ALS: Message ID to know the Ambient light info from MP2 FW
*/
enum sfh_message_type {
MT_HPD,
+ MT_ALS,
};
/**
@@ -36,9 +38,11 @@ enum sfh_hpd_info {
/**
* struct amd_sfh_info - get HPD sensor info from MP2 FW
+ * @ambient_light: Populates the ambient light information
* @user_present: Populates the user presence information
*/
struct amd_sfh_info {
+ u32 ambient_light;
u8 user_present;
};
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/3] Add new SFH interfaces
2023-12-20 7:00 [PATCH 0/3] Add new SFH interfaces Basavaraj Natikar
` (2 preceding siblings ...)
2023-12-20 7:00 ` [PATCH 3/3] HID: amd_sfh: Add a new interface for exporting ALS data Basavaraj Natikar
@ 2024-01-02 10:23 ` Jiri Kosina
2024-01-04 8:29 ` Shyam Sundar S K
3 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2024-01-02 10:23 UTC (permalink / raw)
To: Basavaraj Natikar
Cc: benjamin.tissoires, hdegoede, ilpo.jarvinen, mario.limonciello,
Shyam-sundar.S-k, linux-input
On Wed, 20 Dec 2023, Basavaraj Natikar wrote:
> This series adds new interfaces to export User presence information and
> Ambient light to other drivers within the kernel.
Hi,
thanks for the patches. I'd like this to go in together with the actual
users of it on the PMF side. Does that code already exist?
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/3] Add new SFH interfaces
2024-01-02 10:23 ` [PATCH 0/3] Add new SFH interfaces Jiri Kosina
@ 2024-01-04 8:29 ` Shyam Sundar S K
2024-01-04 9:21 ` Hans de Goede
0 siblings, 1 reply; 8+ messages in thread
From: Shyam Sundar S K @ 2024-01-04 8:29 UTC (permalink / raw)
To: Jiri Kosina, Basavaraj Natikar
Cc: benjamin.tissoires, hdegoede, ilpo.jarvinen, mario.limonciello,
linux-input, Patil Rajesh
Hi Jiri,
On 1/2/2024 3:53 PM, Jiri Kosina wrote:
> On Wed, 20 Dec 2023, Basavaraj Natikar wrote:
>
>> This series adds new interfaces to export User presence information and
>> Ambient light to other drivers within the kernel.
>
> Hi,
>
> thanks for the patches. I'd like this to go in together with the actual
> users of it on the PMF side. Does that code already exist?
I am yet to submit the patches that uses the new SFH interfaces
defined in this series.
The suggestion from Hans is to have the SFH changes landed
independently, so that Hans can take the PMF changes alone later
during the rc's as fix. IMO, we can have this series merged first alone.
But I am OK to have both PMF and SFH changes together.
Hans, what is your feedback for Jiri's question?
Thanks,
Shyam
>
> Thanks,
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] Add new SFH interfaces
2024-01-04 8:29 ` Shyam Sundar S K
@ 2024-01-04 9:21 ` Hans de Goede
2024-01-04 14:20 ` Jiri Kosina
0 siblings, 1 reply; 8+ messages in thread
From: Hans de Goede @ 2024-01-04 9:21 UTC (permalink / raw)
To: Shyam Sundar S K, Jiri Kosina, Basavaraj Natikar
Cc: benjamin.tissoires, ilpo.jarvinen, mario.limonciello, linux-input,
Patil Rajesh
Hi all,
On 1/4/24 09:29, Shyam Sundar S K wrote:
> Hi Jiri,
>
> On 1/2/2024 3:53 PM, Jiri Kosina wrote:
>> On Wed, 20 Dec 2023, Basavaraj Natikar wrote:
>>
>>> This series adds new interfaces to export User presence information and
>>> Ambient light to other drivers within the kernel.
>>
>> Hi,
>>
>> thanks for the patches. I'd like this to go in together with the actual
>> users of it on the PMF side. Does that code already exist?
>
> I am yet to submit the patches that uses the new SFH interfaces
> defined in this series.
>
> The suggestion from Hans is to have the SFH changes landed
> independently, so that Hans can take the PMF changes alone later
> during the rc's as fix. IMO, we can have this series merged first alone.
>
> But I am OK to have both PMF and SFH changes together.
>
> Hans, what is your feedback for Jiri's question?
Jiri, originally the drivers/hid/amd-sfh-hid/ changes
were posted as part of this series:
https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-1-Shyam-sundar.S-k@amd.com/
specifically in these patches:
https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-14-Shyam-sundar.S-k@amd.com/
https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-15-Shyam-sundar.S-k@amd.com/
https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-16-Shyam-sundar.S-k@amd.com/
Where the last 2 patches introduce both the HID changes and the drivers/platform/x86/amd/pmf/...
consumer of the HID changes in one go.
I have asked Shyam to split out the HID changes:
https://lore.kernel.org/platform-driver-x86/ad064333-48a4-4cfa-9428-69e8a7c44667@redhat.com/
"""
But this patch also needs to have its HID parts split out
from the rest and the HID patches need to be merged
separately.
Since the merge-window is getting close I would like
to propose the following:
1. Send a v7 addressing review remarks consisting of
only patches 1-12, assuming all review remarks are
fixed in v7 I can merge that then.
2. Send a 3 patch HID patch series separately:
[PATCH 1/3] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()
[PATCH 2/3] HID: amd_sfh: adding the HID hpd bits + amd_get_sfh_info() function
[PATCH 3/3] HID: amd_sfh: adding the HID als bits
3. Once v7 of patches 1-12 + hopefully the 3 patch HID series have
landed in 6.8-rc1 then I would be willing to take a patch using
amd_get_sfh_info() to implement hpd + als support in the spc code
as a fix for 6.8-rc# .
"""
I have merged patches 1-12 of the AMD PMF series already.
So assuming there are no other objections against the HID
changes it would be great if these can still make it into
6.8-rc1 then Shyam can re-send the AMD PMF changes which
consume the new HID API as a separate patch and then I'll
send that to Linus once the HID changes have been merged
by Linus.
Note I understand if the timing does not work out
in that case the HID changes + the AMD PMF patches which
consume the new HID API can wait for the next cycle.
If this is going to wait for the next cycle, then please
send me a pull-request for an immutable branch with
the HID changes in there so that I can merge that
into pdx86/for-next before merging the AMD PMF changes.
Regards,
Hans
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] Add new SFH interfaces
2024-01-04 9:21 ` Hans de Goede
@ 2024-01-04 14:20 ` Jiri Kosina
0 siblings, 0 replies; 8+ messages in thread
From: Jiri Kosina @ 2024-01-04 14:20 UTC (permalink / raw)
To: Hans de Goede
Cc: Shyam Sundar S K, Basavaraj Natikar, benjamin.tissoires,
ilpo.jarvinen, mario.limonciello, linux-input, Patil Rajesh
On Thu, 4 Jan 2024, Hans de Goede wrote:
> > I am yet to submit the patches that uses the new SFH interfaces
> > defined in this series.
> >
> > The suggestion from Hans is to have the SFH changes landed
> > independently, so that Hans can take the PMF changes alone later
> > during the rc's as fix. IMO, we can have this series merged first alone.
> >
> > But I am OK to have both PMF and SFH changes together.
> >
> > Hans, what is your feedback for Jiri's question?
>
> Jiri, originally the drivers/hid/amd-sfh-hid/ changes
> were posted as part of this series:
>
> https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-1-Shyam-sundar.S-k@amd.com/
>
> specifically in these patches:
>
> https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-14-Shyam-sundar.S-k@amd.com/
> https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-15-Shyam-sundar.S-k@amd.com/
> https://lore.kernel.org/platform-driver-x86/20231204101548.1458499-16-Shyam-sundar.S-k@amd.com/
>
> Where the last 2 patches introduce both the HID changes and the drivers/platform/x86/amd/pmf/...
> consumer of the HID changes in one go.
>
> I have asked Shyam to split out the HID changes:
> https://lore.kernel.org/platform-driver-x86/ad064333-48a4-4cfa-9428-69e8a7c44667@redhat.com/
[ ... snip ... ]
Thanks a lot to both of you for the background. I have now queued the 3
HID patches in hid.git#for-6.8/amd-sfh
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread