Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5515247imu; Tue, 29 Jan 2019 22:02:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7id3QE6JJ8/315cUtUiuC5qzUpZTunNDEjjuJu1XtNN40/QpehQqP9d06YdAq68VNtWbzV X-Received: by 2002:a17:902:5588:: with SMTP id g8mr29177239pli.22.1548828127582; Tue, 29 Jan 2019 22:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548828127; cv=none; d=google.com; s=arc-20160816; b=d/TQE3HhTZD/UIVophrTIqX7aCbnaaXIF75g2NboOadFgm3lklSTwsNJ4Idr8Dzdxb 4VynChNF585n81s7VplocvGLkuWc82etnkOr0k0DeDPABhYZkWJ2YlfuHEmgqqVioKM/ azsqZ2rpN9ucG90vPCh0D2rYfJpQZ8HLwLkX5xZLuZ15U85fYEYTP3bfqym6PfvHqGhS 0f5xGYW4BJT4DdYoaYs73KpQCCnIBWwPEQ37NNLdQcERvBsJzeRdaqYKZNk0Wv89vhtK V6flolFA1XoaWWl62Hwf2kU/miPxaE+pO/kK2Pn/HpWD0GUwV2v9/bIeAUB7zNGIFpiA YX4g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=RKKy7Zp7rHZIgz0Vlqdz0knCbBY+6CXoKW8FO1Am1iA=; b=PmIGt6Cqg/pbso2CMbS5fPRp9+lJnMiud6d71mnHhq8CbWD9pPFQJq7Mt7R4qR7iny hiRxxLjxFB8+rmWYs6x78EWUIweXhyH31TwACu5hWOtiCbi6OkZpZO+WE+j1veaTY2lp nmcWMpwVb4WXkFAClZ3NcL0qSpdr/6mWoRq7QkjKL7WxEJ9r22Z+no1CqlOyWKfLtVG+ dTshzjuNArts2QVEKcveZzpFV3AI/eRJWsN3iXvnU2u/b/dKbS4jVDiYv6/XzYD06fM/ EJN9ewvVKaCppU6RtWS0dVQwweEUn5FI0Bpbmghoud5zuhTnTxHmtgCs23ELNbUfioek nptQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Wi6gewMN; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si612482pfg.254.2019.01.29.22.01.51; Tue, 29 Jan 2019 22:02:07 -0800 (PST) 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=@chromium.org header.s=google header.b=Wi6gewMN; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729970AbfA3GBA (ORCPT + 99 others); Wed, 30 Jan 2019 01:01:00 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42635 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729845AbfA3GA7 (ORCPT ); Wed, 30 Jan 2019 01:00:59 -0500 Received: by mail-pg1-f193.google.com with SMTP id d72so9880063pga.9 for ; Tue, 29 Jan 2019 22:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RKKy7Zp7rHZIgz0Vlqdz0knCbBY+6CXoKW8FO1Am1iA=; b=Wi6gewMNPfCuXhGbctuuPwEPCohGiR7PHkl3xxMZscIE8PVutOFjG6IctY77YggX8a D64ttY3/WQK0MnrcHZfU2jJBUkHHecb1WBy88ni+4GoonYavRNaYx63tZQCNzTw71/Mo 1384JzJ+PtchdC4Z+14dQvVVTxbqXtj3PLvPk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RKKy7Zp7rHZIgz0Vlqdz0knCbBY+6CXoKW8FO1Am1iA=; b=GJEEKSXVraHGMNoMLhl9arpPQhTlVZwvCiBxhrMPfarhwmklzGkvZNYDJRAxMq/EUX c+q54H5WuvoIYqGQFhKtgbgVC6hfKyWr90GUox32tXtxkwkOcdc+iG4VjT4we0obF6cw clG2hkuxeVJ4x96E9n1L/bo6nZHN2XjhZos0gSlxvJJ9tyC4kPAMtUhfvqsBU5qgaTgq kRwABySyugoUIbcJkUV5zPZYoQCbTp0+GyzroPbb+5cnYckWsBOSrcgKuOkD/E+l+4Qy tU/VeNlZYnGJ5H8V0rFFdbpAMxoSK7DRPepEKEBZZZ5UIjnMcLSjm9zuNb/p5R15bxYi oYYA== X-Gm-Message-State: AJcUukfG/AvADY24/EfVyo+BW/ty53X4UOiN+LthT6+CYaYN9pYL06HD VqlJ+a7tUHInuLxSzW+wYjhKLg== X-Received: by 2002:a63:89c2:: with SMTP id v185mr24414736pgd.97.1548828058939; Tue, 29 Jan 2019 22:00:58 -0800 (PST) Received: from pihsun-z840.tpe.corp.google.com ([2401:fa00:1:10:7889:7a43:f899:134c]) by smtp.gmail.com with ESMTPSA id f62sm683412pgc.67.2019.01.29.22.00.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 22:00:58 -0800 (PST) Subject: Re: [PATCH 07/10] soc: mediatek: add cmdq_dev_get_event function To: Bibby Hsieh , Jassi Brar , Matthias Brugger , Rob Herring , CK HU Cc: devicetree@vger.kernel.org, Nicolas Boichat , Philipp Zabel , srv_heupstream@mediatek.com, Daoyuan Huang , Sascha Hauer , linux-kernel@vger.kernel.org, Dennis-YC Hsieh , kendrick.hsu@mediatek.com, linux-mediatek@lists.infradead.org, Houlong Wei , Sascha Hauer , Frederic Chen , Jiaguang Zhang , linux-arm-kernel@lists.infradead.org, ginny.chen@mediatek.com References: <1548747128-60136-1-git-send-email-bibby.hsieh@mediatek.com> <1548747128-60136-8-git-send-email-bibby.hsieh@mediatek.com> From: Pi-Hsun Shih Message-ID: <4d6f8e17-58d7-2986-29b0-3e0134836929@chromium.org> Date: Wed, 30 Jan 2019 14:00:54 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1548747128-60136-8-git-send-email-bibby.hsieh@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/29/2019 03:32 PM, Bibby Hsieh wrote: > When client ask gce to clear or wait for event, > client need to pass event number to the API. > We suggest client store the event information in device node, > so we provide an API for client parse the event property. > > Signed-off-by: Bibby Hsieh > --- > drivers/soc/mediatek/mtk-cmdq-helper.c | 29 +++++++++++++++++++++++++++++ > include/linux/soc/mediatek/mtk-cmdq.h | 1 + > 2 files changed, 30 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c > index 6ad997f..16c0393 100644 > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c > @@ -56,6 +56,35 @@ struct cmdq_base *cmdq_register_device(struct device *dev) > } > EXPORT_SYMBOL(cmdq_register_device); > > +s32 cmdq_dev_get_event(struct device *dev, const char *name) > +{ > + s32 index = 0; > + struct of_phandle_args spec; > + s32 result; > + > + if (!dev) > + return -EINVAL; > + > + index = of_property_match_string(dev->of_node, "gce-event-names", name); > + if (index < 0) { > + dev_err(dev, "no gce-event-names property or no such event:%s", > + name); > + return index; > + } > + > + if (of_parse_phandle_with_args(dev->of_node, "gce-events", > + "#gce-event-cells", index, &spec)) { nit: Should have more indention for the line above. (Align with the dev->of_node?) > + dev_err(dev, "can't parse gce-events property"); > + return -ENODEV; > + } > + > + result = spec.args[0]; > + of_node_put(spec.np); > + > + return result; > +} > +EXPORT_SYMBOL(cmdq_dev_get_event); > + > static void cmdq_client_timeout(struct timer_list *t) > { > struct cmdq_client *client = from_timer(client, t, timer); > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h > index a1f5eb6..e5b0a98 100644 > --- a/include/linux/soc/mediatek/mtk-cmdq.h > +++ b/include/linux/soc/mediatek/mtk-cmdq.h > @@ -139,5 +139,6 @@ int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, > > u8 cmdq_subsys_base_to_id(struct cmdq_base *clt_base, u32 base); > struct cmdq_base *cmdq_register_device(struct device *dev); > +s32 cmdq_dev_get_event(struct device *dev, const char *name); > > #endif /* __MTK_CMDQ_H__ */ >