Firefly Open Source Community

   Login   |   Register   |
New_Topic

SPI AIO-3128C

24

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
24
Posted at 6/8/2018 16:21:09     
Dear colleagues, I'm building a kernel driver to a device. This device has SPI interface.  I sent data by SPI with the last fireprime model but in this moment I can't send anything by SPI with  AIO board. DTS file are diferent and I don't have schematics to check conections. I have some questions.

1 Which dts file do I have to change? aio-3128c.dts or rk3128-fireprime-aio.dts
2. What do i have to do in this code to use SPI interface?

&spi0 {
    status = "okay";
    max-freq = <48000000>;

    dac0: dh2228@00 {
              status = "disabled";
              compatible = "rohm,dh2228fv";
              reg = <00>;
              spi-max-frequency = <100000>;
          };

    spi_wk2xxx: spi_wk2xxx@00{
                status = "okay";
                compatible = "firefly,spi-wk2xxx";
                reg = <0x00>;
                spi-max-frequency = <10000000>;
                reset-gpio = <&gpio3 GPIO_D3 GPIO_ACTIVE_HIGH>;
                irq-gpio = <&gpio1 GPIO_B4 IRQ_TYPE_EDGE_FALLING>;
                cs-gpio = <&gpio1 GPIO_B3 GPIO_ACTIVE_HIGH>;
                pwr-en-gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_HIGH>;
            };
};


Any suggestion? Thank you very much.
Reply

Use props Report

792

Credits

10

Prestige

10

Contribution

advanced

Rank: 4

Credits
792
Posted at 6/11/2018 14:22:14     
need to disabled spi_wk2xxx
Reply

Use props Report

24

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
24
Posted at 6/18/2018 15:57:49     
The problem was solved. I changed in 312x.dtsi pinctrl-0 = <&spi0_txd_mux0 &spi0_rxd_mux0 &spi0_clk_mux0 &spi0_cs0_mux0 &spi0_cs1_mux0>; to pinctrl-0 = <&spi0_txd_mux2 &spi0_rxd_mux2 &spi0_clk_mux2 &spi0_cs0_mux2>; and it's working.

        spi0: spi@20074000 {
                compatible = "rockchip,rockchip-spi";
                reg = <0x20074000 0x1000>;
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
                pinctrl-names = "default";
                //pinctrl-0 = <&spi0_txd_mux0 &spi0_rxd_mux0 &spi0_clk_mux0 &spi0_cs0_mux0 &spi0_cs1_mux0>;
                //pinctrl-0 = <&spi0_txd_mux1 &spi0_rxd_mux1 &spi0_clk_mux1 &spi0_cs0_mux1 &spi0_cs1_mux1>;
                pinctrl-0 = <&spi0_txd_mux2 &spi0_rxd_mux2 &spi0_clk_mux2 &spi0_cs0_mux2>;
                rockchip,spi-src-clk = <0>;
                num-cs = <2>;
                clocks =<&clk_spi0>, <&clk_gates7 12>;
                clock-names = "spi","pclk_spi0";
                dmas = <&pdma 8>, <&pdma 9>;
                #dma-cells = <2>;
                dma-names = "tx", "rx";
                status = "disabled";
        };

Thanks a lot.
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list