From patchwork Tue May 5 08:43:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1283363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=cvo/bt7Z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49GYCn6qRCz9sRf for ; Tue, 5 May 2020 18:43:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 880DF82046; Tue, 5 May 2020 10:43:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="cvo/bt7Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E92D582046; Tue, 5 May 2020 10:43:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 718B781F67 for ; Tue, 5 May 2020 10:43:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wr1-x443.google.com with SMTP id h9so1727957wrt.0 for ; Tue, 05 May 2020 01:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u2khKbxEiFCEUR00qpEYxMuUbvK9/gZNnNMtQJEnKGM=; b=cvo/bt7ZiwsWcWLgakjVy0MOnOl7/l1EjSOuEHbKR9avATktoiIbt580tIf1r1IiFm aBISlcIoun8dxjrcS71i6P2/E/mUXfkgEy5ahG1bEi5HzXWJxjTioM8gHuP/ltjG9r4h JJCy6sMo5nRiX982qIp8ZHkRYGStN3JjF0wMH8gxvhvXCqrsWVs4P6tfsOLkv2cosr8t aBKxacF6ZbzTTIjNnu0dUTDOWZ7+3GXbytmNcCSEjBDvfsQ5VnwEho7PIZaEDrMahQPH iBdNgr0QJnHBKWm76G4tRClWyns8nA6Ffm4IJr6D4IYFSWN7sasRuJ7LTRfLK2CA3OJw RFGg== 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=u2khKbxEiFCEUR00qpEYxMuUbvK9/gZNnNMtQJEnKGM=; b=W13uYQbZhz1fvncGwUJxKvkF/J54fGFFxWGrf8BHjwm7Y1tzt637dojvsCWHR6IBvD p6dQvXy63yhQ7MBgRN1e/4Ov8Hi7Zwq0jXQIWGs7lubWdACPXiQ7clZqzzwhQy2sYi8m YwCN3T6dJqITCK23Xl7eCSU4ZqA/GZ8xGdeyGFWXME/he9qlqZ1Gkv7vvEFtYbUt6CjK FlcKM9bbrh8sIyW8e4ffpaPOz2fdauXdBpgwyLpG1jdvuXdp3EGyhkBWX3h1j2ju4Kgx 4SVNmSoxsmOYDo2igsz7v/4bYi6IV3OAhp0yH0C8Rd0ceG9Wj7z82U8gq/HNylA1tLHt PZuA== X-Gm-Message-State: AGi0PuZ1QwzPsZUh4uGoFbylw/cXjk9oD2NKtoq44msp1ByPX6k9giQr 56CNxGoV88GstE8BxenSBYW2mw== X-Google-Smtp-Source: APiQypLfjAvqddGzx+mwNith+BDoBsIMsYWkGLDI9sg8inFAVouYwqizYkIBmCMgO3nljwIQAJbXYQ== X-Received: by 2002:adf:e941:: with SMTP id m1mr2277439wrn.385.1588668204904; Tue, 05 May 2020 01:43:24 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:4460:3fd3:382:4a71]) by smtp.gmail.com with ESMTPSA id n2sm1959654wrt.33.2020.05.05.01.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 01:43:24 -0700 (PDT) From: Neil Armstrong To: sjg@chromium.org Cc: patrick.delaunay@st.com, u-boot@lists.denx.de, Neil Armstrong Subject: [PATCH v2 0/2] gpio: add gpio open-drain & open-source emulation Date: Tue, 5 May 2020 10:43:16 +0200 Message-Id: <20200505084318.15307-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean When a line is in open-drain or open-source mode, U-Boot doesn't handle it directly. Let's add gpio open-drain & open-source emulation in gpio u-class to make it transparent to driver using a gpio line from DT. Changes since v1: - fixed all open-drain/open source cases - updated dm gpio test Neil Armstrong (2): gpio: emulate open drain & open source in dm_gpio_set_value() test: dm: update test for open-drain/open-source emulation in gpio-uclass arch/sandbox/dts/test.dts | 4 +- drivers/gpio/gpio-uclass.c | 15 +++++++ test/dm/gpio.c | 89 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 1 deletion(-)