From patchwork Wed Apr 24 10:19:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10914449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5805E1708 for ; Wed, 24 Apr 2019 10:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45DF528867 for ; Wed, 24 Apr 2019 10:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E29028A74; Wed, 24 Apr 2019 10:20:35 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E971428A70 for ; Wed, 24 Apr 2019 10:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728397AbfDXKUE (ORCPT ); Wed, 24 Apr 2019 06:20:04 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:54128 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726443AbfDXKUD (ORCPT ); Wed, 24 Apr 2019 06:20:03 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OA6f7K003010; Wed, 24 Apr 2019 12:19:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=1qyx5n5yMrkv5gfN2MwhOkJMoRwpnipFKGrbpD1y6Rg=; b=1j7bAZKq4hNou+vSEorHQH8RdwSRNQmiMDJ0lwnIy5Gw3qGncRydV5tDwXJMDbYJlGJu cyPsSTodyG/HbIttpP0lfPNSqCxf5C+wWLnD6KI6/fnGWXyi/XPH/+xiLaP6cosZ0Djl FIkUu3sjUgYAbP9WiftplJeJwtLy/SHOXzsWc3W1JMZwYmbCtWy0G3Rh4phRpg9k2t+b sKkpV65/0EXLJk/X842+l7EbH/6vxG2bl1pl8nqjZ4WObLNPKIUfKQob+EqmJlmQ84FM sVTIroyGQ+4486lDSmsdQMwFmoVf7TQ94dwYhIutCcEjoM7xYm2/B7Gh+mvwFPGFjbWT yA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rytad5uaw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 12:19:51 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 090CB3D; Wed, 24 Apr 2019 10:19:32 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A978D1656; Wed, 24 Apr 2019 10:19:32 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 12:19:32 +0200 Received: from localhost (10.201.20.122) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 12:19:30 +0200 From: Benjamin Gaignard To: , , , , , , , , , CC: , , , , , Benjamin Gaignard Subject: [PATCH 1/5] of/device: Add of_ functions for device_link_{add,remove} Date: Wed, 24 Apr 2019 12:19:09 +0200 Message-ID: <20190424101913.1534-2-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com> References: <20190424101913.1534-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_07:,, signatures=0 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 Allows to create and remove links between consumer and suppliers from device-tree data. Use 'links-add' property from consumer node to setup a link with a list of suppliers. Consumers will be suspend before their suppliers and resume after them. Add devm_of_device_links_add() to automatically remove the links when the device is unbound from the bus. Signed-off-by: Benjamin Gaignard --- drivers/of/device.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/of_device.h | 20 +++++++++ 2 files changed, 123 insertions(+) diff --git a/drivers/of/device.c b/drivers/of/device.c index 3717f2a20d0d..011ba9bf7642 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -336,3 +336,106 @@ int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) return 0; } EXPORT_SYMBOL_GPL(of_device_uevent_modalias); + +/** + * of_device_links_add - Create links between consumer and suppliers from + * device tree data + * + * @consumer: consumer device + * + * Returns 0 on success, < 0 on failure. + */ +int of_device_links_add(struct device *consumer) +{ + struct device_node *np; + struct platform_device *pdev; + int i = 0; + + np = of_parse_phandle(consumer->of_node, "links-add", i++); + while (np) { + pdev = of_find_device_by_node(np); + of_node_put(np); + if (!pdev) + return -EINVAL; + + device_link_add(consumer, &pdev->dev, DL_FLAG_STATELESS); + platform_device_put(pdev); + + np = of_parse_phandle(consumer->of_node, "links-add", i++); + } + + return 0; +} +EXPORT_SYMBOL_GPL(of_device_links_add); + +/** + * of_device_links_remove - Remove links between consumer and suppliers from + * device tree data + * + * @consumer: consumer device + * + * Returns 0 on success, < 0 on failure. + */ +int of_device_links_remove(struct device *consumer) +{ + struct device_node *np; + struct platform_device *pdev; + int i = 0; + + np = of_parse_phandle(consumer->of_node, "links-add", i++); + while (np) { + pdev = of_find_device_by_node(np); + of_node_put(np); + if (!pdev) + return -EINVAL; + + device_link_remove(consumer, &pdev->dev); + platform_device_put(pdev); + + np = of_parse_phandle(consumer->of_node, "links-add", i++); + } + + return 0; +} +EXPORT_SYMBOL_GPL(of_device_links_remove); + +static void devm_of_device_links_remove(struct device *dev, void *res) +{ + of_device_links_remove(*(struct device **)res); +} + +/** + * devm_of_device_links_add - Create links between consumer and suppliers + * from device tree data + * + * @consumer: consumer device + * + * Returns 0 on success, < 0 on failure. + * + * Similar to of_device_links_add(), but will automatically call + * of_device_links_remove() when the device is unbound from the bus. + */ +int devm_of_device_links_add(struct device *consumer) +{ + struct device **ptr; + int ret; + + if (!consumer) + return -EINVAL; + + ptr = devres_alloc(devm_of_device_links_remove, + sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return -ENOMEM; + + ret = of_device_links_add(consumer); + if (ret < 0) { + devres_free(ptr); + } else { + *ptr = consumer; + devres_add(consumer, ptr); + } + + return ret; +} +EXPORT_SYMBOL_GPL(devm_of_device_links_add); diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 8d31e39dd564..ad01db6828e8 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -41,6 +41,11 @@ extern int of_device_request_module(struct device *dev); extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env); extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env); + +extern int of_device_links_add(struct device *consumer); +extern int of_device_links_remove(struct device *consumer); +extern int devm_of_device_links_add(struct device *consumer); + static inline void of_device_node_put(struct device *dev) { of_node_put(dev->of_node); @@ -91,6 +96,21 @@ static inline int of_device_uevent_modalias(struct device *dev, return -ENODEV; } +static int of_device_links_add(struct device *consumer) +{ + return 0; +} + +static int of_device_links_remove(struct device *consumer) +{ + return 0; +} + +static int devm_of_device_links_add(struct device *consumer) +{ + return 0; +} + static inline void of_device_node_put(struct device *dev) { } static inline const struct of_device_id *__of_match_device( From patchwork Wed Apr 24 10:19:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10914451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 095C7922 for ; Wed, 24 Apr 2019 10:20:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBDC228701 for ; Wed, 24 Apr 2019 10:20:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFBC328A6F; Wed, 24 Apr 2019 10:20:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 5C61428701 for ; Wed, 24 Apr 2019 10:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbfDXKUX (ORCPT ); Wed, 24 Apr 2019 06:20:23 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:6548 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728240AbfDXKTz (ORCPT ); Wed, 24 Apr 2019 06:19:55 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OAC0jO018520; Wed, 24 Apr 2019 12:19:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=Cbc0YIbEUhbrtU+nyGINJRnGD+3NLVyE/JTC+hG8FKc=; b=ptRNFfKAfiaQe36Lo66WMopSllyXGVMqa+qYMjelZJmbhB6r9QoHWTCymk2RWe7Ow2B4 jMbt38kq7iE5mp40l+GwqUA4vnvbCPM0+9ITK4B+dj37CqVf416osS8S+blmBUoM7hCC hehTtJ5+2tQxpD5bIXQCgcY5OHhvR/v63sf50mkqtve52/f5EM08jJEk4shERMdAAVsm ofzpAL4DIElhreEYlIVig7+RNA0OopHq2aehlOR1PG1i9h24xPh1AVCR6pmK3rMnHf5/ bQEriWtKAnJrC3mjojWJxP1oR/5kKDJt4nqdLbf4YEzk9rX+LRCm5eNOPUyqKVT2iubg Gw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2ryrj6687h-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 12:19:37 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2CD2E3F; Wed, 24 Apr 2019 10:19:36 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EF6421654; Wed, 24 Apr 2019 10:19:35 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 12:19:35 +0200 Received: from localhost (10.201.20.122) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 12:19:33 +0200 From: Benjamin Gaignard To: , , , , , , , , , CC: , , , , , Benjamin Gaignard Subject: [PATCH 2/5] Input: edt-ft5x06: Document links-add property Date: Wed, 24 Apr 2019 12:19:10 +0200 Message-ID: <20190424101913.1534-3-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com> References: <20190424101913.1534-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_07:,, signatures=0 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 Explain the purpose of links_add property. Signed-off-by: Benjamin Gaignard --- Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt index 870b8c5cce9b..38b84d2b32e6 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt @@ -60,6 +60,8 @@ Optional properties: - touchscreen-inverted-x : See touchscreen.txt - touchscreen-inverted-y : See touchscreen.txt - touchscreen-swapped-x-y : See touchscreen.txt + - links-add : List of suppliers handles, suppliers will be + suspended after touchscreen device and resume before it. Example: polytouch: edt-ft5x06@38 { From patchwork Wed Apr 24 10:19:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10914441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14943922 for ; Wed, 24 Apr 2019 10:19:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02C26286E0 for ; Wed, 24 Apr 2019 10:19:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9F2828701; Wed, 24 Apr 2019 10:19:55 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 5E846287FA for ; Wed, 24 Apr 2019 10:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728258AbfDXKTy (ORCPT ); Wed, 24 Apr 2019 06:19:54 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:21652 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfDXKTy (ORCPT ); Wed, 24 Apr 2019 06:19:54 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OAI3L2023663; Wed, 24 Apr 2019 12:19:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=7Auhlb+EZOSaqeM3ITlq3V+bUysVL60SvofLk1lpDJs=; b=ie7++s9Tq+m/dQSH0sNjCb8h6CY4huq/CaCjoZvQdI5m3Ro3rjhv6CPoE8RZW9sKTzun QozPEtJwYWk6apPMQBcQmgWZno0U3FlrOg+2C1M/YAc9BsFPh5iC5QQwTmS878Gl0gjy fd+79z27KjNXz0Clfnkgy9M2VZlmXTQvHPAJPZslgNWwFvQyVceviDfuEBcfFgTeqsoM +f2SJBJ0V3yN39LPKJfZ7kcXxoUKFtHYPjuGMAOyXQtwsYk8Ehi8NwQna8VMXBWkU3Jp aO6rntNPBsbjGpM+uP07/RTt8+kxlUk4BHvFJSpl3je7ZNH9tjR1GUEIp0YDeibiArOo lg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2rys6rvs6m-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 12:19:39 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 16CBE41; Wed, 24 Apr 2019 10:19:39 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E48291654; Wed, 24 Apr 2019 10:19:38 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 12:19:38 +0200 Received: from localhost (10.201.20.122) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 12:19:36 +0200 From: Benjamin Gaignard To: , , , , , , , , , CC: , , , , , Benjamin Gaignard Subject: [PATCH 3/5] input: edt-ft5x06 - Call devm_of_device_links_add() to create links Date: Wed, 24 Apr 2019 12:19:11 +0200 Message-ID: <20190424101913.1534-4-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com> References: <20190424101913.1534-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_07:,, signatures=0 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 From: Yannick Fertré Add a call to devm_of_device_links_add() to create links with suppliers at probe time. Signed-off-by: Yannick Fertré Signed-off-by: Benjamin Gaignard --- drivers/input/touchscreen/edt-ft5x06.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 702bfda7ee77..ac9f7e85efb0 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1167,6 +1167,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, i2c_set_clientdata(client, tsdata); + devm_of_device_links_add(&client->dev); + irq_flags = irq_get_trigger_type(client->irq); if (irq_flags == IRQF_TRIGGER_NONE) irq_flags = IRQF_TRIGGER_FALLING; From patchwork Wed Apr 24 10:19:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10914443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C277A1515 for ; Wed, 24 Apr 2019 10:20:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE8F628867 for ; Wed, 24 Apr 2019 10:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B3D628A72; Wed, 24 Apr 2019 10:20:34 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI 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 63D3428867 for ; Wed, 24 Apr 2019 10:20:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726039AbfDXKT6 (ORCPT ); Wed, 24 Apr 2019 06:19:58 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:15904 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728254AbfDXKT4 (ORCPT ); Wed, 24 Apr 2019 06:19:56 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OA6nMV020600; Wed, 24 Apr 2019 12:19:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=DZCGDDaeC9/R/3CsQpYN8bY55QcNjOX1xXG1bktllLY=; b=RSJuy2TQJOZGWY/pQgtebRrvZuv/Cw1I9vp1ASP0jxS2CAZdcqzhSkUekVlqAK4EUhja MHKxkROwJdhG613iUyepe5gMnK9nQxgpsYYiwH8RVrB7aX3M8Izzq5KD3LJ8y0ab8+6w MX7/FHEcNE5jamKtnkJSMe83jb8Hd73R7MyAp6sU0rJ1ov/ZtI2aWpE6BSRUqhIRCJn0 URzgADy7vvds6FerGUKQmDUea4DKUFzb46YdtbWWfj7M5xKWSaz8uTnKz9PNrwAOWvk5 vGnrFxu07NMgT2edfmjBJdeoOyqMcMLoBl85uSZbAZOKROycC3T7/DoIo/j/NshBvHMc Dg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2ryrvxcus6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 12:19:43 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BB0AD41; Wed, 24 Apr 2019 10:19:42 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 86F03164C; Wed, 24 Apr 2019 10:19:42 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 12:19:42 +0200 Received: from localhost (10.201.20.122) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 12:19:39 +0200 From: Benjamin Gaignard To: , , , , , , , , , CC: , , , , , Benjamin Gaignard Subject: [PATCH 4/5] Input: goodix: Document links-add property Date: Wed, 24 Apr 2019 12:19:12 +0200 Message-ID: <20190424101913.1534-5-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com> References: <20190424101913.1534-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_07:,, signatures=0 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 Explain the purpose of links_add property. Signed-off-by: Benjamin Gaignard --- Documentation/devicetree/bindings/input/touchscreen/goodix.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt index 8cf0b4d38a7e..0447151608c6 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/goodix.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/goodix.txt @@ -24,6 +24,8 @@ Optional properties: - touchscreen-size-x - touchscreen-size-y - touchscreen-swapped-x-y + - links-add : List of suppliers handles, suppliers will be + suspended after goodix device and resume before it. The touchscreen-* properties are documented in touchscreen.txt in this directory. From patchwork Wed Apr 24 10:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 10914445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0154B922 for ; Wed, 24 Apr 2019 10:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3C8428867 for ; Wed, 24 Apr 2019 10:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D782728A71; Wed, 24 Apr 2019 10:20:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 86AE428701 for ; Wed, 24 Apr 2019 10:20:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbfDXKUK (ORCPT ); Wed, 24 Apr 2019 06:20:10 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:54164 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728254AbfDXKUJ (ORCPT ); Wed, 24 Apr 2019 06:20:09 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OAJwBK012732; Wed, 24 Apr 2019 12:19:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=bu+FSSjL3xpYfr+iGtfEQuju6aILlJj4WyU2xE6oOeo=; b=lEzuZVIw0jUl623w6v6mXcpjyoC9rtmVEepCEWXaArJ33dbZb1ONwwS4mm+XlxhyCwqB GEIN7IfPZhT9s++dhMO/3ZO/3cxxvQ+/1QAwHZyJLDRgE8HKUePNH4wO/AxMgqB3LgJt C25u9xl0IzrT327KCCg+szDLGaGE3IjqJ0bH3lFN0QGF1n08RsZ6C44jjAdgBvDHW+fE LMHPZ1o/dOh8Yht//c/Hi+Fe68ti+YcE+DgP6Sx4Ef5xTzRzSPIA0e7VPU4DvL4LY8TG Zy+uKvKu0QA0ukl2660tNDc/k8dF2ZSDtRBaJC/uBq0npR2thU4sGxsfs82SIcgGsA13 fA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rytad5ubw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 12:19:59 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3A20138; Wed, 24 Apr 2019 10:19:46 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 180E21653; Wed, 24 Apr 2019 10:19:46 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 12:19:45 +0200 Received: from localhost (10.201.20.122) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 12:19:43 +0200 From: Benjamin Gaignard To: , , , , , , , , , CC: , , , , , Benjamin Gaignard Subject: [PATCH 5/5] input: goodix - Call devm_of_device_links_add() to create links Date: Wed, 24 Apr 2019 12:19:13 +0200 Message-ID: <20190424101913.1534-6-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com> References: <20190424101913.1534-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.122] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_07:,, signatures=0 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 From: Yannick Fertré Add a call to devm_of_device_links_add() to create links with suppliers at probe time. Signed-off-by: Yannick Fertré Signed-off-by: Benjamin Gaignard --- drivers/input/touchscreen/goodix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index f57d82220a88..9aefbfa39319 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -30,6 +30,7 @@ #include #include #include +#include #include struct goodix_ts_data; @@ -812,6 +813,8 @@ static int goodix_ts_probe(struct i2c_client *client, ts->chip = goodix_get_chip_data(ts->id); + devm_of_device_links_add(&client->dev); + if (ts->gpiod_int && ts->gpiod_rst) { /* update device config */ ts->cfg_name = devm_kasprintf(&client->dev, GFP_KERNEL,