Revert "BACKPORT: FROMLIST: pwm: Add support for different PWM output types"

This reverts commit 106a4b85e0.

This is a failed upstream attempt.  The patch itself is 3.5 years old
and the last known upstream submission was over 18 months ago, which
was NACK'ed.  The code also appears to be unused.

Suggested-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I8e56b2557e47b1a5a5323ec04d1071fae85ecb4b
This commit is contained in:
Lee Jones
2021-05-26 15:20:13 +01:00
parent 586c68b5c5
commit 2aaddfbdeb
3 changed files with 0 additions and 74 deletions

View File

@@ -289,7 +289,6 @@ int pwmchip_add(struct pwm_chip *chip)
pwm->chip = chip;
pwm->pwm = chip->base + i;
pwm->hwpwm = i;
pwm->state.output_type = PWM_OUTPUT_FIXED;
radix_tree_insert(&pwm_tree, pwm->pwm, pwm);
}

View File

@@ -215,35 +215,11 @@ static ssize_t capture_show(struct device *child,
return sprintf(buf, "%u %u\n", result.period, result.duty_cycle);
}
static ssize_t output_type_show(struct device *child,
struct device_attribute *attr,
char *buf)
{
const struct pwm_device *pwm = child_to_pwm_device(child);
const char *output_type = "unknown";
struct pwm_state state;
pwm_get_state(pwm, &state);
switch (state.output_type) {
case PWM_OUTPUT_FIXED:
output_type = "fixed";
break;
case PWM_OUTPUT_MODULATED:
output_type = "modulated";
break;
default:
break;
}
return snprintf(buf, PAGE_SIZE, "%s\n", output_type);
}
static DEVICE_ATTR_RW(period);
static DEVICE_ATTR_RW(duty_cycle);
static DEVICE_ATTR_RW(enable);
static DEVICE_ATTR_RW(polarity);
static DEVICE_ATTR_RO(capture);
static DEVICE_ATTR_RO(output_type);
static struct attribute *pwm_attrs[] = {
&dev_attr_period.attr,
@@ -251,7 +227,6 @@ static struct attribute *pwm_attrs[] = {
&dev_attr_enable.attr,
&dev_attr_polarity.attr,
&dev_attr_capture.attr,
&dev_attr_output_type.attr,
NULL
};
ATTRIBUTE_GROUPS(pwm);

View File

@@ -48,17 +48,6 @@ enum {
PWMF_EXPORTED = 1 << 1,
};
/**
* enum pwm_output_type - output type of the PWM signal
* @PWM_OUTPUT_FIXED: PWM output is fixed until a change request
* @PWM_OUTPUT_MODULATED: PWM output is modulated in hardware
* autonomously with a predefined pattern
*/
enum pwm_output_type {
PWM_OUTPUT_FIXED = 1 << 0,
PWM_OUTPUT_MODULATED = 1 << 1,
};
/*
* struct pwm_state - state of a PWM channel
* @period: PWM period (in nanoseconds)
@@ -70,7 +59,6 @@ struct pwm_state {
u64 period;
u64 duty_cycle;
enum pwm_polarity polarity;
enum pwm_output_type output_type;
bool enabled;
};
@@ -163,16 +151,6 @@ static inline enum pwm_polarity pwm_get_polarity(const struct pwm_device *pwm)
return state.polarity;
}
static inline enum pwm_output_type pwm_get_output_type(
const struct pwm_device *pwm)
{
struct pwm_state state;
pwm_get_state(pwm, &state);
return state.output_type;
}
static inline void pwm_get_args(const struct pwm_device *pwm,
struct pwm_args *args)
{
@@ -276,7 +254,6 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle,
* @get_state: get the current PWM state. This function is only
* called once per PWM device when the PWM chip is
* registered.
* @get_output_type_supported: get the supported output type of this PWM
* @owner: helps prevent removal of modules exporting active PWMs
* @config: configure duty cycles and period length for this PWM
* @set_polarity: configure the polarity of this PWM
@@ -292,8 +269,6 @@ struct pwm_ops {
const struct pwm_state *state);
void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_state *state);
int (*get_output_type_supported)(struct pwm_chip *chip,
struct pwm_device *pwm);
struct module *owner;
/* Only used by legacy drivers */
@@ -348,24 +323,6 @@ void pwm_free(struct pwm_device *pwm);
int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state);
int pwm_adjust_config(struct pwm_device *pwm);
/**
* pwm_get_output_type_supported() - obtain output type of a PWM device.
* @pwm: PWM device
*
* Returns: output type supported by the PWM device
*/
static inline int pwm_get_output_type_supported(struct pwm_device *pwm)
{
if (!pwm)
return -EINVAL;
if (pwm->chip->ops->get_output_type_supported)
return pwm->chip->ops->get_output_type_supported(pwm->chip,
pwm);
return PWM_OUTPUT_FIXED;
}
/**
* pwm_config() - change a PWM device configuration
* @pwm: PWM device
@@ -482,11 +439,6 @@ static inline int pwm_adjust_config(struct pwm_device *pwm)
return -ENOTSUPP;
}
static inline int pwm_get_output_type_supported(struct pwm_device *pwm)
{
return -EINVAL;
}
static inline int pwm_config(struct pwm_device *pwm, int duty_ns,
int period_ns)
{