From patchwork Sat Aug 8 22:43:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 247561 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp3643383ilo; Sat, 8 Aug 2020 15:43:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqu11BJFGk7H8V/j9GTO3Qba/fhPpVwORY6nDliGNkGcspJiIZ0QpvPSUm+kk0JvSqc7qu X-Received: by 2002:a17:90a:a101:: with SMTP id s1mr7443401pjp.205.1596926610695; Sat, 08 Aug 2020 15:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596926610; cv=none; d=google.com; s=arc-20160816; b=SKYWaWhIcWBq315vGqtQX66Mfb2SuHT8RiFzyGk3jkY15D6HzbTZ4wRSf56vYBxHUJ ZiNX7gsGCsuP4hMbBvgj3ijsvP6sSGKxJiHoHXD8phpt4rmQD4/a5O555E2NrgL6V7eX p7MHgb8We5tUtopa1IcEt24gTtk1MAd0nYGUmsKwWPQqMGiLCpqmYbsldiqwilu5KGGS uzooqaJ3tAwqXroPPhhElmAoPpWGLNXY7tYuIVSkslbe78TGXAbPrqw9s2SuMDF3iQBM B4/JnkO1yYTCkN8rC++knMCWikvP0JRLFTPDz5XSN63e+VefWe03apuYS+0NPXdK+IzG aHYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=VV2YN5FpmyeQjw8E25fobWAqwaTUKJ+ukGFIMVyTjpA=; b=RXI61YIE+C5UuQxGZNyxwyKAJ8N//BbYS4n0fdWJRsMsQi1A847ZTvNVMPMz+1anex XLHhFNnMOn1t29jO9KqtZ/Pa89rjQUlCJhUJDrj9yu6ukkxTBM9nmxMefa1JOqJhf6US vGS5AvLfQ5ZxJ9Bt6er43cNHYnPR9aEPDiQzID+ocapvq1unsYAuG1hSmn8EGYxtD3bO QiItqyw9FvVhFh3PjSlM4L/o7Lf/ohyBE54Y8in1DYWN5r9BWgj7vjsfL/LSKcFw8k52 7aKeu5N3hTzSzfKJENcby9kVo6Xogh6/dFOZOHmjPrqOPrHqC+nduXpoWco0NpSSP8JV cJqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fDZiOjqS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z30si8767555pff.128.2020.08.08.15.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2020 15:43:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fDZiOjqS; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FDA56E2AF; Sat, 8 Aug 2020 22:43:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 19A116E2AF for ; Sat, 8 Aug 2020 22:43:26 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id v9so5833843ljk.6 for ; Sat, 08 Aug 2020 15:43:25 -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:mime-version :content-transfer-encoding; bh=zyRYAAosTPHfICqU6xbVT2RtBtStioZtMcci7LezLaQ=; b=fDZiOjqSQCMwezd46e74wpZAsXsgK5wMUVUSE+N6rZ1YNhljEL1vnZOTNIX3b87hcF fGNNvBKn+H/ccvWoIEVoQGTYrfYY8TrSi9KxMBNOGOgQOxaIw1bicvcn6xtvXJOcczNg zK3bBZSxL2p1bFhoW3f3dkmdMPiGmDJcOn4ld+/zi5smHmKy4+GRWNFY5sQauSSZxvfA yp+c3CV6doPaI7jMVb3VU02zRQNrl6iA+jgOXcOaNF8444S15fNXhXAhvbLKxqwOTelt d9ijHsRoBd+zmyipSCW1dEQX1oOMaXrARFSpzVXdLeFscHUcUqmUDHD9dm33+Y3wVvk4 YNyA== 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:mime-version :content-transfer-encoding; bh=zyRYAAosTPHfICqU6xbVT2RtBtStioZtMcci7LezLaQ=; b=atYaESCw9pM4GbZRzeQw4zfLy2nvRYSdLy7ntVWWOznA6hQj1pTHSYxa+djXUUkenT EoHXw+8oc3ybQNnf8ebgMUuQL8uoiny5mDGdBsGX/r9zTEXMs6zC+gP0FuKnzeTuyFuT FfsXyS/AWC0jsjt3U2cdCZo1m4ZeaDtVIOvSCOxQxJHKcGXzygDNHgN1orLwDUWySkXi pMBAOVmnrEfZsIDJYfodkDWjg81wx8UGf1ucS+s95C7F3FImhDmJ1Jdnsyf7YN3NghqU 8vwUAy+Y07NH8YFqzPszJLeOq72TJuFXWkZnF9uPrwoeoC87fScHczCU/vzKhlRBkBFm ayvA== X-Gm-Message-State: AOAM532zmYPt8sjQuXs6lcdYXk8RmuqO5+GSRiL/XZU5CvABeGlOK8Iy CpLswAgwAHFD7hCgg1PTXAT0BA== X-Received: by 2002:a2e:910b:: with SMTP id m11mr9199317ljg.159.1596926604429; Sat, 08 Aug 2020 15:43:24 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id 203sm6577878lfk.49.2020.08.08.15.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2020 15:43:23 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel-notatek-nt35510: Fix MTP read init Date: Sun, 9 Aug 2020 00:43:22 +0200 Message-Id: <20200808224322.1507713-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: newbytee@protonmail.com, Stephan Gerhold Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to successfully read ID of the MTP panel the panel MTP control page must be unlocked. Previously this wasn't encountered because in the setup with this panel the power wasn't ever really dropped. When power gets dropped from the panel, MTP needs to be unlocked. Cc: newbytee@protonmail.com Cc: Stephan Gerhold Signed-off-by: Linus Walleij --- drivers/gpu/drm/panel/panel-novatek-nt35510.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c index 4a8fa908a2cf..d0cd2128df1d 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c @@ -376,6 +376,10 @@ struct nt35510 { }; /* Manufacturer command has strictly this byte sequence */ +static const u8 nt35510_mauc_mtp_read_param[] = { 0xAA, 0x55, 0x25, 0x01 }; +static const u8 nt35510_mauc_mtp_read_setting[] = { 0x01, 0x02, 0x00, 0x20, + 0x33, 0x13, 0x00, 0x40, + 0x00, 0x00, 0x23, 0x02 }; static const u8 nt35510_mauc_select_page_0[] = { 0x55, 0xAA, 0x52, 0x08, 0x00 }; static const u8 nt35510_mauc_select_page_1[] = { 0x55, 0xAA, 0x52, 0x08, 0x01 }; static const u8 nt35510_vgh_on[] = { 0x01 }; @@ -698,6 +702,18 @@ static int nt35510_power_on(struct nt35510 *nt) usleep_range(120000, 140000); } + ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_PARAM, + ARRAY_SIZE(nt35510_mauc_mtp_read_param), + nt35510_mauc_mtp_read_param); + if (ret) + return ret; + + ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_SETTING, + ARRAY_SIZE(nt35510_mauc_mtp_read_setting), + nt35510_mauc_mtp_read_setting); + if (ret) + return ret; + ret = nt35510_read_id(nt); if (ret) return ret;