Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp663310ybt; Wed, 24 Jun 2020 08:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDohqmphm3T3vNe14pFgjaSOOuigmqcuee3PDdoHB79ykb4Njpli+X2g0llBJs2H+RLoLv X-Received: by 2002:aa7:d3cd:: with SMTP id o13mr13128101edr.176.1593011822199; Wed, 24 Jun 2020 08:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593011822; cv=none; d=google.com; s=arc-20160816; b=0/F0fsCalRvHgd9aaO9xQeqHON2Xf9gNFO0IlIF+nMYiUgP7m9ls40PLKaUe3qpVHm 209rfMW1di5Ewqc+2dpZI4hCHunL9aCOe567fGHmVJPUMz9efm3Vb2mb+RC3tACfJdUG bSEscb5+NmF+0ZRRzsXfIqvO/UZBFxkmUvkP8dv5QxQRrslWQonNVs239PGZG1EZPATK I9lUnAbmDdtFBTy4LdD6L259LziwViG6Nnt+9Fh+OcPreeAsnXGkCX/YxrpUnSvzhkz2 ePtEuKzfY51qZuU+75JMTq9GGdoWK1wUQyH02qVmHdnJA72illXH4Y27EOokI70+SCMk 724A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Hxi6IY1GydAtO/7pX5uZIo3/cYhO86idJG41GPsO+MY=; b=AHHkqqWNbc51MpFnMJvV5e2SCXARzeevgbLK1ds/Wv2JAu1aB6X0GB4reDbCOifcxI SqVFc951zEBtpWxnINB0WQMkW3tCGGcH97gKFbz9bpiddlRkm/umR1peuzoGJI0TSt5c XyIUVv+ffMW0Usnt5UhzhSJwB5NijOgZmqjPR0mHNI05iu8DsJa4CGGfwTGD5NC9qNLB kmUB2wb1hsABzBDZCJqJwbGv+vi+L2KfA+UH2EfoBe4RT6a6FYbHb41QQSRFOMpnf/oJ dJ0Jl4TPLIHRpLPrGOFhC4uma2WNItma0GuwXp4qsT7238qS4VdZVmIGSXlMUeJQyOME Lyqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si14405816edv.190.2020.06.24.08.16.38; Wed, 24 Jun 2020 08:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404521AbgFXPQI (ORCPT + 99 others); Wed, 24 Jun 2020 11:16:08 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:60534 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404507AbgFXPQC (ORCPT ); Wed, 24 Jun 2020 11:16:02 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05OEtAIv019590; Wed, 24 Jun 2020 11:15:45 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 31uurjjgb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jun 2020 11:15:45 -0400 Received: from SCSQMBX11.ad.analog.com (scsqmbx11.ad.analog.com [10.77.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 05OFFhNt012583 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Wed, 24 Jun 2020 11:15:44 -0400 Received: from SCSQCASHYB7.ad.analog.com (10.77.17.133) by SCSQMBX11.ad.analog.com (10.77.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 24 Jun 2020 08:15:42 -0700 Received: from SCSQMBX11.ad.analog.com (10.77.17.10) by SCSQCASHYB7.ad.analog.com (10.77.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 24 Jun 2020 08:15:42 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by SCSQMBX11.ad.analog.com (10.77.17.10) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Wed, 24 Jun 2020 08:15:42 -0700 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 05OFFdRp023607; Wed, 24 Jun 2020 11:15:39 -0400 From: To: , , CC: , , Alexandru Tachici Subject: [PATCH v5 0/7] hwmon: pmbus: adm1266: add support Date: Wed, 24 Jun 2020 18:17:29 +0300 Message-ID: <20200624151736.95785-1-alexandru.tachici@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-ADIRoutedOnPrem: True X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-24_08:2020-06-24,2020-06-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 priorityscore=1501 cotscore=-2147483648 bulkscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006240107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandru Tachici Add PMBus probing driver for the adm1266 Cascadable Super Sequencer with Margin Control and Fault Recording. Driver is using the pmbus_core, creating sysfs files under hwmon for inputs: vh1->vh4 and vp1->vp13. 1. Add PMBus probing driver for inputs vh1->vh4 and vp1->vp13. 2. Add Block Write-Read Process Call command. A PMBus specific implementation was required because block write with I2C_SMBUS_PROC_CALL flag allows a maximum of 32 bytes to be received. 3. This makes adm1266 driver expose GPIOs to user-space. Currently are read only. Future developments on the firmware will allow them to be writable. 4. Add two ioctl commands for issuing GO_COMMAND and reading the state of the adm1266 sequencer. 5. Blackboxes are 64 bytes of chip state related data that is generated on faults. Use the nvmem kernel api to expose the blackbox chip functionality to userspace. 6. Expose BLACKBOX_INFO register through debugfs. 7. Device tree bindings for ADM1266. Alexandru Tachici (7): hwmon: pmbus: adm1266: add support hwmon: pmbus: adm1266: Add Block process call hwmon: pmbus: adm1266: Add support for GPIOs hwmon: pmbus: adm1266: Add ioctl commands hwmon: pmbus: adm1266: read blackbox hwmon: pmbus: adm1266: debugfs for blackbox info dt-bindings: hwmon: Add bindings for ADM1266 Changelog v3 -> v4: - moved pmbus_block_wr (pmbus process call) from pmbus_core. to adm1266.c and renamed to pmbus_block_xfer - in pmbus_block_xfer: fixed buffer size bug (from 255 to 257) - in adm1266_gpio_get_multiple: handle pdios and gpios one at a time to lower allocated space on stack - in adm1266_gpio_dbg_show: replaced write_buf with u8 write_cmd var - in adm1266_gpio_dbg_show: check number of bytes received from device returned by pmbus_block_xfer. - now use ioctl to send GO_COMMAND and retrieve current state of adm1266 - split blackbox commit into blackbox nvmem implementation and debugfs blackbox info debugfs - create adm1266 debugfs dir under /sys/kernel/debug/pmbus/hwmon for blackbox_info Changelog v4 -> v5: - added WITH Linux-syscall-note to adm1266.h .../bindings/hwmon/adi,adm1266.yaml | 56 ++ Documentation/hwmon/adm1266.rst | 50 ++ .../userspace-api/ioctl/ioctl-number.rst | 1 + drivers/hwmon/pmbus/Kconfig | 10 + drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/adm1266.c | 657 ++++++++++++++++++ include/uapi/linux/adm1266.h | 16 + 7 files changed, 791 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/adi,adm1266.yaml create mode 100644 Documentation/hwmon/adm1266.rst create mode 100644 drivers/hwmon/pmbus/adm1266.c create mode 100644 include/uapi/linux/adm1266.h -- 2.20.1