From patchwork Thu Nov 21 09:23:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikandan Muralidharan X-Patchwork-Id: 13881800 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6422BD75BDD for ; Thu, 21 Nov 2024 09:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0/pOGJNL993DPyoMevAgdGrHFiNsXmQDI8AHiFFQmMs=; b=o0FnoJ1cnbs6MT1uHm0ydBzrZm 9dIhdGjzM2pUrlHBesq1JTNbE80kSMwM7SfRlaeogJKbdTBGrMAdmQ5UwTCNgZHsNjOZc2vkEb3tK 31jGyfOsMhiUAibOGm+8r4U+cabjy+nETotmOaz1sFThsIVUBcGIVOIYzWfn6VLZ8IjSLvXdGlDVm PYbvL/CJYGoKxroqp0+Gc6XiB5mPME1OB5d1KUmrrKp4NyGCjjhWXxX9Af9PvfHQkbOg0bscep3zf j9aZ/ctENPXpg2EPnxWwLgIE1t032nWz193MTTfi/toVPijdFT+jnQbdvW7VXAXQiMyOwkeUK2AgK lyhCapCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tE3Py-0000000HEiZ-4BH0; Thu, 21 Nov 2024 09:24:07 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tE3P1-0000000HEXU-0jSO for linux-arm-kernel@lists.infradead.org; Thu, 21 Nov 2024 09:23:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1732180987; x=1763716987; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Sa8bPFHTaj9aW+dktFBUNt2YyId16vwK369IXtQxnwo=; b=gSPtDtDmmHCHOqIXKNAfAnBYbfD3JS06diE1dqAzjq5Mho3mTLeBzYs6 yWfLMROXDkZOYgx+LpL8dMIdUAQHzuwF7Qeq11ri9td3StcOeHtXyZYe9 1mc2LpP2yYkvnzCMIikb4SnWSSQAtur0KYfeslHYt6ZMu1b3LV/c2pe5t QsVGBzKTGNXRuVCaBd3gi5danIckl2GVYRof7l2XmzelI4l0UfiRKCIVj Os6XiM6EqHTIN0eizbkjrzfe8Y0WdPy5E6wofXc9Kqukp8TX6ADDbH/Ht 1EI3Q2Kix4BJVtuRUpahosE6S7pmtwgR2EPNWhI90n3sdPWDzlTWZj5np g==; X-CSE-ConnectionGUID: YiAoo1hURNCm0K6Jsadz8A== X-CSE-MsgGUID: jyCdARExQnCVU/SgCMKtbg== X-IronPort-AV: E=Sophos;i="6.12,172,1728975600"; d="scan'208";a="34608880" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Nov 2024 02:23:05 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 21 Nov 2024 02:23:01 -0700 Received: from che-lt-i67131.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 21 Nov 2024 02:22:56 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , CC: , Dharma Balasubiramani Subject: [PATCH 1/3] drm: atmel-hlcdc: add support for LVDS encoder type Date: Thu, 21 Nov 2024 14:53:06 +0530 Message-ID: <20241121092308.130328-1-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241121_012307_238002_36E61980 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Dharma Balasubiramani Add support for encoder type "DRM_MODE_ENCODER_LVDS" with the following bus formats: - RGB888_1X7X4_SPWG - RGB888_1X7X4_JEIDA - RGB666_1X7X3_SPWG - RGB666_1X18 Signed-off-by: Dharma Balasubiramani [manikandan.m@microchip.com: move modifications inside the atmel_xlcdc_connector_output_lvds fn] Signed-off-by: Manikandan Muralidharan --- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 0f7ffb3ced20..0e709047369a 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -356,6 +356,42 @@ static int atmel_xlcdc_connector_output_dsi(struct drm_encoder *encoder, return supported_fmts; } +static int atmel_xlcdc_connector_output_lvds(struct drm_encoder *encoder, + struct drm_display_info *info) +{ + int j; + unsigned int supported_fmts = 0; + + switch (atmel_hlcdc_encoder_get_bus_fmt(encoder)) { + case 0: + break; + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + case MEDIA_BUS_FMT_RGB666_1X18: + return ATMEL_HLCDC_RGB666_OUTPUT; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + return ATMEL_HLCDC_RGB888_OUTPUT; + default: + return -EINVAL; + } + + for (j = 0; j < info->num_bus_formats; j++) { + switch (info->bus_formats[j]) { + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + case MEDIA_BUS_FMT_RGB666_1X18: + supported_fmts |= ATMEL_HLCDC_RGB666_OUTPUT; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + supported_fmts |= ATMEL_HLCDC_RGB888_OUTPUT; + break; + default: + break; + } + } + return supported_fmts; +} + static int atmel_hlcdc_connector_output_mode(struct drm_connector_state *state) { struct drm_connector *connector = state->connector; @@ -374,6 +410,8 @@ static int atmel_hlcdc_connector_output_mode(struct drm_connector_state *state) */ if (encoder->encoder_type == DRM_MODE_ENCODER_DSI) return atmel_xlcdc_connector_output_dsi(encoder, info); + else if (encoder->encoder_type == DRM_MODE_ENCODER_LVDS) + return atmel_xlcdc_connector_output_lvds(encoder, info); switch (atmel_hlcdc_encoder_get_bus_fmt(encoder)) { case 0: