Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp569121iof; Mon, 6 Jun 2022 08:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1j3bfAn+SOobR2cqT4B7pzmGqvtoqd4FtVmOC0/Fk/iHGLpZD3CDlp41rpOYGwKtPOFlM X-Received: by 2002:a17:902:ea43:b0:161:f1fb:fb28 with SMTP id r3-20020a170902ea4300b00161f1fbfb28mr24836631plg.20.1654529987522; Mon, 06 Jun 2022 08:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654529987; cv=none; d=google.com; s=arc-20160816; b=nFbk+YzptEsbtDEOtgpm6yiVHccWxQ3WfKn220u6M5nl6SOyXp8mZkr7sy5Km2ic8c KtmMFzEsFNIiQEZK8a6l79Kdhlu1jvblBAOHUR84Wv1qHUXkmbCapioEitIWnkreKisM z9mfIb3rIzIGrqh5+7XQHWFnpRS1hHUJP02PuJa9J1WDJApyM4a/DqXRIlpuO/HNbcXa l8/AvpTeAAHgJG7twYdVcmfdkpZos5sCVWCuwa5bDc6+RS1b5xqcvrzJGviwx5ef1IlD a2TT5IYWd90W+Dwuq8fq/EdVFdD30JkjPGwMCkLLzIPqdFpjJbeJP1Mr03SjUC0mK5tw DC8Q== 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=pK8Pia3oWcO6LvRo8JULHgdKZyhIvY64SIstYz7E0T8=; b=LY3ur4lQnweDzsu8KUQJzUD/z579zSGZ/Un6KIO8CIp6hnRr7+ksfE99U6C4aKdyhL x1gGTSkJwVUe2PuC7M3GgqfSgpVrqyO/4CnWoxrPNjs2vdIRB4kCo2riqHa2CQLvEe+H sOzOMolHImNoar5xUHerNlUH3aHHwHUOwXyKnWpuw8D5PHdpjA74llzW4AyX4KYfoNms qbIEgAnx+qaQEnFqIIgKbhskUKKbT/GQTczxpe1ZZ/UO3Fg2W/2og25YVIJSSzLavAoq xmWEocCAPEZBQFTT8oJt9O6/whxVSVvSAIL+ANWZQZ/vMO/9OCZNJAGbtotD+61QH/Wv bh6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j8KrEYwz; 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 bi7-20020a170902bf0700b00156b46e2407si20663336plb.471.2022.06.06.08.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:39:47 -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=j8KrEYwz; 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 BC07B1C5926; Mon, 6 Jun 2022 08:25:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240516AbiFFPZU (ORCPT + 99 others); Mon, 6 Jun 2022 11:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240506AbiFFPZD (ORCPT ); Mon, 6 Jun 2022 11:25:03 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42AD304B40 for ; Mon, 6 Jun 2022 08:25:01 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id c18so4838374pgh.11 for ; Mon, 06 Jun 2022 08:25:01 -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=pK8Pia3oWcO6LvRo8JULHgdKZyhIvY64SIstYz7E0T8=; b=j8KrEYwzpTl5wHCO3UxGm1TqLbk/MMUjBXH7zs5T2HtQD/NymmchMMT2FhwajxbvDA /NGiGjbOKNhODqs6sZLzSOIu7dkS7XzlyhcmJNGvmaouF1zHr6tpgxhRc544Z15q2oF9 L+qG4WbV8zWJL+HU6jxVCj6uINhkvLcAgNEFI= 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=pK8Pia3oWcO6LvRo8JULHgdKZyhIvY64SIstYz7E0T8=; b=mJ7wJB8yItLHqGxGvAH6/lcHp8dY9mUhsEqUHjs9KpU/2aXcuupori+hjzYepNDzML nK3nrg68rH/mfiO9GkPUoM0JgUOUG0gF0A9n/LqLkbp02+ko+uKL4GdZNXfoZH5eKtBh OhZPSJJ845JpRYTM+xf2dksXkr38dlmKKHXbr9M0WuwuAhUkq4iiF2IqwYQkX+S+7orb OZTtZF++L2kWDhmNCnnSkXpJ5T/sXTSm4OFh8whJdaQmyZWkDJkBOTcsFUYaUhlz4eO0 Y3ITbxjdf2qa9L+yTrA37ldygDqQQppL8ATC/09+ZhPBHgsHPu2/TogosFeWNN4ec3Ar Sitg== X-Gm-Message-State: AOAM5311J+4UzbowlUrU7Tcnn8sLWPjSY+n8DZtwXIrowliJ0i6urkqY ttd1wWvk+HCTwp3b6atkxFrPqQ== X-Received: by 2002:a05:6a00:338e:b0:51b:c452:4210 with SMTP id cm14-20020a056a00338e00b0051bc4524210mr24166501pfb.69.1654529101396; Mon, 06 Jun 2022 08:25:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:a0a:5e4:e24:c8c4]) by smtp.gmail.com with ESMTPSA id h1-20020a655181000000b003fbaae74971sm10749306pgq.72.2022.06.06.08.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:25:01 -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 v4 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Mon, 6 Jun 2022 23:24:30 +0800 Message-Id: <20220606152431.1889185-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220606152431.1889185-1-hsinyi@chromium.org> References: <20220606152431.1889185-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 Reviewed-by: Douglas Anderson --- 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