Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/6] iio: bmi160: Add of device table for i2c
From: Jonathan Cameron @ 2016-12-30 10:47 UTC (permalink / raw)
  To: Marcin Niestroj
  Cc: Peter Meerwald-Stadler, Hartmut Knaack, Lars-Peter Clausen,
	Daniel Baluta, Gregor Boirie, Sanchayan Maity, Rob Herring,
	Mark Rutland, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161208142259.26230-2-m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>

On 08/12/16 14:22, Marcin Niestroj wrote:
> From now on we can add bmi160 device to device-tree by specifying
> compatible string.
> 
> Signed-off-by: Marcin Niestroj <m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>
Other than the fact this should really have been two patches, this looks good.

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders
to play with it.

Thanks,

Jonathan
> ---
> Patch introduced in v2
> 
>  drivers/iio/imu/bmi160/bmi160_i2c.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
> index 07a179d..155a31f 100644
> --- a/drivers/iio/imu/bmi160/bmi160_i2c.c
> +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
> @@ -11,10 +11,11 @@
>   *      - 0x68 if SDO is pulled to GND
>   *      - 0x69 if SDO is pulled to VDDIO
>   */
> -#include <linux/module.h>
> +#include <linux/acpi.h>
>  #include <linux/i2c.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
> -#include <linux/acpi.h>
Whilst I have no objection to reordering headers so they are alphabetical
(as long as not clarity is lost) it should really be in it's own patch...
>  
>  #include "bmi160.h"
>  
> @@ -56,10 +57,19 @@ static const struct acpi_device_id bmi160_acpi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id bmi160_of_match[] = {
> +	{ .compatible = "bosch,bmi160" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, bmi160_of_match);
> +#endif
> +
>  static struct i2c_driver bmi160_i2c_driver = {
>  	.driver = {
>  		.name			= "bmi160_i2c",
>  		.acpi_match_table	= ACPI_PTR(bmi160_acpi_match),
> +		.of_match_table		= of_match_ptr(bmi160_of_match),
>  	},
>  	.probe		= bmi160_i2c_probe,
>  	.remove		= bmi160_i2c_remove,
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 4/6] iio: bmi160: Protect data transmission with mutex
From: Jonathan Cameron @ 2016-12-30 10:47 UTC (permalink / raw)
  To: Marcin Niestroj
  Cc: Peter Meerwald-Stadler, Hartmut Knaack, Lars-Peter Clausen,
	Daniel Baluta, Gregor Boirie, Sanchayan Maity, Rob Herring,
	Mark Rutland, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161208142259.26230-5-m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>

On 08/12/16 14:22, Marcin Niestroj wrote:
> There are currently two possible cases for data transmission with the
> sensor: read/write by iio sysfs and read in trigger interrupt
> handler. Hence we need to protect data transmission using regmap_*
> functions with mutex.

Except that the regmap functions themselves have build in protection against
any such clashes.  Hence I don't 'think' this is necessary as we don't
have any open coded read / update loops in here that I can see.

Jonathan
> 
> Signed-off-by: Marcin Niestroj <m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>
> ---
> Patch introduced in v2
> 
>  drivers/iio/imu/bmi160/bmi160_core.c | 39 +++++++++++++++++++++++++++++-------
>  1 file changed, 32 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
> index e0251b8..095533c 100644
> --- a/drivers/iio/imu/bmi160/bmi160_core.c
> +++ b/drivers/iio/imu/bmi160/bmi160_core.c
> @@ -2,6 +2,7 @@
>   * BMI160 - Bosch IMU (accel, gyro plus external magnetometer)
>   *
>   * Copyright (c) 2016, Intel Corporation.
> + * Copyright (c) 2016, Grinn
>   *
>   * This file is subject to the terms and conditions of version 2 of
>   * the GNU General Public License.  See the file COPYING in the main
> @@ -112,6 +113,7 @@ enum bmi160_sensor_type {
>  
>  struct bmi160_data {
>  	struct regmap *regmap;
> +	struct mutex mutex;
>  };
>  
>  const struct regmap_config bmi160_regmap_config = {
> @@ -285,7 +287,9 @@ int bmi160_set_mode(struct bmi160_data *data, enum bmi160_sensor_type t,
>  	else
>  		cmd = bmi160_regs[t].pmu_cmd_suspend;
>  
> +	mutex_lock(&data->mutex);
>  	ret = regmap_write(data->regmap, BMI160_REG_CMD, cmd);
> +	mutex_unlock(&data->mutex);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -298,6 +302,7 @@ static
>  int bmi160_set_scale(struct bmi160_data *data, enum bmi160_sensor_type t,
>  		     int uscale)
>  {
> +	int ret;
>  	int i;
>  
>  	for (i = 0; i < bmi160_scale_table[t].num; i++)
> @@ -307,8 +312,12 @@ int bmi160_set_scale(struct bmi160_data *data, enum bmi160_sensor_type t,
>  	if (i == bmi160_scale_table[t].num)
>  		return -EINVAL;
>  
> -	return regmap_write(data->regmap, bmi160_regs[t].range,
> -			    bmi160_scale_table[t].tbl[i].bits);
> +	mutex_lock(&data->mutex);
> +	ret = regmap_write(data->regmap, bmi160_regs[t].range,
> +			   bmi160_scale_table[t].tbl[i].bits);
> +	mutex_unlock(&data->mutex);
> +
> +	return ret;
>  }
>  
>  static
> @@ -317,7 +326,9 @@ int bmi160_get_scale(struct bmi160_data *data, enum bmi160_sensor_type t,
>  {
>  	int i, ret, val;
>  
> +	mutex_lock(&data->mutex);
>  	ret = regmap_read(data->regmap, bmi160_regs[t].range, &val);
> +	mutex_unlock(&data->mutex);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -340,7 +351,9 @@ static int bmi160_get_data(struct bmi160_data *data, int chan_type,
>  
>  	reg = bmi160_regs[t].data + (axis - IIO_MOD_X) * sizeof(__le16);
>  
> +	mutex_lock(&data->mutex);
>  	ret = regmap_bulk_read(data->regmap, reg, &sample, sizeof(__le16));
> +	mutex_unlock(&data->mutex);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -353,6 +366,7 @@ static
>  int bmi160_set_odr(struct bmi160_data *data, enum bmi160_sensor_type t,
>  		   int odr, int uodr)
>  {
> +	int ret;
>  	int i;
>  
>  	for (i = 0; i < bmi160_odr_table[t].num; i++)
> @@ -363,10 +377,14 @@ int bmi160_set_odr(struct bmi160_data *data, enum bmi160_sensor_type t,
>  	if (i >= bmi160_odr_table[t].num)
>  		return -EINVAL;
>  
> -	return regmap_update_bits(data->regmap,
> -				  bmi160_regs[t].config,
> -				  bmi160_regs[t].config_odr_mask,
> -				  bmi160_odr_table[t].tbl[i].bits);
> +	mutex_lock(&data->mutex);
> +	ret = regmap_update_bits(data->regmap,
> +				 bmi160_regs[t].config,
> +				 bmi160_regs[t].config_odr_mask,
> +				 bmi160_odr_table[t].tbl[i].bits);
> +	mutex_unlock(&data->mutex);
> +
> +	return ret;
>  }
>  
>  static int bmi160_get_odr(struct bmi160_data *data, enum bmi160_sensor_type t,
> @@ -374,7 +392,9 @@ static int bmi160_get_odr(struct bmi160_data *data, enum bmi160_sensor_type t,
>  {
>  	int i, val, ret;
>  
> +	mutex_lock(&data->mutex);
>  	ret = regmap_read(data->regmap, bmi160_regs[t].config, &val);
> +	mutex_unlock(&data->mutex);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -402,14 +422,18 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p)
>  	int i, ret, j = 0, base = BMI160_REG_DATA_MAGN_XOUT_L;
>  	__le16 sample;
>  
> +	mutex_lock(&data->mutex);
>  	for_each_set_bit(i, indio_dev->active_scan_mask,
>  			 indio_dev->masklength) {
>  		ret = regmap_bulk_read(data->regmap, base + i * sizeof(__le16),
>  				       &sample, sizeof(__le16));
> -		if (ret < 0)
> +		if (ret < 0) {
> +			mutex_unlock(&data->mutex);
>  			goto done;
> +		}
>  		buf[j++] = sample;
>  	}
> +	mutex_unlock(&data->mutex);
>  
>  	iio_push_to_buffers_with_timestamp(indio_dev, buf,
>  					   iio_get_time_ns(indio_dev));
> @@ -575,6 +599,7 @@ int bmi160_core_probe(struct device *dev, struct regmap *regmap,
>  	data = iio_priv(indio_dev);
>  	dev_set_drvdata(dev, indio_dev);
>  	data->regmap = regmap;
> +	mutex_init(&data->mutex);
>  
>  	ret = bmi160_chip_init(data, use_spi);
>  	if (ret < 0)
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] bus: imx-weim: Place 'fsl,weim-cs-timing' under the required properties section
From: Fabio Estevam @ 2016-12-30 10:46 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A
  Cc: shawnguo-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Fabio Estevam

From: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>

Property 'fsl,weim-cs-timing' is a required one, so place it under
"Required properties" section.

Signed-off-by: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
---
 Documentation/devicetree/bindings/bus/imx-weim.txt | 27 ++++++++++------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/bus/imx-weim.txt b/Documentation/devicetree/bindings/bus/imx-weim.txt
index 6630d84..a9a125b 100644
--- a/Documentation/devicetree/bindings/bus/imx-weim.txt
+++ b/Documentation/devicetree/bindings/bus/imx-weim.txt
@@ -23,6 +23,18 @@ Required properties:
 			integer values for each chip-select line in use:
 
 			   <cs-number> 0 <physical address of mapping> <size>
+ - fsl,weim-cs-timing:	The timing array, contains timing values for the
+			child node. We can get the CS index from the child
+			node's "reg" property. The number of registers depends
+			on the selected chip.
+			For i.MX1, i.MX21 ("fsl,imx1-weim") there are two
+			registers: CSxU, CSxL.
+			For i.MX25, i.MX27, i.MX31 and i.MX35 ("fsl,imx27-weim")
+			there are three registers: CSCRxU, CSCRxL, CSCRxA.
+			For i.MX50, i.MX53 ("fsl,imx50-weim"),
+			i.MX51 ("fsl,imx51-weim") and i.MX6Q ("fsl,imx6q-weim")
+			there are six registers: CSxGCR1, CSxGCR2, CSxRCR1,
+			CSxRCR2, CSxWCR1, CSxWCR2.
 
 Optional properties:
 
@@ -44,21 +56,6 @@ Optional properties:
 			what bootloader sets up in IOMUXC_GPR1[11:0] will be
 			used.
 
-Timing property for child nodes. It is mandatory, not optional.
-
- - fsl,weim-cs-timing:	The timing array, contains timing values for the
-			child node. We can get the CS index from the child
-			node's "reg" property. The number of registers depends
-			on the selected chip.
-			For i.MX1, i.MX21 ("fsl,imx1-weim") there are two
-			registers: CSxU, CSxL.
-			For i.MX25, i.MX27, i.MX31 and i.MX35 ("fsl,imx27-weim")
-			there are three registers: CSCRxU, CSCRxL, CSCRxA.
-			For i.MX50, i.MX53 ("fsl,imx50-weim"),
-			i.MX51 ("fsl,imx51-weim") and i.MX6Q ("fsl,imx6q-weim")
-			there are six registers: CSxGCR1, CSxGCR2, CSxRCR1,
-			CSxRCR2, CSxWCR1, CSxWCR2.
-
 Example for an imx6q-sabreauto board, the NOR flash connected to the WEIM:
 
 	weim: weim@021b8000 {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH v2 3/6] Documentation: DT: Add bmi160 imu binding
From: Jonathan Cameron @ 2016-12-30 10:40 UTC (permalink / raw)
  To: Rob Herring, Marcin Niestroj
  Cc: Peter Meerwald-Stadler, Hartmut Knaack, Lars-Peter Clausen,
	Daniel Baluta, Gregor Boirie, Sanchayan Maity, Mark Rutland,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161212171500.7w67evyvicdpfkfc@rob-hp-laptop>

On 12/12/16 17:15, Rob Herring wrote:
> On Thu, Dec 08, 2016 at 03:22:56PM +0100, Marcin Niestroj wrote:
>> This adds documentation for Bosch BMI160 Inertial Measurement Unit
>> device-tree bindings.
>>
>> Signed-off-by: Marcin Niestroj <m.niestroj-z3quKL4iOrmQ6ZAhV5LmOA@public.gmane.org>
>> ---
>> Changes v1 -> v2 (suggested by Rob):
>>  * remove "gpio" keyword from interrupts property description
>>  * describe "INT1" and "INT2" cases for interrupt-names property
>>
>>  .../devicetree/bindings/iio/imu/bmi160.txt         | 36 ++++++++++++++++++++++
>>  1 file changed, 36 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/iio/imu/bmi160.txt
> 
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Applied to the togreg branch of iio.git - initially pushed out as testing for
the autobuilders to completely ignore this patch.

Thanks,

Jonathan
> 
>>
>> diff --git a/Documentation/devicetree/bindings/iio/imu/bmi160.txt b/Documentation/devicetree/bindings/iio/imu/bmi160.txt
>> new file mode 100644
>> index 0000000..ae0112c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/imu/bmi160.txt
>> @@ -0,0 +1,36 @@
>> +Bosch BMI160 - Inertial Measurement Unit with Accelerometer, Gyroscope
>> +and externally connectable Magnetometer
>> +
>> +https://www.bosch-sensortec.com/bst/products/all_products/bmi160
>> +
>> +Required properties:
>> + - compatible : should be "bosch,bmi160"
>> + - reg : the I2C address or SPI chip select number of the sensor
>> + - spi-max-frequency : set maximum clock frequency (only for SPI)
>> +
>> +Optional properties:
>> + - interrupt-parent : should be the phandle of the interrupt controller
>> + - interrupts : interrupt mapping for IRQ, must be IRQ_TYPE_LEVEL_LOW
>> + - interrupt-names : set to "INT1" if INT1 pin should be used as interrupt
>> +   input, set to "INT2" if INT2 pin should be used instead
>> +
>> +Examples:
>> +
>> +bmi160@68 {
>> +	compatible = "bosch,bmi160";
>> +	reg = <0x68>;
>> +
>> +	interrupt-parent = <&gpio4>;
>> +	interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
>> +	interrupt-names = "INT1";
>> +};
>> +
>> +bmi160@0 {
>> +	compatible = "bosch,bmi160";
>> +	reg = <0>;
>> +	spi-max-frequency = <10000000>;
>> +
>> +	interrupt-parent = <&gpio2>;
>> +	interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
>> +	interrupt-names = "INT2";
>> +};
>> -- 
>> 2.10.2
>>

^ permalink raw reply

* Re: [PATCH 7/9] pinctrl: samsung: Add property to mark pad state as suitable for power down
From: Linus Walleij @ 2016-12-30  9:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Marek Szyprowski, linux-gpio@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
	linux-samsung-soc, Sylwester Nawrocki, Tomasz Figa, Ulf Hansson,
	Bartlomiej Zolnierkiewicz, devicetree@vger.kernel.org
In-Reply-To: <20161227153331.jbh7ei6oh3obmnri@kozik-lap>

On Tue, Dec 27, 2016 at 4:33 PM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Tue, Dec 27, 2016 at 11:30:57AM +0100, Marek Szyprowski wrote:

>> Separate sleep state is needed because of the pin control bindings and
>> design.
>>
>> A separate sleep state is required to let pin control client driver (in this
>> case
>> Exynos I2S driver) let to choose when it is okay to switch pads into sleep
>> state and I see no other way to achieve this.
>
> Maybe the pinctrl API should be extended for this? Doing this in DTS
> just for purpose of passing information between drivers (consumer and
> provider) looks odd.

I don't understand what is going on but you are all smart people so I
guess you're right :)

Tell me if I can help clarifying something...

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v7 3/5] ARM: dts: stm32: Add I2C1 support for STM32F429 SoC
From: Linus Walleij @ 2016-12-30  9:07 UTC (permalink / raw)
  To: M'boumba Cedric Madianga
  Cc: Uwe Kleine-König, Wolfram Sang, Rob Herring, Maxime Coquelin,
	Alexandre Torgue, Patrice Chotard, Russell King,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <CAOAejn1zHMFNiGc-wVbbkC1-JFzG3sjnnUJogtCp9EeAkWsV5A@mail.gmail.com>

On Fri, Dec 23, 2016 at 2:09 PM, M'boumba Cedric Madianga
<cedric.madianga@gmail.com> wrote:
> 2016-12-22 20:11 GMT+01:00 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>> On Thu, Dec 22, 2016 at 02:35:02PM +0100, M'boumba Cedric Madianga wrote:
>>> @@ -337,6 +350,16 @@
>>>                                       slew-rate = <2>;
>>>                               };
>>>                       };
>>> +
>>> +                     i2c1_pins_b: i2c1@0 {
>>> +                             pins1 {
>>> +                                     pinmux = <STM32F429_PB9_FUNC_I2C1_SDA>;
>>> +                                     drive-open-drain;
>>> +                             };
>>> +                             pins2 {
>>> +                                     pinmux = <STM32F429_PB6_FUNC_I2C1_SCL>;
>>> +                             };
>>
>> the second doesn't need the open-drain property? Why?
>
> I thought that open-drain was only needed for SDA line.
> But after double-checking I2C specification, it seems that SDA and SCL
> lines need open-drain or open-collector to perform the wired-AND
> function.

I think I2C SDA/SCL must be open drain by definition.

It also requires pull-up resistors, I guess you have these mounted on the board
so you do not need pull-up from the pin controller?

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH 3/5] pinctrl: mvebu: pinctrl driver for 98DX3236 SoC
From: Linus Walleij @ 2016-12-30  9:03 UTC (permalink / raw)
  To: Chris Packham, Sebastian Hesselbarth, Thomas Petazzoni
  Cc: linux-arm-kernel@lists.infradead.org, Kalyan Kinthada,
	Rob Herring, Mark Rutland, Laxman Dewangan,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <20161222041328.3303-4-chris.packham@alliedtelesis.co.nz>

On Thu, Dec 22, 2016 at 5:13 AM, Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:

> From: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
>
> This pinctrl driver supports the 98DX3236, 98DX3336 and 98DX4251 SoCs
> from Marvell.
>
> Signed-off-by: Kalyan Kinthada <kalyan.kinthada@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Looks good to me, Sebastian and/or Thomas P can you ACK this patch?

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH] gpio: of: Add support for multiple GPIOs in a single GPIO hog
From: Linus Walleij @ 2016-12-30  8:28 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alexandre Courbot, Rob Herring, Mark Rutland,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1482171694-18237-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>

On Mon, Dec 19, 2016 at 7:21 PM, Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:

> When listing multiple GPIOs in the "gpios" property of a GPIO hog, only
> the first GPIO is affected.  The user is left clueless about the
> disfunctioning of the other GPIOs specified.
>
> Fix this by adding and documenting support for specifying multiple
> GPIOs in a single GPIO hog.
>
> Signed-off-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>

Makes a lot of sense.

Patch applied!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] ARM: dts: am572x-idk: Add gpios property to control PCIE_RESETn
From: Kishon Vijay Abraham I @ 2016-12-30  8:07 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren, linux-omap, devicetree,
	linux-arm-kernel, linux-kernel
  Cc: Rob Herring, Mark Rutland, Russell King, nsekhar, kishon

Add 'gpios' property to pcie1 dt node and populate it with
GPIO3_23 in order to drive PCIE_RESETn high.

This gets PCIe cards to be detected in AM572X IDK board.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/boot/dts/am572x-idk.dts |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am572x-idk.dts b/arch/arm/boot/dts/am572x-idk.dts
index 27d9149..1540f7a 100644
--- a/arch/arm/boot/dts/am572x-idk.dts
+++ b/arch/arm/boot/dts/am572x-idk.dts
@@ -87,3 +87,7 @@
 &sn65hvs882 {
 	load-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
 };
+
+&pcie1 {
+	gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
+};
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 4/4] mmc: pwrseq-simple: add disable-post-power-on option
From: Linus Walleij @ 2016-12-30  8:05 UTC (permalink / raw)
  To: Matt Ranostay
  Cc: Ulf Hansson, Rob Herring, devicetree@vger.kernel.org,
	linux-mmc@vger.kernel.org, Tony Lindgren, Liam Breck
In-Reply-To: <CAJ_EiSRAQefYj+B3AKLb1EWXQUGccV=Z4op0T5sAdo3-vDVOhg@mail.gmail.com>

On Mon, Dec 19, 2016 at 1:01 AM, Matt Ranostay <matt@ranostay.consulting> wrote:

> * SD8787 has a "powerdown" line, and CW1200 has a "powerup" line.. I
> know this is a simple logic inversion.

If this is a GPIO line, the GPIO subsystem can flag a line for
inverted logic. GPIO_ACTIVE_LOW from device tree for example.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH] Documentation: panel-dpi: fix path to display-timing.txt
From: yegorslists-gM/Ye1E23mwN+BqQ9rBEUg @ 2016-12-30  8:05 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w, airlied-cv59FeDIM0c,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, Yegor Yefremov

From: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

Signed-off-by: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
 Documentation/devicetree/bindings/display/panel/panel-dpi.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt b/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
index b52ac52..d4add13 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
@@ -12,7 +12,7 @@ Optional properties:
 
 Required nodes:
 - "panel-timing" containing video timings
-  (Documentation/devicetree/bindings/display/display-timing.txt)
+  (Documentation/devicetree/bindings/display/panel/display-timing.txt)
 - Video port for DPI input
 
 Example
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 5/6] ARM: dts: TS-4600: add NBUS support
From: Linus Walleij @ 2016-12-30  8:01 UTC (permalink / raw)
  To: Sebastien Bourdelin
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel,
	mark-L1vi/lXTdtvnC/t2CciAbw, kris-L1vi/lXTdtvnC/t2CciAbw,
	Simon Horman, Thierry Reding, Jon Hunter, Florian Fainelli,
	Fabio Estevam, Sascha Hauer, Shawn Guo, Russell King,
	Guenter Roeck, Wim Van Sebroeck, Mark Rutland, Rob Herring
In-Reply-To: <20161214231237.17496-6-sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>

On Thu, Dec 15, 2016 at 12:12 AM, Sebastien Bourdelin
<sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org> wrote:

> This commit enables the NBUS on the TS-4600, using the ts-nbus driver.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>

> +       nbus {
> +               compatible = "technologic,ts-nbus", "simple-bus";
> +               pinctrl-0 = <&nbus_pins>;
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               pwms = <&pwm 2 83>;
> +               data-gpios   = <&gpio0 0 GPIO_ACTIVE_HIGH
> +                               &gpio0 1 GPIO_ACTIVE_HIGH
> +                               &gpio0 2 GPIO_ACTIVE_HIGH
> +                               &gpio0 3 GPIO_ACTIVE_HIGH
> +                               &gpio0 4 GPIO_ACTIVE_HIGH
> +                               &gpio0 5 GPIO_ACTIVE_HIGH
> +                               &gpio0 6 GPIO_ACTIVE_HIGH
> +                               &gpio0 7 GPIO_ACTIVE_HIGH>;
> +               csn-gpios    = <&gpio0 16 GPIO_ACTIVE_HIGH>;
> +               txrx-gpios   = <&gpio0 24 GPIO_ACTIVE_HIGH>;
> +               strobe-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
> +               ale-gpios    = <&gpio0 26 GPIO_ACTIVE_HIGH>;
> +               rdy-gpios    = <&gpio0 21 GPIO_ACTIVE_HIGH>;

devm_gpiod_get(&pdev->dev, "csn", GPIOD_OUT_HIGH); etc will get these
from the spawned
platform device.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] Documentation: simple-card: add full path to widgets.txt
From: yegorslists-gM/Ye1E23mwN+BqQ9rBEUg @ 2016-12-30  8:00 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	lgirdwood-Re5JQEeQqe8AvxtiuMwx3w, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, Yegor Yefremov

From: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

Signed-off-by: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
 Documentation/devicetree/bindings/sound/simple-card.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
index c7a9393..4198fe5 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -10,7 +10,8 @@ Optional properties:
 
 - simple-audio-card,name		: User specified audio sound card name, one string
 					  property.
-- simple-audio-card,widgets		: Please refer to widgets.txt.
+- simple-audio-card,widgets		: Please refer to
+					  Documentation/devicetree/bindings/sound/widgets.txt.
 - simple-audio-card,routing		: A list of the connections between audio components.
 					  Each entry is a pair of strings, the first being the
 					  connection's sink, the second being the connection's
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 4/6] bus: add driver for the Technologic Systems NBUS
From: Linus Walleij @ 2016-12-30  7:58 UTC (permalink / raw)
  To: Sebastien Bourdelin
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel,
	mark-L1vi/lXTdtvnC/t2CciAbw, kris-L1vi/lXTdtvnC/t2CciAbw,
	Simon Horman, Thierry Reding, Jon Hunter, Florian Fainelli,
	Fabio Estevam, Sascha Hauer, Shawn Guo, Russell King,
	Guenter Roeck, Wim Van Sebroeck, Mark Rutland, Rob Herring
In-Reply-To: <20161214231237.17496-5-sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>

On Thu, Dec 15, 2016 at 12:12 AM, Sebastien Bourdelin
<sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org> wrote:

> This driver implements a GPIOs bit-banged bus, called the NBUS by
> Technologic Systems. It is used to communicate with the peripherals in
> the FPGA on the TS-4600 SoM.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>
(...)

> +#include <linux/gpio.h>

Use:
#include <linux/gpio/consumer.h>
instead, and deal with the fallout.

> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>

Don't use this.

> +#include <linux/platform_device.h>
> +#include <linux/pwm.h>
> +
> +static DEFINE_MUTEX(ts_nbus_lock);
> +static bool ts_nbus_ready;

Why not move this to the struct ts_nbus state container?

It seems to be per-bus not per-system.

> +#define TS_NBUS_READ_MODE  0
> +#define TS_NBUS_WRITE_MODE 1
> +#define TS_NBUS_DIRECTION_IN  0
> +#define TS_NBUS_DIRECTION_OUT 1
> +#define TS_NBUS_WRITE_ADR 0
> +#define TS_NBUS_WRITE_VAL 1
> +
> +struct ts_nbus {
> +       struct pwm_device *pwm;
> +       int num_data;
> +       int *data;
> +       int csn;
> +       int txrx;
> +       int strobe;
> +       int ale;
> +       int rdy;
> +};
> +
> +static struct ts_nbus *ts_nbus;

Nopes. No singletons please.

Use the state container pattern:
Documentation/driver-model/design-patterns.txt

> +/*
> + * request all gpios required by the bus.
> + */
> +static int ts_nbus_init(struct platform_device *pdev)
> +{
> +       int err;
> +       int i;
> +
> +       for (i = 0; i < ts_nbus->num_data; i++) {
> +               err = devm_gpio_request_one(&pdev->dev, ts_nbus->data[i],
> +                                           GPIOF_OUT_INIT_HIGH,
> +                                           "TS NBUS data");
> +               if (err)
> +                       return err;
> +       }

DO not use the legacy GPIO API anywhere.

Reference the device and use gpiod_get() simple, fair and square.

Store struct gpio_desc * pointers in your state container instead.

> +static int ts_nbus_get_of_pdata(struct device *dev, struct device_node *np)
> +{
> +       int num_data;
> +       int *data;
> +       int ret;
> +       int i;
> +
> +       ret = of_gpio_named_count(np, "data-gpios");
> +       if (ret < 0) {
> +               dev_err(dev,
> +                       "failed to count GPIOs in DT property data-gpios\n");
> +               return ret;
> +       }

Do not reinvent the wheel.

Use devm_gpiod_get_array().


> +       ret = of_get_named_gpio(np, "csn-gpios", 0);

And again use devm_gpiod_get(), and gpiod_* accessors.
Applies everywhere.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 3/3] power: supply: bq24735-charger: allow chargers to share the ac-detect gpio
From: Linus Walleij @ 2016-12-30  7:49 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Sebastian Reichel, Alexandre Courbot,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-gpio@vger.kernel.org
In-Reply-To: <e1667d9d-17bf-2fe5-8a65-af73b6507cbd@axentia.se>

On Wed, Dec 14, 2016 at 6:41 PM, Peter Rosin <peda@axentia.se> wrote:
> On 2016-12-14 18:01, Sebastian Reichel wrote:
>> [of course I forgot to actually add gpio people, let's try again]
>>
>> On Wed, Dec 14, 2016 at 05:59:21PM +0100, Sebastian Reichel wrote:
>>> Hi,
>>>
>>> On Wed, Dec 14, 2016 at 12:56:45AM +0100, Peter Rosin wrote:
>>>> If several parallel bq24735 chargers have their ac-detect gpios wired
>>>> together (or if only one of the parallel bq24735 chargers have its
>>>> ac-detect pin wired to a gpio, and the others are assumed to react the
>>>> same), then all driver instances need to check the same gpio. But the
>>>> gpio subsystem does not allow sharing gpios, so handle that locally.
>>>
>>> Adding GPIO subsystem people to see if they can come up with
>>> something in the gpiod API for this usecase.
>
> Right, I don't like how my new code steps away from gpio descriptors.

The issue of shared gpiods have come up over and over again.
For example the messy regulator code needs this too.

It is better if we implement something like gpiod_get_shared()
in the gpiolib of these cases.

Just put a refcount in struct gpio_desc in drivers/gpio/gpiolib.h
for this case I guess?

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH] pinctrl: fix DT bindings for marvell,kirkwood-pinctrl
From: Linus Walleij @ 2016-12-30  7:37 UTC (permalink / raw)
  To: Andreas Klinger
  Cc: devicetree@vger.kernel.org, Rob Herring, Mark Rutland,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20161213230827.GA5286@andreas>

On Wed, Dec 14, 2016 at 12:08 AM, Andreas Klinger <ak@it-klinger.de> wrote:

> On Marvell mv88f6180 mpp pins range from 0 to 19 as well as from 35 to 44.
> This is already fixed in commit: 9573e7923007961799beff38bc5c5a7635634eef
>
> This is the documentation change for above commit.
>
> Signed-off-by: Andreas Klinger <ak@it-klinger.de>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH v3] net: ethernet: faraday: To support device tree usage.
From: Greentime Hu @ 2016-12-30  7:37 UTC (permalink / raw)
  To: netdev, devicetree, andrew, arnd, linux-kernel, jiri; +Cc: Greentime Hu

Signed-off-by: Greentime Hu <green.hu@gmail.com>
---
Changes in v3:
  - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.

 drivers/net/ethernet/faraday/ftmac100.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index dce5f7b..5d70ee9 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1172,11 +1172,17 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ftmac100_of_ids[] = {
+	{ .compatible = "andestech,atmac100" },
+	{ }
+};
+
 static struct platform_driver ftmac100_driver = {
 	.probe		= ftmac100_probe,
 	.remove		= __exit_p(ftmac100_remove),
 	.driver		= {
 		.name	= DRV_NAME,
+		.of_match_table = ftmac100_of_ids
 	},
 };
 
@@ -1200,3 +1206,4 @@ static void __exit ftmac100_exit(void)
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTMAC100 driver");
 MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(of, ftmac100_of_ids);
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: Add missing newline
From: Shawn Guo @ 2016-12-30  7:10 UTC (permalink / raw)
  To: Andreas Färber
  Cc: linux-arm-kernel, Andrew Lunn, David S . Miller, Sascha Hauer,
	Stefan Agner, Rob Herring, Mark Rutland, Russell King, devicetree,
	linux-kernel
In-Reply-To: <1480276484-5482-1-git-send-email-afaerber@suse.de>

On Sun, Nov 27, 2016 at 08:54:44PM +0100, Andreas Färber wrote:
> Found while reviewing Marvell dsa bindings usage.
> 
> Fixes: f283745b3caf ("arm: vf610: zii devel b: Add support for switch interrupts")
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Andreas Färber <afaerber@suse.de>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] ARM: dts: vf610-zii-dev-rev-b: Add missing newline
From: Shawn Guo @ 2016-12-30  7:07 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Andreas Färber,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	David S . Miller, Sascha Hauer, Stefan Agner, Rob Herring,
	Mark Rutland, Russell King, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161127213516.GF13318-g2DYL2Zd6BY@public.gmane.org>

On Sun, Nov 27, 2016 at 10:35:16PM +0100, Andrew Lunn wrote:
> On Sun, Nov 27, 2016 at 10:30:54PM +0100, Andreas Färber wrote:
> > Hi,
> > 
> > Am 27.11.2016 um 22:17 schrieb Andrew Lunn:
> > > On Sun, Nov 27, 2016 at 08:54:44PM +0100, Andreas Färber wrote:
> > >> Found while reviewing Marvell dsa bindings usage.
> > > 
> > > Hi Andreas
> > > 
> > > It is good practice to put the maintainer you expect to accept the
> > > patch on the To: line. You have at least two different maintainers on
> > > Cc: so it is currently ambiguous. And these lists can be high volume,
> > > so without a copy in the maintainers inbox, patches can be overlooked.
> > 
> > As a vf610 DT patch with LAKML in To I am expecting it to be handled by
> > Shawn or anyone from the NXP/ARM side.
> 
> So please have Shawn as To:
> 
> The patch you are fixing went through Dave Miller, who is also on Cc:,
> hence the ambiguity.

The good practice was broken from the beginning when patch "arm: vf610:
zii devel b: Add support for switch interrupts") went through net tree,
even without me on copy.

Shawn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control
From: Lothar Waßmann @ 2016-12-30  7:06 UTC (permalink / raw)
  To: Steve Longerbeam
  Cc: mark.rutland, gnurou, devel, p.zabel, devicetree, gregkh,
	linus.walleij, linux, linux-kernel, Steve Longerbeam, robh+dt,
	kernel, linux-gpio, fabio.estevam, mchehab, shawnguo,
	linux-arm-kernel, linux-media
In-Reply-To: <1483050455-10683-11-git-send-email-steve_longerbeam@mentor.com>

Hi,

On Thu, 29 Dec 2016 14:27:25 -0800 Steve Longerbeam wrote:
> Add optional reset-gpios pin control. If present, de-assert the
> specified reset gpio pin to bring the chip out of reset.
> 
> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: linux-gpio@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> 
> ---
> 
> v2:
> - documented optional reset-gpios property in
>   Documentation/devicetree/bindings/gpio/gpio-pca953x.txt.
> ---
>  Documentation/devicetree/bindings/gpio/gpio-pca953x.txt |  4 ++++
>  drivers/gpio/gpio-pca953x.c                             | 17 +++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt
> index 08dd15f..da54f4c 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt
> @@ -29,6 +29,10 @@ Required properties:
>  	onsemi,pca9654
>  	exar,xra1202
>  
> +Optional properties:
> + - reset-gpios: GPIO specification for the RESET input
> +
> +
>  Example:
>  
>  
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index d5d72d8..d1c0bd5 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -22,6 +22,7 @@
>  #include <linux/of_platform.h>
>  #include <linux/acpi.h>
>  #include <linux/regulator/consumer.h>
> +#include <linux/gpio/consumer.h>
>  
>  #define PCA953X_INPUT		0
>  #define PCA953X_OUTPUT		1
> @@ -133,6 +134,7 @@ struct pca953x_chip {
>  	const char *const *names;
>  	unsigned long driver_data;
>  	struct regulator *regulator;
> +	struct gpio_desc *reset_gpio;
>  
>  	const struct pca953x_reg_config *regs;
>  
> @@ -756,6 +758,21 @@ static int pca953x_probe(struct i2c_client *client,
>  	} else {
>  		chip->gpio_start = -1;
>  		irq_base = 0;
> +
> +		/* see if we need to de-assert a reset pin */
> +		chip->reset_gpio = devm_gpiod_get_optional(&client->dev,
> +							   "reset",
> +							   GPIOD_OUT_LOW);

> +		if (IS_ERR(chip->reset_gpio)) {
> +			dev_err(&client->dev, "request for reset pin failed\n");
> +			return PTR_ERR(chip->reset_gpio);
> +		}
> +
> +		if (chip->reset_gpio) {
> +			/* bring chip out of reset */
> +			dev_info(&client->dev, "releasing reset\n");
> +			gpiod_set_value(chip->reset_gpio, 0);
>
The pin is already initialized to the inactive state thru the
GPIOD_OUT_LOW flag in devm_gpiod_get_optional(), so this call to
gpiod_set_value() is useless.


Lothar Waßmann

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [PATCH v3 2/2] arm64: dts: exynos: Add support for S6E3HA2 panel device on TM2 board
From: Hoegeun Kwon @ 2016-12-30  6:58 UTC (permalink / raw)
  To: robh, thierry.reding, airlied, kgene, krzk
  Cc: dri-devel, linux-kernel, devicetree, linux-samsung-soc, a.hajda,
	inki.dae, cw00.choi, jh80.chung, Hyungwon Hwang, Hoegeun Kwon
In-Reply-To: <1483081108-32055-1-git-send-email-hoegeun.kwon@samsung.com>

From: Hyungwon Hwang <human.hwang@samsung.com>

This patch add the panel device tree node for S6E3HA2 display
controller to TM2 dts.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
---
 arch/arm64/boot/dts/exynos/exynos5433-tm2.dts | 31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts b/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
index db879f4..7434b22 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
+++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
@@ -252,11 +252,42 @@
 			reg = <1>;
 
 			dsi_out: endpoint {
+				remote-endpoint = <&panel_in>;
 				samsung,burst-clock-frequency = <512000000>;
 				samsung,esc-clock-frequency = <16000000>;
 			};
 		};
 	};
+
+	panel@0 {
+		compatible = "samsung,s6e3ha2";
+		reg = <0>;
+		vdd3-supply = <&ldo27_reg>;
+		vci-supply = <&ldo28_reg>;
+		reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>;
+		enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>;
+		te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>;
+
+		display-timings {
+			timing-0 {
+				clock-frequency = <14874444>;
+				hactive = <1440>;
+				vactive = <2560>;
+				hfront-porch = <1>;
+				hback-porch = <1>;
+				hsync-len = <1>;
+				vfront-porch = <1>;
+				vback-porch = <15>;
+				vsync-len = <1>;
+			};
+		};
+
+		port {
+			panel_in: endpoint {
+				remote-endpoint = <&dsi_out>;
+			};
+		};
+	};
 };
 
 &hsi2c_0 {
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 1/2] drm/panel: Add support for S6E3HA2 panel driver on TM2 board
From: Hoegeun Kwon @ 2016-12-30  6:58 UTC (permalink / raw)
  To: robh, thierry.reding, airlied, kgene, krzk
  Cc: dri-devel, linux-kernel, devicetree, linux-samsung-soc, a.hajda,
	inki.dae, cw00.choi, jh80.chung, Hoegeun Kwon, Donghwa Lee,
	Hyungwon Hwang
In-Reply-To: <1483081108-32055-1-git-send-email-hoegeun.kwon@samsung.com>

This patch add support for MIPI-DSI based S6E3HA2 AMOLED panel
driver. This panel has 1440x2560 resolution in 5.7-inch physical
panel in the TM2 device.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
---
Changes for V3:

- In the DT binding document, made it clearly that the panel is a
  child node of dsi.
- Fix reset-gpio active from high to low.
- Is the OF graph saying related to [1]?
  Althogh the panel is a child of dsi, I think OF graph necessary.
  because if a remote-endpoint is not specified, the dsi also
  panel is not probed.
- The display-timings has been fixed to be provided by the device
  driver. however, I think display-timings is necessary in dts.
  because if dts does not have display-timings, dsi will not load.

[1]: Documentation/devicetree/bindings/media/video-interfaces.txt

 .../bindings/display/panel/samsung,s6e3ha2.txt     |  58 ++
 drivers/gpu/drm/panel/Kconfig                      |   6 +
 drivers/gpu/drm/panel/Makefile                     |   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c      | 741 +++++++++++++++++++++
 4 files changed, 806 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c

diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt
new file mode 100644
index 0000000..6ce278a
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt
@@ -0,0 +1,58 @@
+Samsung S6E3HA2 5.7" 1440x2560 AMOLED panel
+
+Required properties:
+  - compatible: "samsung,s6e3ha2"
+  - reg: the virtual channel number of a DSI peripheral
+  - vdd3-supply: I/O voltage supply
+  - vci-supply: voltage supply for analog circuits
+  - reset-gpios: a GPIO spec for the reset pin (active low)
+  - enable-gpios: a GPIO spec for the panel enable pin (active high)
+  - te-gpios: a GPIO spec for the tearing effect synchronization signal
+    gpio pin (active high)
+
+Optional properties:
+  - display-timings: timings for the connected panel as described by [1]
+
+The device node can contain one 'port' child node with one child
+'endpoint' node, according to the bindings defined in [2]. This
+node should describe panel's video bus.
+
+[1]: Documentation/devicetree/bindings/display/panel/display-timing.txt
+[2]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+&dsi {
+	...
+
+	panel@0 {
+		compatible = "samsung,s6e3ha2";
+		reg = <0>;
+		vdd3-supply = <&ldo27_reg>;
+		vci-supply = <&ldo28_reg>;
+		reset-gpios = <&gpg0 0 GPIO_ACTIVE_LOW>;
+		enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>;
+		te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>;
+
+		display-timings {
+			timing-0 {
+				clock-frequency = <14874444>;
+				hactive = <1440>;
+				vactive = <2560>;
+				hfront-porch = <1>;
+				hback-porch = <1>;
+				hsync-len = <1>;
+				vfront-porch = <1>;
+				vback-porch = <15>;
+				vsync-len = <1>;
+			};
+		};
+
+		port {
+			panel_in: endpoint {
+				remote-endpoint = <&dsi_out>;
+			};
+		};
+	};
+};
+
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 62aba97..eea2902 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -52,6 +52,12 @@ config DRM_PANEL_PANASONIC_VVX10F034N00
 	  WUXGA (1920x1200) Novatek NT1397-based DSI panel as found in some
 	  Xperia Z2 tablets
 
+config DRM_PANEL_SAMSUNG_S6E3HA2
+	tristate "Samsung S6E3HA2 DSI video mode panel"
+	depends on OF
+	depends on  DRM_MIPI_DSI
+	select VIDEOMODE_HELPERS
+
 config DRM_PANEL_SAMSUNG_S6E8AA0
 	tristate "Samsung S6E8AA0 DSI video mode panel"
 	depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index a5c7ec0..1d483b0 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
new file mode 100644
index 0000000..8c5a1c2
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
@@ -0,0 +1,741 @@
+/*
+ * MIPI-DSI based s6e3ha2 AMOLED 5.7 inch panel driver.
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Donghwa Lee <dh09.lee@samsung.com>
+ * Hyungwon Hwang <human.hwang@samsung.com>
+ * Hoegeun Kwon <hoegeun.kwon@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.
+ */
+
+#include <drm/drmP.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_panel.h>
+#include <linux/backlight.h>
+#include <linux/gpio/consumer.h>
+#include <linux/regulator/consumer.h>
+
+#define S6E3HA2_MIN_BRIGHTNESS		0
+#define S6E3HA2_MAX_BRIGHTNESS		100
+#define S6E3HA2_DEFAULT_BRIGHTNESS	80
+
+#define S6E3HA2_NUM_GAMMA_STEPS		46
+#define S6E3HA2_GAMMA_CMD_CNT		35
+#define S6E3HA2_VINT_STATUS_MAX		10
+
+static const u8 gamma_tbl[S6E3HA2_NUM_GAMMA_STEPS][S6E3HA2_GAMMA_CMD_CNT] = {
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x82, 0x83,
+	  0x85, 0x88, 0x8b, 0x8b, 0x84, 0x88, 0x82, 0x82, 0x89, 0x86, 0x8c,
+	  0x94, 0x84, 0xb1, 0xaf, 0x8e, 0xcf, 0xad, 0xc9, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x84, 0x84,
+	  0x85, 0x87, 0x8b, 0x8a, 0x84, 0x88, 0x82, 0x82, 0x89, 0x86, 0x8a,
+	  0x93, 0x84, 0xb0, 0xae, 0x8e, 0xc9, 0xa8, 0xc5, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x8a, 0x8a, 0x84, 0x88, 0x81, 0x84, 0x8a, 0x88, 0x8a,
+	  0x91, 0x84, 0xb1, 0xae, 0x8b, 0xd5, 0xb2, 0xcc, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x8a, 0x8a, 0x84, 0x87, 0x81, 0x84, 0x8a, 0x87, 0x8a,
+	  0x91, 0x85, 0xae, 0xac, 0x8a, 0xc3, 0xa3, 0xc0, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x85, 0x85,
+	  0x86, 0x85, 0x88, 0x89, 0x84, 0x89, 0x82, 0x84, 0x87, 0x85, 0x8b,
+	  0x91, 0x88, 0xad, 0xab, 0x8a, 0xb7, 0x9b, 0xb6, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x89, 0x8a, 0x84, 0x89, 0x83, 0x83, 0x86, 0x84, 0x8b,
+	  0x90, 0x84, 0xb0, 0xae, 0x8b, 0xce, 0xad, 0xc8, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x87, 0x89, 0x8a, 0x83, 0x87, 0x82, 0x85, 0x88, 0x87, 0x89,
+	  0x8f, 0x84, 0xac, 0xaa, 0x89, 0xb1, 0x98, 0xaf, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x88, 0x89, 0x84, 0x88, 0x83, 0x82, 0x85, 0x84, 0x8c,
+	  0x91, 0x86, 0xac, 0xaa, 0x89, 0xc2, 0xa5, 0xbd, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x85, 0x87, 0x89, 0x8a, 0x83, 0x87, 0x82, 0x85, 0x88, 0x87, 0x88,
+	  0x8b, 0x82, 0xad, 0xaa, 0x8a, 0xc2, 0xa5, 0xbd, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x87, 0x89, 0x84, 0x88, 0x83, 0x82, 0x85, 0x84, 0x8a,
+	  0x8e, 0x84, 0xae, 0xac, 0x89, 0xda, 0xb7, 0xd0, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x85, 0x86, 0x87, 0x89, 0x84, 0x88, 0x83, 0x80, 0x83, 0x82, 0x8b,
+	  0x8e, 0x85, 0xac, 0xaa, 0x89, 0xc8, 0xaa, 0xc1, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x85, 0x86, 0x87, 0x89, 0x81, 0x85, 0x81, 0x84, 0x86, 0x84, 0x8c,
+	  0x8c, 0x84, 0xa9, 0xa8, 0x87, 0xa3, 0x92, 0xa1, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x85, 0x86, 0x87, 0x89, 0x84, 0x86, 0x83, 0x80, 0x83, 0x81, 0x8c,
+	  0x8d, 0x84, 0xaa, 0xaa, 0x89, 0xce, 0xaf, 0xc5, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x85, 0x86, 0x87, 0x89, 0x81, 0x83, 0x80, 0x83, 0x85, 0x85, 0x8c,
+	  0x8c, 0x84, 0xa8, 0xa8, 0x88, 0xb5, 0x9f, 0xb0, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x86, 0x86, 0x87, 0x88, 0x81, 0x83, 0x80, 0x83, 0x85, 0x85, 0x8c,
+	  0x8b, 0x84, 0xab, 0xa8, 0x86, 0xd4, 0xb4, 0xc9, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x86, 0x86, 0x87, 0x88, 0x81, 0x83, 0x80, 0x84, 0x84, 0x85, 0x8b,
+	  0x8a, 0x83, 0xa6, 0xa5, 0x84, 0xbb, 0xa4, 0xb3, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
+	  0x86, 0x85, 0x86, 0x86, 0x82, 0x85, 0x81, 0x82, 0x83, 0x84, 0x8e,
+	  0x8b, 0x83, 0xa4, 0xa3, 0x8a, 0xa1, 0x93, 0x9d, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x82, 0x82, 0x84, 0x8e,
+	  0x8b, 0x83, 0xa4, 0xa2, 0x86, 0xc1, 0xa9, 0xb7, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x82, 0x82, 0x84, 0x8d,
+	  0x89, 0x82, 0xa2, 0xa1, 0x84, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
+	  0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x83, 0x83, 0x85, 0x8c,
+	  0x87, 0x7f, 0xa2, 0x9d, 0x88, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xbb, 0x00, 0xc5, 0x00, 0xb4, 0x87, 0x86, 0x86, 0x84, 0x83,
+	  0x86, 0x87, 0x87, 0x87, 0x80, 0x82, 0x7f, 0x86, 0x86, 0x88, 0x8a,
+	  0x84, 0x7e, 0x9d, 0x9c, 0x82, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xbd, 0x00, 0xc7, 0x00, 0xb7, 0x87, 0x85, 0x85, 0x84, 0x83,
+	  0x86, 0x86, 0x86, 0x88, 0x81, 0x83, 0x80, 0x83, 0x84, 0x85, 0x8a,
+	  0x85, 0x7e, 0x9c, 0x9b, 0x85, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xc0, 0x00, 0xca, 0x00, 0xbb, 0x87, 0x86, 0x85, 0x83, 0x83,
+	  0x85, 0x86, 0x86, 0x88, 0x81, 0x83, 0x80, 0x84, 0x85, 0x86, 0x89,
+	  0x83, 0x7d, 0x9c, 0x99, 0x87, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xc4, 0x00, 0xcd, 0x00, 0xbe, 0x87, 0x86, 0x85, 0x83, 0x83,
+	  0x86, 0x85, 0x85, 0x87, 0x81, 0x82, 0x80, 0x82, 0x82, 0x83, 0x8a,
+	  0x85, 0x7f, 0x9f, 0x9b, 0x86, 0xb4, 0xa1, 0xac, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xc7, 0x00, 0xd0, 0x00, 0xc2, 0x87, 0x85, 0x85, 0x83, 0x82,
+	  0x85, 0x85, 0x85, 0x86, 0x82, 0x83, 0x80, 0x82, 0x82, 0x84, 0x87,
+	  0x86, 0x80, 0x9e, 0x9a, 0x87, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xca, 0x00, 0xd2, 0x00, 0xc5, 0x87, 0x85, 0x84, 0x82, 0x82,
+	  0x84, 0x85, 0x85, 0x86, 0x81, 0x82, 0x7f, 0x82, 0x82, 0x84, 0x88,
+	  0x86, 0x81, 0x9d, 0x98, 0x86, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xce, 0x00, 0xd6, 0x00, 0xca, 0x86, 0x85, 0x84, 0x83, 0x83,
+	  0x85, 0x84, 0x84, 0x85, 0x81, 0x82, 0x80, 0x81, 0x81, 0x82, 0x89,
+	  0x86, 0x81, 0x9c, 0x97, 0x86, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xd1, 0x00, 0xd9, 0x00, 0xce, 0x86, 0x84, 0x83, 0x83, 0x82,
+	  0x85, 0x85, 0x85, 0x86, 0x81, 0x83, 0x81, 0x82, 0x82, 0x83, 0x86,
+	  0x83, 0x7f, 0x99, 0x95, 0x86, 0xbb, 0xa4, 0xb3, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xd4, 0x00, 0xdb, 0x00, 0xd1, 0x86, 0x85, 0x83, 0x83, 0x82,
+	  0x85, 0x84, 0x84, 0x85, 0x80, 0x83, 0x82, 0x80, 0x80, 0x81, 0x87,
+	  0x84, 0x81, 0x98, 0x93, 0x85, 0xae, 0x9c, 0xa8, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xd8, 0x00, 0xde, 0x00, 0xd6, 0x86, 0x84, 0x83, 0x81, 0x81,
+	  0x83, 0x85, 0x85, 0x85, 0x82, 0x83, 0x81, 0x81, 0x81, 0x83, 0x86,
+	  0x84, 0x80, 0x98, 0x91, 0x85, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xdc, 0x00, 0xe2, 0x00, 0xda, 0x85, 0x84, 0x83, 0x82, 0x82,
+	  0x84, 0x84, 0x84, 0x85, 0x81, 0x82, 0x82, 0x80, 0x80, 0x81, 0x83,
+	  0x82, 0x7f, 0x99, 0x93, 0x86, 0x94, 0x8b, 0x92, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xdf, 0x00, 0xe5, 0x00, 0xde, 0x85, 0x84, 0x82, 0x82, 0x82,
+	  0x84, 0x83, 0x83, 0x84, 0x81, 0x81, 0x80, 0x83, 0x82, 0x84, 0x82,
+	  0x81, 0x7f, 0x99, 0x92, 0x86, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x83, 0x83, 0x84, 0x80, 0x81, 0x80, 0x83, 0x83, 0x84, 0x80,
+	  0x81, 0x7c, 0x99, 0x92, 0x87, 0xa1, 0x93, 0x9d, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x85, 0x84, 0x83, 0x81, 0x81,
+	  0x82, 0x82, 0x82, 0x83, 0x80, 0x81, 0x80, 0x81, 0x80, 0x82, 0x83,
+	  0x82, 0x80, 0x91, 0x8d, 0x83, 0x9a, 0x90, 0x96, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x83, 0x83, 0x84, 0x80, 0x81, 0x80, 0x81, 0x80, 0x82, 0x83,
+	  0x81, 0x7f, 0x91, 0x8c, 0x82, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x83, 0x83, 0x83, 0x82, 0x82, 0x81, 0x81, 0x80, 0x82, 0x82,
+	  0x82, 0x7f, 0x94, 0x89, 0x84, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x83, 0x83, 0x83, 0x82, 0x82, 0x81, 0x81, 0x80, 0x82, 0x83,
+	  0x82, 0x7f, 0x91, 0x85, 0x81, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x83, 0x83, 0x83, 0x80, 0x80, 0x7f, 0x83, 0x82, 0x84, 0x83,
+	  0x82, 0x7f, 0x90, 0x84, 0x81, 0x9a, 0x90, 0x96, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x80, 0x80,
+	  0x82, 0x83, 0x83, 0x83, 0x80, 0x80, 0x7f, 0x80, 0x80, 0x81, 0x81,
+	  0x82, 0x83, 0x7e, 0x80, 0x7c, 0xa4, 0x97, 0x9f, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xe9, 0x00, 0xec, 0x00, 0xe8, 0x84, 0x83, 0x82, 0x81, 0x81,
+	  0x82, 0x82, 0x82, 0x83, 0x7f, 0x7f, 0x7f, 0x81, 0x80, 0x82, 0x83,
+	  0x83, 0x84, 0x79, 0x7c, 0x79, 0xb1, 0xa0, 0xaa, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xed, 0x00, 0xf0, 0x00, 0xec, 0x83, 0x83, 0x82, 0x80, 0x80,
+	  0x81, 0x82, 0x82, 0x82, 0x7f, 0x7f, 0x7e, 0x81, 0x81, 0x82, 0x80,
+	  0x81, 0x81, 0x84, 0x84, 0x83, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xf1, 0x00, 0xf4, 0x00, 0xf1, 0x83, 0x82, 0x82, 0x80, 0x80,
+	  0x81, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x7d,
+	  0x7e, 0x7f, 0x84, 0x84, 0x83, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf5, 0x82, 0x82, 0x81, 0x80, 0x80,
+	  0x80, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x7f, 0x7f, 0x7f, 0x82,
+	  0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x00, 0xfa, 0x00, 0xfb, 0x00, 0xfa, 0x81, 0x81, 0x81, 0x80, 0x80,
+	  0x80, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+	  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80,
+	  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+	  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 },
+	{ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80,
+	  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+	  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
+	  0x00, 0x00 }
+};
+
+unsigned char vint_table[S6E3HA2_VINT_STATUS_MAX] = {
+	0x18, 0x19, 0x1a, 0x1b, 0x1c,
+	0x1d, 0x1e, 0x1f, 0x20, 0x21
+};
+
+struct s6e3ha2 {
+	struct device *dev;
+	struct drm_panel panel;
+	struct backlight_device *bl_dev;
+
+	struct regulator_bulk_data supplies[2];
+	struct gpio_desc *reset_gpio;
+	struct gpio_desc *enable_gpio;
+
+	/* This field is tested by functions directly accessing DSI bus before
+	 * transfer, transfer is skipped if it is set. In case of transfer
+	 * failure or unexpected response the field is set to error value.
+	 * Such construct allows to eliminate many checks in higher level
+	 * functions.
+	 */
+	int error;
+};
+
+static int  s6e3ha2_clear_error(struct s6e3ha2 *ctx)
+{
+	int ret = ctx->error;
+
+	ctx->error = 0;
+	return ret;
+}
+
+static void s6e3ha2_dcs_write(struct s6e3ha2 *ctx, const void *data, size_t len)
+{
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+	ssize_t ret;
+
+	if (ctx->error < 0)
+		return;
+
+	ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
+	if (ret < 0) {
+		dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n",
+						ret, (int)len, data);
+		ctx->error = ret;
+	}
+}
+
+#define s6e3ha2_dcs_write_seq_static(ctx, seq...) do {	\
+	static const u8 d[] = { seq };			\
+	s6e3ha2_dcs_write(ctx, d, ARRAY_SIZE(d));	\
+} while (0)
+
+static void s6e3ha2_test_key_on_f0(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf0, 0x5a, 0x5a);
+}
+
+static void s6e3ha2_test_key_off_f0(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf0, 0xa5, 0xa5);
+}
+
+static void s6e3ha2_test_key_on_fc(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfc, 0x5a, 0x5a);
+}
+
+static void s6e3ha2_test_key_off_fc(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfc, 0xa5, 0xa5);
+}
+
+static void s6e3ha2_single_dsi_set(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67);
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf9, 0x09);
+}
+
+static void s6e3ha2_freq_calibration(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c);
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39);
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0);
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20);
+	s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62,
+		0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5);
+}
+
+static void s6e3ha2_aor_control(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb2, 0x03, 0x10);
+}
+
+static void s6e3ha2_caps_elvss_set(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb6, 0x9c, 0x0a);
+}
+
+static void s6e3ha2_acl_off(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0x55, 0x00);
+}
+
+static void s6e3ha2_acl_off_opr(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb5, 0x40);
+}
+
+static void s6e3ha2_test_global(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb0, 0x07);
+}
+
+static void s6e3ha2_test(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb8, 0x19);
+}
+
+static void s6e3ha2_touch_hsync_on1(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx,
+			0xbd, 0x33, 0x11, 0x02, 0x16, 0x02, 0x16);
+}
+
+static void s6e3ha2_pentile_control(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xc0, 0x00, 0x00, 0xd8, 0xd8);
+}
+
+static void s6e3ha2_poc_global(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb0, 0x20);
+}
+
+static void s6e3ha2_poc_setting(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x08);
+}
+
+static void s6e3ha2_pcd_set_off(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xcc, 0x40, 0x51);
+}
+
+static void s6e3ha2_err_fg_set(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xed, 0x44);
+}
+
+static void s6e3ha2_hbm_off(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0x53, 0x00);
+}
+
+static void s6e3ha2_te_start_setting(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xb9, 0x10, 0x09, 0xff, 0x00, 0x09);
+}
+
+static void s6e3ha2_gamma_update(struct s6e3ha2 *ctx)
+{
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf7, 0x03);
+	ndelay(100); /* need for 100ns delay */
+	s6e3ha2_dcs_write_seq_static(ctx, 0xf7, 0x00);
+}
+
+static int s6e3ha2_get_brightness(struct backlight_device *bl_dev)
+{
+	return bl_dev->props.brightness;
+}
+
+static void s6e3ha2_set_vint(struct s6e3ha2 *ctx)
+{
+	struct backlight_device *bl_dev = ctx->bl_dev;
+	unsigned int brightness = bl_dev->props.brightness;
+	unsigned char data[] = { 0xf4, 0x8b,
+			vint_table[brightness * (S6E3HA2_VINT_STATUS_MAX - 1) /
+			S6E3HA2_MAX_BRIGHTNESS] };
+
+	s6e3ha2_dcs_write(ctx, data, 3);
+}
+
+static unsigned int s6e3ha2_get_brightness_index(unsigned int brightness)
+{
+	return (brightness * (S6E3HA2_NUM_GAMMA_STEPS - 1)) /
+		S6E3HA2_MAX_BRIGHTNESS;
+}
+
+static int s6e3ha2_update_gamma(struct s6e3ha2 *ctx, unsigned int brightness)
+{
+	struct backlight_device *bl_dev = ctx->bl_dev;
+	unsigned int index = s6e3ha2_get_brightness_index(brightness);
+	u8 data[S6E3HA2_GAMMA_CMD_CNT + 1] = { 0xca, };
+
+	memcpy(data + 1, gamma_tbl + index, S6E3HA2_GAMMA_CMD_CNT);
+	s6e3ha2_dcs_write(ctx, data, ARRAY_SIZE(data));
+
+	s6e3ha2_gamma_update(ctx);
+	bl_dev->props.brightness = brightness;
+
+	return 0;
+}
+
+static int s6e3ha2_set_brightness(struct backlight_device *bl_dev)
+{
+	struct s6e3ha2 *ctx = (struct s6e3ha2 *)bl_get_data(bl_dev);
+	unsigned int brightness = bl_dev->props.brightness;
+
+	if (brightness < S6E3HA2_MIN_BRIGHTNESS ||
+		brightness > bl_dev->props.max_brightness) {
+		dev_err(ctx->dev, "Invalid brightness: %u\n", brightness);
+		return -EINVAL;
+	}
+
+	if (bl_dev->props.power > FB_BLANK_NORMAL)
+		return -EPERM;
+
+	s6e3ha2_test_key_on_f0(ctx);
+	s6e3ha2_update_gamma(ctx, brightness);
+	s6e3ha2_aor_control(ctx);
+	s6e3ha2_set_vint(ctx);
+	s6e3ha2_test_key_off_f0(ctx);
+
+	return ctx->error;
+}
+
+static const struct backlight_ops s6e3ha2_bl_ops = {
+	.get_brightness = s6e3ha2_get_brightness,
+	.update_status = s6e3ha2_set_brightness,
+};
+
+static void s6e3ha2_panel_init(struct s6e3ha2 *ctx)
+{
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+
+	mipi_dsi_dcs_exit_sleep_mode(dsi);
+	usleep_range(5000, 6000);
+
+	s6e3ha2_test_key_on_f0(ctx);
+	s6e3ha2_single_dsi_set(ctx);
+	s6e3ha2_test_key_on_fc(ctx);
+	s6e3ha2_freq_calibration(ctx);
+	s6e3ha2_test_key_off_fc(ctx);
+	s6e3ha2_test_key_off_f0(ctx);
+}
+
+static int s6e3ha2_power_off(struct s6e3ha2 *ctx)
+{
+	return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int s6e3ha2_disable(struct drm_panel *panel)
+{
+	struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+
+	mipi_dsi_dcs_enter_sleep_mode(dsi);
+	if (ctx->error != 0)
+		goto err;
+
+	mipi_dsi_dcs_set_display_off(dsi);
+	if (ctx->error != 0)
+		goto err;
+
+	msleep(40);
+	ctx->bl_dev->props.power = FB_BLANK_NORMAL;
+
+	return 0;
+err:
+	return ctx->error;
+}
+
+static int s6e3ha2_unprepare(struct drm_panel *panel)
+{
+	struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
+	int ret;
+
+	ret = s6e3ha2_clear_error(ctx);
+	if (!ret)
+		ctx->bl_dev->props.power = FB_BLANK_POWERDOWN;
+
+	return s6e3ha2_power_off(ctx);
+}
+
+static int s6e3ha2_power_on(struct s6e3ha2 *ctx)
+{
+	int ret;
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+	if (ret < 0)
+		return ret;
+
+	msleep(120);
+
+	gpiod_set_value(ctx->enable_gpio, 0);
+	usleep_range(5000, 6000);
+	gpiod_set_value(ctx->enable_gpio, 1);
+
+	gpiod_set_value(ctx->reset_gpio, 1);
+	usleep_range(5000, 6000);
+	gpiod_set_value(ctx->reset_gpio, 0);
+	usleep_range(5000, 6000);
+
+	return 0;
+}
+static int s6e3ha2_prepare(struct drm_panel *panel)
+{
+	struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
+	int ret;
+
+	ret = s6e3ha2_power_on(ctx);
+	if (ret < 0)
+		return ret;
+
+	s6e3ha2_panel_init(ctx);
+
+	ret = s6e3ha2_clear_error(ctx);
+	if (ret < 0) {
+		s6e3ha2_power_off(ctx);
+		return ret;
+	}
+
+	ctx->bl_dev->props.power = FB_BLANK_NORMAL;
+
+	return 0;
+}
+
+static int s6e3ha2_enable(struct drm_panel *panel)
+{
+	struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+
+	/* common setting */
+	mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+	s6e3ha2_test_key_on_f0(ctx);
+	s6e3ha2_test_key_on_fc(ctx);
+	s6e3ha2_touch_hsync_on1(ctx);
+	s6e3ha2_pentile_control(ctx);
+	s6e3ha2_poc_global(ctx);
+	s6e3ha2_poc_setting(ctx);
+	s6e3ha2_test_key_off_fc(ctx);
+
+	/* pcd setting off for TB */
+	s6e3ha2_pcd_set_off(ctx);
+	s6e3ha2_err_fg_set(ctx);
+	s6e3ha2_te_start_setting(ctx);
+
+	/* brightness setting */
+	s6e3ha2_set_brightness(ctx->bl_dev);
+	s6e3ha2_aor_control(ctx);
+	s6e3ha2_caps_elvss_set(ctx);
+	s6e3ha2_gamma_update(ctx);
+	s6e3ha2_acl_off(ctx);
+	s6e3ha2_acl_off_opr(ctx);
+	s6e3ha2_hbm_off(ctx);
+
+	/* elvss temp compensation */
+	s6e3ha2_test_global(ctx);
+	s6e3ha2_test(ctx);
+	s6e3ha2_test_key_off_f0(ctx);
+
+	mipi_dsi_dcs_set_display_on(dsi);
+	if (ctx->error != 0)
+		return ctx->error;
+
+	ctx->bl_dev->props.power = FB_BLANK_UNBLANK;
+
+	return 0;
+}
+
+static const struct drm_display_mode default_mode = {
+	.clock = 14874,
+	.hdisplay = 1440,
+	.hsync_start = 1440 + 1,
+	.hsync_end = 1440 + 1 + 1,
+	.htotal = 1440 + 1 + 1 + 1,
+	.vdisplay = 2560,
+	.vsync_start = 2560 + 1,
+	.vsync_end = 2560 + 1 + 1,
+	.vtotal = 2560 + 1 + 1 + 15,
+	.vrefresh = 60,
+	.flags = 0,
+};
+
+static int s6e3ha2_get_modes(struct drm_panel *panel)
+{
+	struct drm_connector *connector = panel->connector;
+	struct drm_display_mode *mode;
+
+	mode = drm_mode_duplicate(panel->drm, &default_mode);
+	if (!mode) {
+		DRM_ERROR("failed to create a new display mode\n");
+		DRM_ERROR("failed to add mode %ux%ux@%u\n",
+				default_mode.hdisplay, default_mode.vdisplay,
+				default_mode.vrefresh);
+		return -ENOMEM;
+	}
+
+	drm_mode_set_name(mode);
+
+	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
+	drm_mode_probed_add(connector, mode);
+
+	connector->display_info.width_mm = 71;
+	connector->display_info.height_mm = 125;
+
+	return 1;
+}
+
+static const struct drm_panel_funcs s6e3ha2_drm_funcs = {
+	.disable = s6e3ha2_disable,
+	.unprepare = s6e3ha2_unprepare,
+	.prepare = s6e3ha2_prepare,
+	.enable = s6e3ha2_enable,
+	.get_modes = s6e3ha2_get_modes,
+};
+
+static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
+{
+	struct device *dev = &dsi->dev;
+	struct s6e3ha2 *ctx;
+	int ret;
+
+	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	ctx->dev = dev;
+
+	dsi->lanes = 4;
+	dsi->format = MIPI_DSI_FMT_RGB888;
+	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+	ctx->supplies[0].supply = "vdd3";
+	ctx->supplies[1].supply = "vci";
+
+	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
+				      ctx->supplies);
+	if (ret < 0) {
+		dev_err(dev, "failed to get regulators: %d\n", ret);
+		return ret;
+	}
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	if (IS_ERR(ctx->reset_gpio)) {
+		dev_err(dev, "cannot get reset-gpios %ld\n",
+			PTR_ERR(ctx->reset_gpio));
+		return PTR_ERR(ctx->reset_gpio);
+	}
+
+	ctx->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->enable_gpio)) {
+		dev_err(dev, "cannot get enable-gpios %ld\n",
+			PTR_ERR(ctx->enable_gpio));
+		return PTR_ERR(ctx->enable_gpio);
+	}
+
+	ctx->bl_dev = backlight_device_register("s6e3ha2", dev, ctx,
+						&s6e3ha2_bl_ops, NULL);
+	if (IS_ERR(ctx->bl_dev)) {
+		dev_err(dev, "failed to register backlight device\n");
+		return PTR_ERR(ctx->bl_dev);
+	}
+
+	ctx->bl_dev->props.max_brightness = S6E3HA2_MAX_BRIGHTNESS;
+	ctx->bl_dev->props.brightness = S6E3HA2_DEFAULT_BRIGHTNESS;
+	ctx->bl_dev->props.power = FB_BLANK_POWERDOWN;
+
+	drm_panel_init(&ctx->panel);
+	ctx->panel.dev = dev;
+	ctx->panel.funcs = &s6e3ha2_drm_funcs;
+
+	ret = drm_panel_add(&ctx->panel);
+	if (ret < 0)
+		goto unregister_backlight;
+
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0)
+		goto remove_panel;
+
+	return ret;
+
+remove_panel:
+	drm_panel_remove(&ctx->panel);
+
+unregister_backlight:
+	backlight_device_unregister(ctx->bl_dev);
+
+	return ret;
+}
+
+static int s6e3ha2_remove(struct mipi_dsi_device *dsi)
+{
+	struct s6e3ha2 *ctx = mipi_dsi_get_drvdata(dsi);
+
+	mipi_dsi_detach(dsi);
+	drm_panel_remove(&ctx->panel);
+	backlight_device_unregister(ctx->bl_dev);
+
+	return 0;
+}
+
+static const struct of_device_id s6e3ha2_of_match[] = {
+	{ .compatible = "samsung,s6e3ha2" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, s6e3ha2_of_match);
+
+static struct mipi_dsi_driver s6e3ha2_driver = {
+	.probe = s6e3ha2_probe,
+	.remove = s6e3ha2_remove,
+	.driver = {
+		.name = "panel-samsung-s6e3ha2",
+		.of_match_table = s6e3ha2_of_match,
+	},
+};
+module_mipi_dsi_driver(s6e3ha2_driver);
+
+MODULE_AUTHOR("Donghwa Lee <dh09.lee@samsung.com>");
+MODULE_AUTHOR("Hyungwon Hwang <human.hwang@samsung.com>");
+MODULE_AUTHOR("Hoegeun Kwon <hoegeun.kwon@samsung.com>");
+MODULE_DESCRIPTION("MIPI-DSI based s6e3ha2 AMOLED Panel Driver");
+MODULE_LICENSE("GPL v2");
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 0/2] Add support for the S6E3HA2 panel on TM2 board
From: Hoegeun Kwon @ 2016-12-30  6:58 UTC (permalink / raw)
  To: robh, thierry.reding, airlied, kgene, krzk
  Cc: dri-devel, linux-kernel, devicetree, linux-samsung-soc, a.hajda,
	inki.dae, cw00.choi, jh80.chung, Hoegeun Kwon
