OSDN Git Service

media: atomisp: Add some ACPI detection info
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 10 May 2020 08:29:57 +0000 (10:29 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 12:51:28 +0000 (14:51 +0200)
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>
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index 6ca708e..b69a5b5 100644 (file)
@@ -1309,8 +1309,18 @@ static int gc0310_probe(struct i2c_client *client)
        int ret;
        void *pdata;
        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);
        if (!dev)
                return -ENOMEM;
index b663b47..e863e19 100644 (file)
@@ -1051,6 +1051,17 @@ static int gc2235_probe(struct i2c_client *client)
        void *gcpdev;
        int ret;
        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);
        if (!dev)
index 05f9b35..0e9f802 100644 (file)
@@ -850,6 +850,17 @@ static int lm3554_probe(struct i2c_client *client)
        struct lm3554 *flash;
        unsigned int i;
        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);
        if (!flash)
index 9c426c9..e7af4bb 100644 (file)
@@ -1816,6 +1816,17 @@ static int mt9m114_probe(struct i2c_client *client)
        int ret = 0;
        unsigned int i;
        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 */
        dev = kzalloc(sizeof(*dev), GFP_KERNEL);
index cb8989e..4f1e0d8 100644 (file)
@@ -1386,6 +1386,17 @@ static int ov2680_probe(struct i2c_client *client)
        int ret;
        void *pdata;
        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);
        if (!dev)
index 44edd18..0879905 100644 (file)
@@ -1214,6 +1214,17 @@ static int ov2722_probe(struct i2c_client *client)
        struct ov2722_device *dev;
        void *ovpdev;
        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);
        if (!dev)
index 9e92ee8..6572e92 100644 (file)
@@ -1901,6 +1901,17 @@ static int ov5693_probe(struct i2c_client *client)
        int ret = 0;
        void *pdata;
        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"
index 9914e05..d4e44a1 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/pm_qos.h>
 #include <linux/timer.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/interrupt.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;
        const char *name;
+       const char *product;
+
+       product = dmi_get_system_info(DMI_PRODUCT_NAME);
 
        switch (id->device & ATOMISP_PCI_DEVICE_SOC_MASK) {
        case ATOMISP_PCI_DEVICE_SOC_MRFLD:
@@ -1481,8 +1485,8 @@ static bool is_valid_device(struct pci_dev *dev,
                atomisp_hw_is_isp2401 = true;
                break;
        default:
-               dev_err(&dev->dev, "Unknown device ID %x04:%x04\n",
-                       id->vendor, id->device);
+               dev_err(&dev->dev, "%s: unknown device ID %x04:%x04\n",
+                       product, id->vendor, id->device);
                return false;
        }
 
@@ -1511,9 +1515,10 @@ static bool is_valid_device(struct pci_dev *dev,
        }
 #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,
-               atomisp_hw_is_isp2401 ? '1' : '0');
+               atomisp_hw_is_isp2401 ? '1' : '0',
+               product);
 
        return true;
 }