linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] Add max77693 haptic driver
@ 2014-09-17 16:40 Jaewon Kim
  2014-09-17 16:40 ` [PATCH v5 1/3] mfd: max77693: Initialize haptic register map Jaewon Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jaewon Kim @ 2014-09-17 16:40 UTC (permalink / raw)
  To: Lee Jones; +Cc: Chanwoo Choi, linux-kernel, Jaewon Kim

This series adds max77693 haptic driver.
The max77693 is a Multifunction device with PMIC, CHARGER, LED,
MUIC, HAPTIC and this series is haptic device driver in MAX77693.
The haptic driver use regmap method for i2c communication and
support force feedback framework in input device.

Changes in v5:
 - Documentation : change explanation of haptic and pwm

Changes in v4:
 - mfd : fix tabbing in mfd_cell
 - driver : move regulator enable/disable to input open()/close()
 - driver : add resume function

Changes in v3:
 - driver : remove mutex in workqueue
 - driver : mv max77693_haptic_set_duty_cyle() to workqueue.
 - driver : remove max77693_haptic_remove[]
 - driver : add suspend() function to turn-off entering suspend.

Changes in v2:
 - split to documentation and mfd patchs.
 - Documentation : change explanation of haptic 
 - Documentation : remove pwm-names propertie in example

Jaewon Kim (3):
  mfd: max77693: Initialize haptic register map
  mfd: max77693: add haptic of_compatible in mfd_cell
  mfd: max77693: Update DT binding to support haptic

 Documentation/devicetree/bindings/mfd/max77693.txt |   21 ++++++++++++++++
 drivers/mfd/max77693.c                             |   26 +++++++++++++++++---
 2 files changed, 43 insertions(+), 4 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/3] mfd: max77693: Initialize haptic register map
  2014-09-17 16:40 [PATCH v5 0/3] Add max77693 haptic driver Jaewon Kim
@ 2014-09-17 16:40 ` Jaewon Kim
  2014-10-06 20:47   ` Lee Jones
  2014-09-17 16:40 ` [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell Jaewon Kim
  2014-09-17 16:40 ` [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic Jaewon Kim
  2 siblings, 1 reply; 7+ messages in thread
From: Jaewon Kim @ 2014-09-17 16:40 UTC (permalink / raw)
  To: Lee Jones; +Cc: Chanwoo Choi, linux-kernel, Jaewon Kim

This patch add regmap_haptic initialization to use haptic register map
in haptic device driver.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max77693.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 249c139..fbfed56 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -144,6 +144,12 @@ static const struct regmap_irq_chip max77693_muic_irq_chip = {
 	.num_irqs		= ARRAY_SIZE(max77693_muic_irqs),
 };
 
+static const struct regmap_config max77693_regmap_haptic_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = MAX77693_HAPTIC_REG_END,
+};
+
 static int max77693_i2c_probe(struct i2c_client *i2c,
 			      const struct i2c_device_id *id)
 {
@@ -193,6 +199,15 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 	}
 	i2c_set_clientdata(max77693->haptic, max77693);
 
+	max77693->regmap_haptic = devm_regmap_init_i2c(max77693->haptic,
+					&max77693_regmap_haptic_config);
+	if (IS_ERR(max77693->regmap_haptic)) {
+		ret = PTR_ERR(max77693->regmap_haptic);
+		dev_err(max77693->dev,
+			"failed to initialize haptic register map: %d\n", ret);
+		goto err_regmap;
+	}
+
 	/*
 	 * Initialize register map for MUIC device because use regmap-muic
 	 * instance of MUIC device when irq of max77693 is initialized
@@ -204,7 +219,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 		ret = PTR_ERR(max77693->regmap_muic);
 		dev_err(max77693->dev,
 			"failed to allocate register map: %d\n", ret);
-		goto err_regmap_muic;
+		goto err_regmap;
 	}
 
 	ret = regmap_add_irq_chip(max77693->regmap, max77693->irq,
@@ -214,7 +229,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 				&max77693->irq_data_led);
 	if (ret) {
 		dev_err(max77693->dev, "failed to add irq chip: %d\n", ret);
-		goto err_regmap_muic;
+		goto err_regmap;
 	}
 
 	ret = regmap_add_irq_chip(max77693->regmap, max77693->irq,
@@ -265,7 +280,7 @@ err_irq_charger:
 	regmap_del_irq_chip(max77693->irq, max77693->irq_data_topsys);
 err_irq_topsys:
 	regmap_del_irq_chip(max77693->irq, max77693->irq_data_led);
-err_regmap_muic:
+err_regmap:
 	i2c_unregister_device(max77693->haptic);
 err_i2c_haptic:
 	i2c_unregister_device(max77693->muic);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell
  2014-09-17 16:40 [PATCH v5 0/3] Add max77693 haptic driver Jaewon Kim
  2014-09-17 16:40 ` [PATCH v5 1/3] mfd: max77693: Initialize haptic register map Jaewon Kim
@ 2014-09-17 16:40 ` Jaewon Kim
  2014-10-06 20:47   ` Lee Jones
  2014-09-17 16:40 ` [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic Jaewon Kim
  2 siblings, 1 reply; 7+ messages in thread
From: Jaewon Kim @ 2014-09-17 16:40 UTC (permalink / raw)
  To: Lee Jones; +Cc: Chanwoo Choi, linux-kernel, Jaewon Kim

This patch add haptic of_compatible in order to use the haptic
device driver using Devicetree.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max77693.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index fbfed56..5b516fe 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -46,7 +46,10 @@ static const struct mfd_cell max77693_devs[] = {
 	{ .name = "max77693-charger", },
 	{ .name = "max77693-flash", },
 	{ .name = "max77693-muic", },
-	{ .name = "max77693-haptic", },
+	{
+		.name = "max77693-haptic",
+		.of_compatible = "maxim,max77693-haptic",
+	},
 };
 
 static const struct regmap_config max77693_regmap_config = {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic
  2014-09-17 16:40 [PATCH v5 0/3] Add max77693 haptic driver Jaewon Kim
  2014-09-17 16:40 ` [PATCH v5 1/3] mfd: max77693: Initialize haptic register map Jaewon Kim
  2014-09-17 16:40 ` [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell Jaewon Kim
@ 2014-09-17 16:40 ` Jaewon Kim
  2014-10-06 20:48   ` Lee Jones
  2 siblings, 1 reply; 7+ messages in thread
From: Jaewon Kim @ 2014-09-17 16:40 UTC (permalink / raw)
  To: Lee Jones; +Cc: Chanwoo Choi, linux-kernel, Jaewon Kim

This patch add haptic DT binding documentation and example
to support haptic driver in max77693 Multifunction device.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 Documentation/devicetree/bindings/mfd/max77693.txt |   21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
index 11921cc..01e9f30 100644
--- a/Documentation/devicetree/bindings/mfd/max77693.txt
+++ b/Documentation/devicetree/bindings/mfd/max77693.txt
@@ -27,6 +27,20 @@ Optional properties:
 
 	[*] refer Documentation/devicetree/bindings/regulator/regulator.txt
 
+- haptic : The MAX77693 haptic device utilises a PWM controlled motor to provide
+  users with tactile feedback. PWM period and duty-cycle are varied in
+  order to provide the approprite level of feedback.
+
+ Required properties:
+	- compatible : Must be "maxim,max77693-hpatic"
+	- haptic-supply : power supply for the haptic motor
+	[*] refer Documentation/devicetree/bindings/regulator/regulator.txt
+	- pwms : phandle to the physical PWM(Pulse Width Modulation) device.
+	 PWM properties should be named "pwms". And number of cell is different
+	 for each pwm device.
+	 To get more informations, please refer to documentaion.
+	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
+
 Example:
 	max77693@66 {
 		compatible = "maxim,max77693";
@@ -52,4 +66,11 @@ Example:
 					regulator-boot-on;
 			};
 		};
+
+		haptic {
+			compatible = "maxim,max77693-haptic";
+			haptic-supply = <&haptic_supply>;
+			pwms = <&pwm 0 40000 0>;
+			pwm-names = "haptic";
+		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/3] mfd: max77693: Initialize haptic register map
  2014-09-17 16:40 ` [PATCH v5 1/3] mfd: max77693: Initialize haptic register map Jaewon Kim
@ 2014-10-06 20:47   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2014-10-06 20:47 UTC (permalink / raw)
  To: Jaewon Kim; +Cc: Chanwoo Choi, linux-kernel

On Thu, 18 Sep 2014, Jaewon Kim wrote:

> This patch add regmap_haptic initialization to use haptic register map
> in haptic device driver.
> 
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/max77693.c |   21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)

