162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright 2008 Openmoko, Inc. 462306a36Sopenharmony_ci * Copyright 2008 Simtec Electronics 562306a36Sopenharmony_ci * http://armlinux.simtec.co.uk/ 662306a36Sopenharmony_ci * Ben Dooks <ben@simtec.co.uk> 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * Samsung Platform - GPIO pin configuration helper definitions 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* This is meant for core cpu support, machine or other driver files 1262306a36Sopenharmony_ci * should not be including this header. 1362306a36Sopenharmony_ci */ 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#ifndef __PLAT_GPIO_CFG_HELPERS_H 1662306a36Sopenharmony_ci#define __PLAT_GPIO_CFG_HELPERS_H __FILE__ 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci/* As a note, all gpio configuration functions are entered exclusively, either 1962306a36Sopenharmony_ci * with the relevant lock held or the system prevented from doing anything else 2062306a36Sopenharmony_ci * by disabling interrupts. 2162306a36Sopenharmony_ci*/ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_cistatic inline int samsung_gpio_do_setcfg(struct samsung_gpio_chip *chip, 2462306a36Sopenharmony_ci unsigned int off, unsigned int config) 2562306a36Sopenharmony_ci{ 2662306a36Sopenharmony_ci return (chip->config->set_config)(chip, off, config); 2762306a36Sopenharmony_ci} 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_cistatic inline int samsung_gpio_do_setpull(struct samsung_gpio_chip *chip, 3062306a36Sopenharmony_ci unsigned int off, samsung_gpio_pull_t pull) 3162306a36Sopenharmony_ci{ 3262306a36Sopenharmony_ci return (chip->config->set_pull)(chip, off, pull); 3362306a36Sopenharmony_ci} 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#endif /* __PLAT_GPIO_CFG_HELPERS_H */ 36