Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2288624rdb; Mon, 20 Nov 2023 07:13:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGY63OUq7ehppJn2JxkI/z1pre5e64gpD+qeFAPYtk8WBaHakghEbEGIpbuTV1hJeaPnVqp X-Received: by 2002:a17:90a:e7c3:b0:280:99f0:4234 with SMTP id kb3-20020a17090ae7c300b0028099f04234mr5355190pjb.7.1700493209657; Mon, 20 Nov 2023 07:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700493209; cv=none; d=google.com; s=arc-20160816; b=al43pWacK+mQrd8MmqYSF+6xfJ3KhSsMqzL2J2eG7fxitTyVAK1p/lhyWo7lOEV4EE 0vo6Zncj56XUFzV+PGSOShVHuUuwX3tYkykNge/k6Z1yJFm4jyCjaaHoGU2SxmtOJoVW 1uvIEek7FV9lf2iG3mnsmhcKASZGPs90WE0zSPWvTVH99xtksIM8bjAxD5vfvAiNYBxN WuQpQAxxBxHrbvZu6Q0HeOaW11DfPbIc1tb7AYKxXUczDhhO8v9aY5jdpVyTZw7vZ9nt luD3ICdcfdfDiWx4BLukIQAiO0G79jLX9ok4ioOAOozZaNDc6AzCmLtrE52nIjOsZRaP 5SKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NAmZGLTmGJXV9YK2C2V+/HZinpAhQyW4PPvI5BLDSDo=; fh=PneF+5aiqFDY0M7vAJCwjLV7AwRCOicCFwzwDt0kWXY=; b=VCB5Vv6SaVQw5hjwvxMeSe8mf+/5RKXgGL+Lwfbdol3HmUeaqBaoH9p+R9gBCs6TXi pDmRaP/6HsLnkAIvxoZ7kiwyiBBEcv54YrqYrOXadlvjl8+5wzhEz9/3sy5DIqoQAOjM m/xaLJm0VFHNJ2WhttS6gNNCs67V4/OLSumWqKmUEJb5Qr0zKnVZHZpPcUbbHF8r1ZTf UZcdE3f2YpgW5Wvty1wdg9bpAbcG9OBEKPCUV/TgpxgNQmq4sMn18I5WuMGKUqDACa+N By3XsCBpS5MCk7js+THrWVdSijffRXCmE/tHRCxOp26YiDJfst3BqMhraMS59Kca/VkL a2qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=NEjJ9VGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id na10-20020a17090b4c0a00b0027d01d450desi8495525pjb.86.2023.11.20.07.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:13:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=NEjJ9VGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EEBF18077FDC; Mon, 20 Nov 2023 07:11:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234106AbjKTPLO (ORCPT + 99 others); Mon, 20 Nov 2023 10:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233333AbjKTPLI (ORCPT ); Mon, 20 Nov 2023 10:11:08 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65FFBAC for ; Mon, 20 Nov 2023 07:11:01 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507adc3381cso5759774e87.3 for ; Mon, 20 Nov 2023 07:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1700493059; x=1701097859; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NAmZGLTmGJXV9YK2C2V+/HZinpAhQyW4PPvI5BLDSDo=; b=NEjJ9VGTvnXQkawfgAfjIFIOcbQBdGjRz7cCI1K7qN0jLSQ60AP8lb+KTguop8FMqr IwJV80RC9juiO2uF7B4Jz9MqEIbZeLQNlXFOn1ppxB4ChULaQ0yrCqBsBtzk6KhOoXxW t0hRWzRwMALigKqulTmJb69ObiJh6gIs8/hyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700493059; x=1701097859; 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=NAmZGLTmGJXV9YK2C2V+/HZinpAhQyW4PPvI5BLDSDo=; b=r9/xIKKx9J8vrlpsUfjfwzwF0M3/wPNvznBlODYxsjLpXwIOWeRrI+vVrEzUuTiTY5 QT23/SrPTEiof7rCCDS4ou+GhyfeA2NrI93V3+6JV9krHzslbgUsfXcgtVFP6AdHTkWp n8qjI3Ro07HBgiRcu2x0YOWKStwAvxqrZlE6SNrA+EpOxwwXsYj6ktrTpjUN5CW9nDgR buDDgZIvL6fl7Vu5v/Je8HOQngZQk0nuiWajd4d8HChveRM65HuQrl0rT4yXb5DLCftL m3gkWhJQQvQr38lBObx7t7RDf2WQv76yYs+ocZpT5YQzgLQAfcGIpQOMUxLz5T3Y3xJx fXeQ== X-Gm-Message-State: AOJu0YwFFj4F07Bck+uV0wJ1orXykkt3baBTdW/0AtvS2XmtiODwVLTt amE7Sf4KEES1cP5WMSDHi/CRXw== X-Received: by 2002:a19:5218:0:b0:507:a66f:55e2 with SMTP id m24-20020a195218000000b00507a66f55e2mr5161118lfb.10.1700493059459; Mon, 20 Nov 2023 07:10:59 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id g29-20020a0565123b9d00b00502e2ab7118sm1207444lfv.50.2023.11.20.07.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:10:59 -0800 (PST) From: Rasmus Villemoes To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: Andy Shevchenko , Lukas Wunner , Rasmus Villemoes , Rob Herring Subject: [PATCH 0/2] serial: add rs485-mux-gpio dt binding and support Date: Mon, 20 Nov 2023 16:10:53 +0100 Message-Id: <20231120151056.148450-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.40.1.1.g1c60b9335d MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 07:11:30 -0800 (PST) Some boards are wired so that they support both rs232 and rs485, with a gpio controlling a mux connecting the SOC's pins to the appropriate external circuitry. Instead of requiring the application to know about such details and handle the gpio appropriately, allow it to be described in device tree and let the serial core code handle it if present. Tested on a board based on imx8mp. Rasmus Villemoes (2): dt-bindings: serial: rs485: add rs485-mux-gpios binding serial: core: implement support for rs485-mux-gpios .../devicetree/bindings/serial/rs485.yaml | 5 +++ drivers/tty/serial/serial_core.c | 35 +++++++++++++++++-- include/linux/serial_core.h | 1 + 3 files changed, 39 insertions(+), 2 deletions(-) -- 2.40.1.1.g1c60b9335d