Applied for v3.19.

> diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
> index 249c139..fbfed56 100644
> --- a/drivers/mfd/max77693.c
> +++ b/drivers/mfd/max77693.c
> @@ -144,6 +144,12 @@ static const struct regmap_irq_chip max77693_muic_irq_chip = {
>  	.num_irqs		= ARRAY_SIZE(max77693_muic_irqs),
>  };
>  
> +static const struct regmap_config max77693_regmap_haptic_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.max_register = MAX77693_HAPTIC_REG_END,
> +};
> +
>  static int max77693_i2c_probe(struct i2c_client *i2c,
>  			      const struct i2c_device_id *id)
>  {
> @@ -193,6 +199,15 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
>  	}
>  	i2c_set_clientdata(max77693->haptic, max77693);
>  
> +	max77693->regmap_haptic = devm_regmap_init_i2c(max77693->haptic,
> +					&max77693_regmap_haptic_config);
> +	if (IS_ERR(max77693->regmap_haptic)) {
> +		ret = PTR_ERR(max77693->regmap_haptic);
> +		dev_err(max77693->dev,
> +			"failed to initialize haptic register map: %d\n", ret);
> +		goto err_regmap;
> +	}
> +
>  	/*
>  	 * Initialize register map for MUIC device because use regmap-muic
>  	 * instance of MUIC device when irq of max77693 is initialized
> @@ -204,7 +219,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
>  		ret = PTR_ERR(max77693->regmap_muic);
>  		dev_err(max77693->dev,
>  			"failed to allocate register map: %d\n", ret);
> -		goto err_regmap_muic;
> +		goto err_regmap;
>  	}
>  
>  	ret = regmap_add_irq_chip(max77693->regmap, max77693->irq,
> @@ -214,7 +229,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
>  				&max77693->irq_data_led);
>  	if (ret) {
>  		dev_err(max77693->dev, "failed to add irq chip: %d\n", ret);
> -		goto err_regmap_muic;
> +		goto err_regmap;
>  	}
>  
>  	ret = regmap_add_irq_chip(max77693->regmap, max77693->irq,
> @@ -265,7 +280,7 @@ err_irq_charger:
>  	regmap_del_irq_chip(max77693->irq, max77693->irq_data_topsys);
>  err_irq_topsys:
>  	regmap_del_irq_chip(max77693->irq, max77693->irq_data_led);
> -err_regmap_muic:
> +err_regmap:
>  	i2c_unregister_device(max77693->haptic);
>  err_i2c_haptic:
>  	i2c_unregister_device(max77693->muic);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell
  2014-09-17 16:40 ` [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell Jaewon Kim
@ 2014-10-06 20:47   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2014-10-06 20:47 UTC (permalink / raw)
  To: Jaewon Kim; +Cc: Chanwoo Choi, linux-kernel

On Thu, 18 Sep 2014, Jaewon Kim wrote:

> This patch add haptic of_compatible in order to use the haptic
> device driver using Devicetree.
> 
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/max77693.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied for v3.19.

> diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
> index fbfed56..5b516fe 100644
> --- a/drivers/mfd/max77693.c
> +++ b/drivers/mfd/max77693.c
> @@ -46,7 +46,10 @@ static const struct mfd_cell max77693_devs[] = {
>  	{ .name = "max77693-charger", },
>  	{ .name = "max77693-flash", },
>  	{ .name = "max77693-muic", },
> -	{ .name = "max77693-haptic", },
> +	{
> +		.name = "max77693-haptic",
> +		.of_compatible = "maxim,max77693-haptic",
> +	},
>  };
>  
>  static const struct regmap_config max77693_regmap_config = {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic
  2014-09-17 16:40 ` [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic Jaewon Kim
@ 2014-10-06 20:48   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2014-10-06 20:48 UTC (permalink / raw)
  To: Jaewon Kim; +Cc: Chanwoo Choi, linux-kernel

On Thu, 18 Sep 2014, Jaewon Kim wrote:

> This patch add haptic DT binding documentation and example
> to support haptic driver in max77693 Multifunction device.
> 
> Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  Documentation/devicetree/bindings/mfd/max77693.txt |   21 ++++++++++++++++++++
>  1 file changed, 21 insertions(+)

Applied for v3.19.

> diff --git a/Documentation/devicetree/bindings/mfd/max77693.txt b/Documentation/devicetree/bindings/mfd/max77693.txt
> index 11921cc..01e9f30 100644
> --- a/Documentation/devicetree/bindings/mfd/max77693.txt
> +++ b/Documentation/devicetree/bindings/mfd/max77693.txt
> @@ -27,6 +27,20 @@ Optional properties:
>  
>  	[*] refer Documentation/devicetree/bindings/regulator/regulator.txt
>  
> +- haptic : The MAX77693 haptic device utilises a PWM controlled motor to provide
> +  users with tactile feedback. PWM period and duty-cycle are varied in
> +  order to provide the approprite level of feedback.
> +
> + Required properties:
> +	- compatible : Must be "maxim,max77693-hpatic"
> +	- haptic-supply : power supply for the haptic motor
> +	[*] refer Documentation/devicetree/bindings/regulator/regulator.txt
> +	- pwms : phandle to the physical PWM(Pulse Width Modulation) device.
> +	 PWM properties should be named "pwms". And number of cell is different
> +	 for each pwm device.
> +	 To get more informations, please refer to documentaion.
> +	[*] refer Documentation/devicetree/bindings/pwm/pwm.txt
> +
>  Example:
>  	max77693@66 {
>  		compatible = "maxim,max77693";
> @@ -52,4 +66,11 @@ Example:
>  					regulator-boot-on;
>  			};
>  		};
> +
> +		haptic {
> +			compatible = "maxim,max77693-haptic";
> +			haptic-supply = <&haptic_supply>;
> +			pwms = <&pwm 0 40000 0>;
> +			pwm-names = "haptic";
> +		};
>  	};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-06 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-17 16:40 [PATCH v5 0/3] Add max77693 haptic driver Jaewon Kim
2014-09-17 16:40 ` [PATCH v5 1/3] mfd: max77693: Initialize haptic register map Jaewon Kim
2014-10-06 20:47   ` Lee Jones
2014-09-17 16:40 ` [PATCH v5 2/3] mfd: max77693: add haptic of_compatible in mfd_cell Jaewon Kim
2014-10-06 20:47   ` Lee Jones
2014-09-17 16:40 ` [PATCH v5 3/3] mfd: max77693: Update DT binding to support haptic Jaewon Kim
2014-10-06 20:48   ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).