In-Reply-To: <CGME20161230065850epcas5p3ecad04edde7dfe1f2ad3c86815dcc377@epcas5p3.samsung.com>

Purpose of this patch is add support for S6E3HA2 AMOLED panel on
the TM2 board. The first patch adds support for S6E3HA2 panel
device tree document and driver, the second patch add support for
S6E3HA2 panel device tree.

Changes for V3:

- In the DT binding document, made it clearly that the panel is a
  child node of dsi.
- Fix reset-gpio active from high to low.
- Is the OF graph saying related to [1]?
  Althogh the panel is a child of dsi, I think OF graph necessary.
  because if a remote-endpoint is not specified, the dsi also
  panel is not probed.
- The display-timings has been fixed to be provided by the device
  driver. however, I think display-timings is necessary in dts.
  because if dts does not have display-timings, dsi will not load.

[1]: Documentation/devicetree/bindings/media/video-interfaces.txt

Hoegeun Kwon (1):
  drm/panel: Add support for S6E3HA2 panel driver on TM2 board

Hyungwon Hwang (1):
  arm64: dts: exynos: Add support for S6E3HA2 panel device on TM2 board

 .../bindings/display/panel/samsung,s6e3ha2.txt     |  58 ++
 arch/arm64/boot/dts/exynos/exynos5433-tm2.dts      |  31 +
 drivers/gpu/drm/panel/Kconfig                      |   6 +
 drivers/gpu/drm/panel/Makefile                     |   1 +
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c      | 741 +++++++++++++++++++++
 5 files changed, 837 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c

