Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp134817iof; Sun, 5 Jun 2022 23:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2VwtLuvpzMUYNPQ/u506VhB5KavHcKqpfXtwzrT9ngkl+lnwfslGDAU/A8fG5lQi/zBrL X-Received: by 2002:a63:2b02:0:b0:3fb:fe88:8a8f with SMTP id r2-20020a632b02000000b003fbfe888a8fmr19530737pgr.247.1654496658120; Sun, 05 Jun 2022 23:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496658; cv=none; d=google.com; s=arc-20160816; b=o+ZI3eOyMyXwTJSblwf0FAupdO+CHQ9d0eesGOHThU5UM7ceoHWDOPyt6o4OLU27Qg UKNYQQrfDuRugbi+evKZ3ZZAbXeKi7qhsesuPG/VZtRIUweJh/GQsIGLUeaA+IMypxJr ISiyuLdfbPz+lUSq9r/2yAEu1fQNcd+Nctskv3nrW6rMqA1f3dq+SE6zsINzx9lMGRVG Ajjzd6ddOGB/gNfy4hy2hmEGYqz5uQ3NeiQMwcTRdu9OGEzYpg72Y+7UkTFYc/rHs/G8 /SSpTnqMJybDVH/anxsk6y3LgPoycx5CHEnpWXrYYqaadjI/NU1ZvlV3eL/vneApL0VS kn/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=97K3htkiWQw+INn8ETXNI7aVsJxE2gVqrlXYI1w5zzg=; b=FXrO+TUUXWsWJh2XYxYa8r5aDSvBuE8o4I/RKliXT+y8wAkO93eAArIXi2/h19f6Wb iugWADKxjrDD3xZS6/v9QUb1STFHvMcH1kITWTdI0xRcxK7FjZnfLuAKfY82/ME8cyIy NhSztiETSC0s4ImTmatqB+IESPmdlvWsxqI1H3Sp4iaDk0PPwfcrW+1582nVfUWZU93g /Wz6Dxcvl7MyCx6uTfoCAlOY7JxgsMed1IoIlhRawIi0XFQTAPwD4RIZ99fCd1AUS8uY NahY3P18lAyGC0GowmpD7RjvmxLfO83MT8XUQ1C2MYLKWgSJMwMpeZw9jJm6+suiVm0X Hc2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dpNT3fTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k18-20020a170902c41200b00161d4849a90si6883551plk.575.2022.06.05.23.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dpNT3fTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D748D138907; Sun, 5 Jun 2022 22:07:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbiFFFGs (ORCPT + 99 others); Mon, 6 Jun 2022 01:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiFFFGq (ORCPT ); Mon, 6 Jun 2022 01:06:46 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37AF72F5A73 for ; Sun, 5 Jun 2022 21:47:52 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id j7so11870850pjn.4 for ; Sun, 05 Jun 2022 21:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=97K3htkiWQw+INn8ETXNI7aVsJxE2gVqrlXYI1w5zzg=; b=dpNT3fTX/WPB28+JQiYWM7nrmX5TOOLvK8DrJSqzIIFhGqrpFbggxbj9UFaSCTSaAn LmuhI/pzBFe/vSEP67ajaAyBbveZCRa0Uw47P+OUvwnCR9uLK97wlNpW3/B55/T156Cd +NaBn/YN9zWbC4kRLOhAn6kg37+XSoHeweuDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=97K3htkiWQw+INn8ETXNI7aVsJxE2gVqrlXYI1w5zzg=; b=3sztGaS79CyL1BNY+7hKLmCqM8Qw3k0M9cQ9aZaPKY/LAELNL9gDk+/S8FjfT8w0CN nbbr/YGnzLDeRZIdKqh6KbI7vnb49bLfjzkk6VTINlTEjrrooDj/juKpPq8rJNUb6U13 T3zj5hNZDwLgz3S+LQc/UHdafvZzTjYxpjZFxNRvyytBc2mx+XKRdRnpn0UY5IbqmLGh QbB+TF9XS3elgsDY7b1sH/PSBhc9m0TCyfDk2hBrpPZugHtCjwbBgc9JrjwZgNJ8DOfE j5oc/2jUK4B7dRz1XN1khLB5ciRMa6NYtVRwloG2GsMGYcDl+N0KApByfnviw/8QP13X RiHA== X-Gm-Message-State: AOAM533kcdVtibDVc3F8Yh3HSEevwCJwUxfjYFrEH7cDA5xGIEd3x8i7 7zRn2f6dSpx+YI1W5PGrzMQtVQ== X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr22003917plk.172.1654490871310; Sun, 05 Jun 2022 21:47:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:ced3:b110:401b:b32c]) by smtp.gmail.com with ESMTPSA id t190-20020a6381c7000000b003db7de758besm9718609pgd.5.2022.06.05.21.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:47:50 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Mon, 6 Jun 2022 12:47:19 +0800 Message-Id: <20220606044720.945964-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220606044720.945964-1-hsinyi@chromium.org> References: <20220606044720.945964-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede --- v2->v3: add comments for notice. --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index 80227617a4d6..fa85a288afdc 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -217,15 +217,29 @@ static int kd35t133_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; drm_mode_probed_add(connector, mode); + /* + * drm drivers are expected to call drm_panel_get_orientation() to get + * panel's orientation then drm_connector_set_panel_orientation() to + * set the property before drm_dev_register(). Otherwise there will be + * a WARN_ON if orientation is set after drm is registered. + */ drm_connector_set_panel_orientation(connector, ctx->orientation); return 1; } +static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel) +{ + struct kd35t133 *ctx = panel_to_kd35t133(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs kd35t133_funcs = { .unprepare = kd35t133_unprepare, .prepare = kd35t133_prepare, .get_modes = kd35t133_get_modes, + .get_orientation = kd35t133_get_orientation, }; static int kd35t133_probe(struct mipi_dsi_device *dsi) -- 2.36.1.255.ge46751e96f-goog