SPI spi_sync error

For AGX Xavier, which two files should I replace? or, How can I know the file name ?

And next, how to use gpio step by step? We use gpio 6 as output gpio. How to use it in kernel code?

It’s could be the tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg to replace. Should be able to see it in the flash message.

Have a check below document for GPIO API.

We use gpio6 as output gpio. And I checked Jetson_AGX_Series_DevKit_Pinmux_Configuration_Template.xlsm, pin E59 is gpio6 already.

int gpio_request(unsigned gpio, const char *label)
{
struct gpio_desc *desc = gpio_to_desc(gpio);

/* Compatibility: assume unavailable "valid" GPIOs will appear later */
if (!desc && gpio_is_valid(gpio))
	return -EPROBE_DEFER;

return gpiod_request(desc, label);

}
In gpio_request function, if parameter gpio is set to 6, gpio_to_desc returns NULL.
How to set parameter gpio for function gpio_request(unsigned gpio, const char *label)? Why does gpio_to_desc return NULL?

We use gpio 6.
In pin mux table,
GPIO06 E59 CAN0_EN GPIO3_PAA.05 vddio_ao_hv CZ 19.5K +/- 35% z GPIO3_PAA.05 Output Drive 0 PEX_REFCLK_SEL CVB UPHY reference clock select GPIO

customer usage is GPIO3_PAA.05 , but I can not find TEGRA194_MAIN_GPIO_PORT_AA in file tegra194-gpio.h, why?

I have resolved the problem by myself. Gpio 6 is a aon gpio. Thanks

Where could I see the flash message? Which file should be replaced by the generated pad.cfg?

When you flash the image by flash.sh command.
The flash.sh was gen by the sdkmanager in your host.