Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp535244pxj; Thu, 10 Jun 2021 06:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgYjB/RuTpNTkS1mpqKmZfJIYwEZIrpFwrjulzyzBqxG/WS//fQ0/yJoRMiIKI45+dHGgY X-Received: by 2002:a17:907:1c9e:: with SMTP id nb30mr4696980ejc.0.1623333195019; Thu, 10 Jun 2021 06:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623333195; cv=none; d=google.com; s=arc-20160816; b=VYAYB3soQaCpYARu1bCcIoHQC3sOukpMfCE/6mLS14C1uLFy9EtlpAiPWZseqMrRib 3mqfT/Wqj4EOJ9uoN6880zgpSv2xdZJ2cr8ZXwL8HK5zQqzpI3vnaK44InUj7ODa1zNG B7IclSMLCktZ+Hmeb2FNXkB5AfPxHhj8ndmhLKk6ML8nNGQyV/Jqlq9+TyWUS2zRAhyl 3TKHL3a8546IDQqCTUV266h9zW1UTvlF33DDqcAnISRTSOjFCn7xo1hS5dEq6hJLlsI8 0J/V1SdgWQwPLJSwzL8TN7qcLL2/h4LmAU5wmNc+gP/9m27ooFdNIbK0sb3mXOxeSRDe SAyw== 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=FhMPsDuNTkIcroGrocTv4Th0r3ifg2AX/Ou/LtkyD9w=; b=TOYbEzoTBPJ54Bz+DzBn8M15kEhBMuSyeAps7yL8d6VDj8uFTldpXSxXOuzlYvxGhv tmQhEmhkp9+aHIdq+u1KoDZ6aRQ6SAg7+CPhez6hcRYjIp0mb05UU5lbxBL4IFpqwoOF yXjsVo02a6uZPLVxHcB8+S2Cf9NAX/NAc4YHVAcGPHGtvJ7DLKchhgYXCDgcd8CUSWJ8 5xllP7ybLcXYlAdx6LJPTBFe0NsaapzhTB2cEA73ftC/Acxk7O3/WVHuu5JVq56G0jth NuqdMKDWWpIZKSE85FavZ/BKDecHpz3QEJ2PnjsyhOwMuPBRy910GNoNsHRuPFzxMhOQ 2DoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=BiEwTRBe; 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 dz22si2155092edb.470.2021.06.10.06.52.51; Thu, 10 Jun 2021 06:53:15 -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=BiEwTRBe; 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 S231164AbhFJNxZ (ORCPT + 99 others); Thu, 10 Jun 2021 09:53:25 -0400 Received: from mout.gmx.net ([212.227.15.18]:45035 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbhFJNxW (ORCPT ); Thu, 10 Jun 2021 09:53:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1623333079; bh=FhMPsDuNTkIcroGrocTv4Th0r3ifg2AX/Ou/LtkyD9w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=BiEwTRBehru6TfGJTBvOvDehaU04aZ2JPWlbqgTiNkYiSQZCKw9axNjrAeleXMOYA cyrE6xEwHr568LYnX/0/Enyjr/mck1FR2PHJHW6psEZnGP0smMHTPlCjO2zx/krKqO 3s5F9KUC5S0CSdRs3kJxGc/1DG40TeDwiR4cIMU0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MrQIv-1lWKLg2EdT-00oaTm; Thu, 10 Jun 2021 15:51:19 +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] serial: amba-pl011: add RS485 support Date: Thu, 10 Jun 2021 15:50:04 +0200 Message-Id: <20210610135004.7585-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:SnbNrTGSw/Dk5Z77Um92lL9RApvFqWM9OyYcRkT18i759IWDWHa dXa/Sk0oPoKWsoogaKj3u9dBf1sBpfmcruoNVmSUByJgfl/7dVuP5oNcjute+vjzrl6X22O 9SvfUUSTiOWlX9ec0CrztB3i/2LZexfXRd9jtYoFT4B8nTls/qsuGxpoxnx3DzWAyBkJg1X TX/C/lP5TdSVaLMldm/8Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9EmTWMNaGhc=:xwR3pbxMImgeBCm9Ug6+y6 zrIC0rlDFhfMtxY16wwLj83SfhMxoNSaQcY1VmUZFGJ0jwOVFI3c0ZHQTSYBMK3xg7dzveG5u JQc2byn40bNSepdeJcmM2+A5ff7KrPddreTCX7Wg29FqlasXQj9fKVZUuowQOUt3uBRGwCQzy INQia0lKCTEyCYvW41nI1OyVvNO7D9rleApmP2xapvbPieMzK6CstPgixF7KP0WTh3XIiqlw+ Fdi7Vk8vQCkI1ABFawEKS1DYVBp3XHl5+dCLGIRVtJbQLbHJ1A8qy2pMclYmnl27jW+j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