From patchwork Thu Aug 3 12:56:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Collamati X-Patchwork-Id: 13339954 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 9391EC41513 for ; Thu, 3 Aug 2023 12:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231705AbjHCM4n (ORCPT ); Thu, 3 Aug 2023 08:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjHCM4m (ORCPT ); Thu, 3 Aug 2023 08:56:42 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E1E1712; Thu, 3 Aug 2023 05:56:41 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-523108efb36so499163a12.1; Thu, 03 Aug 2023 05:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691067400; x=1691672200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9w2kAX5SuWXUcxUMa/7advq5QKHG60UYwE5l01L0SL4=; b=H3ibOCOUojy7D5f0/dMAe08rOL8nXB9zx2LjkJkv0CoLWmyo+cZ2sdjUQex7XzzUjZ GecP/NbvZQKWjg6MQpUhv9XVWB3Uc6evWDnBRFhxjO74HMmaGZG83Q81VVRfenURPVcN bvfyHXlmjER5lmnD2CFFRlt4WdixwvtMJGJh2I8OaMi2xVx9o6HU7WyjPuv3yAw15JAV lJmYyR4WikgXhitDWGMzYC8Ihm6SfSomNBetyrrNJY4pnsQthav6IfZ53zn4Hbehgmx2 7LoX6BUIDIZHyK81SDQDRvAOtllsF1/RAfl9ak7JpQQsvcjeNVkNavDtRA3nU7B4XmuE Ar0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691067400; x=1691672200; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9w2kAX5SuWXUcxUMa/7advq5QKHG60UYwE5l01L0SL4=; b=aevDG4PV8dJNvxl/rLBRSqPqVyok7Ksnav3zrr/988Jv6SxJB8qoXeBQibcCQejFtA o6/ICP4CXiIw0oY20NG2tLd8KNFNKKYIrL/2JXQkSToDanKVY0Z8gDbla+QeIoB7bqf9 A0v4oAh12SE19vlMINxhvGbVdADLmZVl/NB5kz4F2teUCTwx5LD3xsEmk3ne3d8uL8/5 MseDy9XMQJafAR5Iegy+h8BjtChPy5F12Ck6ahAy4Qp0GGp8+hx8W0AwQSBjN9UpsYow lp78m+v4CT3gvrkQFLMXYsfTlwr/kZf1NGi7DYwLNVcvWPit3k/xPcTQqT6R5WfCHvBM i/Fg== X-Gm-Message-State: ABy/qLaLz0gb0004nCTobYcrupGErdhvzq03G44f8z0TBlZKgw5GIy9y J/ZUvJIrdkeYd+pxEfu73s8= X-Google-Smtp-Source: APBJJlGDtIbCvMmKx/Bm1ASPtAVgVnQMJIdWxxexX0nBxEAKPzbyqADWOguSCp1E5vLkt+biTy0Iww== X-Received: by 2002:a17:906:3cb1:b0:99b:f08d:a390 with SMTP id b17-20020a1709063cb100b0099bf08da390mr6778946ejh.26.1691067399651; Thu, 03 Aug 2023 05:56:39 -0700 (PDT) Received: from colla-nuc.fritz.box (host-79-26-241-62.retail.telecomitalia.it. [79.26.241.62]) by smtp.gmail.com with ESMTPSA id ci18-20020a170906c35200b0099bd682f317sm10378877ejb.206.2023.08.03.05.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 05:56:39 -0700 (PDT) Received: from colla-nuc.fritz.box (localhost [127.0.0.1]) by colla-nuc.fritz.box (8.15.2/8.15.2/Debian-22ubuntu3) with ESMTP id 373CucRs207731; Thu, 3 Aug 2023 14:56:38 +0200 Received: (from colla@localhost) by colla-nuc.fritz.box (8.15.2/8.15.2/Submit) id 373Cub6h207730; Thu, 3 Aug 2023 14:56:37 +0200 From: Andrea Collamati To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrea Collamati Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: =?utf-8?q?=5BPATCH_v4_0/2=5D_add_MCP4728_I2C_DAC_driver=E2=80=8B?= Date: Thu, 3 Aug 2023 14:56:33 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Changes v3->v4: - sorted includes - driver name inlined - used FIELD_PREP() / FIELD_GET() to define/access regs - fix comment style - removed infrastructur form multiple support devices - wrapped up custom ABI in the standard ABI of _scale - used dev_get_drvdata(dev) to cleanup code - used devm_add_action_or_reset to cleanup code Changes v2->v3: - fix wrong i2c_device_id array indentation - removed double blank line in Kconfig - added description in dt-bindings - use uppercase letters for device name Changes v1->v2: - fix mcp4728_remove prototype - improve indentation - various fixes suggested by checkscript.pl - removed unused of_device_id.data field - removed unuseful mcp4728_data.id field - various fixes suggested by dt_binding_check Andrea Collamati (2): dt-bindings: iio: dac: add mcp4728.yaml iio: add MCP4728 I2C DAC driver .../bindings/iio/dac/microchip,mcp4728.yaml | 49 ++ drivers/iio/dac/Kconfig | 11 + drivers/iio/dac/Makefile | 1 + drivers/iio/dac/mcp4728.c | 626 ++++++++++++++++++ 4 files changed, 687 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/dac/microchip,mcp4728.yaml create mode 100644 drivers/iio/dac/mcp4728.c