Skip to content

Commit 101acad

Browse files
ukleineknunojsa
authored andcommitted
pwm: Drop changes related to pwm_capture() compared to mainline
The changes compared to mainline don't introduce a single user of pwm capture support. So drop the changes introduced in commit 2a1b16e ("pwm: Convert period and duty cycle to u64") and the followup fix 16d0dd9 ("pwm: pwm-sti: fix 64bit division on 32bit architectures") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
1 parent 4246bc9 commit 101acad

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

drivers/pwm/pwm-sti.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ static int sti_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
371371
effective_ticks = clk_get_rate(pc->cpt_clk);
372372

373373
result->period = (high + low) * NSEC_PER_SEC;
374-
result->period = div_u64(result->period, effective_ticks);
374+
result->period /= effective_ticks;
375375

376376
result->duty_cycle = high * NSEC_PER_SEC;
377-
result->duty_cycle = div_u64(result->duty_cycle, effective_ticks);
377+
result->duty_cycle /= effective_ticks;
378378

379379
break;
380380

drivers/pwm/sysfs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ static ssize_t capture_show(struct device *child,
247247
if (ret)
248248
return ret;
249249

250-
return sysfs_emit(buf, "%llu %llu %llu\n", result.period,
251-
result.duty_cycle, result.phase);
250+
return sysfs_emit(buf, "%u %u\n", result.period, result.duty_cycle);
252251
}
253252

254253
static DEVICE_ATTR_RW(period);

include/linux/pwm.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,8 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle,
274274
* @duty_cycle: duty cycle of the PWM signal (in nanoseconds)
275275
*/
276276
struct pwm_capture {
277-
u64 period;
278-
u64 duty_cycle;
279-
u64 phase;
277+
unsigned int period;
278+
unsigned int duty_cycle;
280279
};
281280

282281
/**

0 commit comments

Comments
 (0)