From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941716AbcLWWNF (ORCPT ); Fri, 23 Dec 2016 17:13:05 -0500 Received: from argos.tuxed.org ([176.9.87.227]:51048 "EHLO argos.tuxed.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbcLWWNB (ORCPT ); Fri, 23 Dec 2016 17:13:01 -0500 From: Alexander Koch To: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean Delvare , Guenter Roeck , Jiri Kosina , Alexander Koch Subject: [RFC PATCH v2 0/4] hwmon: adc128d818: Support missing operation modes Date: Fri, 23 Dec 2016 23:12:01 +0100 Message-Id: <20161223221205.8825-1-mail@alexanderkoch.net> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ADC128D818 offers four different chip operation modes which vary in the number and measurement types of the available input signals (see datasheet sec. 8.4.1). The current version of the driver only supports the default chip operation mode (mode 0), providing seven analog values and a temperature reading. This patch series adds support for operation modes 1-3, selectable through the device tree attribute 'mode': adc1: adc128d818@1d { compatible = "ti,adc128d818"; reg = <0x1d>; mode = /bits/ 8 <1>; }; The changes are transparent as 'mode' defaults to mode 0 which yields the previous behaviour. Changes from v1: - Add bindings document as first patch - Preserve logical atomicity of code changes - Improve sysfs device node handling (use is_visible() instead of duplicate attribute list) - Add trivial code refactoring stage for checkpatch.pl to succeed Alexander Koch (4): devicetree: hwmon: Add bindings for ADC128D818 hwmon: adc128d818: Implement mode selection via dt hwmon: adc128d818: Trivial code style fixup hwmon: adc128d818: Support operation modes 1-3 .../devicetree/bindings/hwmon/adc128d818.txt | 39 ++++ drivers/hwmon/adc128d818.c | 237 ++++++++++++--------- 2 files changed, 179 insertions(+), 97 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwmon/adc128d818.txt -- 2.11.0