Sebastian Haas wrote:
> Hi,
> 
> Wolfgang Grandegger schrieb:
>> Hi Kurt,
> 
>> Kurt Van Dijck wrote:
>>> The goal of this patch series is to add an external hook function into
>>> the CAN netdevice's open/close functions.
>>>
>>> I think this is much simpler than using netdev notifactions. These new
>>> hook functions carry the original device in its argument list.
>>> A hook function for platform_device can be as simple as:
>>>
>>> static const int can_drv_gpio[NUM] = { ... };
>>> static int can_drv_enable(struct platform_device *pdev, int enable)
>>> {
>>>    gpio_set_value(can_drv_gpio[pdev->id], enable);
>>>    return 0;
>>> }
>>>
>>> This kind of 'glue functions' is what make board run, and should not
>>> be too complex IMO.
>>>
>>> I (EIA Electronics) use this to activate/deactivate a GPIO that powers
>>> the CAN transceiver (PCA82...).
>>>
>>> My original idea was to limit this functionality to the sja1000
>>> platform_device, but the sja1000 'object-oriented' approach forced me to
>>> dig some deeper, int the generic sja1000 code.
>>>
>>> Currently, my tests have been limited to activation/deactivation, since
>>> only these operations are affected.
>> The at91_can also use a platform function to enable/disable the
>> transceiver when the device is started or stopped. Therefore I would
>> prefer a similar approach using the name "transceiver_switch". What do
>> you think?
> Isn't transceiver_switch too specific? I meant, a user may also use this
> function to enable power supply for the controller itself. I would call
> it post_initialization or something else.

This should be controlled by suspend/resume. Nevertheless, if there are
other use cases, the name should be changed, of course.

Wolfgang.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to