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: 812180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="jp/3LAPv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xr4Ms3X0Jz9s4s for ; Mon, 11 Sep 2017 07:44:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751613AbdIJVok (ORCPT ); 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(-)