From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 886B6C2D0A3 for ; Wed, 4 Nov 2020 19:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2106F2080D for ; Wed, 4 Nov 2020 19:30:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="vQ6r5NKU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731165AbgKDTa6 (ORCPT ); Wed, 4 Nov 2020 14:30:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730788AbgKDTa5 (ORCPT ); Wed, 4 Nov 2020 14:30:57 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26C53C0613D3 for ; Wed, 4 Nov 2020 11:30:57 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id h62so3421006wme.3 for ; Wed, 04 Nov 2020 11:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e+B4nn+p6SZl8VwNKsIwWlOdD51ov0d76Utq0vxaU8M=; b=vQ6r5NKUfUoH6zxRR/t4N8Ndt5Qt2rIQ4STPSFDtPuzui6ro3NzW2pe9Bc1vQFNzfV TfHzVbLO9TIGAsQnKYlKIuSaMLvRXOtw2xLeFydPuoZfHxQ/Cp/WfA/sX+LMqXpoxDRe S+sQ/QUtJLJIU8WK2MRwiUSfzZvSwX7kW3F9aHKU5/yl54G5IyxE6QuHi4YOEINMLoyf i07fivKubVP7PqY710hdExXKheyV7mWBdLtzA1bixaCIZ8zOwcCQKZ3FmbUDJJm5NbRp tqqmSROBrrx8h4pO4Ij+M7HSP8ZUWLxvwIxNCu3yUoC74krCppxZNozNpyiRYO9g+bvk XcOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e+B4nn+p6SZl8VwNKsIwWlOdD51ov0d76Utq0vxaU8M=; b=LS3vU+/F5eiycKuoc2zd/C0m57oG9gkz4TPRVaW9uh96JXbXkynBul3ptXlHb4Tg7g rcnvHUPZUq4GXdQcaV738i2Y+9cEc2ApwWIXGQOZ1EOp2TfYXJk7S2FSgaTPJX3qjit7 m7sLjJpyk2csPLj5EyrvSlFWj3Qio0E9dobyjLTipRsFk4YRrH5AASQK2Co0LB/YJSmH gmESRH2FP3wOeE2INv1ApUAzQcCWzjeb7tks1Uu9OuBgjUgo4tVDcYuS+RLZClLwT5XK L6LbLtq6hjO7T3AMLsuQbxMqrv9aNaNzA40KVLA3gKtS4jR3/uYw9xvqYY6XOIfWr3oo 6bLg== X-Gm-Message-State: AOAM533Yb/fnMSiMzXTypGCA9ndkMzapNU5sB6I9n3tAU+yZSJd7CYig fk6C2/KVtPYmjk97jCFdonIhlw== X-Google-Smtp-Source: ABdhPJzHNVHbF+dAaencqhQbE8YKSuUJoCIc128keyMbqIKB5KKOffJsTQet890hcblRShwH+P4JCg== X-Received: by 2002:a1c:6843:: with SMTP id d64mr6465760wmc.131.1604518255891; Wed, 04 Nov 2020 11:30:55 -0800 (PST) Received: from debian-brgl.home (amarseille-656-1-4-167.w90-8.abo.wanadoo.fr. [90.8.158.167]) by smtp.gmail.com with ESMTPSA id m12sm4051671wrs.92.2020.11.04.11.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 11:30:55 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Jan Kiszka , David Laight , Mark Brown Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 0/8] gpio: exar: refactor the driver Date: Wed, 4 Nov 2020 20:30:43 +0100 Message-Id: <20201104193051.32236-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski I just wanted to convert the driver to using simpler IDA API but ended up quickly converting it to using regmap. Unfortunately I don't have the HW to test it so marking the patches that introduce functional change as RFT and Cc'ing the original author. v1 -> v2: - add new regmap helper: regmap_assign_bits() - fix lvl vs sel register access - set value in direction_output callback Note: I didn't use the fancy method of offset calculation Andy and David suggested because this series broke the driver according to Jan - let's get it right before we modify it any more. I found a couple problems that could maybe cause the crash. Jan: could you give it another spin? Bartosz Golaszewski (8): regmap: provide regmap_assign_bits() gpio: exar: add a newline after the copyright notice gpio: exar: include idr.h gpio: exar: switch to a simpler IDA interface gpio: exar: use a helper variable for &pdev->dev gpio: exar: unduplicate address and offset computation gpio: exar: switch to using regmap gpio: exar: use devm action for freeing the IDA and drop remove() drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-exar.c | 151 +++++++++++++++++++-------------------- include/linux/regmap.h | 16 +++++ 3 files changed, 90 insertions(+), 78 deletions(-) -- 2.29.1