Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1473040pxj; Fri, 18 Jun 2021 07:55:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3hBDdPk48sy4mlKKwGCRZJLf1C9ss1O1N1E9kaa7SrkA8Vb8gNFun8w944M3I/A3o682v X-Received: by 2002:a05:6e02:525:: with SMTP id h5mr8143181ils.212.1624028109666; Fri, 18 Jun 2021 07:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624028109; cv=none; d=google.com; s=arc-20160816; b=Y6JGlaTHglJbHHQr2Ik0h/KXIytp7vVgRGmL6qlPWU8HxIz+F+FipMx7glq7IQQ784 UM79lPM4rBJ7zVIytEffqoLById4kAxeXCkSs0FCAs3VmIkUIuA4IfYS05PLYLdCYliB +m+P7RKiNOaz4MxwzzsYuEUAUN1GewrsRBr6KfLtJkG+WPao+9XKf2LZELH046b9wGFJ IudB0e0f8eSRSV3g7LkDh2OCot9pHZeAWYCZTMnr6ZlIaWpjiFvUxBUMnFCwSK4+jczO VER45ZbQPHb2659rBkJXbO2xk0b+KLrKFFVJcP+PHHzPKcU0gyxBoD3tpqlZlqu+PFej rpvg== 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=5KANbDUOSm1uBFlCYYXKIoijReWqt8fXs2haBqiKeDk=; b=goxuxHuOJDQ7R3+y5CUTDac95cCQYxC6R0Ng5vwOchMDc5LyJhEBFyH25hZQrxJkI3 zd8T0Prs+FIv0ERYmCXhUq2Us2XuugNjJRzNcdLLQfnJMpLHU0EEP54IpxUhsyN1sFrj 8VV0Lhfw1h33FZqo6zJhTny3BHU9wtHpH7RgG4A88ndO/7sstBHUHXwfq7Y53NOl+hG4 LaHJVUjUkl3ehQ0G85dD+3m9NkGMF+5FGTC0D+j1NuGpX5Ycj/3B0DKD7jTzei+TEAQx LPvnHCz1i1jYBVsO2vvcg/k1kQyZephhCg7Jy3GCBem2jIw4qmtYT+kw5MhddoAOAiNA xf0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="MV+R3p/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si2409290ilp.35.2021.06.18.07.54.56; Fri, 18 Jun 2021 07:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="MV+R3p/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234758AbhFROzC (ORCPT + 99 others); Fri, 18 Jun 2021 10:55:02 -0400 Received: from mout.gmx.net ([212.227.15.15]:50719 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234753AbhFROzB (ORCPT ); Fri, 18 Jun 2021 10:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624027966; bh=5KANbDUOSm1uBFlCYYXKIoijReWqt8fXs2haBqiKeDk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=MV+R3p/o2RUR7HWu7O/XF6HRNyrXijA4LNhqWkghgdN01r3VXHULGG8wjfUFyr66K arkFArj6dUrM9szGqWWAPqlNDsagbrlJXydhYIdyg7wsdOU72k4DzmkFdkxnW+eda0 Gp8+OZ8+a2vuF/2dW+fQgfFLmIjiJtIf9LjNxdBg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.234.120]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBDjA-1m0HSa0Xi2-00Cktx; Fri, 18 Jun 2021 16:52:46 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org Cc: linux@armlinux.org.uk, jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Lino Sanfilippo Subject: [PATCH v2] serial: amba-pl011: add RS485 support Date: Fri, 18 Jun 2021 16:51:53 +0200 Message-Id: <20210618145153.1906-1-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:CB+ebwe0LaU4nsaqrxqhNQ+UJYl2zS7N5eKwzKvGEATKkoQVXMw hFlEzlNCJiHpDmh1g7EBmJu/TjZSaSQfTZ1YlCusP6DEZ28rs3P6xmYVoCbwyvmavdWJE3a bbADF8RRKTm5v7J5EbU/fv4dKh47GJEbiReZFu5GFRDfl7qg2/Upv35NP/yrCGDQ0h9uoVk wGpWV69yoLk3xQFPgV8DA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:yp5ZZtAgNTc=:NWNaVPC/JuUbpWa3ifh5Gu Go+9QcV9zy+BmSf/fPHMV+v8ufrVMdv90HwLuLPAxT83tZz9+Uu4SzHbqswiOCitYq7lnMNxp P6o+lysDPmIfn3JNJAo5opBppPCLIDjfdAFmT4THz7YpZ63rnb068WRWRE6FTkGcI9XsE7I8p OLw2ygWMKE2JmemwXTBql6A6Lyrv/yg/7CFXkjGX342tSd2D3i9jhYLmBvLyxPwDauIjkUANS GkAjZKN5SOulMsApFXGppH9ak2bazmYY4GDMDsi8V+QY+gFC40NOpr7NiJ2T+ZZYAAZ8RdQVX ayWcP4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