From nobody Fri Dec 19 17:36:31 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AABE226981D for ; Thu, 13 Feb 2025 20:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739479507; cv=none; b=IrTVgL08Cd4zwaW0l+34IsN4jOHdmgc90YQ0muTvnH62SHAt4t6vAk3KAZwEOKqKWsAaV1g3mSo0XMXVncutbzs3e9bNc2NzcJu4e4gjTFZuIEpPnSw3HcetxjHXqcX8mVUoUYBheVNV26ch/BuLajWfnXNk5nzm8hO7pFGs/Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739479507; c=relaxed/simple; bh=P6MfJCrjan4Mpobi9cgpSSc8GRm8lqpmywVPdHfP/k4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Mt+uqBhyWJIEuCMLKH0tV61pvTm8xJUX7gBUN8Az8Nsrntjs7FRfawvfXzdkSnyu4LwMDK9NCJrvt5ZorxYg2zJIBXiOYHSjjlC7ldY/mMNtafd+nFLRRuhYIZfKKA6Wt1xkFrH451/KPAy3oLDldXArewFWfbZnhj56g2yU3c8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=C8zrCuWB; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C8zrCuWB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739479504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hqLmvup2Sea4jhYwCSUfiXHD+FvkO6EEqLzTP6+H1yA=; b=C8zrCuWBncCrDvPV0Iz7Tnok5R7Y0XwsnwaUOaOnrpQbZpZnwfAWK/j8thflce9nts1TVL UCAGP1QuImXMRkXPFjMlctJsFAstninsUfG/j2gDCADUIPaCN7ROaQ49jA7V4qXSMRcCfc bSFT/7KGd4wE6RCbl7nkW1sazfbqT/U= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-mbXvAAEqP_aFq8s6HZs-6A-1; Thu, 13 Feb 2025 15:45:01 -0500 X-MC-Unique: mbXvAAEqP_aFq8s6HZs-6A-1 X-Mimecast-MFC-AGG-ID: mbXvAAEqP_aFq8s6HZs-6A_1739479499 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DBA7D1800264; Thu, 13 Feb 2025 20:44:58 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 60E2519373D9; Thu, 13 Feb 2025 20:44:54 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 15:44:21 -0500 Subject: [PATCH 04/20] drm/panel/boe-bf060y8m-aj0: Move to using mipi_dsi_*_multi() variants Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mipi_cocci_multi-v1-4-67d94ff319cc@redhat.com> References: <20250213-mipi_cocci_multi-v1-0-67d94ff319cc@redhat.com> In-Reply-To: <20250213-mipi_cocci_multi-v1-0-67d94ff319cc@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Joel Selvaraj , Ondrej Jirman , Javier Martinez Canillas , Jianhua Lu , Robert Chiras , Artur Weber , Jonathan Corbet Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1739479476; l=5700; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=P6MfJCrjan4Mpobi9cgpSSc8GRm8lqpmywVPdHfP/k4=; b=jfsWVg+meYNnRXC6Q5l0AYbwxuYDFhSrg5Pg7GcD8A4Mq7EKVgCzoLzZ2jVAlNkoQNq9WZM1P CH9a+z3f5sWCr+fNN1PRR934zhidcP51S9AXiurl/TKXvJQtcp9CzAJ X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Stop using deprecated API. Used Coccinelle to make the change. @rule_3@ identifier dsi_var; identifier r; identifier func; type t; position p; expression dsi_device; expression list es; @@ t func(...) { ... struct mipi_dsi_device *dsi_var =3D dsi_device; +struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D dsi_var }; <+... ( -mipi_dsi_dcs_write_seq(dsi_var,es); +mipi_dsi_dcs_write_seq_multi(&dsi_ctx,es); | -r =3D mipi_dsi_dcs_exit_sleep_mode(dsi_var)@p; +mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); | -r =3D mipi_dsi_dcs_enter_sleep_mode(dsi_var)@p; +mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); | -r =3D mipi_dsi_dcs_set_display_off(dsi_var)@p; +mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); | .....//rest of the mipi APIs with _multi variant ) <+... -if(r < 0) { -... -} ...+> } Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 75 +++++++++++-----------= ---- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c b/drivers/gpu/d= rm/panel/panel-boe-bf060y8m-aj0.c index 7e66db4a88bbed27920107458d01efd9cf4986df..8903a6c889794330fa1f54a30e7= 79c7d5fbc4b14 100644 --- a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +++ b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c @@ -55,42 +55,34 @@ static void boe_bf060y8m_aj0_reset(struct boe_bf060y8m_= aj0 *boe) static int boe_bf060y8m_aj0_on(struct boe_bf060y8m_aj0 *boe) { struct mipi_dsi_device *dsi =3D boe->dsi; - struct device *dev =3D &dsi->dev; - int ret; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D dsi }; =20 - mipi_dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x4c); - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_3D_CONTROL, 0x10); - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, DCS_ALLOW_HBM_RANG= E); - mipi_dsi_dcs_write_seq(dsi, 0xf8, - 0x00, 0x08, 0x10, 0x00, 0x22, 0x00, 0x00, 0x2d); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0xa5, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2, 0x00, 0x4c); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_3D_CONTROL, 0x10); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, + DCS_ALLOW_HBM_RANGE); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf8, 0x00, 0x08, 0x10, 0x00, + 0x22, 0x00, 0x00, 0x2d); =20 - ret =3D mipi_dsi_dcs_exit_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to exit sleep mode: %d\n", ret); - return ret; - } + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); msleep(30); =20 - mipi_dsi_dcs_write_seq(dsi, 0xb0, 0xa5, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xc0, - 0x08, 0x48, 0x65, 0x33, 0x33, 0x33, - 0x2a, 0x31, 0x39, 0x20, 0x09); - mipi_dsi_dcs_write_seq(dsi, 0xc1, 0x00, 0x00, 0x00, 0x1f, 0x1f, - 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, - 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); - mipi_dsi_dcs_write_seq(dsi, 0xe2, 0x20, 0x04, 0x10, 0x12, 0x92, - 0x4f, 0x8f, 0x44, 0x84, 0x83, 0x83, 0x83, - 0x5c, 0x5c, 0x5c); - mipi_dsi_dcs_write_seq(dsi, 0xde, 0x01, 0x2c, 0x00, 0x77, 0x3e); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0xa5, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc0, 0x08, 0x48, 0x65, 0x33, + 0x33, 0x33, 0x2a, 0x31, 0x39, 0x20, 0x09); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc1, 0x00, 0x00, 0x00, 0x1f, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe2, 0x20, 0x04, 0x10, 0x12, + 0x92, 0x4f, 0x8f, 0x44, 0x84, 0x83, 0x83, + 0x83, 0x5c, 0x5c, 0x5c); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xde, 0x01, 0x2c, 0x00, 0x77, + 0x3e); =20 msleep(30); =20 - ret =3D mipi_dsi_dcs_set_display_on(dsi); - if (ret < 0) { - dev_err(dev, "Failed to set display on: %d\n", ret); - return ret; - } + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); msleep(50); =20 return 0; @@ -99,24 +91,18 @@ static int boe_bf060y8m_aj0_on(struct boe_bf060y8m_aj0 = *boe) static int boe_bf060y8m_aj0_off(struct boe_bf060y8m_aj0 *boe) { struct mipi_dsi_device *dsi =3D boe->dsi; - struct device *dev =3D &dsi->dev; - int ret; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D dsi }; =20 /* OFF commands sent in HS mode */ dsi->mode_flags &=3D ~MIPI_DSI_MODE_LPM; - ret =3D mipi_dsi_dcs_set_display_off(dsi); - if (ret < 0) { - dev_err(dev, "Failed to set display off: %d\n", ret); - return ret; - } + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); + msleep(20); =20 - ret =3D mipi_dsi_dcs_enter_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to enter sleep mode: %d\n", ret); - return ret; - } + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); + usleep_range(1000, 2000); + dsi->mode_flags |=3D MIPI_DSI_MODE_LPM; =20 return 0; @@ -233,12 +219,10 @@ static const struct drm_panel_funcs boe_bf060y8m_aj0_= panel_funcs =3D { static int boe_bf060y8m_aj0_bl_update_status(struct backlight_device *bl) { struct mipi_dsi_device *dsi =3D bl_get_data(bl); + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D dsi }; u16 brightness =3D backlight_get_brightness(bl); - int ret; =20 - ret =3D mipi_dsi_dcs_set_display_brightness(dsi, brightness); - if (ret < 0) - return ret; + mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, brightness); =20 return 0; } @@ -246,6 +230,7 @@ static int boe_bf060y8m_aj0_bl_update_status(struct bac= klight_device *bl) static int boe_bf060y8m_aj0_bl_get_brightness(struct backlight_device *bl) { struct mipi_dsi_device *dsi =3D bl_get_data(bl); + u16 brightness; int ret; =20 --=20 2.47.0