This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTC_UIE_ON ioctl: Invalid argument, while running rtctest for ds3234 rtc.

Hi,

We are using beaglebone black based custom board,
We have interfaced external RTC with SPI0
SPI0 has two slaves attached to it one is EEPROM and other is RTC(DS3234).

RTC's interrupt pin is connected to gpio3_6, i have modified devicetree as follows,

spi0_pins: pinmux_spi0_pins{               
    pinctrl-single,pins = <
        0x150 0x30 /* spi0_sclk, INPUT_PULLUP | MODE0 */
        0x154 0x10 /* spi0_d0, OUTPUT_PULLUP | MODE0 */
        0x158 0x30 /* spi0_d1, INPUT_PULLUP | MODE0 */
        /* For EEPROM */
        0x15c 0x10 /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
        /* For RTC */
        0x160 0x10 /* spi0_cs1, OUTPUT_PULLUP | MODE0 */
    >;
};

	rtc_interrupt_gpio: rtc_interrupt_gpio{
		pinctrl-single,pins = <
			/* GPIO3_6 : Interrupt pin for RTC */
			0x18C (PIN_INPUT_PULLUP | MUX_MODE7)	/* i2c_scl.gpio3_6*/
		>;
	};

&spi0{
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins>;
    /* DO is MOSI, D1 is MISO */   
    ti,pindir-d0-out-d1-in = <1>;    
    spidev {
        compatible = "spidev";
        /* We use SPI CS 0; register the same */
        reg = <0>;
        spi-max-frequency = <1000000>;
        spi-cs-high;
        /* Operate with CPOL and CPHA set to zero */
        /* spi-cpol; */
        /* spi-cpha; */
    };
    rtc: ds3234@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "dallas,ds3234";
        reg = <1>; /* Indicated SPI chip select number*/
        spi-max-frequency = <1000000>;
		interrupts = <62>;
             /* spi-cpol; */
             /* spi-cpha; */
    };
    
};

When i cross compiled and run rtctest.c available at Documentation/rtc.txt i am getting following error.

# /rtctest /dev/rtc

                        RTC Driver Test Example.

RTC_UIE_ON ioctl: Invalid argument

I tried many combinations like giving interrupt-parent as "&gpio"  and "&intc" but with no help.

any suggestions/corrections/pointers please

Thank you,

Regards,
Ankur