From patchwork Mon Apr 18 09:22:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinay Simha B N X-Patchwork-Id: 8871291 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C3E81BF29F for ; Mon, 18 Apr 2016 11:28:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0027120270 for ; Mon, 18 Apr 2016 11:28:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2B6A220204 for ; Mon, 18 Apr 2016 11:28:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 35FF76E069; Mon, 18 Apr 2016 11:28:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E5706E55C for ; Mon, 18 Apr 2016 09:23:22 +0000 (UTC) Received: by mail-pf0-x22f.google.com with SMTP id c20so79064938pfc.1 for ; Mon, 18 Apr 2016 02:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sRsZEGYpes1G1dHrRWSguy4JLOxTKtBfYKSIQF+V5Aw=; b=huKtGc5ERBM7O5V/yC7VlV5UPwrFR8UTjlbuLW+S6xUIG3sj50k7FUFOGK6JH8y0v4 NSiNBJsZl/Ajq327Edzwft2yD1Iv6auGoRXXx3t+TZVGd2ObIqis6WJh91ZIgjbw28+i GDoOqATEhlTiEla7bj3QqrdNZmGQAc3Bg1K77+6P7LZoljqQOaLZYXnxG1B6RiXkkOQS lYFyJ94xY7TvgZIY+Eulza3LeNx78VqwGcU2ThSjT8632jKh08R6qMYY/CEkSUOrcQc0 p51BU+gqu/oXfQNgux/CwcgOdAsEVOsKbgg1zen7+NiKciH3SkVApGyutfW5SY0W+vzr kOyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sRsZEGYpes1G1dHrRWSguy4JLOxTKtBfYKSIQF+V5Aw=; b=dbpdpbBOctNCRhoANXn886dIseQVfSCcxNH/qZU7pxv1TWoWdsnoDhfhFC+Zpm1d0q 9lu+tKYaVKSdbKOlU6FfgiXqUtMsDLt5JVlQHH6A3CNdzZMYv4hWhqDndLY1BYRuY5PZ V5NZvZ6dnMlP7OVUsS8i5gLDNLyYI//56QosaiOUtu/HIGONJm2GHj2eJMCjMx0SEdk8 iXFoLiINuBkqvpHJh1AvSZg8GuDIZ3I5197Peq1M3TfAsvSvBCc7VHV7yMBtl4am7P+8 k+FqUyCF92fV9KhDVHT2ceVjjbqea9d3nBU3WUCHy6RFjQUPk3q0iwU50Dd3fGuWHf0z MTkg== X-Gm-Message-State: AOPr4FWrlK1Tg4iKOr2IgoX7is9EjbA2zIgFwvxl6nQkTHgOOoO59ysmsTfSgg1JmK7Ddw== X-Received: by 10.98.93.29 with SMTP id r29mr23669508pfb.18.1460971401761; Mon, 18 Apr 2016 02:23:21 -0700 (PDT) Received: from localhost.localdomain ([202.83.17.75]) by smtp.gmail.com with ESMTPSA id oy2sm82299796pac.38.2016.04.18.02.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Apr 2016 02:23:21 -0700 (PDT) From: Vinay Simha BN To: Subject: [PATCH 2/2] drm/dsi: Implement DCS get display self diagnostic Date: Mon, 18 Apr 2016 14:52:05 +0530 Message-Id: <1460971325-26982-2-git-send-email-simhavcs@gmail.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1460971325-26982-1-git-send-email-simhavcs@gmail.com> References: <1460971325-26982-1-git-send-email-simhavcs@gmail.com> X-Mailman-Approved-At: Mon, 18 Apr 2016 11:28:08 +0000 Cc: Vinay Simha BN , open list , "open list:DRM DRIVERS" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Provide a small convenience wrapper that transmits a DCS get_diagnostic_result command. Signed-off-by: Vinay Simha BN --- drivers/gpu/drm/drm_mipi_dsi.c | 25 +++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 2e032ea..e49b346 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -816,6 +816,31 @@ int mipi_dsi_dcs_get_display_mode(struct mipi_dsi_device *dsi, u8 *mode) EXPORT_SYMBOL(mipi_dsi_dcs_get_display_mode); /** + * mipi_dsi_dcs_get_diagnostic_result() - query the display module's diagnostic + * result + * @dsi: DSI peripheral device + * @mode: return location for the display self diagnostic result + * + * Return: 0 on success or a negative error code on failure. + */ +int mipi_dsi_dcs_get_diagnostic_result(struct mipi_dsi_device *dsi, u8 *mode) +{ + ssize_t err; + + err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DIAGNOSTIC_RESULT, mode, + sizeof(*mode)); + if (err <= 0) { + if (err == 0) + err = -ENODATA; + + return err; + } + + return 0; +} +EXPORT_SYMBOL(mipi_dsi_dcs_get_diagnostic_result); + +/** * mipi_dsi_dcs_get_pixel_format() - gets the pixel format for the RGB image * data used by the interface * @dsi: DSI peripheral device diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 48fcd65..61c375b 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -255,6 +255,7 @@ int mipi_dsi_dcs_nop(struct mipi_dsi_device *dsi); int mipi_dsi_dcs_soft_reset(struct mipi_dsi_device *dsi); int mipi_dsi_dcs_get_power_mode(struct mipi_dsi_device *dsi, u8 *mode); int mipi_dsi_dcs_get_display_mode(struct mipi_dsi_device *dsi, u8 *mode); +int mipi_dsi_dcs_get_diagnostic_result(struct mipi_dsi_device *dsi, u8 *mode); int mipi_dsi_dcs_get_pixel_format(struct mipi_dsi_device *dsi, u8 *format); int mipi_dsi_dcs_enter_sleep_mode(struct mipi_dsi_device *dsi); int mipi_dsi_dcs_exit_sleep_mode(struct mipi_dsi_device *dsi);