Linux Kernel Mentees list
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: "Nicolás Antinori" <nico.antinori.7@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>
Cc: Brigham Campbell <me@brighamcampbell.com>,
	Jori Koolstra <jkoolstra@xs4all.nl>,
	Shuah Khan <skhan@linuxfoundation.org>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH v3 2/3] drm/ch1115: add support for Chipwealth CH1115 OLED controller
Date: Sat, 29 Aug 2026 10:18:16 +0200	[thread overview]
Message-ID: <968d5cd7-60e0-450e-b096-6058d76863d8@wanadoo.fr> (raw)
In-Reply-To: <cb767f9b1db18f981c363222f96a46061e77e4c7.1787973729.git.nico.antinori.7@gmail.com>

Le 29/08/2026 à 08:32, Nicolás Antinori a écrit :
> Chipwealth CH1115 is a controller for monochrome dot matrix OLED panels.
> 
> Add DRM support for this chip using i2c bus.
> 
> Signed-off-by: Nicolás Antinori <nico.antinori.7@gmail.com>

Hi,

a few nitpick below, should it help.

...

> +static int ch1115_connector_init(struct ch1115_device *ch1115)
> +{
> +	struct drm_connector *connector = &ch1115->connector;
> +	struct drm_encoder *encoder = &ch1115->encoder;
> +	struct drm_device *dev = &ch1115->dev;
> +	int ret;
> +
> +	ret = drm_connector_init(dev, connector, &ch1115_connector_funcs,
> +				 DRM_MODE_CONNECTOR_Unknown);
> +

Unneeded empty ilne.

> +	if (ret)
> +		return ret;
> +
> +	drm_connector_helper_add(connector, &ch1115_connector_helper_funcs);
> +
> +	return drm_connector_attach_encoder(connector, encoder);
> +}

...

> +static int ch1115_probe(struct i2c_client *client)
> +{
> +	struct ch1115_device *ch1115;
> +	struct device *dev;
> +	struct backlight_device *bl;
> +	int ret;
> +
> +	dev = &client->dev;
> +	ch1115 = devm_drm_dev_alloc(&client->dev, &ch1115_driver,
> +				    struct ch1115_device, dev);
> +	if (IS_ERR(ch1115))
> +		return PTR_ERR(ch1115);
> +
> +	i2c_set_clientdata(client, ch1115);
> +
> +	ch1115->client = client;
> +	ch1115->regmap = devm_regmap_init(dev, &ch1115_regmap_bus,
> +					  client, &ch1115_regmap_config);
> +	if (IS_ERR(ch1115->regmap)) {
> +		return dev_err_probe(dev, PTR_ERR(ch1115->regmap),
> +				     "Failed to initialize regmap\n");
> +	}

Un-needed { } to be consistent with other paths below.

> +
> +	ret = ch1115_parse_dt(ch1115);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to parse DT\n");
> +
> +	ch1115->pages = DIV_ROUND_UP(ch1115->height, CH1115_PAGE_HEIGHT);
> +	ch1115->bytes_per_row = DIV_ROUND_UP(ch1115->width, 8);
> +	ch1115->x_start_offset = ch1115->flip_horizontal
> +		? CH1115_MAX_WIDTH - ch1115->width
> +		: 0;
> +	ch1115->mode = ch1115_mode(ch1115);
> +
> +	ch1115->hwbuf = devm_kzalloc(dev, (ch1115->width * ch1115->height) / 8,
> +				     GFP_KERNEL);
> +	if (!ch1115->hwbuf)
> +		return -ENOMEM;
> +
> +	ch1115->row = devm_kzalloc(dev, ch1115->width, GFP_KERNEL);
> +	if (!ch1115->row)
> +		return -ENOMEM;
> +
> +	// Backlight
> +	bl = devm_backlight_device_register(dev, dev_name(dev), dev, ch1115,
> +					    &ch1115_bl_ops, NULL);
> +	if (IS_ERR(bl))
> +		return dev_err_probe(dev, PTR_ERR(bl),
> +				     "Unable to register backlight device\n");
> +
> +	bl->props.brightness = ch1115->contrast;
> +	bl->props.max_brightness = CH1115_MAX_CONTRAST;
> +	ch1115->bl_dev = bl;
> +
> +	// DRM
> +	ret = ch1115_mode_config_init(ch1115);
> +	if (ret)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to initialize mode config\n");
> +
> +	ret = ch1115_plane_init(ch1115);
> +	if (ret)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to initialize primary plane\n");
> +
> +	ret = ch1115_crtc_init(ch1115);
> +	if (ret < 0)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to initialize CRTC\n");
> +
> +	ret = ch1115_encoder_init(ch1115);
> +	if (ret < 0)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to initialize encoder\n");
> +
> +	ret = ch1115_connector_init(ch1115);
> +	if (ret < 0)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to initialize connector\n");
> +
> +	drm_mode_config_reset(&ch1115->dev);
> +
> +	ret = drm_dev_register(&ch1115->dev, 0);
> +	if (ret)
> +		return dev_err_probe(&client->dev, ret,
> +				     "Failed to register DRM device\n");
> +
> +	drm_client_setup(&ch1115->dev, NULL);
> +
> +	return 0;
> +}
> +
> +static void ch1115_remove(struct i2c_client *client)
> +{
> +	struct ch1115_device *ch1115 = i2c_get_clientdata(client);
> +	int ret;
> +
> +	u8 cmd_list[] = {
> +		CH1115_CMD_OFF,
> +
> +		CH1115_CMD_ALL_ON,
> +
> +		CH1115_CMD_DC_DC,
> +		CH1115_VAL_DC_DC_OFF,
> +	};
> +
> +	drm_dev_unplug(&ch1115->dev);
> +	drm_atomic_helper_shutdown(&ch1115->dev);
> +
> +	ret = ch1115_send_command_list(ch1115, cmd_list, ARRAY_SIZE(cmd_list));
> +	if (ret < 0)
> +		dev_err(&client->dev, "There was an error executing the shutdown commands");

Missing trailing \n to be consistent with other messages.

> +}
...

CJ

  reply	other threads:[~2026-08-29  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  6:32 [PATCH v3 0/3] Add support for CH1115 Controller Nicolás Antinori
2026-08-29  6:32 ` [PATCH v3 1/3] dt-bindings: display: add Chipwealth CH1115 OLED Controller Nicolás Antinori
2026-08-31  9:05   ` Krzysztof Kozlowski
2026-08-29  6:32 ` [PATCH v3 2/3] drm/ch1115: add support for Chipwealth CH1115 OLED controller Nicolás Antinori
2026-08-29  8:18   ` Christophe JAILLET [this message]
2026-08-29  6:32 ` [PATCH v3 3/3] MAINTAINERS: add entry for Chipwealth CH1115 OLED Controller Nicolás Antinori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=968d5cd7-60e0-450e-b096-6058d76863d8@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jkoolstra@xs4all.nl \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=me@brighamcampbell.com \
    --cc=mripard@kernel.org \
    --cc=nico.antinori.7@gmail.com \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox