How to call "clock_control_off(const struct device *dev, clock_control_subsys_t sys)" on LFCLK

Hi,

If i need to call zephyr driver API clock_control_off( ) present in zephyr\include\drivers\clock_control.h on LFCLK.
How can I do it,.?

As an example, to populate the argument '*dev' in 

clock_control_off(const struct device *dev, clock_control_subsys_t sys)


Do I Use something like:

	const struct device *clock;
	
	clock = device_get_binding("CLOCK");

Will this give me dev struct to LFCLK..?
And how do I populate for:

clock_control_subsys_t sys

for LFCLK.

Kindly suggest.

Thanks,

Parents
  • Should i declare a new device in project's zephyr.dts file for LFCLK label..?
    As in:

    		clock: clock@40000000 {
    			compatible = "nordic,nrf-clock";
    			reg = < 0x40000000 0x1000 >;
    			interrupts = < 0x0 0x1 >;
    			status = "okay";
    			label = "LFCLK";
    		};


    What are the changes I need to consider to LFCLK device declaration as in above.?
    And how do I set the argument "clock_control_subsys_t sys" for LFCLK.?

Reply
  • Should i declare a new device in project's zephyr.dts file for LFCLK label..?
    As in:

    		clock: clock@40000000 {
    			compatible = "nordic,nrf-clock";
    			reg = < 0x40000000 0x1000 >;
    			interrupts = < 0x0 0x1 >;
    			status = "okay";
    			label = "LFCLK";
    		};


    What are the changes I need to consider to LFCLK device declaration as in above.?
    And how do I set the argument "clock_control_subsys_t sys" for LFCLK.?

Children
Related