Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4515733imu; Tue, 29 Jan 2019 03:00:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ACKb2HSZfD5BojwZEqK8OPL7lcvAG1InCp1dBVVqNPU+KN4a4dhE7XqPSRRq3QUs8SyDs X-Received: by 2002:a17:902:720c:: with SMTP id ba12mr25638743plb.79.1548759620474; Tue, 29 Jan 2019 03:00:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548759620; cv=none; d=google.com; s=arc-20160816; b=SeD0Z1YoVX3hr6Yk4uMDauexLQIx2Gi+0r2F+MdeyjY+tSmYpbjLFNYp5s/DVNLY/z i33m/EtsUNZx7KdgxJ6+TUBZUqmmWkLzcUO+G3PLGFSsOxHQdenFs1WAr4rbXSBz5sjD dSI/IHkRKlm2DSYO1tt4uEf6sfp1W+KYZN2Z4NL0oPyVD2GThCreheT5qE6ZSl192a0Q k+796fQniTnQder5rxmuUtUecnLTupjWAIbbtcUnXqc5VsZaKNEGZO23ctzELcSZ2wDB LFlQGk63LTER8tZxKS2dawwLYMW1ET8U/Cra9kQf6FXCtxyfSJZeNYAtPTt16ATyr4Lm LiSQ== 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:date:cc:to:from:subject:message-id; bh=FsM54P1b9WhrDXMZkdDurq2IkrggPU6KVrupB+6lrFo=; b=FfJK3KBOeB1QXc8Dd0FCLhuxS5brhPrhvOYD7Yhqum5Hb/TRJxUSzl0f/hsQEe1AZ/ ZGeBAmhiewGYEgTKgPePCR5GA4M1OYMH7Lvagx066gHtOtZXwPbBl+wUqbtztizKik6c TGc6YMq+/LPi+42I+sgGDYVCdq3PCF9gxen0ESgTAj8/rI7pC+mH+zjxrWYN+Qfa5J95 YjlPCi8r74dMnP61thkykUn2oRf5RFAMGtguovnYT83WDrxJV/Mw6ZW+c1zY4g8IpzBY kq8Wk8EF5W5U2bxRC7EdfZP0+g6okEeELMD+fhY9bdVC4l53MCm7kbqbqeeZkMdlAAgg 7ABQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si33655978pgd.88.2019.01.29.03.00.04; Tue, 29 Jan 2019 03:00:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728552AbfA2K7a (ORCPT + 99 others); Tue, 29 Jan 2019 05:59:30 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:4291 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726298AbfA2K7a (ORCPT ); Tue, 29 Jan 2019 05:59:30 -0500 X-UUID: 80b6836dc11f49b199860e1d8ba82947-20190129 X-UUID: 80b6836dc11f49b199860e1d8ba82947-20190129 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1194113965; Tue, 29 Jan 2019 18:59:24 +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 CC: Jassi Brar , Matthias Brugger , Rob Herring , Daniel Kurtz , Sascha Hauer , , , , , , Sascha Hauer , "Philipp Zabel" , Nicolas Boichat , "YT Shen" , Daoyuan Huang , Jiaguang Zhang , Dennis-YC Hsieh , Houlong Wei , , , Frederic Chen 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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__ */