Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1122371imm; Fri, 29 Jun 2018 11:46:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKS5e+/iqqyJrRwdM5fXWjpALWKrGib1JcSalK31RVZelLpsYMvlkIz/5yOsUMkp9Kg5MOA X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr16196044plh.291.1530298011483; Fri, 29 Jun 2018 11:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530298011; cv=none; d=google.com; s=arc-20160816; b=LROpuvwY7ZbFqXc4+g3j5J67upxi4mVyWboDzAkdpRJFBR4HNW/lE19fCcdLrOuAKW iWGzVJ7sOfyBw6HuS0sR2PHP4kIUPAm49vxWcO1V+ACAG3iYz+yNTLPVW8RFrhgyXLpP CAATmH0DtXOQ1LG0QpPzyOgakBZhSWLxaRjfcTp8Zj61rohJOxfg+xxii5SQ3+4uXn3x jwO7c27x/vRe7o3m5xyEiLc2/LPEmwBxpZYuGOc1pmmHSy4qQ8Qa6QC4IE55YHI8Tuap fufVhqkMipn72yW06Tw1ZtcOLmJZ5fZlyaIiAdO8drNyQ/zVzG6zgJW5axYbmi7T4MkZ emhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+I0gG2WZ8JhpXbNfzw6Sple9HJ/Qr5rWeej0tFRTSFc=; b=0lUiDKbO411pMjGSzmKtstbP+rZDcL8Nl70mUWopWpGmkTCUegAkFgBSQaGMFYyPfd YJ5qqnaNnaAoq5iEq4omdP3qif0ls9VoqWjefDySLGDRJBm6n4eYs/YzADFBqoBb4oTz H11RwWyV0dzcYsSo+r/bbkDEyJm/JZ0tescIvTavtE8VJWPyNspOe3VxQWeQ/za3LgT6 CsaBHlApwcvZ08BFDeBOACsRvtArKJxq71+shmmsdEeDJgRMG3Nm5wI9mk+ZiEncFawg nt+cJCOW57vKNzdziZwj/RivH/h2UerzeuNRPcswmCzDfrcAWENxe3M7fUuuYblr46DL CHHQ== 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 g65-v6si10060206pfc.330.2018.06.29.11.46.34; Fri, 29 Jun 2018 11:46:51 -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 S934967AbeF2RfR (ORCPT + 99 others); Fri, 29 Jun 2018 13:35:17 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:41274 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbeF2RfP (ORCPT ); Fri, 29 Jun 2018 13:35:15 -0400 Received: from [192.168.178.170] (pD95EF0F3.dip0.t-ipconnect.de [217.94.240.243]) by mail.bugwerft.de (Postfix) with ESMTPSA id D00FB28C416; Fri, 29 Jun 2018 17:31:58 +0000 (UTC) Subject: Re: [PATCH v3 0/4] Add devicetree functionality to w1 busses and ds2760 To: zbr@ioremap.net, robh+dt@kernel.org, mark.rutland@arm.com, szabolcs.gyurko@tlt.hu Cc: sre@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, robert.jarzmik@free.fr References: <20180629173137.12690-1-daniel@zonque.org> From: Daniel Mack Message-ID: <48c3d0fd-7a31-3531-044c-3cbd307771c8@zonque.org> Date: Fri, 29 Jun 2018 19:35:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180629173137.12690-1-daniel@zonque.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, June 29, 2018 07:31 PM, Daniel Mack wrote: > This patch set contains four small patches that bring devicetree > functionality to w1 bus masters and slaves in general. As an example, > the DS2760 driver is made aware of devicetree nodes as an example. > Other drivers can easily be ported later. > > W1 masters scan their bus in order to discover slave devices. Once > one is found, a driver matching the family of the device is instanciated > which handles it. > > All that's needed for now is a call to of_find_matching_node() when > a slave device is attached, so the corresponding of_node pointer is > set. > > The series also contains a patch that merges the w1 slave driver for the > DS2760 battery monitor into its only user, the ds2760 supply driver. > The indirection with two drivers never had any benefit, and here is > a good opportunity to clean this up. > > Patch #1 adds some DT bindings documentation > Patch #2 adds the call to of_find_matching_node() > Patch #3 merges the w1 slave and the supply driver for ds2760 > Patch #4 makes the ds2760 supply driver aware of DT environments > > This works fine on a PXA3xx based board with a battery attached to > the w1-gpio bus master controller. Sorry, I messed up the patch statistics in the cover letter. Here is the correct version: .../bindings/power/supply/maxim,ds2760.txt | 29 ++ .../devicetree/bindings/w1/w1-gpio.txt | 6 + Documentation/devicetree/bindings/w1/w1.txt | 18 + drivers/power/supply/Kconfig | 2 +- drivers/power/supply/ds2760_battery.c | 351 +++++++++++++----- drivers/w1/slaves/Kconfig | 12 - drivers/w1/slaves/Makefile | 1 - drivers/w1/slaves/w1_ds2760.c | 175 --------- drivers/w1/slaves/w1_ds2760.h | 59 --- drivers/w1/w1.c | 3 + include/linux/w1.h | 2 + 11 files changed, 320 insertions(+), 338 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/maxim,ds2760.txt create mode 100644 Documentation/devicetree/bindings/w1/w1.txt delete mode 100644 drivers/w1/slaves/w1_ds2760.c delete mode 100644 drivers/w1/slaves/w1_ds2760.h