Skip to content

Commit

Permalink
platform/x86: int1092: Fix non sequential device mode handling
Browse files Browse the repository at this point in the history
SAR information from BIOS may come in non sequential pattern.

To overcome the issue, a check is made to extract the right SAR
information using the device mode which is currently being used.

Remove .owner field if calls are used which set it automatically.
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Shravan S <s.shravan@intel.com>
Link: https://lore.kernel.org/r/20211006073525.1332925-1-s.shravan@intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Shravan S authored and Hans de Goede committed Oct 11, 2021
1 parent 0b243c0 commit 85303db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9302,7 +9302,7 @@ S: Maintained
F: drivers/platform/x86/intel/atomisp2/led.c

INTEL BIOS SAR INT1092 DRIVER
M: Shravan S <s.shravan@intel.com>
M: Shravan Sudhakar <s.shravan@intel.com>
M: Intel Corporation <linuxwwan@intel.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
Expand Down
23 changes: 15 additions & 8 deletions drivers/platform/x86/intel/int1092/intel_sar.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ static void update_sar_data(struct wwan_sar_context *context)

if (config->device_mode_info &&
context->sar_data.device_mode < config->total_dev_mode) {
struct wwan_device_mode_info *dev_mode =
&config->device_mode_info[context->sar_data.device_mode];

context->sar_data.antennatable_index = dev_mode->antennatable_index;
context->sar_data.bandtable_index = dev_mode->bandtable_index;
context->sar_data.sartable_index = dev_mode->sartable_index;
int itr = 0;

for (itr = 0; itr < config->total_dev_mode; itr++) {
if (context->sar_data.device_mode ==
config->device_mode_info[itr].device_mode) {
struct wwan_device_mode_info *dev_mode =
&config->device_mode_info[itr];

context->sar_data.antennatable_index = dev_mode->antennatable_index;
context->sar_data.bandtable_index = dev_mode->bandtable_index;
context->sar_data.sartable_index = dev_mode->sartable_index;
break;
}
}
}
}

Expand Down Expand Up @@ -305,12 +313,11 @@ static struct platform_driver sar_driver = {
.remove = sar_remove,
.driver = {
.name = DRVNAME,
.owner = THIS_MODULE,
.acpi_match_table = ACPI_PTR(sar_device_ids)
}
};
module_platform_driver(sar_driver);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Platform device driver for INTEL MODEM BIOS SAR");
MODULE_AUTHOR("Shravan S <s.shravan@intel.com>");
MODULE_AUTHOR("Shravan Sudhakar <s.shravan@intel.com>");

0 comments on commit 85303db

Please sign in to comment.