From nobody Sun May 19 01:15:29 2024 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 5D65D58AB9; Tue, 23 Apr 2024 08:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861763; cv=none; b=m7uZjkWXmUfCEY/ca8uM9ManGzOI8DUcoHnVe05N1EcvaMUG99lJb2gTm+QOh9bCG4oZDe3C8TJmmpm43Q+xDamT3nNpowCSxwxufclb80OFlQ1pXaFl1X5JvOGOADNQ4XBilpXrRAvtm4OeH86835wW7sl/7J8wSAVsaT0v2TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861763; c=relaxed/simple; bh=ZCJiTRsB42adJW1jGpsPbGOs+pdNg3esf+F7zVVDU9s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=P3UGxd3+La+DfSJUgxNMnscUhxMFbGsKXIG9+okRLKF4F5ppHpmOVCiYZNvgHjY9Fzj5taXvguhAIZ1d+CB96RniPTjtKUQDSCikBO30QT6UTU/WcqsA645VDSK/kYzH7Xoz7Fl1YTF8MiRCKIrfs48bHBOZM3jsmYYWh2PrjI8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dqwXTFIj; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dqwXTFIj" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-347c197a464so3979039f8f.2; Tue, 23 Apr 2024 01:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713861759; x=1714466559; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1JJb8CLWZ+zpfclyWYZpViBviTkIv/4bGLE2vrOMCLo=; b=dqwXTFIjn4ZjKsyX/iiOCIMcdvAKNjvU+3jyxBieLAO6V2lWehEhrZiT/4ok8lly9/ xS8b8qyAgzxA0p8isPJgvHZRPMRvksVB8mxfPrEbFHMTQFqhUS6q5S1X2b2YRB9RQjPL MivDrcOQ5PPyd/Ans8mp369hT0KnecMKPIrQyBDw+BNRceoTrgpcqh3jc0RjT0kGDOdu Sro4L59HCMhvb92ibl7nIpPML+gkfLzvSTMCe+M9sc3lJV5pfwgmceyov79WNPHjorDA uRtV1CbRyBvTXZ4WZeL0p7/inbIg9NfXWqEKZscpyzrqfh0Uc4s35nwW/x+HUgLJojO+ EfRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713861759; x=1714466559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1JJb8CLWZ+zpfclyWYZpViBviTkIv/4bGLE2vrOMCLo=; b=nLiqEXq4iepcoLFo/V294eT7aDVB1zXTQQFGVqgZslixq5LY1gxQWZcRpMi/8DzF/c NGA4XLmwHMx9X5JRs/kIk9ZhSbFY/Z14D24KXTn8P8ubgI27L0JnSCLQuDMYJ1/eHz9V ST9m3zgZrFaCO2TRhvhJX3LcokHjA6IhzSW1dXNO9HcubL2mnzOmakM2ahWwglYfyt6C pzmJD30ohbjuAexhxgJoDyO75xJrq1iGxAcHJRiGRnGO89nuMvtfPu527Lyc/o6eMZNx daSv3JsUk14ZncqpMGdtKCgHzBhlGR77FNNccBYe+578nwv+Dqavj9ntApTCI9e90LPf x2Og== X-Forwarded-Encrypted: i=1; AJvYcCVzw5GlutbaZO1n6h20Q5dshb3V/xn3SteRgX8eS0/1Q8pOYi2HNMVXCJwRQ19A1ePDb4EmROBhaq2Y4tB0UMP8uGiQUW7oQ4YAszcDehIDVUpMeTr8osgY/SF7jN1QvSe5krUI6ccIQyUIDVE02nQ5wivsEpwLm8b89IuhLgNgTg== X-Gm-Message-State: AOJu0Yybqn7c3gKU5xD/uRQbsS7mS1EgL4mdal+vSuhqFerfGkUgFEgJ gJqwgxmRnC/PyXtkPpt9419YarUBBijokSz1SrrPF953ppAG0C0UejgaA0dD X-Google-Smtp-Source: AGHT+IF8jcQSDNPpCg/TPAHgCWqSBkGJdO0aEfxeS/y7ooRXaDk/V7G3SyflRe3iPkFknUqZzkWVjA== X-Received: by 2002:adf:e30f:0:b0:34a:119b:aadc with SMTP id b15-20020adfe30f000000b0034a119baadcmr7191229wrj.6.1713861759472; Tue, 23 Apr 2024 01:42:39 -0700 (PDT) Received: from rbolboac.. ([2a02:2f0e:320d:e800:cce2:61fe:1efc:ce48]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b0034af18ef68csm5989939wrr.5.2024.04.23.01.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:42:38 -0700 (PDT) From: Ramona Gradinariu X-Google-Original-From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, corbet@lwn.net, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: Ramona Gradinariu , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH 1/5] iio: adis16480: make the burst_max_speed configurable Date: Tue, 23 Apr 2024 11:42:06 +0300 Message-Id: <20240423084210.191987-2-ramona.gradinariu@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423084210.191987-1-ramona.gradinariu@analog.com> References: <20240423084210.191987-1-ramona.gradinariu@analog.com> 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: quoted-printable With this, we can pass the maxixum spi burst speed to the 'ADIS16480_DATA()' macro. This is in preparation to support new devices that have a different speed than the one used so far. Signed-off-by: Nuno S=C3=A1 Signed-off-by: Ramona Gradinariu --- drivers/iio/imu/adis16480.c | 84 +++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index b40a55bba30c..bc6cbd00cd4b 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -107,8 +107,6 @@ #define ADIS16495_BURST_ID 0xA5A5 /* total number of segments in burst */ #define ADIS16495_BURST_MAX_DATA 20 -/* spi max speed in burst mode */ -#define ADIS16495_BURST_MAX_SPEED 6000000 =20 #define ADIS16480_REG_SERIAL_NUM ADIS16480_REG(0x04, 0x20) =20 @@ -872,33 +870,33 @@ static const char * const adis16480_status_error_msgs= [] =3D { =20 static int adis16480_enable_irq(struct adis *adis, bool enable); =20 -#define ADIS16480_DATA(_prod_id, _timeouts, _burst_len) \ -{ \ - .diag_stat_reg =3D ADIS16480_REG_DIAG_STS, \ - .glob_cmd_reg =3D ADIS16480_REG_GLOB_CMD, \ - .prod_id_reg =3D ADIS16480_REG_PROD_ID, \ - .prod_id =3D (_prod_id), \ - .has_paging =3D true, \ - .read_delay =3D 5, \ - .write_delay =3D 5, \ - .self_test_mask =3D BIT(1), \ - .self_test_reg =3D ADIS16480_REG_GLOB_CMD, \ - .status_error_msgs =3D adis16480_status_error_msgs, \ - .status_error_mask =3D BIT(ADIS16480_DIAG_STAT_XGYRO_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_YGYRO_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_ZGYRO_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_XACCL_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_YACCL_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_ZACCL_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_XMAGN_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_YMAGN_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_ZMAGN_FAIL) | \ - BIT(ADIS16480_DIAG_STAT_BARO_FAIL), \ - .enable_irq =3D adis16480_enable_irq, \ - .timeouts =3D (_timeouts), \ - .burst_reg_cmd =3D ADIS16495_REG_BURST_CMD, \ - .burst_len =3D (_burst_len), \ - .burst_max_speed_hz =3D ADIS16495_BURST_MAX_SPEED \ +#define ADIS16480_DATA(_prod_id, _timeouts, _burst_len, _burst_max_speed) \ +{ \ + .diag_stat_reg =3D ADIS16480_REG_DIAG_STS, \ + .glob_cmd_reg =3D ADIS16480_REG_GLOB_CMD, \ + .prod_id_reg =3D ADIS16480_REG_PROD_ID, \ + .prod_id =3D (_prod_id), \ + .has_paging =3D true, \ + .read_delay =3D 5, \ + .write_delay =3D 5, \ + .self_test_mask =3D BIT(1), \ + .self_test_reg =3D ADIS16480_REG_GLOB_CMD, \ + .status_error_msgs =3D adis16480_status_error_msgs, \ + .status_error_mask =3D BIT(ADIS16480_DIAG_STAT_XGYRO_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_YGYRO_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_ZGYRO_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_XACCL_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_YACCL_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_ZACCL_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_XMAGN_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_YMAGN_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_ZMAGN_FAIL) | \ + BIT(ADIS16480_DIAG_STAT_BARO_FAIL), \ + .enable_irq =3D adis16480_enable_irq, \ + .timeouts =3D (_timeouts), \ + .burst_reg_cmd =3D ADIS16495_REG_BURST_CMD, \ + .burst_len =3D (_burst_len), \ + .burst_max_speed_hz =3D _burst_max_speed \ } =20 static const struct adis_timeout adis16485_timeouts =3D { @@ -944,7 +942,7 @@ static const struct adis16480_chip_info adis16480_chip_= info[] =3D { .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, .filter_freqs =3D adis16480_def_filter_freqs, - .adis_data =3D ADIS16480_DATA(16375, &adis16485_timeouts, 0), + .adis_data =3D ADIS16480_DATA(16375, &adis16485_timeouts, 0, 0), }, [ADIS16480] =3D { .channels =3D adis16480_channels, @@ -958,7 +956,7 @@ static const struct adis16480_chip_info adis16480_chip_= info[] =3D { .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, .filter_freqs =3D adis16480_def_filter_freqs, - .adis_data =3D ADIS16480_DATA(16480, &adis16480_timeouts, 0), + .adis_data =3D ADIS16480_DATA(16480, &adis16480_timeouts, 0, 0), }, [ADIS16485] =3D { .channels =3D adis16485_channels, @@ -972,7 +970,7 @@ static const struct adis16480_chip_info adis16480_chip_= info[] =3D { .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, .filter_freqs =3D adis16480_def_filter_freqs, - .adis_data =3D ADIS16480_DATA(16485, &adis16485_timeouts, 0), + .adis_data =3D ADIS16480_DATA(16485, &adis16485_timeouts, 0, 0), }, [ADIS16488] =3D { .channels =3D adis16480_channels, @@ -986,7 +984,7 @@ static const struct adis16480_chip_info adis16480_chip_= info[] =3D { .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, .filter_freqs =3D adis16480_def_filter_freqs, - .adis_data =3D ADIS16480_DATA(16488, &adis16485_timeouts, 0), + .adis_data =3D ADIS16480_DATA(16488, &adis16485_timeouts, 0, 0), }, [ADIS16490] =3D { .channels =3D adis16485_channels, @@ -1000,7 +998,7 @@ static const struct adis16480_chip_info adis16480_chip= _info[] =3D { .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, .has_pps_clk_mode =3D true, - .adis_data =3D ADIS16480_DATA(16490, &adis16495_timeouts, 0), + .adis_data =3D ADIS16480_DATA(16490, &adis16495_timeouts, 0, 0), }, [ADIS16495_1] =3D { .channels =3D adis16485_channels, @@ -1016,7 +1014,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16495, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, [ADIS16495_2] =3D { .channels =3D adis16485_channels, @@ -1032,7 +1031,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16495, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, [ADIS16495_3] =3D { .channels =3D adis16485_channels, @@ -1048,7 +1048,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16495, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, [ADIS16497_1] =3D { .channels =3D adis16485_channels, @@ -1064,7 +1065,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16497, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, [ADIS16497_2] =3D { .channels =3D adis16485_channels, @@ -1080,7 +1082,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16497, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, [ADIS16497_3] =3D { .channels =3D adis16485_channels, @@ -1096,7 +1099,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .has_pps_clk_mode =3D true, /* 20 elements of 16bits */ .adis_data =3D ADIS16480_DATA(16497, &adis16495_1_timeouts, - ADIS16495_BURST_MAX_DATA * 2), + ADIS16495_BURST_MAX_DATA * 2, + 6000000), }, }; =20 --=20 2.34.1 From nobody Sun May 19 01:15:29 2024 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 DAD3259173; Tue, 23 Apr 2024 08:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861764; cv=none; b=KqeVkjb16SA6q+DVBzFBAm5+kujTpakoeolk1eMWNoEYnqC/Y/+ovpxaTQVkddgXCBZlM3eJLVs03af589VEi6AxHKrsDtfaOxv944UKxzX/YLJglkkpomx8Z3ERXxuj3Y4YnXHwlkv+8c3CC7ySXwAOyiO0BUTyuQrR53l6WIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861764; c=relaxed/simple; bh=2NXtJqNwMfj19zuaumAKGjpJjaHAeKnJ8xEnBbcueR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gvhWcUsI21OwRaaaDC8yLRNv3WNjqRxtAG6Juw05t2YJ7pHXoEjkYubzQiTCu1C5F21/AhCetNvqLfdrybsMitYwGP+aAcqwSWuyHfRXALl3+zXrzr2EDQd2IUKQYflbcjJlsuZ+qz/JC7a7ppXD8/t9LHyNLdytLtz1KIMtN3s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DvHpWkP5; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DvHpWkP5" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-34a7e47d164so3135874f8f.3; Tue, 23 Apr 2024 01:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713861760; x=1714466560; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MmgvWFvlswLGZUJ7yfS60zJgrcO9Ytw9o2rKwpBXkoY=; b=DvHpWkP5wW0DHatcDf/7fW1HF79YjXd7NNr76tCNeW5Qjl894/KjhZNL8cxWH+201B VzYdk12SZ5iPICjV56sI3Ci3avkN2Ptoi3k+oHBSEFz2bDYVsfGOz19oObyzkReVczKQ 3Nhny9DHCx27B6r5nw7TtLgptjGYAhTG5LhRW7wY54r7UexQIkaNNdXg0e7AXI2qhz9H GCbspQm/rt5xZxz5cBRKG4uyOqJMdVorX2RT2ct8whCgeS748wLlhdPBj4S7EBJ2xDzH FMmkpHdWGNZGCzLJgJnaMtkXeULRxc+77jesDepjz3SggEVTbxhlElVb12uyMFNflRez Hhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713861760; x=1714466560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MmgvWFvlswLGZUJ7yfS60zJgrcO9Ytw9o2rKwpBXkoY=; b=Z33PZ7RDIrxG5qNIEIh0uKaHb0ckXzfrIj2tRS2QJAukpSnljl1ZMkXObhrSkK5i3u NoaKd6WN/NF/1CWWTDtg9LWHPLRxvFT8AjInfQhymr0hN9F3mPbYAEmaVJFF2MqV0NrP MJp31xxD2WhXNszp4iX1wCUFzJTt+s/gK7Xu73dVj+nfaYvvfd4J0uLLYwnY9ieiOA6P IQST9KNcBZOlAi0+o6QJt5RzGR39CVBeSY7WukNpkQBvzirfKkTtvfJZIWK65vTeMQpr f+DSW6wj8bgdm5Cl8Rv8AnTiznVwAXvi2imwmV/e92FPLeTk/7C5zKoP5Uuq/0xsU2hi Q5sg== X-Forwarded-Encrypted: i=1; AJvYcCUSYjPX6ehv//2V/LL9opGvy7pwqDMVj0mrDhsC8VXpvWocx32lL3mTszU96mdTqnpgFyrlpe449inOo7p5PtZnPszaxaaKbgW3WyQF/El+GbyOlnQrK01eOc/LqxO2jiYjS8BbdGgWtH/7L1r3QgrQEZaRxBAseOQR150J00wloQ== X-Gm-Message-State: AOJu0Yw2IYXcy4cDRq1EZQ6fHbWO/oicz35yzc1LJmmZCH7L0rjURY3z moU/hYewK34cqMZVw7NDVkvAJSMVa51UWdR8wfAzZMx0UdimailmSWjWircI X-Google-Smtp-Source: AGHT+IHA7RStjrs648Bt277IwOsy4o4Y3wUoLcKkpOWil4UMH0QOlaryQDoNgB70AfnKxoIrE4qCQw== X-Received: by 2002:a05:6000:1109:b0:343:a098:f41 with SMTP id z9-20020a056000110900b00343a0980f41mr7778658wrw.28.1713861760501; Tue, 23 Apr 2024 01:42:40 -0700 (PDT) Received: from rbolboac.. ([2a02:2f0e:320d:e800:cce2:61fe:1efc:ce48]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b0034af18ef68csm5989939wrr.5.2024.04.23.01.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:42:40 -0700 (PDT) From: Ramona Gradinariu X-Google-Original-From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, corbet@lwn.net, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: Ramona Gradinariu Subject: [PATCH 2/5] iio: imu: adis16480.c: Add delta angle and delta velocity channels Date: Tue, 23 Apr 2024 11:42:07 +0300 Message-Id: <20240423084210.191987-3-ramona.gradinariu@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423084210.191987-1-ramona.gradinariu@analog.com> References: <20240423084210.191987-1-ramona.gradinariu@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for delta angle and delta velocity raw readings to adis16480 driver. Signed-off-by: Ramona Gradinariu --- drivers/iio/imu/adis16480.c | 78 ++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index bc6cbd00cd4b..4adc2244a4ef 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -140,6 +140,8 @@ struct adis16480_chip_info { unsigned int accel_max_val; unsigned int accel_max_scale; unsigned int temp_scale; + unsigned int deltang_max_val; + unsigned int deltvel_max_val; unsigned int int_clk; unsigned int max_dec_rate; const unsigned int *filter_freqs; @@ -445,6 +447,12 @@ enum { ADIS16480_SCAN_MAGN_Z, ADIS16480_SCAN_BARO, ADIS16480_SCAN_TEMP, + ADIS16480_SCAN_DELTANG_X, + ADIS16480_SCAN_DELTANG_Y, + ADIS16480_SCAN_DELTANG_Z, + ADIS16480_SCAN_DELTVEL_X, + ADIS16480_SCAN_DELTVEL_Y, + ADIS16480_SCAN_DELTVEL_Z, }; =20 static const unsigned int adis16480_calibbias_regs[] =3D { @@ -688,6 +696,14 @@ static int adis16480_read_raw(struct iio_dev *indio_de= v, *val =3D 131; /* 1310mbar =3D 131 kPa */ *val2 =3D 32767 << 16; return IIO_VAL_FRACTIONAL; + case IIO_DELTA_ANGL: + *val =3D st->chip_info->deltang_max_val; + *val2 =3D 31; + return IIO_VAL_FRACTIONAL_LOG2; + case IIO_DELTA_VELOCITY: + *val =3D st->chip_info->deltvel_max_val; + *val2 =3D 31; + return IIO_VAL_FRACTIONAL_LOG2; default: return -EINVAL; } @@ -761,6 +777,30 @@ static int adis16480_write_raw(struct iio_dev *indio_d= ev, BIT(IIO_CHAN_INFO_CALIBSCALE), \ 32) =20 +#define ADIS16480_DELTANG_CHANNEL(_mod) \ + ADIS16480_MOD_CHANNEL(IIO_DELTA_ANGL, IIO_MOD_ ## _mod, \ + ADIS16480_REG_ ## _mod ## _DELTAANG_OUT, ADIS16480_SCAN_DELTANG_ ## _mod,= \ + 0, \ + 32) + +#define ADIS16480_DELTANG_CHANNEL_NO_SCAN(_mod) \ + ADIS16480_MOD_CHANNEL(IIO_DELTA_ANGL, IIO_MOD_ ## _mod, \ + ADIS16480_REG_ ## _mod ## _DELTAANG_OUT, -1, \ + 0, \ + 32) + +#define ADIS16480_DELTVEL_CHANNEL(_mod) \ + ADIS16480_MOD_CHANNEL(IIO_DELTA_VELOCITY, IIO_MOD_ ## _mod, \ + ADIS16480_REG_ ## _mod ## _DELTAVEL_OUT, ADIS16480_SCAN_DELTVEL_ ## _mod,= \ + 0, \ + 32) + +#define ADIS16480_DELTVEL_CHANNEL_NO_SCAN(_mod) \ + ADIS16480_MOD_CHANNEL(IIO_DELTA_VELOCITY, IIO_MOD_ ## _mod, \ + ADIS16480_REG_ ## _mod ## _DELTAVEL_OUT, -1, \ + 0, \ + 32) + #define ADIS16480_MAGN_CHANNEL(_mod) \ ADIS16480_MOD_CHANNEL(IIO_MAGN, IIO_MOD_ ## _mod, \ ADIS16480_REG_ ## _mod ## _MAGN_OUT, ADIS16480_SCAN_MAGN_ ## _mod, \ @@ -816,7 +856,13 @@ static const struct iio_chan_spec adis16480_channels[]= =3D { ADIS16480_MAGN_CHANNEL(Z), ADIS16480_PRESSURE_CHANNEL(), ADIS16480_TEMP_CHANNEL(), - IIO_CHAN_SOFT_TIMESTAMP(11) + IIO_CHAN_SOFT_TIMESTAMP(11), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(X), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(Y), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(Z), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(X), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(Y), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(Z), }; =20 static const struct iio_chan_spec adis16485_channels[] =3D { @@ -827,7 +873,13 @@ static const struct iio_chan_spec adis16485_channels[]= =3D { ADIS16480_ACCEL_CHANNEL(Y), ADIS16480_ACCEL_CHANNEL(Z), ADIS16480_TEMP_CHANNEL(), - IIO_CHAN_SOFT_TIMESTAMP(7) + IIO_CHAN_SOFT_TIMESTAMP(7), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(X), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(Y), + ADIS16480_DELTANG_CHANNEL_NO_SCAN(Z), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(X), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(Y), + ADIS16480_DELTVEL_CHANNEL_NO_SCAN(Z), }; =20 enum adis16480_variant { @@ -938,6 +990,8 @@ static const struct adis16480_chip_info adis16480_chip_= info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(21973 << 16), .accel_max_scale =3D 18, .temp_scale =3D 5650, /* 5.65 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(180), + .deltvel_max_val =3D 100, .int_clk =3D 2460000, .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, @@ -952,6 +1006,8 @@ static const struct adis16480_chip_info adis16480_chip= _info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(12500 << 16), .accel_max_scale =3D 10, .temp_scale =3D 5650, /* 5.65 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 200, .int_clk =3D 2460000, .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, @@ -966,6 +1022,8 @@ static const struct adis16480_chip_info adis16480_chip= _info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(20000 << 16), .accel_max_scale =3D 5, .temp_scale =3D 5650, /* 5.65 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 50, .int_clk =3D 2460000, .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, @@ -980,6 +1038,8 @@ static const struct adis16480_chip_info adis16480_chip= _info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(22500 << 16), .accel_max_scale =3D 18, .temp_scale =3D 5650, /* 5.65 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 200, .int_clk =3D 2460000, .max_dec_rate =3D 2048, .has_sleep_cnt =3D true, @@ -994,6 +1054,8 @@ static const struct adis16480_chip_info adis16480_chip= _info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(16000 << 16), .accel_max_scale =3D 8, .temp_scale =3D 14285, /* 14.285 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 200, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1008,6 +1070,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 8, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(360), + .deltvel_max_val =3D 100, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1025,6 +1089,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 8, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 100, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1042,6 +1108,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 8, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(2160), + .deltvel_max_val =3D 100, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1059,6 +1127,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 40, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(360), + .deltvel_max_val =3D 400, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1076,6 +1146,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 40, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 400, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, @@ -1093,6 +1165,8 @@ static const struct adis16480_chip_info adis16480_chi= p_info[] =3D { .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), .accel_max_scale =3D 40, .temp_scale =3D 12500, /* 12.5 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(2160), + .deltvel_max_val =3D 400, .int_clk =3D 4250000, .max_dec_rate =3D 4250, .filter_freqs =3D adis16495_def_filter_freqs, --=20 2.34.1 From nobody Sun May 19 01:15:29 2024 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 1021655E48; Tue, 23 Apr 2024 08:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861765; cv=none; b=Ru5OnmY2jQB/IJ0B3cDRAjrQLv2mmMqQZQAlfNk3sQRxHyLXsmA5eRIwzlDeVqPC9fTgUGQyaCl4rXkwXKC/FdHDfBJxTutVVJBZWgYHtFswQ6cZSlC1Ve7u+apNKEG2H91yUptdEkvJdU54I4d4SZKn3CXD6TxJozcQ0Eosz/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861765; c=relaxed/simple; bh=kWQlPAJNcD1y4ZVlQb05o47efzckJi7SO+NKuvm/BRQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aFohUdiUEVEGyk091tDQRluASHXc6NlIPufSRBfB9N6s+ywJDxapYm2f1LdznPpDgkZ98K40T23gRXUVYtqQMXglhth2RSkFjlIRGiRyLpm+mjVSfD6ZO40U3xJX/gweDhRJYVUTD+259788HKZ6tRSljDUsIPpjb9zWeVCj3dA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XaucwfBB; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XaucwfBB" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-346359c8785so4456602f8f.0; Tue, 23 Apr 2024 01:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713861762; x=1714466562; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yh6tRQE9lZtbElirucPOKJE6dihjXQGvGMliXELOkAk=; b=XaucwfBBQk4T+SxvUK9CkxouElIkc4eUC46Fu2OlwMJrHO63Hv7VvgTj4h6MfIkllX JgXqkRpzv+8w7p+J3GLDwLchrmiiW32uU7M7X8eOJmp/ctqnA0bstY5amV6ssZyLhZ02 swkv/2lb5BJGB4fKogziuOovMUrpU9uadsjOOuCIhzmmZlk3e+EDP55KWXkejq5rGZBv mkSeryg/LTc0mMdqp1uXZJf8lEMRtKZliX1YvDyiysWBzczvUWGcIWnYGWz1RkweEqy8 mlSBNY3b5AJKHg5JFNkGR7GubP6r153bOOb99T6Iqrqk2Elw3rS2oQjtA0+fv/2219mh vlPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713861762; x=1714466562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yh6tRQE9lZtbElirucPOKJE6dihjXQGvGMliXELOkAk=; b=vDw09JTI2VMmDnds1de/mFGyHyiEsSL3oFPO4wwLV+bIZO4WH9NiTo6fL8M2kFZVMn z1MEdBfkZD9wYE56hMZ8EB15BAMuaVR900/DAmCXVpV4+rs/q4SiSXfXhiPiWjLFsvPe qYFlNrc3h/1v1SGTUi06w5HkjySA5V8MwuBniSVAlvuwalhZEm3W89HHIijI+PL6eqZE RtuKeb57CG0sGYRcseMLFjyYHUzaCeCDfD697qoQr11mThbAvUD6qzSniJ3gMKfd756Y faWTgjtEfX+Z+WSnzKHAh7LsbWdaNbmgHY/nscl4ihgXNUjg56Kpn2eOKZ7q9jLlY7to tbVQ== X-Forwarded-Encrypted: i=1; AJvYcCXEfB/HR5DETIk/2l2HxDU40U5pxaJ4GetSV3tS8mBLDRhVyJ7VsdNQuv79XXpiPf5mf/B9TujKfMfz0IJnfhdw3ho9c0mUAJfouUnHCRzu7M89T587C/M/zP8ysRMnQhnPQ5roUDaC3jSoxOB0eiHbQjc7KeIkgpVLKwznKrnzCw== X-Gm-Message-State: AOJu0Yxf0BKHHZErcphkzzZBR/2+B4NGNoiJe+hXPV97afvGPzjmkfkD p5EoGPDS613w2qX0K8BGElGRiDHBWGVWOfrswumjJUOZJVNkkFZ9WSr5X7o/ X-Google-Smtp-Source: AGHT+IEYHLpIBj1SJpP4iXr8CMZUjLSlJbnWRW0HwfIgV+VO2YHCo0W4bRaKaZImbhqblUz7bFLjgg== X-Received: by 2002:adf:e3cb:0:b0:343:772d:9349 with SMTP id k11-20020adfe3cb000000b00343772d9349mr8127935wrm.50.1713861761811; Tue, 23 Apr 2024 01:42:41 -0700 (PDT) Received: from rbolboac.. ([2a02:2f0e:320d:e800:cce2:61fe:1efc:ce48]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b0034af18ef68csm5989939wrr.5.2024.04.23.01.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:42:41 -0700 (PDT) From: Ramona Gradinariu X-Google-Original-From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, corbet@lwn.net, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: Ramona Gradinariu Subject: [PATCH 3/5] dt-bindings: iio: imu: Add docs for ADIS16545/47 Date: Tue, 23 Apr 2024 11:42:08 +0300 Message-Id: <20240423084210.191987-4-ramona.gradinariu@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423084210.191987-1-ramona.gradinariu@analog.com> References: <20240423084210.191987-1-ramona.gradinariu@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Update ADIS16480 existing documentation with documentation for ADIS16545/47 devices. Signed-off-by: Ramona Gradinariu --- .../devicetree/bindings/iio/imu/adi,adis16480.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml b= /Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml index 56e0dc20f5e4..e3eec38897bf 100644 --- a/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml +++ b/Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml @@ -23,6 +23,12 @@ properties: - adi,adis16497-1 - adi,adis16497-2 - adi,adis16497-3 + - adi,adis16545-1 + - adi,adis16545-2 + - adi,adis16545-3 + - adi,adis16547-1 + - adi,adis16547-2 + - adi,adis16547-3 =20 reg: maxItems: 1 --=20 2.34.1 From nobody Sun May 19 01:15:29 2024 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 6AF1D612F5; Tue, 23 Apr 2024 08:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861767; cv=none; b=rVAq1VLqUYwnhfb+YaLBHDsCh9QBOC4A4qwGQPzeKkTugbP2DTRXgwvsBKN73QXpR7Vx80w2pMf+Mx+kM5F5oXywTuIAwbHQ+yrcVuHpu/ITpMV6ly2BjU6YkomiuL7jaVvLgAzXZm1CHQUIAvsr4daFKw1Y57ic84gImxNWPhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861767; c=relaxed/simple; bh=L/dV8VBeeiLpiO/7u7guKB1YnfK6Zy2VJWhiirSr000=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=LQEz4NpW0Mqr1VD55p7M0Amw/6yAQR3rn0xhgA8aJwbr/MnYX/h9f7r2SLTbq2OHzCK/d6XCuvmkvID18Ni4CVDVcvKNi8S6gR+e1MAxsSYITusDwE/JQbmXIIQgRqq+o9HMCN88eCOaChG+6jGj0YqF6m1dLS3vrq9kuc+lZXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M+KGpn32; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M+KGpn32" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-346406a5fb9so4283988f8f.1; Tue, 23 Apr 2024 01:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713861763; x=1714466563; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YB73JlYFnDlcsmhQl4eDUMeA5RC0hbTDUOZZngCdft0=; b=M+KGpn320zTTb4AwjloKmMb7YGHBcRMLMFTzuMxqZlNYcrHJOSBl0Zri4l6HgcQyp/ bN7bHlKogx/bc0W53a070qbYpdobGXp7ex0frrKQWcy+CglC4TcGbFf2bkNaFaUMzLnW DDdp61xQh5/HacaubJrCGBTTDXTXM8ko+68m8C6CzXgaGZrRNE7ok+QZzFF+cQY4/xDU ESIEU+xzFNbFUxn+M5aQL5i7+HVSIcistrvhdDD1l1W/TZm2GFwXx2DPgh/IVkhFMLWT evd0Jt/KcNh4L5wiO8nKjc869fo4ziH5KTnOIu7tD6H/dfrh7M8YAHK2NSJUYD1puWYv Syzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713861763; x=1714466563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YB73JlYFnDlcsmhQl4eDUMeA5RC0hbTDUOZZngCdft0=; b=Us5FClsZJGCdGAri6JnX2ESgPvrq0mED4nFb3qoZkkBlCo4Hh/bLxc5dcCmf1iysiy 4968SBh6o8Mk+IfCy1M3IxpXXxgwZfbUnv69Sdk2tyAbnKWyQlUHRwM4cNffAJdjtlFi fkqO7GfBbelcz5+eRNF95g5DVhxt7F1kIK0tnqHoN6oSsK3s6O3ftmxYW4+Y1S8kcbKw pFMJDQVu4P9mQt0hC/nNDf2wp1wn6INPLvygVsV8QRqHaP64JrX++CdDmXbzSP0JZltD D66Dl71ygxOLc7HsLUDO5LytyfsEDz1iCnJhNY0SVvoMD7v6/EVFrZNXWaQzPaGxO73X gmlw== X-Forwarded-Encrypted: i=1; AJvYcCWVZy+USyLf0nG7mNQh2eT/m9XF7xWMvfoSydiqEFUh7B31ZJVHtmXD0KrUhy4nE6/t7RuTkarw71CBfF4TFfMmoarLpy1Vi39d+Of3lzAvk6c5O3vjiKBQS3/Zpu0Ohvau6HKR5sH/FHVTHEWnINSu9pvRz9THisiGRk4VIvGdMA== X-Gm-Message-State: AOJu0YxoWRgWaVvuz0tSHZGJcE2Ht/j+YWWI5yVxEfads3/a50fIau7C ErieUxLouYbVRkNF8LsQk7+/demq/4EZca0hXpWF/fmFVEUIopbgRSGwtkry X-Google-Smtp-Source: AGHT+IFY9Z3ReQGE26+JVhbT5WRDbGHx17yXXryb9m9b2s8B+25k3imAZ1LgRnIakpPKmYXcwsDv8Q== X-Received: by 2002:a05:6000:23a:b0:346:ab3c:1753 with SMTP id l26-20020a056000023a00b00346ab3c1753mr7658906wrz.40.1713861763092; Tue, 23 Apr 2024 01:42:43 -0700 (PDT) Received: from rbolboac.. ([2a02:2f0e:320d:e800:cce2:61fe:1efc:ce48]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b0034af18ef68csm5989939wrr.5.2024.04.23.01.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:42:42 -0700 (PDT) From: Ramona Gradinariu X-Google-Original-From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, corbet@lwn.net, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: Ramona Gradinariu , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH 4/5] iio: adis16480: add support for adis16545/7 families Date: Tue, 23 Apr 2024 11:42:09 +0300 Message-Id: <20240423084210.191987-5-ramona.gradinariu@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423084210.191987-1-ramona.gradinariu@analog.com> References: <20240423084210.191987-1-ramona.gradinariu@analog.com> 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: quoted-printable The ADIS16545 and ADIS16547 are a complete inertial system that includes a triaxis gyroscope and a triaxis accelerometer. The serial peripheral interface (SPI) and register structure provide a simple interface for data collection and configuration control. These devices are similar to the ones already supported in the driver, with changes in the scales, timings and the max spi speed in burst mode. Also, they support delta angle and delta velocity readings in burst mode, for which support was added in the trigger handler. Signed-off-by: Nuno S=C3=A1 Signed-off-by: Ramona Gradinariu --- drivers/iio/imu/adis16480.c | 222 ++++++++++++++++++++++++++++++++++-- 1 file changed, 215 insertions(+), 7 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index 4adc2244a4ef..e0020b7b5fb5 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -132,6 +132,10 @@ #define ADIS16480_SYNC_MODE_MSK BIT(8) #define ADIS16480_SYNC_MODE(x) FIELD_PREP(ADIS16480_SYNC_MODE_MSK, x) =20 +#define ADIS16545_BURST_DATA_SEL_0_CHN_MASK GENMASK(5, 0) +#define ADIS16545_BURST_DATA_SEL_1_CHN_MASK GENMASK(16, 11) +#define ADIS16545_BURST_DATA_SEL_MASK BIT(8) + struct adis16480_chip_info { unsigned int num_channels; const struct iio_chan_spec *channels; @@ -147,6 +151,7 @@ struct adis16480_chip_info { const unsigned int *filter_freqs; bool has_pps_clk_mode; bool has_sleep_cnt; + bool has_burst_delta_data; const struct adis_data adis_data; }; =20 @@ -170,6 +175,7 @@ struct adis16480 { struct clk *ext_clk; enum adis16480_clock_mode clk_mode; unsigned int clk_freq; + u16 burst_id; /* Alignment needed for the timestamp */ __be16 data[ADIS16495_BURST_MAX_DATA] __aligned(8); }; @@ -882,6 +888,23 @@ static const struct iio_chan_spec adis16485_channels[]= =3D { ADIS16480_DELTVEL_CHANNEL_NO_SCAN(Z), }; =20 +static const struct iio_chan_spec adis16545_channels[] =3D { + ADIS16480_GYRO_CHANNEL(X), + ADIS16480_GYRO_CHANNEL(Y), + ADIS16480_GYRO_CHANNEL(Z), + ADIS16480_ACCEL_CHANNEL(X), + ADIS16480_ACCEL_CHANNEL(Y), + ADIS16480_ACCEL_CHANNEL(Z), + ADIS16480_TEMP_CHANNEL(), + ADIS16480_DELTANG_CHANNEL(X), + ADIS16480_DELTANG_CHANNEL(Y), + ADIS16480_DELTANG_CHANNEL(Z), + ADIS16480_DELTVEL_CHANNEL(X), + ADIS16480_DELTVEL_CHANNEL(Y), + ADIS16480_DELTVEL_CHANNEL(Z), + IIO_CHAN_SOFT_TIMESTAMP(13), +}; + enum adis16480_variant { ADIS16375, ADIS16480, @@ -894,6 +917,12 @@ enum adis16480_variant { ADIS16497_1, ADIS16497_2, ADIS16497_3, + ADIS16545_1, + ADIS16545_2, + ADIS16545_3, + ADIS16547_1, + ADIS16547_2, + ADIS16547_3 }; =20 #define ADIS16480_DIAG_STAT_XGYRO_FAIL 0 @@ -975,6 +1004,12 @@ static const struct adis_timeout adis16495_1_timeouts= =3D { .self_test_ms =3D 20, }; =20 +static const struct adis_timeout adis16545_timeouts =3D { + .reset_ms =3D 315, + .sw_reset_ms =3D 270, + .self_test_ms =3D 35, +}; + static const struct adis16480_chip_info adis16480_chip_info[] =3D { [ADIS16375] =3D { .channels =3D adis16485_channels, @@ -1176,6 +1211,126 @@ static const struct adis16480_chip_info adis16480_c= hip_info[] =3D { ADIS16495_BURST_MAX_DATA * 2, 6000000), }, + [ADIS16545_1] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 20000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(125), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 8, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(360), + .deltvel_max_val =3D 100, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16545, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, + [ADIS16545_2] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 18000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(450), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 8, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 100, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16545, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, + [ADIS16545_3] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 20000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(2000), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 8, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(2160), + .deltvel_max_val =3D 100, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16545, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, + [ADIS16547_1] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 20000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(125), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 40, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(360), + .deltvel_max_val =3D 400, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16547, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, + [ADIS16547_2] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 18000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(450), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 40, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(720), + .deltvel_max_val =3D 400, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16547, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, + [ADIS16547_3] =3D { + .channels =3D adis16545_channels, + .num_channels =3D ARRAY_SIZE(adis16545_channels), + .gyro_max_val =3D 20000 << 16, + .gyro_max_scale =3D IIO_DEGREE_TO_RAD(2000), + .accel_max_val =3D IIO_M_S_2_TO_G(32000 << 16), + .accel_max_scale =3D 40, + .temp_scale =3D 7000, /* 7 milli degree Celsius */ + .deltang_max_val =3D IIO_DEGREE_TO_RAD(2160), + .deltvel_max_val =3D 400, + .int_clk =3D 4250000, + .max_dec_rate =3D 4250, + .filter_freqs =3D adis16495_def_filter_freqs, + .has_pps_clk_mode =3D true, + .has_burst_delta_data =3D true, + /* 20 elements of 16bits */ + .adis_data =3D ADIS16480_DATA(16547, &adis16545_timeouts, + ADIS16495_BURST_MAX_DATA * 2, + 3200000), + }, }; =20 static bool adis16480_validate_crc(const u16 *buf, const u8 n_elem, const = u32 crc) @@ -1200,7 +1355,7 @@ static irqreturn_t adis16480_trigger_handler(int irq,= void *p) struct adis16480 *st =3D iio_priv(indio_dev); struct adis *adis =3D &st->adis; struct device *dev =3D &adis->spi->dev; - int ret, bit, offset, i =3D 0; + int ret, bit, offset, i =3D 0, buff_offset =3D 0; __be16 *buffer; u32 crc; bool valid; @@ -1233,8 +1388,8 @@ static irqreturn_t adis16480_trigger_handler(int irq,= void *p) * 16-bit responses containing the BURST_ID depending on the sclk. If * clk > 3.6MHz, then we will have two BURST_ID in a row. If clk < 3MHZ, * we have only one. To manage that variation, we use the transition from= the - * BURST_ID to the SYS_E_FLAG register, which will not be equal to 0xA5A5= . If - * we not find this variation in the first 4 segments, then the data shou= ld + * BURST_ID to the SYS_E_FLAG register, which will not be equal to 0xA5A5= /0xC3C3. + * If we not find this variation in the first 4 segments, then the data s= hould * not be valid. */ buffer =3D adis->buffer; @@ -1242,7 +1397,7 @@ static irqreturn_t adis16480_trigger_handler(int irq,= void *p) u16 curr =3D be16_to_cpu(buffer[offset]); u16 next =3D be16_to_cpu(buffer[offset + 1]); =20 - if (curr =3D=3D ADIS16495_BURST_ID && next !=3D ADIS16495_BURST_ID) { + if (curr =3D=3D st->burst_id && next !=3D st->burst_id) { offset++; break; } @@ -1269,11 +1424,22 @@ static irqreturn_t adis16480_trigger_handler(int ir= q, void *p) switch (bit) { case ADIS16480_SCAN_TEMP: st->data[i++] =3D buffer[offset + 1]; + /* + * The temperature channel has 16-bit storage size. + * We need to perform the padding to have the buffer + * elements naturally aligned in case there are any + * 32-bit storage size channels enabled which have a + * scan index higher than the temperature channel scan + * index. + */ + if (*indio_dev->active_scan_mask & + GENMASK(ADIS16480_SCAN_DELTVEL_Z, ADIS16480_SCAN_DELTANG_X)) + st->data[i++] =3D 0; break; case ADIS16480_SCAN_GYRO_X ... ADIS16480_SCAN_ACCEL_Z: /* The lower register data is sequenced first */ - st->data[i++] =3D buffer[2 * bit + offset + 3]; - st->data[i++] =3D buffer[2 * bit + offset + 2]; + st->data[i++] =3D buffer[2 * (bit - buff_offset) + offset + 3]; + st->data[i++] =3D buffer[2 * (bit - buff_offset) + offset + 2]; break; } } @@ -1285,10 +1451,38 @@ static irqreturn_t adis16480_trigger_handler(int ir= q, void *p) return IRQ_HANDLED; } =20 +static int adis16480_update_scan_mode(struct iio_dev *indio_dev, + const unsigned long *scan_mask) +{ + u16 en; + int ret; + struct adis16480 *st =3D iio_priv(indio_dev); + + if (st->chip_info->has_burst_delta_data) { + if ((*scan_mask & ADIS16545_BURST_DATA_SEL_0_CHN_MASK) && + (*scan_mask & ADIS16545_BURST_DATA_SEL_1_CHN_MASK)) + return -EINVAL; + if (*scan_mask & ADIS16545_BURST_DATA_SEL_0_CHN_MASK) { + en =3D FIELD_PREP(ADIS16545_BURST_DATA_SEL_MASK, 0); + st->burst_id =3D 0xA5A5; + } else { + en =3D FIELD_PREP(ADIS16545_BURST_DATA_SEL_MASK, 1); + st->burst_id =3D 0xC3C3; + } + + ret =3D __adis_update_bits(&st->adis, ADIS16480_REG_CONFIG, + ADIS16545_BURST_DATA_SEL_MASK, en); + if (ret) + return ret; + } + + return adis_update_scan_mode(indio_dev, scan_mask); +} + static const struct iio_info adis16480_info =3D { .read_raw =3D &adis16480_read_raw, .write_raw =3D &adis16480_write_raw, - .update_scan_mode =3D adis_update_scan_mode, + .update_scan_mode =3D &adis16480_update_scan_mode, .debugfs_reg_access =3D adis_debugfs_reg_access, }; =20 @@ -1498,6 +1692,8 @@ static int adis16480_probe(struct spi_device *spi) if (ret) return ret; =20 + st->burst_id =3D ADIS16495_BURST_ID; + if (st->chip_info->has_sleep_cnt) { ret =3D devm_add_action_or_reset(dev, adis16480_stop, indio_dev); if (ret) @@ -1571,6 +1767,12 @@ static const struct spi_device_id adis16480_ids[] = =3D { { "adis16497-1", ADIS16497_1 }, { "adis16497-2", ADIS16497_2 }, { "adis16497-3", ADIS16497_3 }, + { "adis16545-1", ADIS16545_1 }, + { "adis16545-2", ADIS16545_2 }, + { "adis16545-3", ADIS16545_3 }, + { "adis16547-1", ADIS16547_1 }, + { "adis16547-2", ADIS16547_2 }, + { "adis16547-3", ADIS16547_3 }, { } }; MODULE_DEVICE_TABLE(spi, adis16480_ids); @@ -1587,6 +1789,12 @@ static const struct of_device_id adis16480_of_match[= ] =3D { { .compatible =3D "adi,adis16497-1" }, { .compatible =3D "adi,adis16497-2" }, { .compatible =3D "adi,adis16497-3" }, + { .compatible =3D "adi,adis16545-1" }, + { .compatible =3D "adi,adis16545-2" }, + { .compatible =3D "adi,adis16545-3" }, + { .compatible =3D "adi,adis16547-1" }, + { .compatible =3D "adi,adis16547-2" }, + { .compatible =3D "adi,adis16547-3" }, { }, }; MODULE_DEVICE_TABLE(of, adis16480_of_match); --=20 2.34.1 From nobody Sun May 19 01:15:29 2024 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 B59156519D; Tue, 23 Apr 2024 08:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861769; cv=none; b=skW4KsLS+hQ2z0faGYxZtMZnn9/u0bMTh0bWvdQXjB5NHVzvJA8NzwdNtwOIaA70nEqT6dOxrdAgQ6QGk7iWI9YnVYkll25I+mvWWH1eaRnX9+4pQ5xOuZFQEa1rTBVthpWQRl8U/5mHvbYh8RnZN6QkOO4KB+v9t+ofWg6Koeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713861769; c=relaxed/simple; bh=m32k9ui5GsmFa7NHxN6AVeSuGhx9hpIjx1Xv/IqaHss=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=hwuCfrzhgmEEU7K/ylfuqhiOoayLnGkrdZWFrMxafKL0ABPGryyPjR9PtKNfU+SqV/4L2LNtuKQKGxFrhwORIPI+1lqAAO8FBL34s464/sC0cZFHIXWFeEQh2A9xCSudaqtjaI7hpaXRI5ZfpCb8zbdjHr+DVIHJXqqFsISGgqo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nZF5/Yw4; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nZF5/Yw4" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-41a77836fa6so11591965e9.2; Tue, 23 Apr 2024 01:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713861765; x=1714466565; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OdZpy2A4Ou9LOcVTryduG1E0ZEVntlrv/HUoAaVxhDU=; b=nZF5/Yw4L+1+hiRWZKRpvM5Dui9yzOIAn6etLDdD+MEhrtXcQFSIbqwzNjeQOe/utU lhWEViYgMP6Z9nB9+1Aw7klciWW0EvM4Fo6SdcFT26nl52kMybYvLeKY2FFPUSm615xH dpNnfMy8ao91QSmpBhMh0btY9MbNOsCSHlHvr0zqjMFag+9AosOCLuotls4Ave91nvvR O7uI5k6euvDozZglUwUEAxyo3qcE7cI1QeOjQkOy4eUKzwqeh1Dw+YHU4v5x3zTdRi7g q21oEusNla63/eW0dA/deT80EhOzIxFnyrqUHyrbmv+z5L8USGX12Aqs0pmnQY3J7zm4 5G4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713861765; x=1714466565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OdZpy2A4Ou9LOcVTryduG1E0ZEVntlrv/HUoAaVxhDU=; b=o/4IhwsZW/Kj8lap1pcT2SPaztOFjw6bnsTMCwYf/OHh00oZoFAFcybEkd4FgIEifD kQLPsx6kfuLChKM2oQKjGb4ujwnIkhmCJmo2D9pwDQ3Ym2V31McFJE7Lnql0Z6bwWyGi 9RAhaFygLi71ediuEUozboL/DbvFYug8zwfa3gBVyImhZItXF/Dlry8rstxBbicd8tl0 l1rFGkCAyQmXtpSgwhqP6WlKzclS3Pbln6+LFNESBCr4pbKs+fkwK88+wsxcAqino3Pj 1oglcdlMGtraPkEjHC+I4j3bOTdH3vo2+7/VlEptohBJAALpHjcnzshgE3f2K+QAlrhD kdfg== X-Forwarded-Encrypted: i=1; AJvYcCXZ5Q6yiBCw9fUiuRbRD+tfqwo2584zS1uZbUI1mH+sVxYUHHldVEqVxYCBgfyNkXfTyE+IgMQP63YmOUwXVS2QA9Alp/2F3shuG0EHlHXeFIRjgneSzL3yIBgZqHg1OronRcXiHSR+p22/twR9kLbWqXq0k2byorej71L71y/ESw== X-Gm-Message-State: AOJu0YzXhSec0QWLHOFjrWua1r6FzPwnEJr5TdPzslPLaT4Xie6TXwDs eWI5AWeMWCYwK69gaFinEwJDAwMvIAPkxs+bzw1bhG5F0n/YY7eLS3qTv0js X-Google-Smtp-Source: AGHT+IGM5gun/BKMlSQukPzdascWTr3pK3t8AZIuniQfZRz6G8X7JrCIeVmRT1iEa/bthzp1QGjSLQ== X-Received: by 2002:a05:6000:1290:b0:34a:7613:b09f with SMTP id f16-20020a056000129000b0034a7613b09fmr8957448wrx.35.1713861764583; Tue, 23 Apr 2024 01:42:44 -0700 (PDT) Received: from rbolboac.. ([2a02:2f0e:320d:e800:cce2:61fe:1efc:ce48]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b0034af18ef68csm5989939wrr.5.2024.04.23.01.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:42:43 -0700 (PDT) From: Ramona Gradinariu X-Google-Original-From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, corbet@lwn.net, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org Cc: Ramona Gradinariu Subject: [PATCH 5/5] docs: iio: add documentation for adis16480 driver Date: Tue, 23 Apr 2024 11:42:10 +0300 Message-Id: <20240423084210.191987-6-ramona.gradinariu@analog.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423084210.191987-1-ramona.gradinariu@analog.com> References: <20240423084210.191987-1-ramona.gradinariu@analog.com> 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: quoted-printable Add documentation for adis16480 driver which describes the driver device files and shows how the user may use the ABI for various scenarios (configuration, measurement, etc.). Signed-off-by: Ramona Gradinariu --- Documentation/iio/adis16480.rst | 461 ++++++++++++++++++++++++++++++++ Documentation/iio/index.rst | 1 + 2 files changed, 462 insertions(+) create mode 100644 Documentation/iio/adis16480.rst diff --git a/Documentation/iio/adis16480.rst b/Documentation/iio/adis16480.= rst new file mode 100644 index 000000000000..891865cfa712 --- /dev/null +++ b/Documentation/iio/adis16480.rst @@ -0,0 +1,461 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +ADIS16480 driver +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This driver supports Analog Device's IMUs on SPI bus. + +1. Supported devices +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +* `ADIS16375 `_ +* `ADIS16480 `_ +* `ADIS16485 `_ +* `ADIS16488 `_ +* `ADIS16490 `_ +* `ADIS16495 `_ +* `ADIS16497 `_ +* `ADIS16545 `_ +* `ADIS16547 `_ + +Each supported device is a complete inertial system that includes a triaxi= al +gyroscope and a triaxial accelerometer. Each inertial sensor in device com= bines +with signal conditioning that optimizes dynamic performance. The factory +calibration characterizes each sensor for sensitivity, bias, and alignment= . As +a result, each sensor has its own dynamic compensation formulas that provi= de +accurate sensor measurements. + +2. Device attributes +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Accelerometer, gyroscope measurements are always provided. Furthermore, the +driver offers the capability to retrieve the delta angle and the delta vel= ocity +measurements computed by the device. + +The delta angle measurements represent a calculation of angular displaceme= nt +between each sample update, while the delta velocity measurements represen= t a +calculation of linear velocity change between each sample update. + +Finally, temperature data are provided which show a coarse measurement of +the temperature inside of the IMU device. This data is most useful for +monitoring relative changes in the thermal environment. + +ADIS16480 and ADIS16488 also provide access to barometric pressure data and +triaxial magnetometer measurements. + +Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:devi= ceX``, +where X is the IIO index of the device. Under these folders reside a set of +device files, depending on the characteristics and features of the hardware +device in questions. These files are consistently generalized and document= ed in +the IIO ABI documentation. + +The following tables show the adis16480 related device files, found in the +specific device folder path ``/sys/bus/iio/devices/iio:deviceX``. + +**Available only for ADIS16480 and ADIS16488:** + ++------------------------------------------+------------------------------= ---------------------------+ +| 3-Axis Magnetometer related device files | Description = | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_scale | Scale for the magnetometer ch= annels. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_x_calibbias | Calibration offset for the X-= axis magnetometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis magn= etometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_x_raw | Raw X-axis magnetometer chann= el value. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_y_calibbias | Calibration offset for the Y-= axis magnetometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis magn= etometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_y_raw | Raw Y-axis magnetometer chann= el value. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_z_calibbias | Calibration offset for the Z-= axis magnetometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis magn= etometer channel. | ++------------------------------------------+------------------------------= ---------------------------+ +| in_magn_z_raw | Raw Z-axis magnetometer chann= el value. | ++------------------------------------------+------------------------------= ---------------------------+ + ++------------------------------------------+------------------------------= -----------------------+ +| Barometric pressure sensor related files | Description = | ++------------------------------------------+------------------------------= -----------------------+ +| in_pressure0_calibbias | Calibration offset for barome= tric pressure channel. | ++------------------------------------------+------------------------------= -----------------------+ +| in_pressure0_raw | Raw barometric pressure chann= el value. | ++------------------------------------------+------------------------------= -----------------------+ +| in_pressure0_scale | Scale for the barometric pres= sure sensor channel. | ++------------------------------------------+------------------------------= -----------------------+ + +**Available for all supported devices:** + ++-------------------------------------------+-----------------------------= -----------------------------+ +| 3-Axis Accelerometer related device files | Description = | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_scale | Scale for the accelerometer = channels. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_x_calibbias | Calibration offset for the X= -axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_x_calibscale | Calibration scale for the X-= axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis acc= elerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_x_raw | Raw X-axis accelerometer cha= nnel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_y_calibbias | Calibration offset for the Y= -axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_y_calibscale | Calibration scale for the Y-= axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis acc= elerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_y_raw | Raw Y-axis accelerometer cha= nnel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_z_calibbias | Calibration offset for the Z= -axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_z_calibscale | Calibration scale for the Z-= axis accelerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis acc= elerometer channel. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_accel_z_raw | Raw Z-axis accelerometer cha= nnel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_deltavelocity_scale | Scale for delta velocity cha= nnels. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_deltavelocity_x_raw | Raw X-axis delta velocity ch= annel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_deltavelocity_y_raw | Raw Y-axis delta velocity ch= annel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ +| in_deltavelocity_z_raw | Raw Z-axis delta velocity ch= annel value. | ++-------------------------------------------+-----------------------------= -----------------------------+ + ++--------------------------------------------+----------------------------= --------------------------+ +| 3-Axis Gyroscope related device files | Description = | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_scale | Scale for the gyroscope cha= nnels. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_x_calibbias | Calibration offset for the = X-axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_x_calibscale | Calibration scale for the X= -axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis gy= roscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_x_raw | Raw X-axis gyroscope channe= l value. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_y_calibbias | Calibration offset for the = Y-axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_y_calibscale | Calibration scale for the Y= -axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis gy= roscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_y_raw | Raw Y-axis gyroscope channe= l value. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_z_calibbias | Calibration offset for the = Z-axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_z_calibscale | Calibration scale for the Z= -axis gyroscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis gy= roscope channel. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_anglvel_z_raw | Raw Z-axis gyroscope channe= l value. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_deltaangl_scale | Scale for delta angle chann= els. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_deltaangl_x_raw | Raw X-axis delta angle chan= nel value. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_deltaangl_y_raw | Raw Y-axis delta angle chan= nel value. | ++--------------------------------------------+----------------------------= --------------------------+ +| in_deltaangl_z_raw | Raw Z-axis delta angle chan= nel value. | ++--------------------------------------------+----------------------------= --------------------------+ + ++----------------------------------+--------------------------------------= -----+ +| Temperature sensor related files | Description = | ++----------------------------------+--------------------------------------= -----+ +| in_temp0_raw | Raw temperature channel value. = | ++----------------------------------+--------------------------------------= -----+ +| in_temp0_offset | Offset for the temperature sensor cha= nnel.| ++----------------------------------+--------------------------------------= -----+ +| in_temp0_scale | Scale for the temperature sensor chan= nel. | ++----------------------------------+--------------------------------------= -----+ + ++-------------------------------+-----------------------------------------= ----------------+ +| Miscellaneous device files | Description = | ++-------------------------------+-----------------------------------------= ----------------+ +| name | Name of the IIO device. = | ++-------------------------------+-----------------------------------------= ----------------+ +| sampling_frequency | Currently selected sample rate. = | ++-------------------------------+-----------------------------------------= ----------------+ + +The following table shows the adis16480 related device debug files, found = in the +specific device debug folder path ``/sys/kernel/debug/iio/iio:deviceX``. + ++----------------------+--------------------------------------------------= -----------------------+ +| Debugfs device files | Description = | ++----------------------+--------------------------------------------------= -----------------------+ +| serial_number | The serial number of the chip in hexadecimal form= at. | ++----------------------+--------------------------------------------------= -----------------------+ +| product_id | Chip specific product id (e.g. 16480, 16488, 1654= 5, etc.). | ++----------------------+--------------------------------------------------= -----------------------+ +| flash_count | The number of flash writes performed on the devic= e. | ++----------------------+--------------------------------------------------= -----------------------+ +| firmware_revision | String containing the firmware revision in the fo= llowing format ##.##. | ++----------------------+--------------------------------------------------= -----------------------+ +| firmware_date | String containing the firmware date in the follow= ing format mm-dd-yyyy. | ++----------------------+--------------------------------------------------= -----------------------+ + +Channels processed values +------------------------- + +A channel value can be read from its _raw attribute. The value returned is= the +raw value as reported by the devices. To get the processed value of the ch= annel, +apply the following formula: + +.. code-block:: bash + + processed value =3D (_raw + _offset) * _scale + +Where _offset and _scale are device attributes. If no _offset attribute is +present, simply assume its value is 0. + +The adis16480 driver offers data for 7 types of channels, the table below = shows +the measurement units for the processed value, which are defined by the IIO +framework: + ++--------------------------------------+---------------------------+ +| Channel type | Measurement unit | ++--------------------------------------+---------------------------+ +| Acceleration on X, Y, and Z axis | Meters per Second squared | ++--------------------------------------+---------------------------+ +| Angular velocity on X, Y and Z axis | Radians per second | ++--------------------------------------+---------------------------+ +| Delta velocity on X. Y, and Z axis | Meters per Second | ++--------------------------------------+---------------------------+ +| Delta angle on X, Y, and Z axis | Radians | ++--------------------------------------+---------------------------+ +| Temperature | Millidegrees Celsius | ++--------------------------------------+---------------------------+ +| Magnetic field along X, Y and Z axis | Gauss | ++--------------------------------------+---------------------------+ +| Barometric pressure | kilo Pascal | ++--------------------------------------+---------------------------+ + +Usage examples +-------------- + +Show device name: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat name + adis16545-1 + +Show accelerometer channels value: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw + 1376728 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw + 4487621 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw + 262773792 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale + 0.000000037 + +- X-axis acceleration =3D in_accel_x_raw * in_accel_scale =3D 0.050938936 = m/s^2 +- Y-axis acceleration =3D in_accel_y_raw * in_accel_scale =3D 0.166041977 = m/s^2 +- Z-axis acceleration =3D in_accel_z_raw * in_accel_scale =3D 9.722630304 = m/s^2 + +Show gyroscope channels value: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_x_raw + -1041702 + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_raw + -273013 + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_z_raw + 2745116 + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_scale + 0.000000001 + +- X-axis angular velocity =3D in_anglvel_x_raw * in_anglvel_scale =3D =E2= =88=920.001041702 rad/s +- Y-axis angular velocity =3D in_anglvel_y_raw * in_anglvel_scale =3D =E2= =88=920.000273013 rad/s +- Z-axis angular velocity =3D in_anglvel_z_raw * in_anglvel_scale =3D 0.00= 2745116 rad/s + +Set calibration offset for accelerometer channels: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias + 0 + + root:/sys/bus/iio/devices/iio:device0> echo 5000 > in_accel_x_cali= bbias + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias + 5000 + +Set calibration offset for gyroscope channels: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias + 0 + + root:/sys/bus/iio/devices/iio:device0> echo -5000 > in_anglvel_y_c= alibbias + root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias + -5000 + +Set sampling frequency: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency + 4250.000000 + + root:/sys/bus/iio/devices/iio:device0> echo 1000 > sampling_freque= ncy + 1062.500000 + +Set bandwidth for accelerometer channels: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_p= ass_3db_frequency + 0 + + root:/sys/bus/iio/devices/iio:device0> echo 300 > in_accel_x_filte= r_low_pass_3db_frequency + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_p= ass_3db_frequency + 300 + +Show serial number: + +.. code-block:: bash + + root:/sys/kernel/debug/iio/iio:device0> cat serial_number + 0x000c + +Show product id: + +.. code-block:: bash + + root:/sys/kernel/debug/iio/iio:device0> cat product_id + 16545 + +Show flash count: + +.. code-block:: bash + + root:/sys/kernel/debug/iio/iio:device0> cat flash_count + 88 + +Show firmware revision: + +.. code-block:: bash + + root:/sys/kernel/debug/iio/iio:device0> cat firmware_revision + 1.4 + +Show firmware date: + +.. code-block:: bash + + root:/sys/kernel/debug/iio/iio:device0> cat firmware_date + 09-23-2023 + +3. Device buffers +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This driver supports IIO buffers. + +All devices support retrieving the raw acceleration, gyroscope and tempera= ture +measurements using buffers. + +The following device families also support retrieving the delta velocity, = delta +angle and temperature measurements using buffers: + +- ADIS16545 +- ADIS16547 + +However, when retrieving acceleration or gyroscope data using buffers, del= ta +readings will not be available and vice versa. + +Usage examples +-------------- + +Set device trigger in current_trigger, if not already set: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger + + root:/sys/bus/iio/devices/iio:device0> echo adis16545-1-dev0 > tri= gger/current_trigger + root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger + adis16545-1-dev0 + +Select channels for buffer read: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_d= eltavelocity_x_en + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_d= eltavelocity_y_en + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_d= eltavelocity_z_en + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_t= emp0_en + +Set the number of samples to be stored in the buffer: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length + +Enable buffer readings: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable + +Obtain buffered data: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0 + ... + 00006aa0 09 62 00 00 ff ff fc a4 00 00 01 69 00 03 3c 08 |.b...= ......i..<.| + 00006ab0 09 61 00 00 00 00 02 96 00 00 02 8f 00 03 37 50 |.a...= .........7P| + 00006ac0 09 61 00 00 00 00 12 3d 00 00 0b 89 00 03 2c 0b |.a...= ..=3D......,.| + 00006ad0 09 61 00 00 00 00 1e dc 00 00 16 dd 00 03 25 bf |.a...= .........%.| + 00006ae0 09 61 00 00 00 00 1e e3 00 00 1b bf 00 03 27 0b |.a...= .........'.| + 00006af0 09 61 00 00 00 00 15 50 00 00 19 44 00 03 30 fd |.a...= ..P...D..0.| + 00006b00 09 61 00 00 00 00 09 0e 00 00 14 41 00 03 3d 7f |.a...= ......A..=3D.| + 00006b10 09 61 00 00 ff ff ff f0 00 00 0e bc 00 03 48 d0 |.a...= .........H.| + 00006b20 09 63 00 00 00 00 00 9f 00 00 0f 37 00 03 4c fe |.c...= ......7..L.| + 00006b30 09 64 00 00 00 00 0b f6 00 00 18 92 00 03 43 22 |.d...= .........C"| + 00006b40 09 64 00 00 00 00 18 df 00 00 22 33 00 03 33 ab |.d...= ....."3..3.| + 00006b50 09 63 00 00 00 00 1e 81 00 00 26 be 00 03 29 60 |.c...= .....&...)`| + 00006b60 09 63 00 00 00 00 1b 13 00 00 22 2f 00 03 23 91 |.c...= ....."/..#.| + ... + +See ``Documentation/iio/iio_devbuf.rst`` for more information about how bu= ffered +data is structured. + +4. IIO Interfacing Tools +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Linux Kernel Tools +------------------ + +Linux Kernel provides some userspace tools that can be used to retrieve da= ta +from IIO sysfs: + +* lsiio: example application that provides a list of IIO devices and trigg= ers +* iio_event_monitor: example application that reads events from an IIO dev= ice + and prints them +* iio_generic_buffer: example application that reads data from buffer +* iio_utils: set of APIs, typically used to access sysfs files. + +LibIIO +------ + +LibIIO is a C/C++ library that provides generic access to IIO devices. The +library abstracts the low-level details of the hardware, and provides a si= mple +yet complete programming interface that can be used for advanced projects. + +For more information about LibIIO, please see: +https://github.com/analogdevicesinc/libiio diff --git a/Documentation/iio/index.rst b/Documentation/iio/index.rst index fb6f9d743211..79c348a0284b 100644 --- a/Documentation/iio/index.rst +++ b/Documentation/iio/index.rst @@ -18,5 +18,6 @@ Industrial I/O Kernel Drivers =20 ad7944 adis16475 + adis16480 bno055 ep93xx_adc --=20 2.34.1