From patchwork Sun Sep 10 21:44:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 112154 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp4844307pji; Sun, 10 Sep 2017 14:44:41 -0700 (PDT) X-Received: by 10.98.194.148 with SMTP id w20mr3888384pfk.299.1505079881570; Sun, 10 Sep 2017 14:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505079881; cv=none; d=google.com; s=arc-20160816; b=vF8ogh30/VEI6jBPzCEIgc3tg8qju5x2JDesiG1nUUce9now1oHzEP/PDF8u5FU4+X TCBUVSKajJO9L90GWqU9EaG3dWU+TwWkTUfhp0VNwmQak727cW4zZjup7jJzWgQkSbYK k1Tk+KQ0wuF/VhIvEMlsJRKKE/mquqbBP5gwMtpFPG1p50Is/s3X0IRne4Tgts8lZnYH H35EAGSSjE3MlIri6s58gdj4ipTv4rnHBMkxrWw/8B1sdW66w6oS1FPwRp14vEoHQvHE OGq65m5+zeiIm/oe3/Vsjf/jvJXEWfWAH5Did3eKScwYxSvLCMNh5FTjD3cQTan2KtD5 ylng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=NPJnt6DBOZyDbXy7i482J3lzooUWfFSBp/M/l+4Dbh8=; b=ZfxYRA7muZ90ZGUR28cTSkc10aUdJQb9jKF56CJs8ps6fndPckNGoWzilrpEeED5SE IITRc3utDro11kupU4h2PlAuwWukLdCPOhU34EAuIUeW66L82+UCPpWWXBzjfVPPHpRL 652riVk6hklb06zV6JY6V7O1RBL0YZOdk6dE1938OCUDcjP07o88y575GuV6FqFVn9m+ ZsocUNQ59gmBs3e/kMXdi/WDsJJDuMw7jt+8O2L42fAjSWRqFXVxqdNfyJsIlJTF8U+l 4kGb3uzjmlJPARLg+HmXXPCc0/0XUiad6oWQDESLxJZlm8XHpCXtLvulm/PSIUHt6fBN 0gSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jp/3LAPv; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si5925819plk.558.2017.09.10.14.44.40; Sun, 10 Sep 2017 14:44:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jp/3LAPv; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751613AbdIJVok (ORCPT + 2 others); Sun, 10 Sep 2017 17:44:40 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:36152 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbdIJVoj (ORCPT ); Sun, 10 Sep 2017 17:44:39 -0400 Received: by mail-lf0-f47.google.com with SMTP id m199so14415355lfe.3 for ; Sun, 10 Sep 2017 14:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NPJnt6DBOZyDbXy7i482J3lzooUWfFSBp/M/l+4Dbh8=; b=jp/3LAPvQbClEMWTE4P//+aiHN4qx7JriZyGZlDNdASSRyBpG1h0K6VCkHz9bD9BqL /sanxFrPHfr29NvfePBvOj3K5UmUNZRS1npTmLLZG0hxqO68pzNyUcboQtp54yLTHR+z kjr4AgGp60dX5P4ZsGXNKaC0FcEwPJ5AgjFbE= 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; bh=NPJnt6DBOZyDbXy7i482J3lzooUWfFSBp/M/l+4Dbh8=; b=PquBhGybbXrH31tvUFD2n01aYYW5AKxueMfvz8hGwiVHK8cVa2vxXpcxtFYYm9TB5h Ws4RFtheKQTjvq3cs72k4GGUAbstcw5/QCrRouZp2kil1nV9R+opskG5/Oz53MzMSK8B KhpAD7PKx8HmsyfTBBisOKbf1wHluquIjfq9NY7bdBq3Yu2mu/Av7HJw49Kiksn9lsXG 8UmTQinclT3yIxcG7FBL1LRpvfeaj0xJTyClezIp/+GaE1ZC9nxtIuJbzMwGxuh7kl+S vAPzQrOM0gjffNh474skQ3NfLML6mmMgEQkzSeZ4UaqAt8bINDWOcpyAnJDp8243bDCG TWdQ== X-Gm-Message-State: AHPjjUhgmL62xVjHsP1ngozNveG3cSCB3jVIzpzlV6R9gelieuZbH1Bi ftzaLEs+db5ovSV+ X-Google-Smtp-Source: AOwi7QDyf/JwYlqFfcj+Cx0MR/HOs43sn7Dc5+qe1OA9/UQt+4gsPNeuGp6qeFpkPUbZsNcE21Bp/Q== X-Received: by 10.25.155.71 with SMTP id d68mr2481468lfe.181.1505079877815; Sun, 10 Sep 2017 14:44:37 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-2209e055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.9.34]) by smtp.gmail.com with ESMTPSA id c69sm1461546ljd.42.2017.09.10.14.44.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 14:44:37 -0700 (PDT) From: Linus Walleij To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org, adi-buildroot-devel@lists.sourceforge.net, Linus Walleij Subject: [PATCH 0/5] I2C GPIO to use gpiolibs open drain Date: Sun, 10 Sep 2017 23:44:19 +0200 Message-Id: <20170910214424.14945-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org I recently looked at this driver when testing the I2C GPIO on the Gemini platform. It's one of the archectypical places in the kernel where we have open coded open drain emulation, also without much explanation. So I went in and fixed it. The fix is pretty brutal changing all boards and one MFD device using this, but I like the end result, making the code much more readable and skipping the intermediate step of looping through the old GPIO API. It would be nice to get some testing and ACKs on this if people agree. I imagine Wolfram would use the whole thing into the I2C tree but I could also carry a branch in GPIO to be merged through the GPIO tree if it is preferred (like e.g. Wolfram want me to get the heat for any regressions, hehe). Linus Walleij (5): i2c: gpio: Convert to use descriptors gpio: Make it possible for consumers to enforce open drain i2c: gpio: Enforce open drain through gpiolib i2c: gpio: Augment all boardfiles to use open drain i2c: gpio: Local vars in probe arch/arm/mach-ep93xx/core.c | 41 +++--- arch/arm/mach-ep93xx/edb93xx.c | 15 +-- arch/arm/mach-ep93xx/include/mach/platform.h | 4 +- arch/arm/mach-ep93xx/simone.c | 12 +- arch/arm/mach-ep93xx/snappercl15.c | 12 +- arch/arm/mach-ep93xx/vision_ep9307.c | 7 +- arch/arm/mach-ixp4xx/avila-setup.c | 17 ++- arch/arm/mach-ixp4xx/dsmg600-setup.c | 16 ++- arch/arm/mach-ixp4xx/fsg-setup.c | 16 ++- arch/arm/mach-ixp4xx/goramo_mlr.c | 24 +--- arch/arm/mach-ixp4xx/ixdp425-setup.c | 16 ++- arch/arm/mach-ixp4xx/nas100d-setup.c | 16 ++- arch/arm/mach-ixp4xx/nslu2-setup.c | 16 ++- arch/arm/mach-ks8695/board-acs5k.c | 15 ++- arch/arm/mach-pxa/palmz72.c | 14 +- arch/arm/mach-pxa/viper.c | 27 +++- arch/arm/mach-sa1100/simpad.c | 14 +- arch/blackfin/mach-bf533/boards/blackstamp.c | 19 ++- arch/blackfin/mach-bf533/boards/ezkit.c | 18 ++- arch/blackfin/mach-bf533/boards/stamp.c | 18 ++- arch/blackfin/mach-bf561/boards/ezkit.c | 18 ++- arch/mips/alchemy/board-gpr.c | 23 +++- arch/mips/ath79/mach-pb44.c | 16 ++- drivers/gpio/gpiolib.c | 13 ++ drivers/i2c/busses/i2c-gpio.c | 184 +++++++++++---------------- drivers/mfd/sm501.c | 49 +++---- include/linux/gpio/consumer.h | 6 + include/linux/i2c-gpio.h | 4 - 28 files changed, 372 insertions(+), 278 deletions(-) -- 2.13.5