Commit e8b4a890 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

media: atomisp: Get rid of ACPI specifics in gmin_subdev_add()

First of all ACPI HID is a part of the device name which is printed
as a part of the dev_info(dev, ...); line. Second, since the only BID
is left, it's a part of ACPI path, which can be printed via %pfw.

Besides that, drop ACPI handle from atomisp_get_acpi_power() parameters.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5cb30aed
...@@ -423,12 +423,13 @@ static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg, ...@@ -423,12 +423,13 @@ static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg,
return ret; return ret;
} }
static int atomisp_get_acpi_power(struct device *dev, acpi_handle handle) static int atomisp_get_acpi_power(struct device *dev)
{ {
char name[5]; char name[5];
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer b_name = { sizeof(name), name }; struct acpi_buffer b_name = { sizeof(name), name };
union acpi_object *package, *element; union acpi_object *package, *element;
acpi_handle handle = ACPI_HANDLE(dev);
acpi_handle rhandle; acpi_handle rhandle;
acpi_status status; acpi_status status;
int clock_num = -1; int clock_num = -1;
...@@ -515,15 +516,10 @@ static int gmin_subdev_add(struct gmin_subdev *gs) ...@@ -515,15 +516,10 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
{ {
struct i2c_client *client = v4l2_get_subdevdata(gs->subdev); struct i2c_client *client = v4l2_get_subdevdata(gs->subdev);
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct acpi_device *adev; struct acpi_device *adev = ACPI_COMPANION(dev);
acpi_handle handle;
int ret, clock_num = -1; int ret, clock_num = -1;
handle = ACPI_HANDLE(dev); dev_info(dev, "%s: ACPI path is %pfw\n", __func__, dev_fwnode(dev));
adev = ACPI_COMPANION(dev);
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev));
/*WA:CHT requires XTAL clock as PLL is not stable.*/ /*WA:CHT requires XTAL clock as PLL is not stable.*/
gs->clock_src = gmin_get_var_int(dev, false, "ClkSrc", gs->clock_src = gmin_get_var_int(dev, false, "ClkSrc",
...@@ -612,7 +608,7 @@ static int gmin_subdev_add(struct gmin_subdev *gs) ...@@ -612,7 +608,7 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
/* Try first to use ACPI to get the clock resource */ /* Try first to use ACPI to get the clock resource */
if (acpi_device_power_manageable(adev)) if (acpi_device_power_manageable(adev))
clock_num = atomisp_get_acpi_power(dev, handle); clock_num = atomisp_get_acpi_power(dev);
/* Fall-back use EFI and/or DMI match */ /* Fall-back use EFI and/or DMI match */
if (clock_num < 0) if (clock_num < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment