summaryrefslogtreecommitdiff
path: root/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
AgeCommit message (Collapse)AuthorFilesLines
2024-05-07HID: amd_sfh: Handle "no sensors" in PM operationsBasavaraj Natikar1-0/+10
Resume or suspend each sensor device based on the num_hid_devices. Therefore, add a check to handle the special case where no sensors are present. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-05-07HID: amd_sfh: Modify and log error only if case of functionality failuresBasavaraj Natikar1-3/+4
Modify log messages, but only log errors when sensors are missing or a true failure occurs to avoid misleading "failed" messages. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-02-27HID: amd_sfh: Extend MP2 register access to SFHBasavaraj Natikar1-2/+2
Various MP2 register sets are supported by newer processors. Therefore, extend MP2 register access to SFH. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-01-04HID: amd_sfh: Add a new interface for exporting ALS dataBasavaraj Natikar1-0/+6
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> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-01-04HID: amd_sfh: Add a new interface for exporting HPD dataBasavaraj Natikar1-0/+14
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> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2023-05-23HID: amd_sfh: Split sensor and HID initialization for SFH1.1Basavaraj Natikar1-5/+5
Sensors are enabled independently of HID device initialization. Sensor initialization should be kept separate in this case, while HID devices should be initialized according to the sensor state. Hence split sensor initialization and HID initialization for SFH1.1 into separate blocks. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-05-23HID: amd_sfh: Remove duplicate cleanup for SFH1.1Basavaraj Natikar1-13/+1
A duplicate cleanup is performed that is not necessary. As a result, remove duplicate cleanup and use common cleanup. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: amd_sfh: Handle "no sensors" enabled for SFH1.1Basavaraj Natikar1-0/+11
Based on num_hid_devices, each sensor device is initialized. If "no sensors" is initialized, amd_sfh work initialization and scheduling doesn’t make sense and returns EOPNOTSUPP to stop driver probe. Hence, add a check for "no sensors" enabled to handle the special case. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-01-06HID: amd_sfh: Fix warning unwind gotoBasavaraj Natikar1-1/+1
Return directly instead of using existing goto will not cleanup previously allocated resources. Hence replace return with goto to fix warning unwind goto which cleanups previously allocated resources. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-09-30HID: amd_sfh: Handle condition of "no sensors" for SFH1.1Basavaraj Natikar1-0/+2
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> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-09-30HID: amd_sfh: Change dev_err to dev_dbg for additional debug infoBasavaraj Natikar1-3/+3
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> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-07-21HID: amd_sfh: Implement SFH1.1 functionalityBasavaraj Natikar1-0/+324
Newer AMD SOCs use SFH1.1 memory access with new PCI-id. Hence add new sfh1_1 sub directory to implement SFH1.1 functionality by defining new PCI id, interface functions, descriptor functions and handlers which invokes sfh1.1. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>