Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3783610ybt; Tue, 23 Jun 2020 10:36:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmZbyhPVwcxR5GjzndSCf/hypefmXRys512jKMOswZnC9ut7Yp32sc6x9bbGh3xBZNc8s4 X-Received: by 2002:a50:d5db:: with SMTP id g27mr2729619edj.217.1592933764859; Tue, 23 Jun 2020 10:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592933764; cv=none; d=google.com; s=arc-20160816; b=IOlaPNPD3hkB/1lSXDuN0Kv6HP4S1OMiLJqRMDsguInVkP/q3klrMiQcx24ME2G33w mK49a652uD1vmqNsYVhRK0deGLleLpj2z/06YvWt/inXVCt32oZSUheAbEl3asb3LKNv OSwZN78c174QzCgHS5YCEHR5ex5vYyDmqJvOL9aetQ39dSptAiJ5aNjf+Kz9abNiRQEp Ri5VSajJMebLRc3UhJ/6htxxMcxNdhAnTaaDzZ6F8NgrFtZc4n86t1zw2f+6wjYxrLzL JkFIGCPBHN+Mq/lU8gxiXRmIXLACBHCi+wA0fGnxHWSTSxfi1GeOoBoaADl4UeIowHT5 JYyQ== 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=MQcNUBPbn6Rp81SdKVV8NmVTCm2SLqgJw1yxAWR/sF8=; b=xFUgsl2LEBIh6cwhsaoEePDoJN+OWJIScgwv/YhHKILE8KvIMaQr/qg0KxpzTt4555 gJAoHy797XDLy++P+gaY9U4bwWSuzEkk9DgvzyATeEfmKcxDrXETicCGX8OwMNVtTmiJ SWiEW9jKjfCX/uvo7lz901bb1AaxsQxRDQgA5yeyyPP7VmfubFB7YO6vZGUE2VWiKghD EpnKsgnQfeqcQ9UtHF0Fxx31Vq6K14Fr9wPXWJqkXRgixAt335HSE1dXWLknHAlALmPq WgoBptD2+iv3NZtHOQUNEnwo13seyXv2VTbnsWkEDFc/Oe8Sok2/KZqkOTazCTLVFhRJ H0bA== 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 ci18si5384625ejb.0.2020.06.23.10.35.41; Tue, 23 Jun 2020 10:36:04 -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 S1733141AbgFWRfX (ORCPT + 99 others); Tue, 23 Jun 2020 13:35:23 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:23920 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733045AbgFWRfV (ORCPT ); Tue, 23 Jun 2020 13:35:21 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05NHNRKr031355; Tue, 23 Jun 2020 13:35:04 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com with ESMTP id 31uk3grq2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jun 2020 13:35:03 -0400 Received: from ASHBMBX9.ad.analog.com (ashbmbx9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 05NHZ202031562 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Tue, 23 Jun 2020 13:35:02 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Tue, 23 Jun 2020 13:35:01 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Tue, 23 Jun 2020 13:35:01 -0400 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 05NHYxMP017521; Tue, 23 Jun 2020 13:34:59 -0400 From: To: , , CC: , , Alexandru Tachici Subject: [PATCH v4 0/7] hwmon: pmbus: adm1266: add support Date: Tue, 23 Jun 2020 20:36:52 +0300 Message-ID: <20200623173659.41358-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-23_11:2020-06-23,2020-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006120000 definitions=main-2006230123 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 .../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