Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp95182pxv; Wed, 30 Jun 2021 15:59:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsFRR0mPFfzixhX2foSoUtmYzTkWfI9Edmxqm00xoXwPCYkr6IZVFjnR+G6lDZsU6AC1ZJ X-Received: by 2002:a17:906:5408:: with SMTP id q8mr14771303ejo.2.1625093999723; Wed, 30 Jun 2021 15:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625093999; cv=none; d=google.com; s=arc-20160816; b=SuDpSVOXDQo90wS8ixMXouOB2BrzykVI4SqCBtdyRZPqfgEU9ywfi0W6UzFfY476Tj 9elQldLua2hK+9SbgD9ahUCf82kfZ5EmABUO+t9KoXQnfs1RSfXPdtVMd9Sx5jC3eD3v 365ph3yxPdvZwJ/4BCeH/IUrh7pQFsXACTJKnldysrsDZ9Y7cE0FiSQhILcyI2ElGfGV xDzYucUAZ3DFz0PNZWAH6ZenBTBnH5HqkoOYHJcUiTmMWun0dVGZPn5iQupbyeI1S1e2 F+kG5iDHp9TvGeMIVWh0R9vyGBB1ikLG3cAhTYfaRmXTSKwxv7P13YkLvtx8ioyN1KqF W6PQ== 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=NaS6NWz5hAdA8VokT4izVYKBa9VxtERQx5BuK2c9IAQ=; b=gyRAwdsUlFgagJjUQoqXWU1YSjYTXZr8AXLW9xuq4iIIaWjc6PAMzy0VXI0N1O13KB DNLl7On149FDj3/7IF9d9rMmVvEgeH+Z2un9YHGKsHlzNHTdbVnrvSbUdT0JA51hXoe2 iTbmmYvNZlejE139Zs1s1pDocrrYWU1QRmso9HRrYo9WfaXe0LqA7eLAfBWfSzKrJt+h BD73zkkNHXs+a5rDH53VkZMwrtXUquynSD2r1gfzwAtvLi9utnJjc6M0KxKIhtSQ+AYp oGzF36tUR5oueKbvBNRsOKoueBM9lNdns3IeRH8dnPYCqSnnKMxpgv8e7EC4rP8Cym0S Bwyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=RlylW0Xq; 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 h8si22838123edj.149.2021.06.30.15.59.35; Wed, 30 Jun 2021 15:59:59 -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=RlylW0Xq; 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 S233374AbhF3XAM (ORCPT + 99 others); Wed, 30 Jun 2021 19:00:12 -0400 Received: from mout.gmx.net ([212.227.17.22]:50585 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232971AbhF3XAJ (ORCPT ); Wed, 30 Jun 2021 19:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1625093854; bh=NaS6NWz5hAdA8VokT4izVYKBa9VxtERQx5BuK2c9IAQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=RlylW0XqelHXjVtqZ1iveK6yupcBMLddJ+7sC0QDL+L1esOCH66bPz+LfFctCeabD fCtPz3LHPrrljwI1anhIoD1fQHUX49TS9O0ZS8C8r9KzF7KIsMGirKwAS/x205cByI v6CvVZTGgtJV5nVbQ/nwqLTTarIQcWkIiUG0nIJU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.234.120]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MORAU-1lZtWi15Q6-00PufC; Thu, 01 Jul 2021 00:57:34 +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 v3] serial: amba-pl011: add RS485 support Date: Thu, 1 Jul 2021 00:56:44 +0200 Message-Id: <20210630225644.3744-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:ESBFkLxIrFDj9kXAvmHFhGgX4laKVLsYxxcVI/y0GHzpb64AMsN SdJ2oFZWSkxsI3zYV2wAiIwfJGRz8/xtpmPG7e+8Fsbsocm0mGzNQkXWo0/QE1tnwTwuQsx HfUgzjx9rM+4v/XtK/Bp6hAL4ASUsF+bKVv8mJKIZ1OwzqCqnQcKRRV+zZA56ZcEwmD7Eqw xHPJKSy6zmigAHEhcs+GQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:dXFoP/Shyb0=:ro6keEg/pfiGo4uRgsxQPl LV4j7nTZUXQcYbBnVi+OsU1CadjNmtpVMYWShQ0gXsaSXoMoAld9XRDwLpXCP0CiT/kv5sD0m PYVO6yM7+3MDPtypJt3/e58xIyxBFe4XigwabxAUc5caKoKP0dicO3k9sGT+ZwO67/rziMo2w lEHHbI4JroH2PLBfn1zgF/5vHT88UU2FptngtGhDewz29HT2zkxe2jPufmwJatNJtmMjWClkC IGlhKdmhoD6/qqJDpPcwK2p23FfVXSYtx5/3RwaCyNiFZqv3QJrFWvsl2gChUUvqv2ErmIRyA lt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