All of lore.kernel.org
 help / color / mirror / Atom feed
* Ad5064 SPI probe not called
@ 2016-11-30  6:32 Akshay Vijapur
  2016-11-30 12:31 ` Slawomir Stepien
  0 siblings, 1 reply; 4+ messages in thread
From: Akshay Vijapur @ 2016-11-30  6:32 UTC (permalink / raw)
  To: linux-iio

Respected sir ,

I am using a DAC device with raspberry pi board connected via SPI , So
i am using ad5064 driver in the kernel .

 I am seeing that spi probe is not being called . after days of
researching i got to know that i need to add the device tree for this
driver . since i am new to the driver development and usage i tried to
create device tree like this


/dts-v1/;
/plugin/;

/ {

        compatible = "brcm,bcm2708";

        fragment@0 {
                target = <&spidev0>;
                __overlay__ {
                         status = "okay";
                };
        };


        fragment@2 {
                target = <&spidev0>;
                __overlay__ {
                 #address-cells = <1>;
                 #size-cells = <0>;

                compatible = "spidev";
        ad5064@0 {
                     compatible = "adi,ad5064";
                     reg = <1>;
                     spi-max-frequency = <1000000>;
                     spi-cpha=<1>;
                     spi-cpol=<1>;
                     vcc-supply = <&vcc_io>;
              };
        regulators {
        vcc_io: regulator@0 {
               regulator-name = "vcc_io";
          regulator-min-microvolt = <2500000>;
        regulator-max-microvolt = <2500000>;
        regulator-boot-on;
                        };


since i am using raspberry 3 board i tried to add some info about spi
in the dts file , But still spi probe is not happing . so Could you
please help me by specifying how to use the device driver with
raspberry pi 3 board with linux kernel 4.4 in it .

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ad5064 SPI probe not called
  2016-11-30  6:32 Ad5064 SPI probe not called Akshay Vijapur
@ 2016-11-30 12:31 ` Slawomir Stepien
  2016-11-30 13:53   ` Akshay Vijapur
  0 siblings, 1 reply; 4+ messages in thread
From: Slawomir Stepien @ 2016-11-30 12:31 UTC (permalink / raw)
  To: Akshay Vijapur; +Cc: linux-iio

On Nov 30, 2016 12:02, Akshay Vijapur wrote:
> Respected sir ,
> 
> I am using a DAC device with raspberry pi board connected via SPI , So
> i am using ad5064 driver in the kernel .
> 
>  I am seeing that spi probe is not being called . after days of
> researching i got to know that i need to add the device tree for this
> driver . since i am new to the driver development and usage i tried to
> create device tree like this

Yes, the overlay.

> 
> /dts-v1/;
> /plugin/;
> 
> / {
> 
>         compatible = "brcm,bcm2708";
> 
>         fragment@0 {
>                 target = <&spidev0>;
>                 __overlay__ {
>                          status = "okay";

I think this is not what you want. You should disable the spidev driver, so the
AD5064 will be able to use SPI lines.

>                 };
>         };
> 
> 
>         fragment@2 {
>                 target = <&spidev0>;

When adding new device on SPI line, you should add it to the spi target.

>                 (...)
> 
> since i am using raspberry 3 board i tried to add some info about spi
> in the dts file , But still spi probe is not happing . so Could you
> please help me by specifying how to use the device driver with
> raspberry pi 3 board with linux kernel 4.4 in it .

Guys on rpi forum are quite helpful with solving that kind of problems.
Nevertheless please analyze this (it is for different driver, but you should get
the idea):

/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

        fragment@0 {
                target = <&spi0>;
                __overlay__ {
                        status = "okay";
                };
        };

        fragment@1 {
                target = <&spidev0>;
                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@2 {
                target = <&spidev1>;
                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@3 {
                target = <&spi0>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;

                        mcp4131: mcp4131@0 {
                                compatible = "microchip,mcp4162-502";
                                reg = <0>;
                                spi-max-frequency = <10000>;
                        };
                };
        };
};

-- 
Slawomir Stepien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ad5064 SPI probe not called
  2016-11-30 12:31 ` Slawomir Stepien
