Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp58809rdb; Wed, 21 Feb 2024 17:14:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVm5A7NdNNrJTjZQNV2Ycz/NRqXyimMtDv5+rA00XHBNLNDe7gRKvHRJhpSzJyBWwxuOUsXe1+YAEZnWYSBg6IhvTFipos5iytX6/n4Lg== X-Google-Smtp-Source: AGHT+IHvtcB+QuvmcVNtcWpFIPKZH4XJU5ymsE6Tnbny6AjUTiGwLkSPgkoi8BhuY/2XTGmhyNXd X-Received: by 2002:a05:622a:174f:b0:42d:f560:3978 with SMTP id l15-20020a05622a174f00b0042df5603978mr15950833qtk.35.1708564478218; Wed, 21 Feb 2024 17:14:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708564478; cv=pass; d=google.com; s=arc-20160816; b=zaSJfxHyd+f075I7kJSkP86ZGsM6gYnwb6IiZdESeff0xCWkHLgSFtp5Clc5b3PdmX 2lTPnKhvosgRAmhONeEKgJgjMVRFDYgMvde/c6LaZxB0j2uNEoPLP4aAP7dkj6T8kgFe bgmTqU+D2fUa9/g/A/v8i996U2wXGYiy0LOv53OEarqt+bfcNTQI0x7FphMXaWga9b4W K2myDSz8oMn3m35NQAteRYVxMECNirrvY7pFfOjZO2qq0Hq4z9abAuu8kQflPkqZ+6Em vhOVCkwkggyLc+C82sYnqPWBpFPf8yAVClPogvv69r7t+YGl70reac0DjDV+6Lk0CEnd 5KmA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 20-20020a05620a04d400b00787181fdb73si11515520qks.545.2024.02.21.17.14.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 17:14:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75759-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 005091C21B25 for ; Thu, 22 Feb 2024 01:14:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29E6917573; Thu, 22 Feb 2024 01:13:57 +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=20Jirman?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 -- 2.43.0