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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA53CC169C4 for ; Tue, 29 Jan 2019 10:59:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7A93D2084C for ; Tue, 29 Jan 2019 10:59:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rZYpCzVL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A93D2084C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ah+V1I67+fRZCwPUqG8S51rWPySm2TsGtW/ncvV/+a0=; b=rZYpCzVLRlf1dv OMGp77uuUX7vgLw1A0aVfYK9YpJ3qMDTzskN10knmpnCZ3ZcOIFqdU3JeferyJncoq1bhr7yHXCAN 3VPnDMlQOUwJHCUBQtbH1OpoI85fUBheIB05qhj4wGshAFVigT4oxiKhB76RR3L/bWdN1T0RqxUZE Ga0zIFBWrrF7NaMkxx5RJzkLnkgmdTKGU9J1jfd50sh0eWJrtmHcXU6v3OVzqhqxF0N9NmtzXrfqg o+MPYh1Dli/rzLkkHjbjgEQWwyfw5KCk/8ZCGEvbpwyymV5c74AW6AwfU7NnwRolk1cd4mup0c4jA 9AwAXJyaRZKER/VhIK6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1goR7D-0000GV-Pl; Tue, 29 Jan 2019 10:59:39 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goR7A-0000G2-K1; Tue, 29 Jan 2019 10:59:38 +0000 X-UUID: 4074851459214dd6a0f20e6491daf79f-20190129 X-UUID: 4074851459214dd6a0f20e6491daf79f-20190129 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1767187026; Tue, 29 Jan 2019 02:59:26 -0800 Received: from mtkmbs03n1.mediatek.inc (172.21.101.181) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 29 Jan 2019 02:59:25 -0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 29 Jan 2019 18:59:23 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 29 Jan 2019 18:59:23 +0800 Message-ID: <1548759563.11055.10.camel@mtksdaap41> Subject: Re: [PATCH 07/10] soc: mediatek: add cmdq_dev_get_event function From: CK Hu To: Bibby Hsieh Date: Tue, 29 Jan 2019 18:59:23 +0800 In-Reply-To: <1548747128-60136-8-git-send-email-bibby.hsieh@mediatek.com> References: <1548747128-60136-1-git-send-email-bibby.hsieh@mediatek.com> <1548747128-60136-8-git-send-email-bibby.hsieh@mediatek.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_025936_667823_6352D8E1 X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Nicolas Boichat , Philipp Zabel , srv_heupstream@mediatek.com, kendrick.hsu@mediatek.com, Daoyuan Huang , Sascha Hauer , Jassi Brar , linux-kernel@vger.kernel.org, Daniel Kurtz , Dennis-YC Hsieh , YT Shen , Rob Herring , linux-mediatek@lists.infradead.org, Houlong Wei , Sascha Hauer , Matthias Brugger , Jiaguang Zhang , Frederic Chen , linux-arm-kernel@lists.infradead.org, ginny.chen@mediatek.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Bibby: On Tue, 2019-01-29 at 15:32 +0800, 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); Where is the binding? > + 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)) { Ditto. Regards, CK > + 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__ */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel