From patchwork Wed Apr 12 12:29:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13209122 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 34277C77B6E for ; Wed, 12 Apr 2023 12:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231560AbjDLM37 (ORCPT ); Wed, 12 Apr 2023 08:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjDLM3t (ORCPT ); Wed, 12 Apr 2023 08:29:49 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC9E72B1; Wed, 12 Apr 2023 05:29:12 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id q26so2275942lfe.9; Wed, 12 Apr 2023 05:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681302551; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=siCdH4i793Fr0Wj+21nPqmHI0RDFnIElDQrnU73xJYE=; b=VQeCgQHI1EcjcFspsDA0zh1lWNC/OCP9F8kU/YlAwXgU5fTRTIXy7bmnnl4+N7zA+p 6IA34k911R6zsbWb73+5Z4Q/6GHydO4fCAqHpV0/Vpq3c7U5RY1EGSlvGUR7Td3fpzwi TSD63KOFu/GsWRmacMpazKGJzQxEX64GgltaFsMgj3n+2RrUATCwS252Xo1Cz3H0i7S6 X888/cR9bclHvDmJjkuF7XVHguwYS+fBrPjh0zUvagF0HYfVVHO58kbujExExX8VuoJS CLTAZq0aEhmDsLfXXuzLoph0kIexzAwKXQ+Vce3NidURTMIYEBGNE65nAtIIOHuEFPWX 4phg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681302551; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=siCdH4i793Fr0Wj+21nPqmHI0RDFnIElDQrnU73xJYE=; b=q2BUy0mMUhev7NcibrK6zz0D7cQtZuwjYE0nedHdDrh6oIA2U9nfi1QCNSAfLQ0CiI P490+4BDmL+Ukf/hD8awsZSgtK0YCoKpRIvUj99fLz1bMbWY0L2Rj1eiMYfKP2vwdIm9 GfVZT5s2xfG87vb9OVQy8CWthbVXf00G1G5cBHFOIq0LGQZGZkrY2HYgSSWR3Dlqumpy 5itpweHUXno53HXitFyFJ6J9BD4xpAoKnLLq55yn4t0cJWe5WKo669Xxc4uZnkGuT1py dzYGL1VdQOINiIANz3oy7zZiUp7QBLterlUhTzLVgB+pQzXqPPONmZ6cYKanlaqWMH1B j7QQ== X-Gm-Message-State: AAQBX9c8OTWAspTe3e9++XDqmYQe857n1KjV1VAz5sYqe4aRskDuLvv3 jayQ/BTqk6U9ZYulWU8gdJ0= X-Google-Smtp-Source: AKy350YoQXSzO91Dyj+lPCb5tSWpcCDLY/OAJLAUkM8P1zlP2mEfymzfXSK3UmKtyEid6KjzXadmhw== X-Received: by 2002:a05:6512:203:b0:4e9:d158:d56b with SMTP id a3-20020a056512020300b004e9d158d56bmr512162lfo.62.1681302550783; Wed, 12 Apr 2023 05:29:10 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::1]) by smtp.gmail.com with ESMTPSA id n12-20020a19550c000000b004e7d6eb9cbfsm2973522lfe.190.2023.04.12.05.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 05:29:10 -0700 (PDT) Date: Wed, 12 Apr 2023 15:29:01 +0300 From: Matti Vaittinen To: Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Matti Vaittinen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] iio: bu27034: Fix integration time units Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The integration time was presented by BU27034 in micro seconds. The ABI documentation says this should be in seconds. Fix integration time to be in seconds. Signed-off-by: Matti Vaittinen --- drivers/iio/light/rohm-bu27034.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/rohm-bu27034.c b/drivers/iio/light/rohm-bu27034.c index e486dcf35eba..6044db52abfa 100644 --- a/drivers/iio/light/rohm-bu27034.c +++ b/drivers/iio/light/rohm-bu27034.c @@ -1171,7 +1171,7 @@ static int bu27034_read_raw(struct iio_dev *idev, if (*val < 0) return *val; - return IIO_VAL_INT; + return IIO_VAL_INT_MICRO; case IIO_CHAN_INFO_SCALE: return bu27034_get_scale(data, chan->channel, val, val2); @@ -1229,7 +1229,10 @@ static int bu27034_write_raw(struct iio_dev *idev, ret = bu27034_set_scale(data, chan->channel, val, val2); break; case IIO_CHAN_INFO_INT_TIME: - ret = bu27034_try_set_int_time(data, val); + if (val) + return -EINVAL; + + ret = bu27034_try_set_int_time(data, val2); break; default: ret = -EINVAL;