Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7231563ybp; Wed, 16 Oct 2019 05:52:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYCOtf9lrvLmDIHq+fI7o4Kt8xizUmXaXcfc2CL1KwZjXSevbQG87yGLLkrlLNUlu1VJyU X-Received: by 2002:a17:906:60c2:: with SMTP id f2mr4444993ejk.21.1571230351143; Wed, 16 Oct 2019 05:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571230351; cv=none; d=google.com; s=arc-20160816; b=d1aLyK3KhkBq1H0XCc0L0UIM4uC2N2Ub6Hoyp5kYAUWA7GEJFltvvHSBozil2o405S B6DlZbuOZssHwYhWamnXwrEmtdIgzhgyNKRpOa8wLhxToAuBAZIg6mdOln2OTBCpuw+J NRm4PVR8bEdfQMUdLa97/WwyI0305/5GqMT6rJ33JGNPHPy+XquyUeWFCZH05OZFX6hZ m+AtvDIiJpZRyZ2DmQSXd3icRs/9GUHF6cWdkHg1gUOMHe2L414YDvrFLRLJcDQ7qmiZ 11K5jfq3fZ+j42YFLmrjKphj1Cxsojbr4Dpx1el3fnkJFJ2JyxkixqmDFIHfYssAVEow 4T8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Xo35Bg7+wZLq9WAYiOuUcTZRMp2CbtvKNgMqelyARTU=; b=Jr9A1E8/V2zCBDm/ZnjLjvPiXLYlRijVDeZN8q8gC/9qcEn0jMUCngnf1GJL6aF5VE kGxlVit1lYzZ3DTlE+EM0b5y1LKDhb4LE3UhbkYKd8pHz4YyVciG+RbkXIFW9j9+jL/L oR2u9NQU5yfjosAktRY4a+hd4aeiVmnDHgcl0hJfhcpRJWoLrs7uHqByHYjTkCLNi1w+ cQV4zekTVS7tkd8xUv2j55atyN05N6fY+IDwNA9PEB8cvcs0W2BnWtbm7LOBxmMaHswO fPqlw/odncuj/tu2cOg/b0+BLlHYHpX3E0OcQhDOQtywTQs07ttvlENTS6GxA2/5XvG3 R/Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eFXeazm0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id me9si14517791ejb.280.2019.10.16.05.52.08; Wed, 16 Oct 2019 05:52:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eFXeazm0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391598AbfJPIZn (ORCPT + 99 others); Wed, 16 Oct 2019 04:25:43 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35203 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfJPIZn (ORCPT ); Wed, 16 Oct 2019 04:25:43 -0400 Received: by mail-lf1-f67.google.com with SMTP id w6so16713404lfl.2 for ; Wed, 16 Oct 2019 01:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xo35Bg7+wZLq9WAYiOuUcTZRMp2CbtvKNgMqelyARTU=; b=eFXeazm0o1tL5yIT8cIoz4Wk8anNWAsBOAqZuTJLrcmF2+ZuFXcPF5UVUCWL7aIqil IPv3kOP6K1GOt7SHle1XCTL3se7HLV7MPcGNg3WcrI60YQPfUEAm9aUokJNKOpR2EbAA e78DxjS58Ht4pQMlOpK4jhBzKtIqSy4nCyWtSESafH71SkFiMrXk5gnX5z+kGwZe4s+D y2VQBtcVTbKENFN9vL8/vc6TXOxscGJmF/Jq1j1cum1G2Fb3HvotNml0i/JH6jiGyldY NROzHm86nPDDviCEMqX2kExhGpQbdpmN4YLu0WJPUUraOjC0mX+NYkDkyo+WQAtLFgIE 8RcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xo35Bg7+wZLq9WAYiOuUcTZRMp2CbtvKNgMqelyARTU=; b=QJmMci+t1zTRMxm2vPfr407/xgwcmDgjythLN1j9ijPvYqxIXQVxNCHPL/FZUBMzwA Z7ho9SCiU7iIx80Ex+mpEeE3V1GB64YU+U9uBXfGt+pNBrTC8Y5keVp9LG1qvfXy238K V0QL2CQYqakI1y8Xmx6GyU28F+V248AmVYyW5W55mQueQW0AoejeXS5Nzo/vPpkhoMqU VUjbcaoHpMQBP2gJ/F3lCg0tL0t0rUw39xshPixPgRdIbHk+hpbfAsr8kaWin2XXURsL m+CcClyD0/CNeM7X78flhRWfTLri5VVNq0t1Xy3rIxSiu+GM1BICkVMYYsUxoEljJ0aX xxHw== X-Gm-Message-State: APjAAAXdyoekH1LuJOedcZ+ymuf3Yy0guEKIxH9YJhyTofn3z44/RO/c rGrTsnNtjbPKeHWsYv+IPxxvsD/ze/p9VSe3EJA= X-Received: by 2002:a19:6f0e:: with SMTP id k14mr24108061lfc.34.1571214340972; Wed, 16 Oct 2019 01:25:40 -0700 (PDT) MIME-Version: 1.0 References: <20191016070740.121435-1-codekipper@gmail.com> <20191016070740.121435-3-codekipper@gmail.com> <20191016080653.3seixioa2xiaobd7@gilmour> In-Reply-To: <20191016080653.3seixioa2xiaobd7@gilmour> From: Code Kipper Date: Wed, 16 Oct 2019 10:25:29 +0200 Message-ID: Subject: Re: [PATCH v6 2/7] ASoC: sun4i-i2s: Add functions for RX and TX channel offsets To: Maxime Ripard Cc: Chen-Yu Tsai , linux-sunxi , linux-arm-kernel , Liam Girdwood , Mark Brown , linux-kernel , Linux-ALSA , "Andrea Venturi (pers)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Oct 2019 at 10:06, Maxime Ripard wrote: > > Hi, > > On Wed, Oct 16, 2019 at 09:07:35AM +0200, codekipper@gmail.com wrote: > > From: Marcus Cooper > > > > Newer SoCs like the H6 have the channel offset bits in a different > > position to what is on the H3. As we will eventually add multi- > > channel support then create function calls as opposed to regmap > > fields to add support for different devices. > > > > Signed-off-by: Marcus Cooper > > --- > > sound/soc/sunxi/sun4i-i2s.c | 31 +++++++++++++++++++++++++------ > > 1 file changed, 25 insertions(+), 6 deletions(-) > > > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > > index f1a80973c450..875567881f30 100644 > > --- a/sound/soc/sunxi/sun4i-i2s.c > > +++ b/sound/soc/sunxi/sun4i-i2s.c > > @@ -157,6 +157,8 @@ struct sun4i_i2s_quirks { > > int (*set_chan_cfg)(const struct sun4i_i2s *, > > const struct snd_pcm_hw_params *); > > int (*set_fmt)(struct sun4i_i2s *, unsigned int); > > + void (*set_txchanoffset)(const struct sun4i_i2s *, int); > > + void (*set_rxchanoffset)(const struct sun4i_i2s *); > > The point of removing the regmap_field was that because having a > one-size-fits-all function with regmap_field sort of making the > abstraction was becoming more and more of a burden to maintain. > > Having functions for each and every register access is exactly the > same as using regmap_field here, and the issue we adressed is not with > regmap_fields in itself. > > If the H6 has a different register layout, then so be it, create a new > set_chan_cfg or set_fmt function for the H6. The H3 and the H6 have a similar register layout but the issue here is that sooner rather than later we would want to be supporting multi-channel audio which requires the offset to be applied to each TX channel channel select register(8chan PCM for HDMI requires 4 Tx channels). Currently we're only using one. BR, CK > > Maxime