Set pulldown on sama5d36 input pin in dts file

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am trying to change several pins from pull up to pull down by doing the following in the dts file:

 

	ahb {
	    apb {

	        ...

			pinctrl@fffff200 {
				board {
					pinctrl_inputs: inputs_pins {
						atmel,pins =
							<AT91_PIOC 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 27 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOA 30 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOA 31 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};
				};
			};
	    };
	};

	myInputs {
		compatible = "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_inputs>;
	};

 

But it doesn't seem to make a difference, any insight on what I am missing?

Last Edited: Wed. Feb 14, 2018 - 06:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just wanted to add that I do see PULL_DOWN in /sys/kernel/debug/pinctrl/ahb:apb:pinctrl@fffff200/pinconf-pins:

 

pin 30 (pioA30): PULL_DOWN|DRIVE_STRENGTH_MED

pin 31 (pioA31): PULL_DOWN|DRIVE_STRENGTH_MED

pin 90 (pioC26): PULL_DOWN|DRIVE_STRENGTH_MED

pin 91 (pioC27): PULL_DOWN|DRIVE_STRENGTH_MED

 

but /sys/class/gpio/pioA30 still shows a value of 1:

direction -> in

active_low -> 0

value -> 1

 

Same for the other pins (PioA31, pioC26, pioC27).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not getting much of a response so I am going to try posting this question in the Microchip forum:  http://www.at91.com/viewtopic.php?f=12&t=26523

 

Look there if I ever get a resolution.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Figured it out, just needed to get the SPI dts settings correct, turn off all peripherals, realize that some pins are pulled up in hardware, including some LED settings and I can down get things to work.  Here is my final test setup showing a bunch of pins I was able to pull down.

 

			spi1: spi@f8008000 {
				cs-gpios = <0>, <0>, <0>, <0>;
				pinctrl-0 = <&pinctrl_spi1 &pinctrl_ble_irq>;
				dmas = <0>, <0>;
				status = "okay";
				spidev@0 {
					compatible = "semtech,sx1301";
					spi-max-frequency = <10000000>;
					reg = <0>;
				};
			};
			
...

					pinctrl_ble_irq: ble_irq {
						atmel,pins =
							<AT91_PIOB 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 20 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 22 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 16 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 23 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};