From patchwork Mon Oct 2 21:32:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 9981279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 710D060365 for ; Mon, 2 Oct 2017 21:32:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6447A24B48 for ; Mon, 2 Oct 2017 21:32:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5860B288BF; Mon, 2 Oct 2017 21:32:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100B824B48 for ; Mon, 2 Oct 2017 21:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750940AbdJBVc0 (ORCPT ); Mon, 2 Oct 2017 17:32:26 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:46085 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbdJBVcZ (ORCPT ); Mon, 2 Oct 2017 17:32:25 -0400 Received: by mail-pf0-f173.google.com with SMTP id r68so3530277pfj.3 for ; Mon, 02 Oct 2017 14:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PUSggAoawgUJ11mSqXBMbZOLuCyGpXWMUk1AX7jWrR4=; b=TccVVZVoGND/2BHxx7NToL45xwX9Ac3oRvIHXOb4109n3Itf+m1JPB585WKu+gXN03 ggRYm0Q0WwRM/FObriaIUQlZYxkRws52SWJbiavrWhfQP22OFMARyFEEzNjdNIk+hX+s C7FNy0YUYcw52AjDxWxx0fzkG09iwfaPVcbDuo90sbZArZn12jS6hnT+WYflre2zsfZB BIqfgNXk3k8VLgc8yy/SXGmRG6gfgFoGNDk9VXpt+K8//jlEAw2RUjOdRawCWZ4T5TLk /Qs9YTusrB0mPyLvNRnmD4LdPoA3uG4lRYQPItw2myIRFYDS6BHK7MAfFEw17gydGqYa U1Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PUSggAoawgUJ11mSqXBMbZOLuCyGpXWMUk1AX7jWrR4=; b=l2yWnLYXpIruROhmd+Psbq/bevYUYjlbOmz3mbYObkoAYK1HUS/1R9RLFAm3Htteit GSnaRz53cwFl8+P7TCmZIGy7po5PPy8T6eLRItupBtY9q644sjseIQSDEohsd2SKv70R SkuLxcMrA4d4U/IepSz3xoNon4xkXWPSbrnysY0MM1SgAWVCRsDPshJIDPDFULsOtjTj igXWMmi3jG+9AFPzLJdtzC9iRCjJiQswARHryH29cNAGd//GRVqq0xgB3VmUfNk97lXj 41HTN/85h0t5a2vrLIU8anHrCISNwS4wRSuoPUtkZln5rQimQS2y4BlYJfJZWjzsjfJ3 g12Q== X-Gm-Message-State: AHPjjUhASbcNIBS0hlCPBPl1Wud6Q7oYyqDVFfdBLsvsmoPkEqVHtMk8 jYUtl7IfNWlSY/Hrx2SAcveDKA== X-Google-Smtp-Source: AOwi7QDngvcpwgM7GALqmk51UnAYJnwO/RaOLPTi8O2GRS93ehJiawSVoU+wk0M+1C06c9RLBowq+w== X-Received: by 10.98.218.18 with SMTP id c18mr15389827pfh.256.1506979945205; Mon, 02 Oct 2017 14:32:25 -0700 (PDT) Received: from rajat.mtv.corp.google.com ([172.22.112.48]) by smtp.gmail.com with ESMTPSA id p127sm17832559pfp.168.2017.10.02.14.32.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Oct 2017 14:32:24 -0700 (PDT) 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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }