media: atomisp: Add some ACPI detection info

When someone would report problems with a new device, we
need to know the DMI product ID and the ACPI name for the
detected sensor. So, print them at dmesg.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2020-05-10 10:29:57 +02:00
parent 88a4711e79
commit 0d64e94205
8 changed files with 86 additions and 5 deletions

View file

@ -1309,8 +1309,18 @@ static int gc0310_probe(struct i2c_client *client)
int ret; int ret;
void *pdata; void *pdata;
unsigned int i; unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
pr_info("%s S\n", __func__);
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;

View file

@ -1051,6 +1051,17 @@ static int gc2235_probe(struct i2c_client *client)
void *gcpdev; void *gcpdev;
int ret; int ret;
unsigned int i; unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -850,6 +850,17 @@ static int lm3554_probe(struct i2c_client *client)
struct lm3554 *flash; struct lm3554 *flash;
unsigned int i; unsigned int i;
int ret; int ret;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
flash = kzalloc(sizeof(*flash), GFP_KERNEL); flash = kzalloc(sizeof(*flash), GFP_KERNEL);
if (!flash) if (!flash)

View file

@ -1816,6 +1816,17 @@ static int mt9m114_probe(struct i2c_client *client)
int ret = 0; int ret = 0;
unsigned int i; unsigned int i;
void *pdata; void *pdata;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
/* Setup sensor configuration structure */ /* Setup sensor configuration structure */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);

View file

@ -1386,6 +1386,17 @@ static int ov2680_probe(struct i2c_client *client)
int ret; int ret;
void *pdata; void *pdata;
unsigned int i; unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -1214,6 +1214,17 @@ static int ov2722_probe(struct i2c_client *client)
struct ov2722_device *dev; struct ov2722_device *dev;
void *ovpdev; void *ovpdev;
int ret; int ret;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -1901,6 +1901,17 @@ static int ov5693_probe(struct i2c_client *client)
int ret = 0; int ret = 0;
void *pdata; void *pdata;
unsigned int i; unsigned int i;
acpi_handle handle;
struct acpi_device *adev;
handle = ACPI_HANDLE(&client->dev);
if (!handle || acpi_bus_get_device(handle, &adev)) {
dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV;
}
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
/* /*
* Firmware workaround: Some modules use a "secondary default" * Firmware workaround: Some modules use a "secondary default"

View file

@ -22,6 +22,7 @@
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/iosf_mbi.h> #include <asm/iosf_mbi.h>
@ -1460,6 +1461,9 @@ static bool is_valid_device(struct pci_dev *dev,
{ {
unsigned int a0_max_id = 0; unsigned int a0_max_id = 0;
const char *name; const char *name;
const char *product;
product = dmi_get_system_info(DMI_PRODUCT_NAME);
switch (id->device & ATOMISP_PCI_DEVICE_SOC_MASK) { switch (id->device & ATOMISP_PCI_DEVICE_SOC_MASK) {
case ATOMISP_PCI_DEVICE_SOC_MRFLD: case ATOMISP_PCI_DEVICE_SOC_MRFLD:
@ -1481,8 +1485,8 @@ static bool is_valid_device(struct pci_dev *dev,
atomisp_hw_is_isp2401 = true; atomisp_hw_is_isp2401 = true;
break; break;
default: default:
dev_err(&dev->dev, "Unknown device ID %x04:%x04\n", dev_err(&dev->dev, "%s: unknown device ID %x04:%x04\n",
id->vendor, id->device); product, id->vendor, id->device);
return false; return false;
} }
@ -1511,9 +1515,10 @@ static bool is_valid_device(struct pci_dev *dev,
} }
#endif #endif
dev_info(&dev->dev, "Detected %s version %d (ISP240%c)\n", dev_info(&dev->dev, "Detected %s version %d (ISP240%c) on %s\n",
name, dev->revision, name, dev->revision,
atomisp_hw_is_isp2401 ? '1' : '0'); atomisp_hw_is_isp2401 ? '1' : '0',
product);
return true; return true;
} }