From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) (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 272D72E11B8 for ; Wed, 10 Dec 2025 04:07:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765339674; cv=none; b=JvHeYyHn8wlfwCNNucllpdsH+zIhBNzm/fPpAqhdOj6nPI0yF+fTG9ox0YPzU3oYGRFBww2bmCaDTjcV9dvoLlehWjtWIxHAoprCE1x1lT6S15pEEtwTyOXvzrPAF/WZ9BtAYP5swd50+iMEjneyoKhC6TjiUSur1pNAg4L7sFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765339674; c=relaxed/simple; bh=i1gpkRHjj52HV/bqp8fIanguYj2f3n3g7/smx5nUqtQ=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=bKMYhPFw4N7m+5ptlHcBsQS4LsW8kRzw2Xfyq2ufeab6ILwLHLlVnW108LPvhBJ7HuZPQv+VDsd/uBzH+nECSQuQ5M8bgadcGg5bPLjc8gT/U5j0ItwMEjNmALAGiACfhFFTq3O/MYE5dCKdpwog+NsQj54ajJpqDfzfExvlaew= 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=TCwhRmx7; arc=none smtp.client-ip=209.85.222.53 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="TCwhRmx7" Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-93516cbe2bbso1791118241.2 for ; Tue, 09 Dec 2025 20:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765339672; x=1765944472; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jCN+wOZwpo+EvlIubaoI595wTf7FwItvq914uZQahfk=; b=TCwhRmx7DKQcjs1fd2pZ00L5G2gMNwzG3ge9d5wMJcWkwm7PjeI0i1iAI+IvLQh0KY ZpT9+SvotPFyivH19cKXZMCiGBKTQfCddUiTeKmbN5XNpADMv2SDx00G6AL3RvK7KVz/ F0htTaYiZ02mwLz5e1xPs2UE3v17LngYwg2LVceVWqwMBHkXBrCuaHaQvazM15FutHTs w0TweSXNXfttP2RmnSCPHYJ4cpGx8ZGHwWecGzHfpbqvP+ShIB6ECfFQ7Z5e+xyIWuq4 4pdUa6QGZkGm87oxFzRC9sloq9NQ70PxgMUw2+or4Te8DtH9RfeTizWU9Z2BxJE0cWa5 Jb2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765339672; x=1765944472; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jCN+wOZwpo+EvlIubaoI595wTf7FwItvq914uZQahfk=; b=S1uOJ8pEikZziiLQsrk5H92Fj5HPZUzEn2gjvHmnakvbRVVDzvtDPFMK2RrRTcZQg8 4C2uhQlgL3IjR+Th819XmyHsDPVyBYHGg4X4jgIBfhgJjiRscTTFjj9ehfOz8kMtNKek THZl9zn9wKjsj9drhuS+tDS4Zac+fSoKH5CkdIFbDkUKrIWwp0sNjQlvP54hZfPQ5Xpt jgc0qU5r26h//ZfLw8+EAhX5z6s0TR94qHGtfRfV/5I9dnjDmXibUzQ0ByrKJ0iTY6Tj vpbAOFo8EVzXtaIix2YStB7UqrN24YW1aR+jOUOUiU77cJq41S1oGo0cJu41STFDiEYV IwSQ== X-Forwarded-Encrypted: i=1; AJvYcCW2YJmrd/pGt0YnlRXEzWeRLYPls7d1mXxK1fORRw6ZjcvrEP0N4h1zqaZUIaPrt9zCbZTnKmcmkPMHECw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2H3zROmXPGp5S49wVf7cJ+n7n6+ieMVfwtvHGODGEoiTNRPfW TbHuZTKz0fKJwPnilQRqof/DZ3VrzffnOym0Dx+XUWI6YoxkJm6OueyN X-Gm-Gg: AY/fxX4OVKoCUg6dZPgbRsAcEPQV2WehEytWcBpQRNzrGVe6YiJ0BMo6uWpr/c6HBn0 qCltEg+CZUN3P9LsYIblBXuA0iGUVWjq9mDkajJeTK+mJ6h3B9XzEv7EaQUyM9RX2fUK26FPClk q4N1mIbqIqJ2OtTXqiFhWzPzxCkCg0LwWcBoY0SXaMXc+JuBocFAwkdF4LH3wphsy+4xdOuFHDj DG6bftCTXY+Ct1s1eAyEm/H8Yl5fAApaEtcfvPXgpyJjfNe8rsn1ln+4191BSMPdvePETyafpEk 3aBtxPJgHRErFnvbMBSUq/6fI55/glyIpg/pdSJjQ9WXbLMjjqL4WY5sjByy2UkPIf+WOtgS15L lYohapOsiICFtmuluEjqWz0mNWaPHD+uRGwxQ4xuEiuGpqPWDXlgzqUw+17Lx36fZBysjh87FUp MVLTg= X-Google-Smtp-Source: AGHT+IHM30DvWmYtT07T8M42FAxd4lX1UgnTiBhKzv5t+gCOoi7mVGJuQlvB9Bjp4pGe49Z4oPi6Rg== X-Received: by 2002:a05:6102:390f:b0:5db:faa2:f3e1 with SMTP id ada2fe7eead31-5e571a3b7eemr309836137.15.1765339672002; Tue, 09 Dec 2025 20:07:52 -0800 (PST) Received: from localhost ([2800:bf0:82:3d2:875c:6c76:e06b:3095]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-93eed6c41c6sm7781948241.5.2025.12.09.20.07.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Dec 2025 20:07:51 -0800 (PST) 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 Date: Tue, 09 Dec 2025 23:07:49 -0500 Message-Id: Subject: Re: [PATCH v7 2/2] iio: adc: Add ti-ads1018 driver From: "Kurt Borja" To: "Andy Shevchenko" , "Kurt Borja" Cc: "Jonathan Cameron" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Tobias Sperling" , "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" , , , , "Jonathan Cameron" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20251208-ads1x18-v7-0-b1be8dfebfa2@gmail.com> <20251208-ads1x18-v7-2-b1be8dfebfa2@gmail.com> In-Reply-To: On Mon Dec 8, 2025 at 3:19 PM -05, Andy Shevchenko wrote: ... >> +/** >> + * ads1018_calc_delay - Calculates a suitable delay for a single-shot r= eading >> + * @hz: Sampling frequency >> + * >> + * Calculates an appropriate delay for a single shot reading given a sa= mpling >> + * frequency. >> + * >> + * Return: Delay in microseconds (Always greater than 0). >> + */ >> +static u32 ads1018_calc_delay(unsigned int hz) >> +{ >> + /* >> + * Calculate the worst-case sampling rate by subtracting 10% err= or >> + * specified in the datasheet... >> + */ >> + hz -=3D DIV_ROUND_UP(hz, 10); >> + >> + /* ...Then calculate time per sample in microseconds. */ >> + return DIV_ROUND_UP(MICROHZ_PER_HZ, hz); > > If time per sample is in =C2=B5s, the associated frequency is in MHz, so > the correct constant is HZ_PER_MHZ. What did I miss here? I was very confused about this, but the dimensional analysis works with HZ_PER_MHZ so it should be the right constant. Thanks! ... > Other than above, LGTM! > Reviewed-by: Andy Shevchenko Thanks a lot for all your feedback! I also found that the sysfs ABI specifies millivolt for voltage final calculation and millidegree for temps. I will adjust scales to comply with this in the next version. Do you have a suggestion for this? I can keep the ADS1018_FSR_TO_SCALE() macro but it will get a bit more complex or I can just hard code the scales and document the calculation. I'm inclined to do the latter. --=20 ~ Kurt