@ 2016-11-30 13:53   ` Akshay Vijapur
  2016-11-30 17:59     ` Slawomir Stepien
  0 siblings, 1 reply; 4+ messages in thread
From: Akshay Vijapur @ 2016-11-30 13:53 UTC (permalink / raw)
  To: Slawomir Stepien; +Cc: linux-iio

But sir i  want to enable the ad5604 Digital to analog sensor , where
to add the sensor information

On Wed, Nov 30, 2016 at 6:01 PM, Slawomir Stepien <sst@poczta.fm> wrote:
> On Nov 30, 2016 12:02, Akshay Vijapur wrote:
>> Respected sir ,
>>
>> I am using a DAC device with raspberry pi board connected via SPI , So
>> i am using ad5064 driver in the kernel .
>>
>>  I am seeing that spi probe is not being called . after days of
>> researching i got to know that i need to add the device tree for this
>> driver . since i am new to the driver development and usage i tried to
>> create device tree like this
>
> Yes, the overlay.
>
>>
>> /dts-v1/;
>> /plugin/;
>>
>> / {
>>
>>         compatible = "brcm,bcm2708";
>>
>>         fragment@0 {
>>                 target = <&spidev0>;
>>                 __overlay__ {
>>                          status = "okay";
>
> I think this is not what you want. You should disable the spidev driver, so the
> AD5064 will be able to use SPI lines.
>
>>                 };
>>         };
>>
>>
>>         fragment@2 {
>>                 target = <&spidev0>;
>
> When adding new device on SPI line, you should add it to the spi target.
>
>>                 (...)
>>
>> since i am using raspberry 3 board i tried to add some info about spi
>> in the dts file , But still spi probe is not happing . so Could you
>> please help me by specifying how to use the device driver with
>> raspberry pi 3 board with linux kernel 4.4 in it .
>
> Guys on rpi forum are quite helpful with solving that kind of problems.
> Nevertheless please analyze this (it is for different driver, but you should get
> the idea):
>
> /dts-v1/;
> /plugin/;
>
> / {
>         compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
>
>         fragment@0 {
>                 target = <&spi0>;
>                 __overlay__ {
>                         status = "okay";
>                 };
>         };
>
>         fragment@1 {
>                 target = <&spidev0>;
>                 __overlay__ {
>                         status = "disabled";
>                 };
>         };
>
>         fragment@2 {
>                 target = <&spidev1>;
>                 __overlay__ {
>                         status = "disabled";
>                 };
>         };
>
>         fragment@3 {
>                 target = <&spi0>;
>                 __overlay__ {
>                         #address-cells = <1>;
>                         #size-cells = <0>;
>
>                         mcp4131: mcp4131@0 {
>                                 compatible = "microchip,mcp4162-502";
>                                 reg = <0>;
>                                 spi-max-frequency = <10000>;
>                         };
>                 };
>         };
> };
>
> --
> Slawomir Stepien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ad5064 SPI probe not called
  2016-11-30 13:53   ` Akshay Vijapur
@ 2016-11-30 17:59     ` Slawomir Stepien
  0 siblings, 0 replies; 4+ messages in thread
From: Slawomir Stepien @ 2016-11-30 17:59 UTC (permalink / raw)
  To: Akshay Vijapur; +Cc: linux-iio

On Nov 30, 2016 19:23, Akshay Vijapur wrote:
> But sir i  want to enable the ad5604 Digital to analog sensor , where
> to add the sensor information

>From what I can see this driver is not device tree friendly, so you would not be
able to load it using dt overlay.

As I understand you will have to change the board description c file for rpi3.
But this file does not exist for rpi3. So changing the driver to use device tree
is the only option here as far as I know...

-- 
Slawomir Stepien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-30 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30  6:32 Ad5064 SPI probe not called Akshay Vijapur
2016-11-30 12:31 ` Slawomir Stepien
2016-11-30 13:53   ` Akshay Vijapur
2016-11-30 17:59     ` Slawomir Stepien

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.