Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2584612imm; Thu, 11 Oct 2018 12:39:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV61fuCsGqBnlkNtja8GRQlywabCMDmugr+ay0DweN1bsy6o8LmuiSXsJlchl0nfPqoiWX/Xj X-Received: by 2002:a63:91c9:: with SMTP id l192-v6mr2630826pge.433.1539286782899; Thu, 11 Oct 2018 12:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539286782; cv=none; d=google.com; s=arc-20160816; b=ynsgWqSDqz590mg9jB2pXeBwpuu5WL34xdirvgFyTZqJSG+ts0PPvQgvYOo8/e9UNo UhTFJ/nqNo0Ubyalyl5JF5LmcL9SLRwbs2rYfiUVoopk+5m9qWesqflSciinuT3hT36n dRnZt5hmT9/NejjhnpVgYpDrBsv6K6a8MWlwXQrhs6EGOzsRRX9Q9tRm8TYF2IH+f5qG vDm3lzocK0w81GhAPG37HsO5X31CrG/nbyz8P8v/dfWzgkXrLa1/MuzEQbvm+JXVm4K6 Ktk6TWPOsyFQokIybhhP/L+RBebXkrnztHQJoOguWDe1h0+pZmXFGTSERNE/8ePHkVJI twIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=xbAdB+skPtyytONIK7Hu5hVX1yCTT/5VmOUMjqbK+i0=; b=cU27L6509Gm0tcxrIOAm3ROEKhHmEATcxPLT4hhYkS5dJ9s0K512qTcoxy+VQv2766 N2xtkt6ufN93ZHToAdrrjwrtCWDu5w01ssIXi2CXkwKiE+AirN+zuQPc9zm9pVkhfFEN /Xjdo5O99hN9MxMyITw6h161F+ykl4zDhzVqAHeOHWBdzTHK+nTi/mRTbnnJG2N1o+z2 A/lQYaX4Rh/QJ9zXWraJk2Z/v+CXqRxs8S3WwPBhjQqvVPbg75raHk23cS6xOyStmV+/ tnMD2yrk4Yur5yM8iiWEE+6YI9oZNDn27rT5PWfvB9M8mk2pee39kWyDnf6OR29/wtg2 1YQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PIVCUnm0; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 185-v6si29940446pff.270.2018.10.11.12.39.27; Thu, 11 Oct 2018 12:39:42 -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=@kernel.org header.s=default header.b=PIVCUnm0; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727029AbeJLDFE (ORCPT + 99 others); Thu, 11 Oct 2018 23:05:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:43578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbeJLDFE (ORCPT ); Thu, 11 Oct 2018 23:05:04 -0400 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94D3F2075C; Thu, 11 Oct 2018 19:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539286583; bh=GP+tFrIyEuCoLhh+Z5fA+bVSdtOwKhqXI8jkeVaHuP0=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=PIVCUnm00huWNJR9EvnVnnoPvZpo5BR67GM79K0y4ta8VU0VGDN1XfaaXRFbjP9f+ 2YGYxOr2fjkqAwQfkdmCgE/dj4HA7tvUCc0MAOJTtFE2j6qYcvycv0UiJ3jwzIGL3S eHoIrS8/bxgd8az/cc6AT+qmjQ28CUdLMH9AMZG4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Mark Brown From: Stephen Boyd In-Reply-To: <20181011145422.GG25351@sirena.org.uk> Cc: Charles Keepax , lee.jones@linaro.org, linus.walleij@linaro.org, mturquette@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, lgirdwood@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org References: <20181008132542.19775-1-ckeepax@opensource.cirrus.com> <20181008132542.19775-3-ckeepax@opensource.cirrus.com> <153924124658.207691.10370075148426001371@swboyd.mtv.corp.google.com> <20181011145422.GG25351@sirena.org.uk> Message-ID: <153928658292.5275.11321177725702156165@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v2 3/5] clk: lochnagar: Add support for the Cirrus Logic Lochnagar Date: Thu, 11 Oct 2018 12:36:22 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Mark Brown (2018-10-11 07:54:22) > On Thu, Oct 11, 2018 at 12:00:46AM -0700, Stephen Boyd wrote: > > Quoting Charles Keepax (2018-10-08 06:25:40) > = > > > +struct lochnagar_regmap_clk { > > > + unsigned int cfg_reg; > > > + unsigned int ena_mask; > > > + unsigned int dir_mask; > > > + > > > + unsigned int src_reg; > > > + unsigned int src_mask; > = > > Are these 32 bits or 16 bits or 8 bits? Please use a u32/u16/u8 so we > > know the register width. > = > Note that regmap always uses unsigned int to represent registers > regardless of the underlying physical register width, this can be an > issue on reads since we pass the destination for the read in by address. > = > > > +struct lochnagar_clk_priv { > > > + struct device *dev; > > > + struct lochnagar *lochnagar; > = > > Is this used for anything besides getting the regmap? Can you get the > > pointer to the parent in probe and use that to get the regmap pointer > > from dev_get_remap() and also use the of_node of the parent to register > = > dev_get_regmap() is pretty expensive, I'd not advise using it in > anything that might approximate a fast path. It's kind of debatable > when I2C gets involved but still feels wrong. I'm suggesting the regmap is acquired in probe and a pointer is stored here in this structure. That is not a fastpath as far as I know.