From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C94BCC43334 for ; Tue, 28 Jun 2022 13:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-ID:Content-Type: MIME-Version:References:Message-ID:In-Reply-To:Subject:cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iPw8VXfPfuHf1+ajraTJIP4CwHLD/BwHyjCQrex0ozw=; b=Gm/UrBqfP9TwsTDg7VPbV5hMil kynwsqdBnKjaUpg4uwdLiIiQRniLyJ2CWu0Z7Jm+L0438VrcH3nq821cq+AZxCyrFVOaeWIIRlg1+ Lc2RR+kjR9kqBjcriyb7KlWj6pcygeBVdku7GWjmIsGdyTWakRtQ42wSEe8qMiVH+1qimOeLFefsF ojcOI4KMCyE9DV7vHG1EO4W4lBtdTD5vyRhC9wazYGlmj31Pil0qTJ6OgVfSB1RmHzH7GlBuGPY1K KsYnG+gRL0qoYLvD7gLfij1dIctaMpjJY2o9dD3JRKF1C9mUF4ZBs4FdtXR4LjzlfjJr5V9DT82bb k/G8cuaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Ao1-006I98-4J; Tue, 28 Jun 2022 12:59:01 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Anx-006I7G-1w for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 12:58:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656421137; x=1687957137; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=n6FSyD6TOLlqIp96Exr9r3CAQsHxyx4Hfw4enuNKSZo=; b=OT+FeEX/dsH/+7YzuTRjk7rqoWl0VwkfydxJ5dpwdYxw06j0srRnA0n4 MyxcT+aB+a+ZgfmnNC+KKjMVbBRlMwl5hur7Fw7hLsVrxjLE1n7J56IjP 96higkwYHN0VWGRBOdTwAMDNo8vBNUTEFgxai9B21Y99TO4QXSegU7mhM 34aYdmrK12+llVYDXYUt+EazLHl3O2WdHTEll1TA5jReFUxn0Vn9opw1n L5D59kmE2r+S9IgWzMeQUC2+l7EJfWfRsW5xbOz4Mi6/LooDBc1XV75Pp +IB7YkCMObIKeX7zva+Y6GJD3Od7Z3FmPKSO+0gVmyC/OYLkP2Fpu7TF6 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="345729744" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="345729744" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 05:58:55 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="594786039" Received: from iannetti-mobl.ger.corp.intel.com ([10.251.216.215]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 05:58:52 -0700 Date: Tue, 28 Jun 2022 15:58:50 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Chanho Park cc: Krzysztof Kozlowski , Greg Kroah-Hartman , Jiri Slaby , Alim Akhtar , Hector Martin , Jaewon Kim , Vincent Whitchurch , linux-samsung-soc@vger.kernel.org, linux-serial , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] tty: serial: samsung_tty: loopback mode support In-Reply-To: <20220628124050.144398-1-chanho61.park@samsung.com> Message-ID: References: <20220628124050.144398-1-chanho61.park@samsung.com> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-594435092-1656420383=:1603" Content-ID: <9283e8d-cf8-a50-794b-145df2a88931@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_055857_223712_1EE6B5CC X-CRM114-Status: GOOD ( 24.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-594435092-1656420383=:1603 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: <4b2b658-3584-6caa-ca7d-473eed3457f@linux.intel.com> On Tue, 28 Jun 2022, Chanho Park wrote: > Internal loopback mode can be supported by setting > UCON register's Loopback Mode bit. The mode & bit can be supported since > s3c2410 and later SoCs. The prefix of LOOPBACK / BIT(5) naming should be > also changed to S3C2410_ to avoid confusion. > > We can test it by linux-serial-test program > with -k option. The tool will set TIOCM_LOOP mode when the option is > specified. > -k, --loopback Use internal hardware loop back > > Signed-off-by: Chanho Park Reviewed-by: Ilpo Järvinen You should have included Krzysztof's Reviewed-by when you sent this next version so that it won't get lost. I suspect Greg will again complain that you didn't address his comment about the out of the place "-k, --loopback ..." line. -- i. > --- > Changes from v1: > - Drop TIOCM_LOOP return from s3c24xx_serial_get_mctrl as pointed out by > Ilpo. Documentation/driver-api/serial/driver.rst indicates the bit is > only for set_mctrl. > - Change the loopback bit definition from S3C2443_UCON_LOOPBACK to > S3C2410_UCON_LOOPBACK because it has been supported since s3c2410. > - Remove the unnecessary footnote and put a blank line before Signed-off-by > > drivers/tty/serial/samsung_tty.c | 8 ++++++++ > include/linux/serial_s3c.h | 2 +- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index d5ca904def34..03ef4ff506fd 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -1012,6 +1012,7 @@ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) > static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) > { > unsigned int umcon = rd_regl(port, S3C2410_UMCON); > + unsigned int ucon = rd_reg(port, S3C2410_UCON); > > if (mctrl & TIOCM_RTS) > umcon |= S3C2410_UMCOM_RTS_LOW; > @@ -1019,6 +1020,13 @@ static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) > umcon &= ~S3C2410_UMCOM_RTS_LOW; > > wr_regl(port, S3C2410_UMCON, umcon); > + > + if (mctrl & TIOCM_LOOP) > + ucon |= S3C2410_UCON_LOOPBACK; > + else > + ucon &= ~S3C2410_UCON_LOOPBACK; > + > + wr_regl(port, S3C2410_UCON, ucon); > } > > static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) > diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h > index dec15f5b3dec..1672cf0810ef 100644 > --- a/include/linux/serial_s3c.h > +++ b/include/linux/serial_s3c.h > @@ -83,7 +83,7 @@ > #define S3C2410_UCON_RXIRQMODE (1<<0) > #define S3C2410_UCON_RXFIFO_TOI (1<<7) > #define S3C2443_UCON_RXERR_IRQEN (1<<6) > -#define S3C2443_UCON_LOOPBACK (1<<5) > +#define S3C2410_UCON_LOOPBACK (1<<5) > > #define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ > S3C2410_UCON_RXILEVEL | \ > --8323329-594435092-1656420383=:1603 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --8323329-594435092-1656420383=:1603--