-- 
1.9.1

^ permalink raw reply

* Re: [PATCH v2 4/4] ARM64: dts: TM2: comply to the samsung pinctrl naming convention
From: Chanwoo Choi @ 2016-12-30  6:41 UTC (permalink / raw)
  To: Andi Shyti, Tomasz Figa, Krzysztof Kozlowski, Sylwester Nawrocki,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	Kukjin Kim, Javier Martinez Canillas, Linus Walleij
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	stable-u79uwXL29TY76Z2rM5mHXA, Andi Shyti
In-Reply-To: <20161230041421.24448-5-andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hi Andi,

Looks good to me. I tested these patches for booting on TM2 board.
Reviewed-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Regards,
Chanwoo Choi

On 2016년 12월 30일 13:14, Andi Shyti wrote:
> Change the PIN() macro definition so that it can use the macros
> from pinctrl/samsung.h header file.
> 
> Signed-off-by: Andi Shyti <andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi |  25 +-
>  arch/arm64/boot/dts/exynos/exynos5433-tm2.dts      | 254 ++++++++++-----------
>  2 files changed, 133 insertions(+), 146 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> index 2af854b11644..d49879bd34bb 100644
> --- a/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> @@ -14,25 +14,12 @@
>  
>  #include <dt-bindings/pinctrl/samsung.h>
>  
> -#define PIN_PULL_NONE		0
> -#define PIN_PULL_DOWN		1
> -#define PIN_PULL_UP		3
> -
> -#define PIN_DRV_LV1		0
> -#define PIN_DRV_LV2		2
> -#define PIN_DRV_LV3		1
> -#define PIN_DRV_LV4		3
> -
> -#define PIN_IN			0
> -#define PIN_OUT			1
> -#define PIN_FUNC1		2
> -
> -#define PIN(_func, _pin, _pull, _drv)			\
> -	_pin {						\
> -		samsung,pins = #_pin;			\
> -		samsung,pin-function = <PIN_ ##_func>;	\
> -		samsung,pin-pud = <PIN_PULL_ ##_pull>;	\
> -		samsung,pin-drv = <PIN_DRV_ ##_drv>;	\
> +#define PIN(_func, _pin, _pull, _drv)					\
> +	_pin {								\
> +		samsung,pins = #_pin;					\
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_ ##_func>;	\
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_ ##_pull>;		\
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_ ##_drv>;		\
>  	}
>  
>  &pinctrl_alive {
> diff --git a/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts b/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
> index f21bdc2ff834..66c4d5959881 100644
> --- a/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
> +++ b/arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
> @@ -742,77 +742,77 @@
>  	pinctrl-0 = <&initial_alive>;
>  
>  	initial_alive: initial-state {
> -		PIN(IN, gpa0-0, DOWN, LV1);
> -		PIN(IN, gpa0-1, NONE, LV1);
> -		PIN(IN, gpa0-2, DOWN, LV1);
> -		PIN(IN, gpa0-3, NONE, LV1);
> -		PIN(IN, gpa0-4, NONE, LV1);
> -		PIN(IN, gpa0-5, DOWN, LV1);
> -		PIN(IN, gpa0-6, NONE, LV1);
> -		PIN(IN, gpa0-7, NONE, LV1);
> -
> -		PIN(IN, gpa1-0, UP, LV1);
> -		PIN(IN, gpa1-1, NONE, LV1);
> -		PIN(IN, gpa1-2, NONE, LV1);
> -		PIN(IN, gpa1-3, DOWN, LV1);
> -		PIN(IN, gpa1-4, DOWN, LV1);
> -		PIN(IN, gpa1-5, NONE, LV1);
> -		PIN(IN, gpa1-6, NONE, LV1);
> -		PIN(IN, gpa1-7, NONE, LV1);
> -
> -		PIN(IN, gpa2-0, NONE, LV1);
> -		PIN(IN, gpa2-1, NONE, LV1);
> -		PIN(IN, gpa2-2, NONE, LV1);
> -		PIN(IN, gpa2-3, DOWN, LV1);
> -		PIN(IN, gpa2-4, NONE, LV1);
> -		PIN(IN, gpa2-5, DOWN, LV1);
> -		PIN(IN, gpa2-6, DOWN, LV1);
> -		PIN(IN, gpa2-7, NONE, LV1);
> -
> -		PIN(IN, gpa3-0, DOWN, LV1);
> -		PIN(IN, gpa3-1, DOWN, LV1);
> -		PIN(IN, gpa3-2, NONE, LV1);
> -		PIN(IN, gpa3-3, DOWN, LV1);
> -		PIN(IN, gpa3-4, NONE, LV1);
> -		PIN(IN, gpa3-5, DOWN, LV1);
> -		PIN(IN, gpa3-6, DOWN, LV1);
> -		PIN(IN, gpa3-7, DOWN, LV1);
> -
> -		PIN(IN, gpf1-0, NONE, LV1);
> -		PIN(IN, gpf1-1, NONE, LV1);
> -		PIN(IN, gpf1-2, DOWN, LV1);
> -		PIN(IN, gpf1-4, UP, LV1);
> -		PIN(OUT, gpf1-5, NONE, LV1);
> -		PIN(IN, gpf1-6, DOWN, LV1);
> -		PIN(IN, gpf1-7, DOWN, LV1);
> -
> -		PIN(IN, gpf2-0, DOWN, LV1);
> -		PIN(IN, gpf2-1, DOWN, LV1);
> -		PIN(IN, gpf2-2, DOWN, LV1);
> -		PIN(IN, gpf2-3, DOWN, LV1);
> -
> -		PIN(IN, gpf3-0, DOWN, LV1);
> -		PIN(IN, gpf3-1, DOWN, LV1);
> -		PIN(IN, gpf3-2, NONE, LV1);
> -		PIN(IN, gpf3-3, DOWN, LV1);
> -
> -		PIN(IN, gpf4-0, DOWN, LV1);
> -		PIN(IN, gpf4-1, DOWN, LV1);
> -		PIN(IN, gpf4-2, DOWN, LV1);
> -		PIN(IN, gpf4-3, DOWN, LV1);
> -		PIN(IN, gpf4-4, DOWN, LV1);
> -		PIN(IN, gpf4-5, DOWN, LV1);
> -		PIN(IN, gpf4-6, DOWN, LV1);
> -		PIN(IN, gpf4-7, DOWN, LV1);
> -
> -		PIN(IN, gpf5-0, DOWN, LV1);
> -		PIN(IN, gpf5-1, DOWN, LV1);
> -		PIN(IN, gpf5-2, DOWN, LV1);
> -		PIN(IN, gpf5-3, DOWN, LV1);
> -		PIN(OUT, gpf5-4, NONE, LV1);
> -		PIN(IN, gpf5-5, DOWN, LV1);
> -		PIN(IN, gpf5-6, DOWN, LV1);
> -		PIN(IN, gpf5-7, DOWN, LV1);
> +		PIN(INPUT, gpa0-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa0-1, NONE, FAST_SR1);
> +		PIN(INPUT, gpa0-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa0-3, NONE, FAST_SR1);
> +		PIN(INPUT, gpa0-4, NONE, FAST_SR1);
> +		PIN(INPUT, gpa0-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa0-6, NONE, FAST_SR1);
> +		PIN(INPUT, gpa0-7, NONE, FAST_SR1);
> +
> +		PIN(INPUT, gpa1-0, UP, FAST_SR1);
> +		PIN(INPUT, gpa1-1, NONE, FAST_SR1);
> +		PIN(INPUT, gpa1-2, NONE, FAST_SR1);
> +		PIN(INPUT, gpa1-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa1-4, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa1-5, NONE, FAST_SR1);
> +		PIN(INPUT, gpa1-6, NONE, FAST_SR1);
> +		PIN(INPUT, gpa1-7, NONE, FAST_SR1);
> +
> +		PIN(INPUT, gpa2-0, NONE, FAST_SR1);
> +		PIN(INPUT, gpa2-1, NONE, FAST_SR1);
> +		PIN(INPUT, gpa2-2, NONE, FAST_SR1);
> +		PIN(INPUT, gpa2-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa2-4, NONE, FAST_SR1);
> +		PIN(INPUT, gpa2-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa2-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa2-7, NONE, FAST_SR1);
> +
> +		PIN(INPUT, gpa3-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa3-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa3-2, NONE, FAST_SR1);
> +		PIN(INPUT, gpa3-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa3-4, NONE, FAST_SR1);
> +		PIN(INPUT, gpa3-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa3-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpa3-7, DOWN, FAST_SR1);
> +
> +		PIN(INPUT, gpf1-0, NONE, FAST_SR1);
> +		PIN(INPUT, gpf1-1, NONE, FAST_SR1);
> +		PIN(INPUT, gpf1-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf1-4, UP, FAST_SR1);
> +		PIN(OUTPUT, gpf1-5, NONE, FAST_SR1);
> +		PIN(INPUT, gpf1-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf1-7, DOWN, FAST_SR1);
> +
> +		PIN(INPUT, gpf2-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf2-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf2-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf2-3, DOWN, FAST_SR1);
> +
> +		PIN(INPUT, gpf3-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf3-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf3-2, NONE, FAST_SR1);
> +		PIN(INPUT, gpf3-3, DOWN, FAST_SR1);
> +
> +		PIN(INPUT, gpf4-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-4, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf4-7, DOWN, FAST_SR1);
> +
> +		PIN(INPUT, gpf5-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf5-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf5-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf5-3, DOWN, FAST_SR1);
> +		PIN(OUTPUT, gpf5-4, NONE, FAST_SR1);
> +		PIN(INPUT, gpf5-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf5-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf5-7, DOWN, FAST_SR1);
>  	};
>  
>  	te_irq: te_irq {
> @@ -826,8 +826,8 @@
>  	pinctrl-0 = <&initial_cpif>;
>  
>  	initial_cpif: initial-state {
> -		PIN(IN, gpv6-0, DOWN, LV1);
> -		PIN(IN, gpv6-1, DOWN, LV1);
> +		PIN(INPUT, gpv6-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpv6-1, DOWN, FAST_SR1);
>  	};
>  };
>  
> @@ -836,9 +836,9 @@
>  	pinctrl-0 = <&initial_ese>;
>  
>  	initial_ese: initial-state {
> -		PIN(IN, gpj2-0, DOWN, LV1);
> -		PIN(IN, gpj2-1, DOWN, LV1);
> -		PIN(IN, gpj2-2, DOWN, LV1);
> +		PIN(INPUT, gpj2-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpj2-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpj2-2, DOWN, FAST_SR1);
>  	};
>  };
>  
> @@ -847,11 +847,11 @@
>  	pinctrl-0 = <&initial_fsys>;
>  
>  	initial_fsys: initial-state {
> -		PIN(IN, gpr3-0, NONE, LV1);
> -		PIN(IN, gpr3-1, DOWN, LV1);
> -		PIN(IN, gpr3-2, DOWN, LV1);
> -		PIN(IN, gpr3-3, DOWN, LV1);
> -		PIN(IN, gpr3-7, NONE, LV1);
> +		PIN(INPUT, gpr3-0, NONE, FAST_SR1);
> +		PIN(INPUT, gpr3-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpr3-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpr3-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpr3-7, NONE, FAST_SR1);
>  	};
>  };
>  
> @@ -860,14 +860,14 @@
>  	pinctrl-0 = <&initial_imem>;
>  
>  	initial_imem: initial-state {
> -		PIN(IN, gpf0-0, UP, LV1);
> -		PIN(IN, gpf0-1, UP, LV1);
> -		PIN(IN, gpf0-2, DOWN, LV1);
> -		PIN(IN, gpf0-3, UP, LV1);
> -		PIN(IN, gpf0-4, DOWN, LV1);
> -		PIN(IN, gpf0-5, NONE, LV1);
> -		PIN(IN, gpf0-6, DOWN, LV1);
> -		PIN(IN, gpf0-7, UP, LV1);
> +		PIN(INPUT, gpf0-0, UP, FAST_SR1);
> +		PIN(INPUT, gpf0-1, UP, FAST_SR1);
> +		PIN(INPUT, gpf0-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf0-3, UP, FAST_SR1);
> +		PIN(INPUT, gpf0-4, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf0-5, NONE, FAST_SR1);
> +		PIN(INPUT, gpf0-6, DOWN, FAST_SR1);
> +		PIN(INPUT, gpf0-7, UP, FAST_SR1);
>  	};
>  };
>  
> @@ -876,7 +876,7 @@
>  	pinctrl-0 = <&initial_nfc>;
>  
>  	initial_nfc: initial-state {
> -		PIN(IN, gpj0-2, DOWN, LV1);
> +		PIN(INPUT, gpj0-2, DOWN, FAST_SR1);
>  	};
>  };
>  
> @@ -885,54 +885,54 @@
>  	pinctrl-0 = <&initial_peric>;
>  
>  	initial_peric: initial-state {
> -		PIN(IN, gpv7-0, DOWN, LV1);
> -		PIN(IN, gpv7-1, DOWN, LV1);
> -		PIN(IN, gpv7-2, NONE, LV1);
> -		PIN(IN, gpv7-3, DOWN, LV1);
> -		PIN(IN, gpv7-4, DOWN, LV1);
> -		PIN(IN, gpv7-5, DOWN, LV1);
> +		PIN(INPUT, gpv7-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpv7-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpv7-2, NONE, FAST_SR1);
> +		PIN(INPUT, gpv7-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpv7-4, DOWN, FAST_SR1);
> +		PIN(INPUT, gpv7-5, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpb0-4, DOWN, LV1);
> +		PIN(INPUT, gpb0-4, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpc0-2, DOWN, LV1);
> -		PIN(IN, gpc0-5, DOWN, LV1);
> -		PIN(IN, gpc0-7, DOWN, LV1);
> +		PIN(INPUT, gpc0-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpc0-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpc0-7, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpc1-1, DOWN, LV1);
> +		PIN(INPUT, gpc1-1, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpc3-4, NONE, LV1);
> -		PIN(IN, gpc3-5, NONE, LV1);
> -		PIN(IN, gpc3-6, NONE, LV1);
> -		PIN(IN, gpc3-7, NONE, LV1);
> +		PIN(INPUT, gpc3-4, NONE, FAST_SR1);
> +		PIN(INPUT, gpc3-5, NONE, FAST_SR1);
> +		PIN(INPUT, gpc3-6, NONE, FAST_SR1);
> +		PIN(INPUT, gpc3-7, NONE, FAST_SR1);
>  
> -		PIN(OUT, gpg0-0, NONE, LV1);
> -		PIN(FUNC1, gpg0-1, DOWN, LV1);
> +		PIN(OUTPUT, gpg0-0, NONE, FAST_SR1);
> +		PIN(2, gpg0-1, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpd2-5, DOWN, LV1);
> +		PIN(INPUT, gpd2-5, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpd4-0, NONE, LV1);
> -		PIN(IN, gpd4-1, DOWN, LV1);
> -		PIN(IN, gpd4-2, DOWN, LV1);
> -		PIN(IN, gpd4-3, DOWN, LV1);
> -		PIN(IN, gpd4-4, DOWN, LV1);
> +		PIN(INPUT, gpd4-0, NONE, FAST_SR1);
> +		PIN(INPUT, gpd4-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpd4-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpd4-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpd4-4, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpd6-3, DOWN, LV1);
> +		PIN(INPUT, gpd6-3, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpd8-1, UP, LV1);
> +		PIN(INPUT, gpd8-1, UP, FAST_SR1);
>  
> -		PIN(IN, gpg1-0, DOWN, LV1);
> -		PIN(IN, gpg1-1, DOWN, LV1);
> -		PIN(IN, gpg1-2, DOWN, LV1);
> -		PIN(IN, gpg1-3, DOWN, LV1);
> -		PIN(IN, gpg1-4, DOWN, LV1);
> +		PIN(INPUT, gpg1-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg1-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg1-2, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg1-3, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg1-4, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpg2-0, DOWN, LV1);
> -		PIN(IN, gpg2-1, DOWN, LV1);
> +		PIN(INPUT, gpg2-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg2-1, DOWN, FAST_SR1);
>  
> -		PIN(IN, gpg3-0, DOWN, LV1);
> -		PIN(IN, gpg3-1, DOWN, LV1);
> -		PIN(IN, gpg3-5, DOWN, LV1);
> -		PIN(IN, gpg3-7, DOWN, LV1);
> +		PIN(INPUT, gpg3-0, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg3-1, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg3-5, DOWN, FAST_SR1);
> +		PIN(INPUT, gpg3-7, DOWN, FAST_SR1);
>  	};
>  };
>  
> @@ -941,7 +941,7 @@
>  	pinctrl-0 = <&initial_touch>;
>  
>  	initial_touch: initial-state {
> -		PIN(IN, gpj1-2, DOWN, LV1);
> +		PIN(INPUT, gpj1-2, DOWN, FAST_SR1);
>  	};
>  };
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 3/4] ARM64: dts: exynos5433: use macros for pinctrl configuration on Exynos5433
From: Chanwoo Choi @ 2016-12-30  6:38 UTC (permalink / raw)
  To: Andi Shyti, Tomasz Figa, Krzysztof Kozlowski, Sylwester Nawrocki,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	Kukjin Kim, Javier Martinez Canillas, Linus Walleij
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	stable-u79uwXL29TY76Z2rM5mHXA, Andi Shyti
In-Reply-To: <20161230041421.24448-4-andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hi Andi,

