From patchwork Tue Jun 6 16:21:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: inv.git-commit@tdk.com X-Patchwork-Id: 13269434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8219EC7EE24 for ; Tue, 6 Jun 2023 16:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237495AbjFFQWo (ORCPT ); Tue, 6 Jun 2023 12:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233354AbjFFQWn (ORCPT ); Tue, 6 Jun 2023 12:22:43 -0400 Received: from mx0b-00549402.pphosted.com (mx0b-00549402.pphosted.com [205.220.178.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53F5910C2 for ; Tue, 6 Jun 2023 09:22:41 -0700 (PDT) Received: from pps.filterd (m0233779.ppops.net [127.0.0.1]) by mx0b-00549402.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3568m9s5005040; Tue, 6 Jun 2023 16:22:20 GMT Received: from jpn01-os0-obe.outbound.protection.outlook.com (mail-os0jpn01lp2111.outbound.protection.outlook.com [104.47.23.111]) by mx0b-00549402.pphosted.com (PPS) with ESMTPS id 3qyxvgj55s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jun 2023 16:22:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNidBLWKOD3Z0tGdijz5QoVtTpJirogEhv87YFAWmq5ID+VKu+SCzLqBbgMnLUjfvG1oJbT8dZCYC/CoewpWUrju3AL+K6GXnbKXGpVTdVyZBtw380IKr31z84UdDKZ421alSX6H3GIejKmAX2T749WTdH0CyBjs1RZqynYirlI9uDOfzREClHfW/g1gQYemMDiQojl6nuKjY7k6Q+vzUddjtcj8qg+Y75Z/lM6+mwwX0j99uT8ICPKStSXOAJbbym2ZQ0WwVZfEQ8oJq3nzIafqiR+wIPSE+MTujLY01Jp6f49CBwZa1EHLCOuHjldkMmPSmdPQg3IokPW4ZWQWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=avUz9hhH1hP9ofWwNwKMBdocHU5FFUu5eRfREEeh2ME=; b=cdo5QoOmdzLdAo4pkkPpjsdYNzBmNyAx85zHF4gNJUq3fXkoVFJMw4jUpxOK1YpX0wFJYKPKULE5bPXQvw0YcIFjOfRU7dt+pc8p4aI9PFeLRJgnxJkDiRDqLkELVplcDOSBAD5zEHeZK5MDDPFq5PTcV4BWxa2/TblCa1H9k1rtr/CLIZ7LUt5O0omUsplQbQURSOGwm4+ojTAUDyf92hGZ9Pfci0VYtuKgyEw7CmMN97k2KLGaggn8TTUel1Jzugt38sBNA1Jol0Wc5Z//fgSuAat+TgcGceoPZZbU4851A11vugbeopJDsQo5HSJBcMd7KOCMAqd1E0rgT+eYXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=tdk.com; dmarc=pass action=none header.from=tdk.com; dkim=pass header.d=tdk.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tdk.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=avUz9hhH1hP9ofWwNwKMBdocHU5FFUu5eRfREEeh2ME=; b=qjICUd/eyB8Rs+rE9F9QSV5/g6g8VCSDQ2XDZdVc1BxRXiy2sEecWU5et8pG4ryrvcpDUktMYPWFbjwUNsCrx6T46uw5k3Geij61piCG6zM0V4Uh39Qcyrkz65DfOl67sRJqn3F0NccidAnnYdERuiBq+RHfZopoJKezHHvfsT0mh3ghjkx4rCJFnZvJ7PsGjLa89mi/HIDv1A3SF4ORgAJuqA12R2+VRauhanjtKg2AwYjCq2pBQyolZ17ypzX3X6BPtc76vZhZwQ8DlvQl06yBq6QRowDyo6N1/mvZqLsAK/zHRfV//aEjNI39jqh4/uc01GIRGtrfQJ6Gqkr0sA== Received: from OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1a7::13) by TYCP286MB2179.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:15d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19; Tue, 6 Jun 2023 16:22:15 +0000 Received: from OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM ([fe80::60df:b013:2731:f9c1]) by OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM ([fe80::60df:b013:2731:f9c1%7]) with mapi id 15.20.6455.030; Tue, 6 Jun 2023 16:22:08 +0000 From: inv.git-commit@tdk.com To: jic23@kernel.org, linux-iio@vger.kernel.org Cc: lars@metafoo.de, Jean-Baptiste Maneyrol Subject: [PATCH v2 0/4] Factorize timestamp module Date: Tue, 6 Jun 2023 16:21:43 +0000 Message-Id: <20230606162147.79667-1-inv.git-commit@tdk.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: LO2P265CA0212.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::32) To OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:1a7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSZP286MB1942:EE_|TYCP286MB2179:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a1972aa-ccb0-40e0-cba9-08db66aa2ba8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WMtkdtZb8YtSWioDtadVFXY1W9XtZsQptu4h5/e1AZ9p5PxlfiliPA/56nubGp5W6aV/+UYeuEWJwFbn2Hr23Z8mPU/c6YFkGZingQAd+Wu2pVSsXoHNDuzFQyGk2s2sLS6YrnHvNAXcOBDEeH5yJeL6Flr9vevaJAAieJRX45gQY0A8sREB3X/lwOIgbFgi3n6tuCfGgbT50OGucVJMZbE3eRZnXnm8oB1sPMRd/EWCS/iYYK+YbhihBAGJUxMJt6+XV1XnK63AMqTXNKT+8+Po2mrz60G0WNQQFL0UwYPxnwTKkfnftZEwA74+h2c+C2Tqqm8qaWeth4j5KWHmDJutj5acv1yk+EApdQNV1R9ExPTi0wk6zTo4cVdzYEt2cB70RUteQidla2ea8mCPVzEMtjSn6RVHy12ohSwfs6e+9AviqPabe3PZCN23qLVSOmKpqbR/JaZdTu9VJgmZfuqLBmbTQRre+wum1wHDoIVxpbs9R9T1HAoWnXX4ctzlR4LmJFaxHUM05ho95P/HmskSRg1ViAK/Dw4MiW++op1Cygs5fPizozYrOyfrBHTylsz0AtfqpQpXlxwX0LX9Aqy/XfKovk6Z31Kgw2fDChYipdyV7xrbRwjbucoVdfbf X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(136003)(396003)(366004)(451199021)(36756003)(478600001)(5660300002)(6666004)(8936002)(8676002)(316002)(4326008)(66476007)(66556008)(66946007)(41300700001)(38350700002)(38100700002)(2906002)(1076003)(26005)(6506007)(6512007)(9686003)(86362001)(186003)(2616005)(83380400001)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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o2CAkYEi6VtDLmiPGHpHOH3vQmsKP/pL79TqsjuIvaoS+eyzSEP4JJwl4H+gM/rfngCYAJ8VdfTOlFd5boMyc0YVWYBTQORkURLsb0GtYLAeDUrAfHtNXosj5kM+tN9d89Ph17+Ssly5/Xg8n0+pKnbtOCy+O+G98uyBrGCuOodoU4s5n8G3yMpfbvY8aleF0Ri5KG5Xloh2XEZ4LUC0KBeD5GKmUw5r0csukLj1XuWCuEuqG8b821ggQ5eKVLaBWAOnNiNsv2MBkHadggCgLae/vPjtjztcSwRFXn0el9AA90ccNeQqjdQDiujE4cuSOrsBHaxh8ysbNC4HWQuj4QwXr8oERVKVB0K3Zeo+BhepPmcO3DCxUMLHLkMCre/CPJDcHVS5mGYi/rcPzu31vKXcr9keAdFAJINsM5gpNKxLCNHTZtfAszKJQgxvASfWdgAnLtwqjC/xYbbifvnTEfDc/sNXH3/Hf/vkVxK/3VwKzWYQJMGjVJOpDagW48E3NH4HptE/WpIse52k8GwSy3yCr4G8ECojU1G502i8 X-OriginatorOrg: tdk.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a1972aa-ccb0-40e0-cba9-08db66aa2ba8 X-MS-Exchange-CrossTenant-AuthSource: OSZP286MB1942.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 16:22:07.6854 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 7e452255-946f-4f17-800a-a0fb6835dc6c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bAjksc8xWazS7emnxD+hSJGwHka0G1qlJvMq8EQNcm9Mw3T+Q/Vg2FJ6volvhs7p7QtGq3VaXft4HYx6jWfOOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2179 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-06_12,2023-06-06_02,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jean-Baptiste Maneyrol The purpose if this series is to make timestamping from inv_icm42600 driver an independent module and use it for both inv_icm42600 and inv_mpu6050 drivers. Create a new inv_sensors_timestamp common module based on inv_icm42600 driver and use it in the 2 drivers. WARNING: this patch requires following commit in fixes-togreg bbaae0c79ebd ("iio: imu: inv_icm42600: fix timestamp reset") Changelog - v2: do some headers cleanup and add some justifications in the patches descriptions. Jean-Baptiste Maneyrol (4): iio: imu: inv_icm42600: make timestamp module chip independent iio: move inv_icm42600 timestamp module in common iio: make invensense timestamp module generic iio: imu: inv_mpu6050: use the common inv_sensors timestamp module drivers/iio/common/Kconfig | 1 + drivers/iio/common/Makefile | 1 + drivers/iio/common/inv_sensors/Kconfig | 7 ++ drivers/iio/common/inv_sensors/Makefile | 6 ++ .../inv_sensors/inv_sensors_timestamp.c} | 100 +++++++++--------- drivers/iio/imu/inv_icm42600/Kconfig | 1 + drivers/iio/imu/inv_icm42600/Makefile | 1 - .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 35 +++--- .../imu/inv_icm42600/inv_icm42600_buffer.c | 33 +++--- .../iio/imu/inv_icm42600/inv_icm42600_core.c | 14 ++- .../iio/imu/inv_icm42600/inv_icm42600_gyro.c | 35 +++--- .../imu/inv_icm42600/inv_icm42600_timestamp.h | 85 --------------- drivers/iio/imu/inv_mpu6050/Kconfig | 1 + drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 30 ++++-- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 18 ++-- drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 83 ++------------- drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 6 +- .../linux/iio/common/inv_sensors_timestamp.h | 95 +++++++++++++++++ 18 files changed, 278 insertions(+), 274 deletions(-) create mode 100644 drivers/iio/common/inv_sensors/Kconfig create mode 100644 drivers/iio/common/inv_sensors/Makefile rename drivers/iio/{imu/inv_icm42600/inv_icm42600_timestamp.c => common/inv_sensors/inv_sensors_timestamp.c} (56%) delete mode 100644 drivers/iio/imu/inv_icm42600/inv_icm42600_timestamp.h create mode 100644 include/linux/iio/common/inv_sensors_timestamp.h Reviewed-by: Andy Shevchenko