From patchwork Thu Jul 21 19:15:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 12925690 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 14851C43334 for ; Thu, 21 Jul 2022 19:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233575AbiGUTQY (ORCPT ); Thu, 21 Jul 2022 15:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbiGUTQH (ORCPT ); Thu, 21 Jul 2022 15:16:07 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACEAA87C29; Thu, 21 Jul 2022 12:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1658430933; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=t/aA/ADhLOvNZFh4969q9417Wjvts2tDDeNzP6zFyvc=; b=qP0EQAqVLlXA087iqzaLNqkpObBwcOcjymmvG9BcDFG1jq4QjSmC4WdYo61poWsTpXmKeP OsODCuzYz8m4resONXgYz7nm+lm4Eh4JgbMmy224Z/xcH3mdQx/UbdrtJtvXaSAD2xMSHS p1DrIZLQBkDnPkNfbbFa3bwGhSPYCKw= From: Paul Cercueil To: Jonathan Cameron , Peter Rosin Cc: Lars-Peter Clausen , list@opendingux.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 0/4] iio: afe/rescale improvements Date: Thu, 21 Jul 2022 20:15:22 +0100 Message-Id: <20220721191526.374152-1-paul@crapouillou.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Hi Jonathan, This patchset adds support for converting the "scale avail" list that may be provided by the source drivers. It also implements the .write_raw() callback. These two features will later be used by the (drivers/power/supply/ingenic-battery.c) driver, which will pick the best scale possible for the battery's max voltage (it's already implemented in there, but doesn't yet support iio-rescale being in the middle). As you suggested after my RFC I added support for a new IIO_AVAIL_LIST_WITH_TYPE and it's been a perfect solution, so thank you for that. Cheers, -Paul Paul Cercueil (4): iio: inkern: Remove useless argument to iio_channel_read_max() iio: core: Add support for IIO_AVAIL_LIST_WITH_TYPE iio: afe/rescale: Add support for converting scale avail table iio: afe/rescale: Implement write_raw drivers/iio/afe/iio-rescale.c | 107 ++++++++++++++++++++++++++++++++ drivers/iio/industrialio-core.c | 25 ++++++++ drivers/iio/inkern.c | 35 +++++++++-- include/linux/iio/afe/rescale.h | 2 + include/linux/iio/consumer.h | 6 +- include/linux/iio/types.h | 1 + 6 files changed, 168 insertions(+), 8 deletions(-)