Subject: gpt frequency input/pwm driver for MPC512x

From: Matteo Fortini <[email-masked]>
Date: Tue, 30 Sep 2008 13:12:54 +0200

We are developing a couple of gpt drivers (one for input capture and 
frequency measurement, one for pwm lcd backlight control) for an 
MPC512x, and we'd like to find the proper way of inserting it into the 
kernel.

Currently, the frequency input driver is reserving a character device 
and registering as a platform device driver with the 
of_register_platform_driver() calls.
The character device interface is given through the old-style cdev_t 
allocation and deallocation, but I see that maybe this kind of devices, 
which seems not to conform to any device type, should register as 
"miscdevice"s, is that correct? This would leave me with only 14 minor 
numbers free to be allocated. Moreover, there seems to be no way of 
getting to the device data when using miscdevice's file operations, so 
we would be on our own allocating more than one frequency input.

Same for the backlight driver: I'd like to have a pmw driver, which I 
can register a new platform driver, but how do I "glue" it with the 
backlight driver? I'd prefer not to have direct pwm  register calls in 
the backlight driver, but I'd rather have the backlight driver call a 
generic pwm driver in order to do its job.

Thanks,
Matteo