All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: jz4740: Use PWM lookup table
@ 2015-10-05 11:31 Thierry Reding
  2015-10-06 11:34 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2015-10-05 11:31 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Lars-Peter Clausen, linux-mips, linux-kernel, Thierry Reding

Associate the PWM with the pwm-beeper device using a PWM lookup table.
This will eventually allow the legacy function calls to pwm_request() to
be removed from all consumer drivers.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
---
 arch/mips/jz4740/board-qi_lb60.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c
index f2885adda9d0..0e6ad22d265c 100644
--- a/arch/mips/jz4740/board-qi_lb60.c
+++ b/arch/mips/jz4740/board-qi_lb60.c
@@ -25,6 +25,7 @@
 #include <linux/power_supply.h>
 #include <linux/power/jz4740-battery.h>
 #include <linux/power/gpio-charger.h>
+#include <linux/pwm.h>
 
 #include <asm/mach-jz4740/jz4740_fb.h>
 #include <asm/mach-jz4740/jz4740_mmc.h>
@@ -399,13 +400,15 @@ static struct platform_device avt2_usb_regulator_device = {
 	}
 };
 
+static struct pwm_lookup qi_lb60_pwm_lookup[] = {
+	PWM_LOOKUP("jz4740-pwm", 4, "pwm-beeper", NULL, 0,
+		   PWM_POLARITY_NORMAL),
+};
+
 /* beeper */
 static struct platform_device qi_lb60_pwm_beeper = {
 	.name = "pwm-beeper",
 	.id = -1,
-	.dev = {
-		.platform_data = (void *)4,
-	},
 };
 
 /* charger */
@@ -491,6 +494,8 @@ static int __init qi_lb60_init_platform_devices(void)
 		platform_device_register(&jz4740_usb_ohci_device);
 	}
 
+	pwm_add_table(qi_lb60_pwm_lookup, ARRAY_SIZE(qi_lb60_pwm_lookup));
+
 	return platform_add_devices(jz_platform_devices,
 					ARRAY_SIZE(jz_platform_devices));
 
-- 
2.5.0

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

* Re: [PATCH] MIPS: jz4740: Use PWM lookup table
  2015-10-05 11:31 [PATCH] MIPS: jz4740: Use PWM lookup table Thierry Reding
@ 2015-10-06 11:34 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2015-10-06 11:34 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Lars-Peter Clausen, linux-mips, linux-kernel

On Mon, Oct 05, 2015 at 01:31:17PM +0200, Thierry Reding wrote:

> Associate the PWM with the pwm-beeper device using a PWM lookup table.
> This will eventually allow the legacy function calls to pwm_request() to
> be removed from all consumer drivers.

This one applied with fuzz only, probably because I was using the other
fix for the gpio issue.

Thanks,

  Ralf

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

end of thread, other threads:[~2015-10-06 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 11:31 [PATCH] MIPS: jz4740: Use PWM lookup table Thierry Reding
2015-10-06 11:34 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.