Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp627449ybt; Wed, 8 Jul 2020 07:59:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZXth7/Gm2B19z7m7Bfro0giP5H/2HoweoJMUDDEEYr8l3bXaXye3UFDuB7Vlc0yFB9LGc X-Received: by 2002:a17:906:ca56:: with SMTP id jx22mr51331400ejb.494.1594220399008; Wed, 08 Jul 2020 07:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594220399; cv=none; d=google.com; s=arc-20160816; b=akTC2YU1QhiOHpnkkvJwcqsdNs263Qg6In8c1tB0cAI/dSP1IKtDozFONlppX3OruF qUodBGNVTif0wApMhTbLyJiyx39O1HV+KGO9PSmJZ4FRtrYFq9cysSy8NfPaWM+4tYRV A4Rd+jAC78oFoACPYx91iRMvS/C3idyYF13g+pZ5j6Jtmj4tT2ZXy7g0E6Z1B2MIqXr5 IzSqtwX4jlYR7UpSXpKe/2AgKq/wmJ792nOfiFho+/PoDTPjTSBJNZxWP9zHj1IVWu+S 1duS+g1B1NsQVBS5EU7Mqolhoya5pVTTo/J1mBv0eprdYzYKAOMKpo/xcewLZHfxnbLa TRMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=mszeJbmCBEFjl9nY0MACGFR4rlncKrWDQb8Ya4b7ksM=; b=ctNFVjjF+oYgtuljx6+xBLXFpP86Vse9Q1LHV3whbQaURDe9IWG5mP9PFjK+XQ007z HRI5xLUS3Zo2WUXSZxwcv2krgEfgqU5scztyey9sWtyroWF93oqd4tcLvmIi/eFiXQx5 9QU9pD7y9LXR26h8/3wypqQFVTE8zIoFIEQmdANwBUP3urHqGVi0/oUynLxjAuPAVNm9 dIbQMBS++TNkh1B/tdv3ePoTKXkt5F60Sl6iD4FxM2z+jQ63GL6EcBOtopZPZlx0oFe0 XOfcFWMcBnU5tmBi5vkkifc/YSUntLpopGJtWyftFgGXUZlXD1ni3syYmEOeVjkM/MY4 uTiw== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy15si165116edb.22.2020.07.08.07.59.35; Wed, 08 Jul 2020 07:59:58 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729971AbgGHO6S (ORCPT + 99 others); Wed, 8 Jul 2020 10:58:18 -0400 Received: from mga01.intel.com ([192.55.52.88]:54394 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729206AbgGHO6R (ORCPT ); Wed, 8 Jul 2020 10:58:17 -0400 IronPort-SDR: ItNlxMO4N6NFzkLUzKIzJTKj+/rPBNB2N2fEThqdQ4ZfnFaBhLekkzMDGpnaA9WEFYO2K1NCUx 4jZkNgkDLoOA== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="165921741" X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="165921741" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 07:58:17 -0700 IronPort-SDR: id16Q0uJtbOwrtqSPDTWmtvVUzlkhQZprKMISQjsDMxp0dUVrEX7FPeAtyajoU+9ZFd/GiqnvE KR9Em0UU8CYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="427862028" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 08 Jul 2020 07:58:13 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1jtBWY-000gwo-3z; Wed, 08 Jul 2020 17:58:14 +0300 Date: Wed, 8 Jul 2020 17:58:14 +0300 From: Andy Shevchenko To: sean.wang@mediatek.com Cc: gregkh@linuxfoundation.org, jslaby@suse.com, mika.westerberg@linux.intel.com, sr@denx.de, arnd@arndb.de, matthias.bgg@gmail.com, tthayer@opensource.altera.com, linux-mediatek@lists.infradead.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Steven Liu , Ryder Lee Subject: Re: [PATCH v5] tty: serial: don't do termios for BTIF Message-ID: <20200708145814.GN3703480@smile.fi.intel.com> References: <7c67171728cdcc4ccc10adfaea1a14bfbcf8375a.1594163304.git.sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c67171728cdcc4ccc10adfaea1a14bfbcf8375a.1594163304.git.sean.wang@mediatek.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 07:11:22AM +0800, sean.wang@mediatek.com wrote: > From: Sean Wang > > Bluetooth Interface (BTIF) is designed dedicatedly for MediaTek SOC with > BT in order to be instead of the UART interface between BT module and Host > CPU, and not exported to user space to access. > > As the UART design, BTIF will be an APB slave and can transmit or receive > data by MCU access, but doesn't provide termios function like baudrate and > flow control setup. > > Even LCR on offset 0xC that is just a FAKELCR > a. If FAKELCR[7] is equaled to 1, RBR(0x00), THR(0x00), IER(0x04) > will not be readable/writable. > > b. If FAKELCR is equaled to 0xBF, RBR(0x00), THR(0x00), IER(0x04), > IIR(0x08), and LSR(0x14) will not be readable/writable. > > So adding a new capability 'UART_CAP_NTIO' for the unusual unsupported > case. > > The bluetooth driver would use BTIF device as a serdev. So the termios > still function would be called in kernelspace from ttyport_open in > drivers/tty/serdev/serdev-ttyprt.c. ... > up->port.quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0; > + > + if (up->port.type == PORT_MTK_BTIF) > + up->port.quirks |= UPQ_IGNORE_TERMIOS; I don't like to see this in core. Can we have this inside 8250_port.c? Something like extending struct serial8250_config to carry quirks and assign them when you add a port or start it (wherever it's appropriated)? -- With Best Regards, Andy Shevchenko