示例#1
0
inline void s3cfb_spi_set_lcd_data(int ch)
{
	gpio_direction_output(S5P_FB_SPI_CLK(ch), 1);
	gpio_direction_output(S5P_FB_SPI_MOSI(ch), 1);
	gpio_direction_output(S5P_FB_SPI_nSS(ch), 1);

	gpio_pullup(S5P_FB_SPI_CLK(ch), S5P_GPIO_PUD_DISABLE);
	gpio_pullup(S5P_FB_SPI_MOSI(ch), S5P_GPIO_PUD_DISABLE);
	gpio_pullup(S5P_FB_SPI_nSS(ch), S5P_GPIO_PUD_DISABLE);
}
inline void s3cfb_spi_set_lcd_data(int ch)
{
        gpio_direction_output(S5P_FB_SPI_CLK(ch), 1);
        gpio_direction_output(S5P_FB_SPI_MOSI(ch), 1);
        gpio_direction_output(S5P_FB_SPI_CS(ch), 1);

        s3c_gpio_setpull(S5P_FB_SPI_CLK(ch), S3C_GPIO_PULL_NONE);
        s3c_gpio_setpull(S5P_FB_SPI_MOSI(ch), S3C_GPIO_PULL_NONE);
        s3c_gpio_setpull(S5P_FB_SPI_CS(ch), S3C_GPIO_PULL_NONE);
}
int s3cfb_spi_gpio_request(int ch)
{
        int err = 0;

        if (gpio_is_valid(S5P_FB_SPI_CLK(ch))) {
                err = gpio_request(S5P_FB_SPI_CLK(ch), "GPB");

                if (err)
                        goto err_clk;
        } else {
                err = 1;
                goto err_clk;
        }

        if (gpio_is_valid(S5P_FB_SPI_MOSI(ch))) {
                err = gpio_request(S5P_FB_SPI_MOSI(ch), "GPB");

                if (err)
                        goto err_mosi;
        } else {
                err = 1;
                goto err_mosi;
        }

        if (gpio_is_valid(S5P_FB_SPI_CS(ch))) {
                err = gpio_request(S5P_FB_SPI_CS(ch), "GPB");

                if (err)
                        goto err_cs;
        } else {
                err = 1;
                goto err_cs;
        }

err_cs:
        gpio_free(S5P_FB_SPI_MOSI(ch));

err_mosi:
               gpio_free(S5P_FB_SPI_CLK(ch));

err_clk:
        return err;

}
示例#4
0
inline void s3cfb_spi_lcd_dclk(int ch, int value)
{
	gpio_set_value(S5P_FB_SPI_CLK(ch), value);
}
void s3cfb_spi_gpio_free(int ch)
{
        gpio_free(S5P_FB_SPI_CLK(ch));
        gpio_free(S5P_FB_SPI_MOSI(ch));
        gpio_free(S5P_FB_SPI_CS(ch));
}