mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 3/4] media: i2c: s5c73m3: remove support for platform data
Date: Thu, 17 Nov 2022 12:05:36 +0100	[thread overview]
Message-ID: <20221117110536.GC2725180@tom-ThinkPad-T14s-Gen-2i> (raw)
In-Reply-To: <20221115221145.2550572-3-dmitry.torokhov@gmail.com>

On Tue, Nov 15, 2022 at 02:11:44PM -0800, Dmitry Torokhov wrote:
> There are no existing users of s5c73m3_platform_data in the tree, and
> new users shoudl either be using device tree, ACPI, or static device
> properties, so let's remove it from the driver.
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/media/i2c/s5c73m3/s5c73m3-core.c  | 19 ++------
>  drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c |  2 -
>  drivers/media/i2c/s5c73m3/s5c73m3.h       |  6 ++-
>  include/media/i2c/s5c73m3.h               | 56 -----------------------
>  4 files changed, 9 insertions(+), 74 deletions(-)
>  delete mode 100644 include/media/i2c/s5c73m3.h
> 
> diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> index d96ba58ce1e5..561c1a1583ac 100644
> --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
> @@ -27,7 +27,6 @@
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-subdev.h>
>  #include <media/v4l2-mediabus.h>
> -#include <media/i2c/s5c73m3.h>
>  #include <media/v4l2-fwnode.h>
>  
>  #include "s5c73m3.h"
> @@ -1592,26 +1591,16 @@ static int s5c73m3_parse_gpios(struct s5c73m3 *state)
>  	return 0;
>  }
>  
> -static int s5c73m3_get_platform_data(struct s5c73m3 *state)
> +static int s5c73m3_get_dt_data(struct s5c73m3 *state)
>  {
>  	struct device *dev = &state->i2c_client->dev;
> -	const struct s5c73m3_platform_data *pdata = dev->platform_data;
>  	struct device_node *node = dev->of_node;
>  	struct device_node *node_ep;
>  	struct v4l2_fwnode_endpoint ep = { .bus_type = 0 };
>  	int ret;
>  
> -	if (!node) {
> -		if (!pdata) {
> -			dev_err(dev, "Platform data not specified\n");
> -			return -EINVAL;
> -		}
> -
> -		state->mclk_frequency = pdata->mclk_frequency;
> -		state->gpio[STBY] = pdata->gpio_stby;
> -		state->gpio[RSET] = pdata->gpio_reset;
> -		return 0;
> -	}
> +	if (!node)
> +		return -EINVAL;
>  
>  	state->clock = devm_clk_get(dev, S5C73M3_CLK_NAME);
>  	if (IS_ERR(state->clock))
> @@ -1666,7 +1655,7 @@ static int s5c73m3_probe(struct i2c_client *client)
>  		return -ENOMEM;
>  
>  	state->i2c_client = client;
> -	ret = s5c73m3_get_platform_data(state);
> +	ret = s5c73m3_get_dt_data(state);
>  	if (ret < 0)
>  		return ret;
>  
> diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
> index 141ad0ba7f5a..1c8103670fa2 100644
> --- a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
> +++ b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
> @@ -10,7 +10,6 @@
>  #include <linux/sizes.h>
>  #include <linux/delay.h>
>  #include <linux/firmware.h>
> -#include <linux/gpio.h>
>  #include <linux/i2c.h>
>  #include <linux/init.h>
>  #include <linux/media.h>
> @@ -24,7 +23,6 @@
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-subdev.h>
>  #include <media/v4l2-mediabus.h>
> -#include <media/i2c/s5c73m3.h>
>  
>  #include "s5c73m3.h"
>  
> diff --git a/drivers/media/i2c/s5c73m3/s5c73m3.h b/drivers/media/i2c/s5c73m3/s5c73m3.h
> index c3fcfdd3ea66..d68528898249 100644
> --- a/drivers/media/i2c/s5c73m3/s5c73m3.h
> +++ b/drivers/media/i2c/s5c73m3/s5c73m3.h
> @@ -15,7 +15,6 @@
>  #include <media/v4l2-common.h>
>  #include <media/v4l2-ctrls.h>
>  #include <media/v4l2-subdev.h>
> -#include <media/i2c/s5c73m3.h>
>  
>  #define DRIVER_NAME			"S5C73M3"
>  
> @@ -357,6 +356,11 @@ enum s5c73m3_gpio_id {
>  	GPIO_NUM,
>  };
>  
> +struct s5c73m3_gpio {
> +	int gpio;
> +	int level;
> +};
> +
>  enum s5c73m3_resolution_types {
>  	RES_ISP,
>  	RES_JPEG,
> diff --git a/include/media/i2c/s5c73m3.h b/include/media/i2c/s5c73m3.h
> deleted file mode 100644
> index a51f1025ba1c..000000000000
> --- a/include/media/i2c/s5c73m3.h
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -/*
> - * Samsung LSI S5C73M3 8M pixel camera driver
> - *
> - * Copyright (C) 2012, Samsung Electronics, Co., Ltd.
> - * Sylwester Nawrocki <s.nawrocki@samsung.com>
> - * Andrzej Hajda <a.hajda@samsung.com>
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License
> - * version 2 as published by the Free Software Foundation.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - */
> -#ifndef MEDIA_S5C73M3__
> -#define MEDIA_S5C73M3__
> -
> -#include <linux/videodev2.h>
> -#include <media/v4l2-mediabus.h>
> -
> -/**
> - * struct s5c73m3_gpio - data structure describing a GPIO
> - * @gpio:  GPIO number
> - * @level: indicates active state of the @gpio
> - */
> -struct s5c73m3_gpio {
> -	int gpio;
> -	int level;
> -};
> -
> -/**
> - * struct s5c73m3_platform_data - s5c73m3 driver platform data
> - * @mclk_frequency: sensor's master clock frequency in Hz
> - * @gpio_reset:  GPIO driving RESET pin
> - * @gpio_stby:   GPIO driving STBY pin
> - * @bus_type:    bus type
> - * @nlanes:      maximum number of MIPI-CSI lanes used
> - * @horiz_flip:  default horizontal image flip value, non zero to enable
> - * @vert_flip:   default vertical image flip value, non zero to enable
> - */
> -
> -struct s5c73m3_platform_data {
> -	unsigned long mclk_frequency;
> -
> -	struct s5c73m3_gpio gpio_reset;
> -	struct s5c73m3_gpio gpio_stby;
> -
> -	enum v4l2_mbus_type bus_type;
> -	u8 nlanes;
> -	u8 horiz_flip;
> -	u8 vert_flip;
> -};
> -
> -#endif /* MEDIA_S5C73M3__ */
> -- 
> 2.38.1.431.g37b22c650d-goog
> 

Looks good to me.
Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

  reply	other threads:[~2022-11-17 11:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 22:11 [PATCH 1/4] media: i2c: s5k6a3: switch to using gpiod API Dmitry Torokhov
2022-11-15 22:11 ` [PATCH 2/4] media: i2c: s5k5baf: " Dmitry Torokhov
2022-11-17 10:54   ` Tommaso Merciai
2022-11-15 22:11 ` [PATCH 3/4] media: i2c: s5c73m3: remove support for platform data Dmitry Torokhov
2022-11-17 11:05   ` Tommaso Merciai [this message]
2022-11-28  8:39   ` Hans Verkuil
2022-11-28 19:50     ` Dmitry Torokhov
2022-11-15 22:11 ` [PATCH 4/4] media: i2c: s5c73m3: switch to using gpiod API Dmitry Torokhov
2022-11-17  9:06   ` Linus Walleij
2022-11-26 10:34     ` Hans Verkuil
2022-11-26 10:39       ` Hans Verkuil
2022-11-26 21:49       ` Linus Walleij
2022-11-17 11:06   ` Tommaso Merciai
2022-11-17  9:04 ` [PATCH 1/4] media: i2c: s5k6a3: " Linus Walleij
2022-11-17  9:11 ` Tommaso Merciai

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=20221117110536.GC2725180@tom-ThinkPad-T14s-Gen-2i \
    --to=tommaso.merciai@amarulasolutions.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.nawrocki@samsung.com \
    /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

all inboxes | Powered by JetHome®