Received: by 10.192.165.156 with SMTP id m28csp1123534imm; Wed, 11 Apr 2018 12:53:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+9mzuFYdXnI5PGKeEkxPhcl17k6Ux1r8K5WMJm5r2euF8DouTePWMWQ10nDuPxV5KIyXIS X-Received: by 2002:a17:902:2be4:: with SMTP id l91-v6mr6670264plb.102.1523476425855; Wed, 11 Apr 2018 12:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523476425; cv=none; d=google.com; s=arc-20160816; b=kpP4h26KYRvhQ/i4Ziq8+toLy7iP+n2gzmezQ86uAWlqPo0PMxZxWfpmVC4CqHMbxg A8eRq9TbXFrGzMqOS6E7X8okbgiis7770hHJgPEEzXIUnipaWWZv7Imsp1x2htEGg2wy pzMnD4XZuIzb2HRgDXNbqZBrQk6ti18KWIIgqo6/Zon/egjMxTnO4hWicvdYU6UVJFKG LmSDPiBb3dj2J7aFh/Zei4rwssCkEGmCzDmIzeNb8O8aXcwZcFFCv5j6ZkkMhoZMMz1/ Un463/fXh/3pCqyC4GX0nTId2xlqxR2tFCNZLTHiBhQjUJuFO8tJUPqSynznyZAAZVdo 7RqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pw0L0D0Zt7XYPgtEzdnK0QmWVLxPwtIvQnksFIoL2/g=; b=yXRO4ZFFlkUHwfakqjue/rKnVMbN6YrSYP49iYSa3CogHadkEwD9UHwHP3yxbOteqT dMHhCfG63np3QTyLIbHy/luJF6AEU7bSG4+utCcpMaX+bM6bo6NwuUwVksgGFPAqmhdW L86XAlzZyMu2NnvxHK/PZZR3fGv4eT4nxqZJOmZ7FUiad8yModdULLgn8ENa3VsLJ9YE O8SmushHb1bOVyWxf9Gls0Ogl3afRm0dqREysPpUouZM4vuzDPVqFb1t/Zkv/nsngydh U50zZRQ03oJvoByjQM7owwotCxHAOaNNnOKbRF7w1irFsQqAOws1zBPu5uE9Ii5Uv+2I EMJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4si1179497pgf.469.2018.04.11.12.53.09; Wed, 11 Apr 2018 12:53:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934095AbeDKS71 (ORCPT + 99 others); Wed, 11 Apr 2018 14:59:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37390 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932894AbeDKS7Y (ORCPT ); Wed, 11 Apr 2018 14:59:24 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D498195E; Wed, 11 Apr 2018 18:59:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Tissoires , Hans de Goede , Jiri Kosina , Sasha Levin Subject: [PATCH 4.9 151/310] HID: i2c: Call acpi_device_fix_up_power for ACPI-enumerated devices Date: Wed, 11 Apr 2018 20:34:50 +0200 Message-Id: <20180411183628.929142612@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit f3d3eab667de62572376abb1aa26316191c39929 ] For ACPI devices which do not have a _PSC method, the ACPI subsys cannot query their initial state at boot, so these devices are assumed to have been put in D0 by the BIOS, but for touchscreens that is not always true. This commit adds a call to acpi_device_fix_up_power to explicitly put devices without a _PSC method into D0 state (for devices with a _PSC method it is a nop). Note we only need to do this on probe, after a resume the ACPI subsys knows the device is in D3 and will properly put it in D0. This fixes the SIS0817 i2c-hid touchscreen on a Peaq C1010 2-in-1 device failing to probe with a "hid_descr_cmd failed" error. Acked-by: Benjamin Tissoires Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hid/i2c-hid/i2c-hid.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -968,6 +968,15 @@ static int i2c_hid_acpi_pdata(struct i2c return ret < 0 && ret != -ENXIO ? ret : 0; } +static void i2c_hid_acpi_fix_up_power(struct device *dev) +{ + acpi_handle handle = ACPI_HANDLE(dev); + struct acpi_device *adev; + + if (handle && acpi_bus_get_device(handle, &adev) == 0) + acpi_device_fix_up_power(adev); +} + static const struct acpi_device_id i2c_hid_acpi_match[] = { {"ACPI0C50", 0 }, {"PNP0C50", 0 }, @@ -980,6 +989,8 @@ static inline int i2c_hid_acpi_pdata(str { return -ENODEV; } + +static inline void i2c_hid_acpi_fix_up_power(struct device *dev) {} #endif #ifdef CONFIG_OF @@ -1082,6 +1093,8 @@ static int i2c_hid_probe(struct i2c_clie if (ret < 0) goto err; + i2c_hid_acpi_fix_up_power(&client->dev); + pm_runtime_get_noresume(&client->dev); pm_runtime_set_active(&client->dev); pm_runtime_enable(&client->dev);