* [PATCH v2 0/2] Updates to amd_sfh driver
@ 2022-09-27 10:27 Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Basavaraj Natikar
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Basavaraj Natikar @ 2022-09-27 10:27 UTC (permalink / raw)
To: jikos, benjamin.tissoires, linux-input; +Cc: Basavaraj Natikar
Changes includes to replace dev_err to dev_dbg and to handle
"no sensors" case for SFH1.1.
v2:
- Add more verbose changelog
Basavaraj Natikar (2):
HID: amd_sfh: Change dev_err to dev_dbg for additional debug info
HID: amd_sfh: Handle condition of "no sensors" for SFH1.1
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info
2022-09-27 10:27 [PATCH v2 0/2] Updates to amd_sfh driver Basavaraj Natikar
@ 2022-09-27 10:27 ` Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 2/2] HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 Basavaraj Natikar
2022-09-30 8:31 ` [PATCH v2 0/2] Updates to amd_sfh driver Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Basavaraj Natikar @ 2022-09-27 10:27 UTC (permalink / raw)
To: jikos, benjamin.tissoires, linux-input; +Cc: Basavaraj Natikar
Users should only be notified at most one time on systems doesn't have
any sensors connected or non-supported systems.
Check the return code and don't display error messages in those
conditions.
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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 70436f9fad2f..d840efb4a2e2 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
@@ -286,13 +286,13 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2)
phy_base <<= 21;
if (!devm_request_mem_region(dev, phy_base, 128 * 1024, "amd_sfh")) {
- dev_err(dev, "can't reserve mmio registers\n");
+ dev_dbg(dev, "can't reserve mmio registers\n");
return -ENOMEM;
}
mp2->vsbase = devm_ioremap(dev, phy_base, 128 * 1024);
if (!mp2->vsbase) {
- dev_err(dev, "failed to remap vsbase\n");
+ dev_dbg(dev, "failed to remap vsbase\n");
return -ENOMEM;
}
@@ -301,7 +301,7 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2)
memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info));
if (binfo.sbase.fw_info.fw_ver == 0 || binfo.sbase.s_list.sl.sensors == 0) {
- dev_err(dev, "failed to get sensors\n");
+ dev_dbg(dev, "failed to get sensors\n");
return -EOPNOTSUPP;
}
dev_dbg(dev, "firmware version 0x%x\n", binfo.sbase.fw_info.fw_ver);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] HID: amd_sfh: Handle condition of "no sensors" for SFH1.1
2022-09-27 10:27 [PATCH v2 0/2] Updates to amd_sfh driver Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Basavaraj Natikar
@ 2022-09-27 10:27 ` Basavaraj Natikar
2022-09-30 8:31 ` [PATCH v2 0/2] Updates to amd_sfh driver Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Basavaraj Natikar @ 2022-09-27 10:27 UTC (permalink / raw)
To: jikos, benjamin.tissoires, linux-input; +Cc: Basavaraj Natikar
Based on num_hid_devices, each sensor device registers to HID. If
"no sensors" then amd_sfh work initialization and scheduling
doesn’t make sense and return ENODEV to stop driver probe.
Hence add a check for num_hid_devices to handle special
case in the situation of "no sensors" for SFH1.1.
Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality")
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 2 ++
1 file changed, 2 insertions(+)
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 d840efb4a2e2..4da2f9f62aba 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
@@ -110,6 +110,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
amd_sfh1_1_set_desc_ops(mp2_ops);
cl_data->num_hid_devices = amd_sfh_get_sensor_num(privdata, &cl_data->sensor_idx[0]);
+ if (cl_data->num_hid_devices == 0)
+ return -ENODEV;
INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work);
INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] Updates to amd_sfh driver
2022-09-27 10:27 [PATCH v2 0/2] Updates to amd_sfh driver Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 2/2] HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 Basavaraj Natikar
@ 2022-09-30 8:31 ` Jiri Kosina
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2022-09-30 8:31 UTC (permalink / raw)
To: Basavaraj Natikar; +Cc: benjamin.tissoires, linux-input
On Tue, 27 Sep 2022, Basavaraj Natikar wrote:
> Changes includes to replace dev_err to dev_dbg and to handle
> "no sensors" case for SFH1.1.
>
> v2:
> - Add more verbose changelog
>
> Basavaraj Natikar (2):
> HID: amd_sfh: Change dev_err to dev_dbg for additional debug info
> HID: amd_sfh: Handle condition of "no sensors" for SFH1.1
>
> drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-30 8:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 10:27 [PATCH v2 0/2] Updates to amd_sfh driver Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Basavaraj Natikar
2022-09-27 10:27 ` [PATCH v2 2/2] HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 Basavaraj Natikar
2022-09-30 8:31 ` [PATCH v2 0/2] Updates to amd_sfh driver Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).