AnsweredAssumed Answered

add sysfs trigger

Question asked by Prepod on May 24, 2012
Latest reply on May 30, 2012 by Prepod

Hi All!

I have a problems with add a new devices to the Linux system based on the BF532.

Now I want to add iio-sysfs-trigger for generate the clock for external IIO ADC.

I need to make the follow steps(as I see in the http://wiki.analog.com/software/linux/d ... trig-sysfs site):

1) Add "SYSFS trigger" in the kernel configuration by the "menuconfig"

2) Add follow code to the board device file (*.c) :

 

static struct platform_deviceiio_sysfs_trigger = {
   .name      = "iio_sysfs_trigger",
   .id      = 0,
   .dev = {
      .platform_data = NULL,
   },
};

 

static struct platform_device *board_devices[] __initdata = {
   &iio_sysfs_trigger,
};

 

static int __init board_init(void)
{
   [--snip--]

 

   platform_add_devices(board_devices, ARRAY_SIZE(board_devices));

 

   [--snip--]

 

   return 0;
}

 

 

 

But this is only example for abstract platform.

How I should change this code for BF532 for correct work the sysfs-trigger.

I mean what declarated function(for replace "platform_add_devices()" in example) and struct(for replace "platform device" in example) I should use for add new device to the system.

 

I think asnwer will helpfull for all peoples who has a problem to add any new devices to the platform.

Outcomes