1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-04 18:22:02 +02:00
Files
u-boot-megous/include/pwm.h
Ondrej Jirman ba8c26ce40 initial
2019-03-04 15:37:41 +01:00

58 lines
1.3 KiB
C
Executable File

/*
* header file for pwm driver.
*
* Copyright (c) 2011 samsung electronics
* Donghwa Lee <dh09.lee@samsung.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef _pwm_h_
#define _pwm_h_
#if 0
int pwm_init (int pwm_id, int div, int invert);
int pwm_config (int pwm_id, int duty_ns, int period_ns);
int pwm_enable (int pwm_id);
void pwm_disable (int pwm_id);
#endif
enum pwm_polarity {
PWM_POLARITY_NORMAL,
PWM_POLARITY_INVERSED,
};
struct pwm_device {
const char *label;
unsigned long flags;
unsigned int hwpwm;
unsigned int pwm;
struct pwm_chip *chip;
void *chip_data;
unsigned int period; /* in nanoseconds */
};
struct pwm_chip {
struct device *dev;
struct list_head list;
const struct pwm_ops *ops;
int base;
unsigned int npwm;
struct pwm_device *pwms;
//struct pwm_device * (*of_xlate)(struct pwm_chip *pc,
// const struct of_phandle_args *args);
unsigned int of_pwm_n_cells;
bool can_sleep;
};
/* it mapping uboot2014 verison.now just only SUN50IW1P1 use this function,*/
int pwm_set_polarity(int pwm, enum pwm_polarity polarity);
int pwm_config (int pwm, int duty_ns, int period_ns);
int pwm_enable (int pwm);
int pwm_disable (int pwm);
int pwm_init (void);
int pwm_request(int pwm, const char *label);
#endif /* _pwm_h_ */