On Thursday 19 February 2015 08:44:30 Kuninori Morimoto wrote:
I tried this idea before, but I got issues on DT. I forgot detail, but if my memory was correct, it was dev->of_node.
sound { ... ssi3: ssi@3 { interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>; dma-names = "rx", "tx", "rxu", "txu"; }; }
dma_request_slave_channel_compat() requests "dev", and this dev means sound here.
This "dev" will be used in dma_request_slave_channel_reason() and, it uses "dev->of_node". But, here, "dev->of_node" means "sound" here.
If I use your style, I need to do like below, or I need new compat function which can select of_node.
tmp_node = dev->of_node; dev->of_node = subnode; dma_request_slave_channel_compat(... dev ...); dev->of_node = tmp_node;
Ah, I see. I think the best way around this then would be to use of_dma_request_slave_channel(), which takes a device node pointer and a name argument as you need here.
Doing this will require marking that function as EXPORT_SYMBOL_GPL(), but I see no problem with that.
I see you use dma_request_slave_channel_compat here. Does that mean you have to support boards with this sound device that do not use DT? If so, you will also have to split the request function like
if (of_node) chan = of_dma_request_slave_channel(of_node, "rx"); else chan = dma_request_channel(mask, filter, arg);
Arnd