Hi,
I want to cntrol ad4350 through user space in linux. I am having processor sdk linux for am5718idk board version 06.03.00.
The driver information provided by analof devices is asking us to do.
platform device initialization
struct adf4350_platform_data { unsigned long clkin; unsigned long channel_spacing; unsigned long long power_up_frequency; unsigned short ref_div_factor; /* 10-bit R counter */ bool ref_doubler_en; bool ref_div2_en; unsigned r2_user_settings; unsigned r3_user_settings; unsigned r4_user_settings; int gpio_lock_detect; };
Declaring SPI slave devices
static struct spi_board_info board_spi_board_info[] __initdata = { #if defined(CONFIG_ADF4350) || defined(CONFIG_ADF4350_MODULE) { .modalias = "adf4350", .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */ .platform_data = NULL, /* No spi_driver specific config */ .mode = SPI_MODE_0, }, #endif };
static int __init board_init(void) { [--snip--] spi_register_board_info(board_spi_board_info, ARRAY_SIZE(board_spi_board_info)); [--snip--] return 0; } arch_initcall(board_init);
Devicetree bindings
Example: lo_pll0_rx_adf4351: adf4351-rx-lpc@4 { compatible = "adi,adf4351"; reg = <4>; spi-max-frequency = <10000000>; clocks = <&clk0_ad9523 9>; clock-names = "clkin"; adi,channel-spacing = <10000>; adi,power-up-frequency = <2400000000>; adi,phase-detector-polarity-positive-enable; adi,charge-pump-current = <2500>; adi,output-power = <3>; adi,mute-till-lock-enable; };
Adding Linux driver support
Linux Kernel Configuration Device Drivers ---> <*> Industrial I/O support ---> --- Industrial I/O support -*- Enable ring buffer support within IIO -*- Industrial I/O lock free software ring -*- Enable triggered sampling support *** Phase-Locked Loop (PLL) frequency synthesizers *** [--snip--] <*> Analog Devices ADF4350/ADF4351 Wideband Synthesizers [--snip--]
But in AM5718idk where to do that. I am not able to get where to do all above modifications. Kindly help me out.
I think I need to modify the am57xx-idk-commom.dtsi file by adding a node mcspi2. What should be the parameters for Mcspi2 node to control ad4350 synthesizer.
The option is not coming in menuconfig to select AD4350 synthesizer.