From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751749AbdJBVc2 (ORCPT ); Mon, 2 Oct 2017 17:32:28 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:44693 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbdJBVcZ (ORCPT ); Mon, 2 Oct 2017 17:32:25 -0400 X-Google-Smtp-Source: AOwi7QDngvcpwgM7GALqmk51UnAYJnwO/RaOLPTi8O2GRS93ehJiawSVoU+wk0M+1C06c9RLBowq+w== From: Rajat Jain To: Jiri Kosina , Benjamin Tissoires , David Arcari , Mika Westerberg , HungNien Chen , Hans de Goede , Brian Norris , Dmitry Torokhov , dtor@google.com, Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, rajatxjain@gmail.com Cc: Rajat Jain Subject: [PATCH] HID: i2c-hid: Allow ACPI systems to specify "post-power-on-delay-ms" Date: Mon, 2 Oct 2017 14:32:15 -0700 Message-Id: <20171002213215.32201-1-rajatja@google.com> X-Mailer: git-send-email 2.14.2.822.g60be5d43e6-goog In-Reply-To: <1506874730.16112.194.camel@linux.intel.com> References: <1506874730.16112.194.camel@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The property "post-power-on-delay-ms"" allows a platform to specify the delay needed after power-on, but only via device trees. Thus allow ACPI systems to also provide the same information. Signed-off-by: Rajat Jain --- drivers/hid/i2c-hid/i2c-hid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 77396145d2d0..97405156315a 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -865,6 +865,7 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client, union acpi_object *obj; struct acpi_device *adev; acpi_handle handle; + u32 val; handle = ACPI_HANDLE(&client->dev); if (!handle || acpi_bus_get_device(handle, &adev)) @@ -880,6 +881,10 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client, pdata->hid_descriptor_address = obj->integer.value; ACPI_FREE(obj); + if (!device_property_read_u32(&client->dev, "post-power-on-delay-ms", + &val)) + pdata->post_power_delay_ms = val; + return 0; } -- 2.14.2.822.g60be5d43e6-goog