From mboxrd@z Thu Jan 1 00:00:00 1970 From: Archit Taneja Subject: Re: [PATCH 2/9] drm/msm: Drop the gpu binding Date: Wed, 4 May 2016 12:15:29 +0530 Message-ID: <57299A89.5040905@codeaurora.org> References: <1462273081-5814-1-git-send-email-architt@codeaurora.org> <1462273081-5814-3-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:34481 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757028AbcEDGpo (ORCPT ); Wed, 4 May 2016 02:45:44 -0400 In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Rob Herring Cc: Rob Clark , linux-arm-msm , dri-devel , =?UTF-8?Q?Heiko_St=c3=bcbner?= , Philipp Zabel , "devicetree@vger.kernel.org" On 05/03/2016 06:12 PM, Rob Herring wrote: > On Tue, May 3, 2016 at 5:57 AM, Archit Taneja wrote: >> The driver currently identifies the GPU components it needs by parsing >> a phandle list from the 'gpus' DT property. >> >> This isn't the right binding to go with. So, for now, just search all >> device nodes and find the gpu node we need by parsing a list of >> compatible strings. >> >> Once we know how to link the kms and gpu drivers, we'll drop this method >> and use the correct binding. >> >> Signed-off-by: Archit Taneja >> --- >> drivers/gpu/drm/msm/msm_drv.c | 26 +++++++++++++++++++------- >> 1 file changed, 19 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c >> index 30b8f3b..f717a69 100644 >> --- a/drivers/gpu/drm/msm/msm_drv.c >> +++ b/drivers/gpu/drm/msm/msm_drv.c >> @@ -1068,20 +1068,32 @@ static int compare_of(struct device *dev, void *data) >> return dev->of_node == data; >> } >> >> -static int add_components(struct device *dev, struct component_match **matchptr, >> - const char *name) >> +static const char * const msm_compatible_gpus[] = { >> + "qcom,adreno-3xx", >> + "qcom,kgsl-3d0", >> +}; >> + >> +/* >> + * We don't know what's the best binding to link the gpu with the drm device. >> + * Fow now, we just hunt for all the possible gpus that we support, and add them >> + * as components. >> + */ >> +static int add_gpu_components(struct device *dev, >> + struct component_match **matchptr) >> { >> - struct device_node *np = dev->of_node; >> unsigned i; >> >> - for (i = 0; ; i++) { >> + for (i = 0; i < ARRAY_SIZE(msm_compatible_gpus); i++) { > > You can use of_find_matching_node() here instead of a loop. I'll switch to that. Thanks, Archit -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation