From patchwork Tue May 22 15:16:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10418963 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 46F1D6032A for ; Tue, 22 May 2018 15:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 383D628DE2 for ; Tue, 22 May 2018 15:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B65028DF3; Tue, 22 May 2018 15:17:08 +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=-5.4 required=2.0 tests=BAYES_00,FROM_WORDY, 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 8DD2328DE2 for ; Tue, 22 May 2018 15:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448AbeEVPRF (ORCPT ); Tue, 22 May 2018 11:17:05 -0400 Received: from mail1.bemta26.messagelabs.com ([85.158.142.1]:34048 "EHLO mail1.bemta26.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeEVPQ0 (ORCPT ); Tue, 22 May 2018 11:16:26 -0400 Received: from [85.158.142.104] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-1.bemta.az-a.eu-central-1.aws.symcld.net id 70/C5-26668-944340B5; Tue, 22 May 2018 15:16:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRWlGSWpSXmKPExsUSt3Opsa6nCUu 0wd4OfovmxevZLLpW72SxuLxrDpvF594jjBaLlrUyWzxZeIbJ4vTuEgd2j02rOtk85p0M9Ng/ dw27x87vDewenzfJBbBGsWbmJeVXJLBmrJh9jb3gBGfF+jXLmBoYV3B0MXJxCAmsZ5R48/gIW xcjJ5BTIfH14FZGEJtXIFNi9pceFhCbU8Bd4uKC84wQNW4Su9ZvYAKx2QQsJCafeADWyyKgKr H12UGwuLCAt0T/zKtg9SICGxgltq8IBbGZBeoken+/ZYGYLyhxcuYTFoi4hMTBFy+YIeYbSJx e0AgWlxCwl5j+/ipQnAPI1pdoPBYLETaU+D7rG1SJuUTT1pmMExgFZyGZOgvJ1AWMTKsYLZKK MtMzSnITM3N0DQ0MdA0NjXUNdM0t9RKrdBP1Ukt1k1PzSooSgZJ6ieXFesWVuck5KXp5qSWbG IGxwQAEOxhXfUk8xCjJwaQkyhv2lDlaiC8pP6UyI7E4I76oNCe1+BCjDAeHkgTvhDdAOcGi1P TUirTMHGCUwqQlOHiURHiPg6R5iwsSc4sz0yFSpxgVpcR5t4MkBEASGaV5cG2wxHCJUVZKmJc R6BAhnoLUotzMElT5V4ziHIxKwrzPQabwZOaVwE1/BbSYCWjxxeVgi0sSEVJSDYyNqvvkL0TG uzhYtDkvuZLg/3PHTtmc7Q5xPNefX93Ru8hN57nMlPWCEx2u7ln9ZUZ2S92LwOfNZ6RabAsrZ s2ffujihTP7ptkt92zouO+4/ujHlo13/v1eHFm/sLT2lEjHkvOvTuyud0wVrP6s5HnwdOqVC2 uTSq8G5Zd+KFv75fwpb/1vD3R2KrEUZyQaajEXFScCAKoI3R0HAwAA X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-36.tower-229.messagelabs.com!1527002185!660592!1 X-Originating-IP: [94.185.165.51] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.9.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22363 invoked from network); 22 May 2018 15:16:25 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-36.tower-229.messagelabs.com with AES128-SHA encrypted SMTP; 22 May 2018 15:16:25 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.382.0; Tue, 22 May 2018 16:16:24 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id B39E23FB77; Tue, 22 May 2018 16:16:24 +0100 (BST) Message-ID: <449707040719c8845cf9fa6bc779bae25fca54a5.1527000797.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Tue, 22 May 2018 16:16:24 +0100 Subject: [PATCH 2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Sebastian Reichel CC: , , , MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 22/05/2018 13:35:00 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For supply registration, provide fwnode pointer of the port device, via the power_supply_config structure, to allow other psy drivers to add us as a supplier. At present this only applies to DT based platforms using the 'power-supplies' DT property, but in the future should also work for ACPI platforms when the relevant support is added to the power_supply core. Signed-off-by: Adam Thomson Suggested-by: Heikki Krogerus Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tcpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 72996cc..0ccd2ce 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -4500,6 +4501,7 @@ static int devm_tcpm_psy_register(struct tcpm_port *port) char *psy_name; psy_cfg.drv_data = port; + psy_cfg.fwnode = dev_fwnode(port->dev); psy_name = devm_kzalloc(port->dev, psy_name_len, GFP_KERNEL); if (!psy_name) return -ENOMEM;