From patchwork Thu Feb 22 01:13:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 20764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1397758dyc; Wed, 21 Feb 2024 17:15:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9VjjHiwK6iCwH/QJTTOTgEr/SDaZAc7Wwbs738YIE1rx2MiPx4Cf/qYZeKcO7glfeyA/U0St0DLi5j5yYPJaRDs/2Hg== X-Google-Smtp-Source: AGHT+IEfcirMb4LLV1ErSvNXk+vCp255xgOpHUrTt1VNrWnZ8mdeoMcs/ShGdzdcgn5Lmr1MWFY3 X-Received: by 2002:a9d:5f16:0:b0:6e2:e71b:14ac with SMTP id f22-20020a9d5f16000000b006e2e71b14acmr19270882oti.29.1708564525129; Wed, 21 Feb 2024 17:15:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708564525; cv=pass; d=google.com; s=arc-20160816; b=DIQjxLRzqEqKCYhQFUq1pCZJUVafWz30HRdNSJRzVC+amGfNR1Mk5TdTg0EPnP30JC AnS9M1xoO95Mu6S5c2daCybbmslDM6dFzRjMAdB5knKJ1DDs6L+JkQ9kQXCb9idEEUKR q71reWL4swPLyKspT7Xk753anTRDBujaHfoNNmcnKrLEtAVIflepT93rrq7VEmbZguaD zm+nK2W74ijN7GUFQkGsfetNCZG8etrk9HvDhtmJ1AFHWvhpyyystm8XrGhfJeTuKyAP q0djA/DCwWd1etKR2Zvm1Zkgt0MqQ2CiqUH/iDB9WKWXIsf1GvwsWv+B9fpWCoHxoY3M 3wLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Fy73s2NmZ/bK2y/AO2g+SQbAiRmP+RgaRQ08GKaTPXs=; fh=1JigEZLFx5NxNwux57Y+G77EHU/gejug7lEJcIF/Qi4=; b=y7XZ2FrL5C9srGcTzjGVmoef9xbrgz7mwiamqI+0GlJqYM4jhIs/+d+Dirr4cogsrb qBWK9eyWZeMEBvasJzWRCzrLoumTryYghy2uqMchdIcjkdkJb3/prO98rMuahkCE4cKF Ot6GPh8rmWmBb1IUlPzjxef9UC5zZ8WXok2n56FPQS/LF15qeSOw5PJjrOmLRYW9dme6 CdBmG1dh2v/DeD0zv2Co11ELgwUNCcF+cNAB5kLx47+uEXm7agqTXxlNO/zQl8j2SnRt QPIbsW+Hl2Z8S3g210nQ8gpl8T7VcX1pYDyIRhOCw0+xrnWCx1Xl/vgTkxpte505/uBF IKjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=IR51U6C8; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-75759-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e25-20020a656799000000b005d6c2958481si9050825pgr.639.2024.02.21.17.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 17:15:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75759-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=IR51U6C8; arc=pass (i=1 spf=pass spfdomain=xff.cz dkim=pass dkdomain=xff.cz dmarc=pass fromdomain=xff.cz); spf=pass (google.com: domain of linux-kernel+bounces-75759-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D70FF283465 for ; Thu, 22 Feb 2024 01:15:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E622C111AC; Thu, 22 Feb 2024 01:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b="IR51U6C8" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B30CF80C; Thu, 22 Feb 2024 01:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708564436; cv=none; b=NKiDIxijUNDgFZoSnCJi3/jA89IcGlg8IaR2cAcjF4CYe5BI1v1nB+pq0zLXwiUJVslV98rghyJEQX2q+mwdBQByt0L/42qjB8joneDMOlym5k0QkfnzQ03sotyLcisntPF7DqTShlfzk1r6PRb2jlUI6EOyr1Yx1dAYl6Th63c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708564436; c=relaxed/simple; bh=YvwPGE6Je1yh6m1wlcMDe3waw6z0rk4FE6NC0S7WrtI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gU+UbZV0V9xP04JMArqH+ACVfn+ge3X3yrj9fJkoWNHcEuPxaMrFDqutq6Eb6OVuPluowyZhF55b//CA6XZvCLPws67iLwabigtL+FMwAYYrF/QPyKXJ1Mtx3XUMq/OcLlYMtFW7s1xZhRpYX8/HfHB/h9XsXFuXtBjFtkzYDX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz; spf=pass smtp.mailfrom=xff.cz; dkim=pass (1024-bit key) header.d=xff.cz header.i=@xff.cz header.b=IR51U6C8; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1708564424; bh=YvwPGE6Je1yh6m1wlcMDe3waw6z0rk4FE6NC0S7WrtI=; h=From:To:Cc:Subject:Date:From; b=IR51U6C8FowjMKn6pODgTAZeYUwQ5y3+6aiQwNmO+2+6cQSvaB91QuV+fZtUtMeFC XmpHIu7kbs4b9PzJbcahzmZ08UR5S5FIq8iW9fViRG7acsKD8u0/u/j+/I5kP1UXOr Tu5flioRygnxaBzaGu8SFcUqTYWYYBnseahxJOWI= From: =?utf-8?q?Ond=C5=99ej_Jirman?= To: linux-kernel@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrey Skvortsov Cc: Ondrej Jirman , Icenowy Zheng , Dalton Durst , Shoji Keita , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 0/4] Add support for AF8133J magnetometer Date: Thu, 22 Feb 2024 02:13:34 +0100 Message-ID: <20240222011341.3232645-1-megi@xff.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791559755832502649 X-GMAIL-MSGID: 1791559755832502649 From: Ondrej Jirman This series adds support for AF8133J magnetometer sensor. It's a simple 3-axis sensor with two sensitivity options and not much else to it. This sensor is used on both Pinephone and Pinephone Pro. DT patches adding it will come later, once this driver is merged. Please take a look. :) Thank you very much, Ondřej Jirman v4: - move RPM enable in probe function before iio device registration v3: - collect more tags - if (ret < 0) -> (ret) where appropriate - scoped guard move to af8133j_set_scale() - remove pm_runtime_disable/enable guard from af8133j_power_down_action() - pretty much just this: https://megous.com/dl/tmp/0001-if-ret-0-ret-where-appropriate.patch https://megous.com/dl/tmp/0002-scoped-guard-move-to-af8133j_set_scale.patch https://megous.com/dl/tmp/0003-remove-pm_runtime_disable-enable-guard-from-af8133j_.patch v2: - move maintainers patch to the end of series - bindings: - fix compatible definition in bindings file - require power supplies - fix descriptions - driver: - sort includes - rework RPM, the driver should now work with RPM disabled among other improvements - I've tested RPM left and right doing device bind/unbind under various conditions, system suspend under various conditions, etc. - use scoped_guard for mutexes - use devm for power down and handle power down correctly with both RPM enabled/disabled without tracking power state in data->powered - fix issue with changing scale while RPM suspended - various code formatting issues resolved - as for sign-offs, I've added co-developed-by for people I know for sure worked on the driver, and left other tags as they were when I picked up the patch 2 years ago to my Linux branch Icenowy Zheng (3): dt-bindings: vendor-prefix: Add prefix for Voltafield dt-bindings: iio: magnetometer: Add Voltafield AF8133J iio: magnetometer: add a driver for Voltafield AF8133J magnetometer Ondrej Jirman (1): MAINTAINERS: Add an entry for AF8133J driver .../iio/magnetometer/voltafield,af8133j.yaml | 60 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + drivers/iio/magnetometer/Kconfig | 12 + drivers/iio/magnetometer/Makefile | 1 + drivers/iio/magnetometer/af8133j.c | 524 ++++++++++++++++++ 6 files changed, 605 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/voltafield,af8133j.yaml create mode 100644 drivers/iio/magnetometer/af8133j.c