Looks good to me.
Reviewed-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Regards,
Chanwoo Choi

On 2016년 12월 30일 13:14, Andi Shyti wrote:
> Use the macros defined in include/dt-bindings/pinctrl/samsung.h
> instead of hardcoded values.
> 
> Signed-off-by: Andi Shyti <andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi | 348 +++++++++++----------
>  1 file changed, 175 insertions(+), 173 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi b/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> index ad71247b074f..2af854b11644 100644
> --- a/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynos5433-pinctrl.dtsi
> @@ -12,6 +12,8 @@
>   * published by the Free Software Foundation.
>   */
>  
> +#include <dt-bindings/pinctrl/samsung.h>
> +
>  #define PIN_PULL_NONE		0
>  #define PIN_PULL_DOWN		1
>  #define PIN_PULL_UP		3
> @@ -145,23 +147,23 @@
>  	i2s0_bus: i2s0-bus {
>  		samsung,pins = "gpz0-0", "gpz0-1", "gpz0-2", "gpz0-3",
>  				"gpz0-4", "gpz0-5", "gpz0-6";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pcm0_bus: pcm0-bus {
>  		samsung,pins = "gpz1-0", "gpz1-1", "gpz1-2", "gpz1-3";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	uart_aud_bus: uart-aud-bus {
>  		samsung,pins = "gpz1-3", "gpz1-2", "gpz1-1", "gpz1-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  };
>  
> @@ -196,16 +198,16 @@
>  
>  	spi2_bus: spi2-bus {
>  		samsung,pins = "gpd5-0", "gpd5-2", "gpd5-3";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c6_bus: hs-i2c6-bus {
>  		samsung,pins = "gpd5-3", "gpd5-2";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  };
>  
> @@ -260,141 +262,141 @@
>  
>  	sd0_clk: sd0-clk {
>  		samsung,pins = "gpr0-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_cmd: sd0-cmd {
>  		samsung,pins = "gpr0-1";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_rdqs: sd0-rdqs {
>  		samsung,pins = "gpr0-2";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_qrdy: sd0-qrdy {
>  		samsung,pins = "gpr0-3";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_bus1: sd0-bus-width1 {
>  		samsung,pins = "gpr1-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_bus4: sd0-bus-width4 {
>  		samsung,pins = "gpr1-1", "gpr1-2", "gpr1-3";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd0_bus8: sd0-bus-width8 {
>  		samsung,pins = "gpr1-4", "gpr1-5", "gpr1-6", "gpr1-7";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd1_clk: sd1-clk {
>  		samsung,pins = "gpr2-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd1_cmd: sd1-cmd {
>  		samsung,pins = "gpr2-1";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd1_bus1: sd1-bus-width1 {
>  		samsung,pins = "gpr3-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd1_bus4: sd1-bus-width4 {
>  		samsung,pins = "gpr3-1", "gpr3-2", "gpr3-3";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd1_bus8: sd1-bus-width8 {
>  		samsung,pins = "gpr3-4", "gpr3-5", "gpr3-6", "gpr3-7";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	pcie_bus: pcie_bus {
>  		samsung,pins = "gpr3-4", "gpr3-5", "gpr3-6", "gpr3-7";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
>  	};
>  
>  	sd2_clk: sd2-clk {
>  		samsung,pins = "gpr4-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd2_cmd: sd2-cmd {
>  		samsung,pins = "gpr4-1";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd2_cd: sd2-cd {
>  		samsung,pins = "gpr4-2";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd2_bus1: sd2-bus-width1 {
>  		samsung,pins = "gpr4-3";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd2_bus4: sd2-bus-width4 {
>  		samsung,pins = "gpr4-4", "gpr4-5", "gpr4-6";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <3>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR4>;
>  	};
>  
>  	sd2_clk_output: sd2-clk-output {
>  		samsung,pins = "gpr4-0";
> -		samsung,pin-function = <1>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <2>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR3>;
>  	};
>  
>  	sd2_cmd_output: sd2-cmd-output {
>  		samsung,pins = "gpr4-1";
> -		samsung,pin-function = <1>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <2>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR3>;
>  	};
>  };
>  
> @@ -419,9 +421,9 @@
>  
>  	hs_i2c4_bus: hs-i2c4-bus {
>  		samsung,pins = "gpj0-1", "gpj0-0";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  };
>  
> @@ -564,225 +566,225 @@
>  
>  	hs_i2c8_bus: hs-i2c8-bus {
>  		samsung,pins = "gpb0-1", "gpb0-0";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c9_bus: hs-i2c9-bus {
>  		samsung,pins = "gpb0-3", "gpb0-2";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	i2s1_bus: i2s1-bus {
>  		samsung,pins = "gpd4-0", "gpd4-1", "gpd4-2",
>  				"gpd4-3", "gpd4-4";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pcm1_bus: pcm1-bus {
>  		samsung,pins = "gpd4-0", "gpd4-1", "gpd4-2",
>  				"gpd4-3", "gpd4-4";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	spdif_bus: spdif-bus {
>  		samsung,pins = "gpd4-3", "gpd4-4";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <1>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_spi_pin0: fimc-is-spi-pin0 {
>  		samsung,pins = "gpc3-3", "gpc3-2", "gpc3-1", "gpc3-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_spi_pin1: fimc-is-spi-pin1 {
>  		samsung,pins = "gpc3-7", "gpc3-6", "gpc3-5", "gpc3-4";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	uart0_bus: uart0-bus {
>  		samsung,pins = "gpd0-3", "gpd0-2", "gpd0-1", "gpd0-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
>  	};
>  
>  	hs_i2c2_bus: hs-i2c2-bus {
>  		samsung,pins = "gpd0-3", "gpd0-2";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	uart2_bus: uart2-bus {
>  		samsung,pins = "gpd1-5", "gpd1-4";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
>  	};
>  
>  	uart1_bus: uart1-bus {
>  		samsung,pins = "gpd1-3", "gpd1-2", "gpd1-1", "gpd1-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
>  	};
>  
>  	hs_i2c3_bus: hs-i2c3-bus {
>  		samsung,pins = "gpd1-3", "gpd1-2";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c0_bus: hs-i2c0-bus {
>  		samsung,pins = "gpd2-1", "gpd2-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c1_bus: hs-i2c1-bus {
>  		samsung,pins = "gpd2-3", "gpd2-2";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pwm0_out: pwm0-out {
>  		samsung,pins = "gpd2-4";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pwm1_out: pwm1-out {
>  		samsung,pins = "gpd2-5";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pwm2_out: pwm2-out {
>  		samsung,pins = "gpd2-6";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	pwm3_out: pwm3-out {
>  		samsung,pins = "gpd2-7";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	spi1_bus: spi1-bus {
>  		samsung,pins = "gpd6-2", "gpd6-4", "gpd6-5";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c7_bus: hs-i2c7-bus {
>  		samsung,pins = "gpd2-7", "gpd2-6";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	spi0_bus: spi0-bus {
>  		samsung,pins = "gpd8-0", "gpd6-0", "gpd6-1";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c10_bus: hs-i2c10-bus {
>  		samsung,pins = "gpg3-1", "gpg3-0";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	hs_i2c11_bus: hs-i2c11-bus {
>  		samsung,pins = "gpg3-3", "gpg3-2";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	spi3_bus: spi3-bus {
>  		samsung,pins = "gpg3-4", "gpg3-6", "gpg3-7";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	spi4_bus: spi4-bus {
>  		samsung,pins = "gpv7-1", "gpv7-3", "gpv7-4";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_uart: fimc-is-uart {
>  		samsung,pins = "gpc1-1", "gpc0-7";
> -		samsung,pin-function = <3>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch0_i2c: fimc-is-ch0_i2c {
>  		samsung,pins = "gpc2-1", "gpc2-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch0_mclk: fimc-is-ch0_mclk {
>  		samsung,pins = "gpd7-0";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch1_i2c: fimc-is-ch1-i2c {
>  		samsung,pins = "gpc2-3", "gpc2-2";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch1_mclk: fimc-is-ch1-mclk {
>  		samsung,pins = "gpd7-1";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch2_i2c: fimc-is-ch2-i2c {
>  		samsung,pins = "gpc2-5", "gpc2-4";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  
>  	fimc_is_ch2_mclk: fimc-is-ch2-mclk {
>  		samsung,pins = "gpd7-2";
> -		samsung,pin-function = <2>;
> -		samsung,pin-pud = <0>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  };
>  
> @@ -797,8 +799,8 @@
>  
>  	hs_i2c5_bus: hs-i2c5-bus {
>  		samsung,pins = "gpj1-1", "gpj1-0";
> -		samsung,pin-function = <4>;
> -		samsung,pin-pud = <3>;
> -		samsung,pin-drv = <0>;
> +		samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
> +		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
> +		samsung,pin-drv = <EXYNOS5433_PIN_DRV_FAST_SR1>;
>  	};
>  };
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox