Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4236635ybi; Tue, 11 Jun 2019 03:19:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCtGOWOlTpss0DUTT4eGUzOqdu21ZKu94o7d51a8ne1DNtfS5+qthriB1hl14fAQ+LBwTA X-Received: by 2002:a65:48c3:: with SMTP id o3mr19932145pgs.351.1560248391243; Tue, 11 Jun 2019 03:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560248391; cv=none; d=google.com; s=arc-20160816; b=V23pw2KbBFjuYH94SwtCK0I3HboystZ85butAMJ7Msa4kaJy8EFdPQfND9bAtPg1if CO+ABrj2b84aFzZsEbZHjAB8QuiubfV8pXgw/CIR7nHQx6+Ie85Fnzvaw3eIWvlkIWnk 3kmSE5G1y/EYvQLDOR8kbSml+SoJgwJsobX/A4gjVj1Gr7fOuAAbzjCsvVWwXo4dKc22 WCecBO+PGodC7AhSSKs6YEeMoP8VNnBRlKklMhI5z0xhRdIboOJg/XQSgxBeoYXyxhJX zR43kCA4i3Wf9HJniEZRUFuqgcZqwxu2Zts9Rpg98OhItp5JhW5z16okKeG6Q8wSg4Sh woQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9qJ11sTcbrdSx8yCV4nc6YwkYNX/kfDSr2WMaMvTaag=; b=Jxz4vJ+qzBPpyAV6BBkna3G4DpSzoP0TLmEhx2JIDl0OmgHmWzNK6dC8DAjqGGwmcN iH5R4MWwQZUeq23IwXRWO/oG4NUmOaOVOoYwHJk5tF3ZQF1mdDwWiQfBOvsQP3l8ji25 pJQZCBrTl2NXb3eEP7sgNg7uwJ2HAzNoI/yjbHkHtFYpooKit+kD0wQdcbzZDWnXWl4a QQOVKdyOuy7tFGlCagOJo39ZDzluBijbCzZe4YRGwlzmLfXT6LglMjMyfemH3WdlCvaN h7wuphdJj8kROtAMhIvC8m9ZiFeLhQyo0fZWVza7Aa1iM+dPgEg5uQCPYQUDSxxSqRr1 xeLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lVYwXSO6; 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 f5si1480068pfn.225.2019.06.11.03.19.36; Tue, 11 Jun 2019 03:19:51 -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=lVYwXSO6; 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 S2405310AbfFKKRX (ORCPT + 99 others); Tue, 11 Jun 2019 06:17:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:45536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404870AbfFKKRV (ORCPT ); Tue, 11 Jun 2019 06:17:21 -0400 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (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 123762145D; Tue, 11 Jun 2019 10:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560248241; bh=ppRbblaoSv/UGkFO4M4R5lNJos+EEEismPHwgTzrRYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lVYwXSO69AAjv7KePSI7sy5UBERDwLb/mALz26kW28J6qpH3OTJYhh+vy25TQBC+8 aZAM0dVhGA2pMBHF1MmgOqjqOU1oBEG5BZKSzOK5Y3n7HRweMZtBYDMeShMHcWuTUM z0rIyshUq0Q8LsQo/3A8U+0+JVSOD8H0sK6ZQjSs= Received: by wens.tw (Postfix, from userid 1000) id 20D986004A; Tue, 11 Jun 2019 18:17:18 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Stephen Boyd , Michael Turquette Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai Subject: [PATCH v2 03/25] clk: Add CLK_HW_INIT_FW_NAME macro using .fw_name in .parent_data Date: Tue, 11 Jun 2019 18:16:36 +0800 Message-Id: <20190611101658.23855-4-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611101658.23855-1-wens@kernel.org> References: <20190611101658.23855-1-wens@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai With the new clk parenting code, clk_init_data was expanded to include .parent_data, for clk drivers that have parents referenced using a combination of device tree clock-names, clock indices, and/or clk_hw pointers. Add a CLK_HW_INIT macro for specifying a single parent from the device tree using .fw_name in struct clk_parent_data. Signed-off-by: Chen-Yu Tsai --- include/linux/clk-provider.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 70aad5cefea7..b19063512a29 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -927,6 +927,17 @@ extern struct of_device_id __clk_of_table; .ops = _ops, \ }) +#define CLK_HW_INIT_FW_NAME(_name, _parent, _ops, _flags) \ + (&(struct clk_init_data) { \ + .flags = _flags, \ + .name = _name, \ + .parent_data = (const struct clk_parent_data[]) { \ + { .fw_name = _parent }, \ + }, \ + .num_parents = 1, \ + .ops = _ops, \ + }) + #define CLK_HW_INIT_PARENTS(_name, _parents, _ops, _flags) \ (&(struct clk_init_data) { \ .flags = _flags, \ -- 2.20.1