From patchwork Mon Apr 23 13:47:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 133999 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1020738lji; Mon, 23 Apr 2018 06:48:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Fbslp7scLlvCsiSQSmFipMKV0hI4YLyEWbTJSJPJVrGuBdPlkSKhM7KDBtvEqkbGsfOdS X-Received: by 2002:a17:902:b28:: with SMTP id 37-v6mr20824774plq.207.1524491301657; Mon, 23 Apr 2018 06:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524491301; cv=none; d=google.com; s=arc-20160816; b=g5aejQhamGY2u6xrLAGHYym6M2YI2ADD1ylAhNHULVGPuK6qQNQfXbGboCaq2VkUNz OTVPp6NvCg29n8RifRnkIb0ELMK9PhFnrnU8HYfmd1Au/op7norSPBEL4RerKUi8Gutn eUxfyjMJ5XXYs/XFcN4FRFN05iOV5/M3urmzpidSreKrKTPoB55AgbIHK2+hOoFtLgXY Blv2BSTz3r5sk7RE1EiXF/F/OTWZo5nciYMiUpgAvZBSwdjH8kSxOQamRF8Px30DSGqn IIDwnlmqATNBV8PR96YtIoLyxb1LFgWJciPQcCAR2XYvLLrjxiM9kfMEnZy7jZxHQjK0 k7Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=h1KJ888bIufMR3qzucyMjy432MzzCLph2hbsWG/Oe1s=; b=gYHuTgddImNEyd5RVTcilnjV5hwoQJ6DhyIRHjJSyb3jLeRbMOfTsPb+DQL2tV1k/8 2pOZ3OkfzenzTMImJcy/aniLWaVuKx/k+3jVXuR26XfGgHKVkwjZuFmBDcqhjBRLXPrY ED8Xnqn4Dfj6k0aeo+QX7qyYKC4wLIH9vlYQwcEwJYW9NKaU9qzhkQdq/N6y3rENjFXB 2bY03I0uSNlkXtcS+a0UTvXLUwYLAB83sSpNb1+4NsVuU5rxfj+CMUoEmoewEEOIrV9Q SVd97RK0WOAeCB9HGJ7kvoqZH6ury/HymdkUF0VzvVTbCSiahXMtyAROUOJQYfebWsnl KeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QECVWUfd; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l33-v6si11556910pld.512.2018.04.23.06.48.21; Mon, 23 Apr 2018 06:48:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QECVWUfd; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755271AbeDWNsU (ORCPT + 6 others); Mon, 23 Apr 2018 09:48:20 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44419 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755015AbeDWNsS (ORCPT ); Mon, 23 Apr 2018 09:48:18 -0400 Received: by mail-wr0-f195.google.com with SMTP id o15-v6so41476131wro.11 for ; Mon, 23 Apr 2018 06:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DfXCwLr9mOq3wp8mybJGL/qSHG1VGjllf7P08B/qaYM=; b=QECVWUfdCQdHAwlk7Ymw2xwhMhgG/K6XHmIA59i2aElgqtXcPs3uckt85EX44Oix0d QkfbD+t5+4TguJi4dLAUgG/ilizncSs5LBRTaSo6kUSw1zajAOghPnWQ3XoEnsk19UHN PXZ63Z9cucIVOBgsYfJpqnPZR2RKPDcnFHI3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DfXCwLr9mOq3wp8mybJGL/qSHG1VGjllf7P08B/qaYM=; b=H3GMQLYUTOPoqJLghXjus+uHlERfL5vxLkVU0FSdG6iUVp85W+JeBE5CWZlKyFGyIM keGJzLItRiVEw5FdnUm+0CU7YjpVDlF5KCygPF5l3pMCiJZy96bTHmmiRwFl0OMT2wHW rWv4cCJ6liAfyhJCWhxoFGtQ4a4+BXqFeExd4F2GzdF3rzhj26o0IyxZA37CTj9XhhzN eZF7goLyTNVKoAm8ZtrpxA5rg/Sy48VktGckjLzuRwcONCipn33i66v89Bl9Fi6VJQ8r 27ZL2FG5Fr5dzzAaYmF+8rUhD9GuqT6+0+6VE8Gx2Oay72auh23WSD5waR5jruZhCqE/ JBOQ== X-Gm-Message-State: ALQs6tDwU57t5iA7eRj8NvziYYC8Ns+4YhxpN3bCBnww6XG/8TSLn47+ lluCvv8uCuib9KxLw5ZYiFZBWw== X-Received: by 10.28.112.3 with SMTP id l3mr10289839wmc.90.1524491297691; Mon, 23 Apr 2018 06:48:17 -0700 (PDT) Received: from localhost.localdomain ([2001:8a0:6606:9100:b159:5390:182d:7dce]) by smtp.gmail.com with ESMTPSA id n14-v6sm14680319wrj.16.2018.04.23.06.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 06:48:16 -0700 (PDT) From: Rui Miguel Silva To: mchehab@kernel.org, sakari.ailus@linux.intel.com, Steve Longerbeam , Philipp Zabel , Rob Herring Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Shawn Guo , Fabio Estevam , devicetree@vger.kernel.org, Greg Kroah-Hartman , Ryan Harkin , Rui Miguel Silva Subject: [PATCH v2 01/15] media: staging/imx: add support to media dev for no IPU systems Date: Mon, 23 Apr 2018 14:47:36 +0100 Message-Id: <20180423134750.30403-2-rui.silva@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180423134750.30403-1-rui.silva@linaro.org> References: <20180423134750.30403-1-rui.silva@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some i.MX SoC do not have IPU, like the i.MX7, add to the the media device infrastructure support to be used in this type of systems that do not have internal subdevices besides the CSI. Signed-off-by: Rui Miguel Silva --- drivers/staging/media/imx/imx-media-dev.c | 18 +++++++++++++----- .../staging/media/imx/imx-media-internal-sd.c | 3 +++ drivers/staging/media/imx/imx-media.h | 3 +++ 3 files changed, 19 insertions(+), 5 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index f67ec8e27093..c0f277adeebe 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -92,6 +92,9 @@ static int imx_media_get_ipu(struct imx_media_dev *imxmd, struct ipu_soc *ipu; int ipu_id; + if (!imxmd->ipu_present) + return 0; + ipu = dev_get_drvdata(csi_sd->dev->parent); if (!ipu) { v4l2_err(&imxmd->v4l2_dev, @@ -481,16 +484,21 @@ static int imx_media_probe(struct platform_device *pdev) goto notifier_cleanup; } - ret = imx_media_add_internal_subdevs(imxmd); - if (ret) { - v4l2_err(&imxmd->v4l2_dev, - "add_internal_subdevs failed with %d\n", ret); - goto notifier_cleanup; + imxmd->ipu_present = true; + + if (imxmd->ipu_present) { + ret = imx_media_add_internal_subdevs(imxmd); + if (ret) { + v4l2_err(&imxmd->v4l2_dev, + "add_internal_subdevs failed with %d\n", ret); + goto notifier_cleanup; + } } /* no subdevs? just bail */ if (imxmd->notifier.num_subdevs == 0) { ret = -ENODEV; + v4l2_err(&imxmd->v4l2_dev, "no subdevs\n"); goto notifier_cleanup; } diff --git a/drivers/staging/media/imx/imx-media-internal-sd.c b/drivers/staging/media/imx/imx-media-internal-sd.c index 0fdc45dbfb76..2bcdc232369a 100644 --- a/drivers/staging/media/imx/imx-media-internal-sd.c +++ b/drivers/staging/media/imx/imx-media-internal-sd.c @@ -238,6 +238,9 @@ int imx_media_create_internal_links(struct imx_media_dev *imxmd, struct media_pad *pad; int i, j, ret; + if (!imxmd->ipu_present) + return 0; + intsd = find_intsd_by_grp_id(sd->grp_id); if (!intsd) return -ENODEV; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index 44532cd5b812..d40538ecf176 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -147,6 +147,9 @@ struct imx_media_dev { /* for async subdev registration */ struct v4l2_async_notifier notifier; + + /* indicator to if the system has IPU */ + bool ipu_present; }; enum codespace_sel {