Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
obj-$(CONFIG_MTK_ADSP_IPC) += mtk-adsp-ipc.o
obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
obj-$(CONFIG_FIRMWARE_RP1) += rp1.o
obj-$(CONFIG_FIRMWARE_RP1) += rp1-fw.o
obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
obj-$(CONFIG_QCOM_SCM) += qcom-scm.o
qcom-scm-objs += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions drivers/iio/adc/ad4134.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,3 +566,4 @@ module_exit(ad4134_exit);
MODULE_AUTHOR("Cosmin Tanislav <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD4134 SPI driver");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad4630.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,3 +1683,4 @@ MODULE_AUTHOR("Marcelo Schmitt <[email protected]>");
MODULE_AUTHOR("Liviu Adace <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD4630 and ADAQ4224 ADC family driver");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad7768-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,3 +966,4 @@ module_spi_driver(ad7768_driver);
MODULE_AUTHOR("Stefan Popa <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD7768-1 ADC driver");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad7768.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,3 +883,4 @@ module_spi_driver(ad7768_driver);
MODULE_AUTHOR("Stefan Popa <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD7768 ADC");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad7944.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
const char *name;
const struct ad7944_timing_spec *timing_spec;
const struct iio_chan_spec channels[2];
const struct iio_chan_spec offload_channels[1];

Check warning on line 123 in drivers/iio/adc/ad7944.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 28-44 WARNING use flexible-array member instead (https //www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
};

/*
Expand Down Expand Up @@ -788,3 +788,4 @@
MODULE_AUTHOR("David Lechner <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD7944 PulSAR ADC family driver");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,3 +788,4 @@ module_platform_driver(adc_driver);
MODULE_AUTHOR("Dragos Bogdan <[email protected]>");
MODULE_DESCRIPTION("Analog Devices ADC");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ad_pulsar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,3 +1010,4 @@ module_spi_driver(ad_pulsar_driver);
MODULE_AUTHOR("Sergiu Cuciurean <[email protected]>");
MODULE_DESCRIPTION("Analog Devices PulSAR ADC family driver");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/admc_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
static struct platform_driver axiadc_driver = {
.driver = {
.name = KBUILD_MODNAME,
.owner = THIS_MODULE,

Check warning on line 219 in drivers/iio/adc/admc_adc.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 3-8 No need to set .owner here. The core will do it.
.of_match_table = axiadc_of_match,
},
.probe = axiadc_probe,
Expand All @@ -227,3 +227,4 @@
MODULE_AUTHOR("Dragos Bogdan <[email protected]>");
MODULE_DESCRIPTION("Analog Devices MC-ADC");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/admc_speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
unsigned num_channels;
const unsigned long *scan_masks;
unsigned int max_rate;
struct iio_chan_spec channel[1];

Check warning on line 64 in drivers/iio/adc/admc_speed.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 23-30 WARNING use flexible-array member instead (https //www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
};

struct axiadc_state {
Expand Down Expand Up @@ -211,7 +211,7 @@
static struct platform_driver axiadc_of_driver = {
.driver = {
.name = KBUILD_MODNAME,
.owner = THIS_MODULE,

Check warning on line 214 in drivers/iio/adc/admc_speed.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 3-8 No need to set .owner here. The core will do it.
.of_match_table = axiadc_of_match,
},
.probe = axiadc_probe,
Expand All @@ -222,3 +222,4 @@
MODULE_AUTHOR("Dragos Bogdan <[email protected]>");
MODULE_DESCRIPTION("Analog Devices MC-Speed");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/cf_axi_adc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@
static struct platform_driver axiadc_driver = {
.driver = {
.name = KBUILD_MODNAME,
.owner = THIS_MODULE,

Check warning on line 1232 in drivers/iio/adc/cf_axi_adc_core.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 3-8 No need to set .owner here. The core will do it.
.of_match_table = axiadc_of_match,
},
.probe = axiadc_probe,
Expand All @@ -1240,3 +1240,4 @@
MODULE_AUTHOR("Michael Hennerich <[email protected]>");
MODULE_DESCRIPTION("Analog Devices ADI-AIM");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/adc/ltc2387.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
temp = regulator_get_voltage(ltc->vref);
if (temp < 0)

Check warning on line 245 in drivers/iio/adc/ltc2387.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 6-10 WARNING Unsigned expression compared with zero temp < 0
return temp;

*val = (temp * 2) / 1000;
Expand Down Expand Up @@ -417,3 +417,4 @@
MODULE_AUTHOR("Sergiu Cuciurean <[email protected]>");
MODULE_DESCRIPTION("Linear Technology LTC2387 ADC");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/dac/ad5791.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,3 +661,4 @@ module_spi_driver(ad5791_driver);
MODULE_AUTHOR("Michael Hennerich <[email protected]>");
MODULE_DESCRIPTION("Analog Devices AD5760/AD5780/AD5781/AD5790/AD5791 DAC");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/frequency/cf_axi_dds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,7 @@
static struct platform_driver cf_axi_dds_driver = {
.driver = {
.name = "cf_axi_dds",
.owner = THIS_MODULE,

Check warning on line 2667 in drivers/iio/frequency/cf_axi_dds.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 3-8 No need to set .owner here. The core will do it.
.of_match_table = cf_axi_dds_of_match,
},
.probe = cf_axi_dds_probe,
Expand All @@ -2674,3 +2674,4 @@
MODULE_AUTHOR("Michael Hennerich <[email protected]>");
MODULE_DESCRIPTION("Analog Devices DDS");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
1 change: 1 addition & 0 deletions drivers/iio/frequency/m2k-dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@
static struct platform_driver m2k_dac_driver = {
.driver = {
.name = "m2k_dac",
.owner = THIS_MODULE,

Check warning on line 854 in drivers/iio/frequency/m2k-dac.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 3-8 No need to set .owner here. The core will do it.
.of_match_table = m2k_dac_of_match,
},
.probe = m2k_dac_probe,
Expand All @@ -861,3 +861,4 @@
MODULE_AUTHOR("Lars-Peter Clausen <[email protected]>");
MODULE_DESCRIPTION("Analog Devices M2K DAC driver");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
2 changes: 1 addition & 1 deletion drivers/iio/imu/adis16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,5 +1154,5 @@ MODULE_AUTHOR("Ramona Gradinariu <[email protected]>");
MODULE_AUTHOR("Antoniu Miclaus <[email protected]>");
MODULE_AUTHOR("Robert Budai <[email protected]>");
MODULE_DESCRIPTION("Analog Devices ADIS16550 IMU driver");
MODULE_IMPORT_NS("IIO_ADISLIB");
MODULE_IMPORT_NS(IIO_ADISLIB);
MODULE_LICENSE("GPL");
1 change: 1 addition & 0 deletions drivers/iio/logic/m2k-logic-analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,3 +1163,4 @@ module_platform_driver(m2k_la_driver);
MODULE_AUTHOR("");
MODULE_DESCRIPTION("");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(IIO_DMAENGINE_BUFFER);
52 changes: 27 additions & 25 deletions drivers/pwm/pwm-pio-rp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
uint sm;
uint offset;
uint gpio;
uint32_t period; /* In SM cycles */
uint32_t duty_cycle; /* In SM cycles */
uint32_t period; /* In SM cycles */

Check warning on line 33 in drivers/pwm/pwm-pio-rp1.c

View workflow job for this annotation

GitHub Actions / checks / checks

checkpatch: Prefer kernel type 'u32' over 'uint32_t' + uint32_t period; /* In SM cycles */
uint32_t duty_cycle; /* In SM cycles */

Check warning on line 34 in drivers/pwm/pwm-pio-rp1.c

View workflow job for this annotation

GitHub Actions / checks / checks

checkpatch: Prefer kernel type 'u32' over 'uint32_t' + uint32_t duty_cycle; /* In SM cycles */
enum pwm_polarity polarity;
bool enabled;
};
Expand All @@ -42,15 +42,15 @@
#define pwm_loop_ticks 3

static const uint16_t pwm_program_instructions[] = {
// .wrap_target
// .wrap_target
0x9080, // 0: pull noblock side 0
0xa027, // 1: mov x, osr
0xa046, // 2: mov y, isr
0x00a5, // 3: jmp x != y, 5
0x1806, // 4: jmp 6 side 1
0xa042, // 5: nop
0x0083, // 6: jmp y--, 3
// .wrap
// .wrap
};

static const struct pio_program pwm_program = {
Expand Down Expand Up @@ -96,7 +96,7 @@
}

static int pwm_pio_rp1_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
const struct pwm_state *state)
{
struct pwm_pio_rp1 *ppwm = container_of(chip, struct pwm_pio_rp1, chip);
uint32_t new_duty_cycle;
Expand Down Expand Up @@ -131,8 +131,10 @@

if (state->polarity != ppwm->polarity) {
pio_gpio_set_outover(ppwm->pio, ppwm->gpio,
(state->polarity == PWM_POLARITY_INVERSED) ?
GPIO_OVERRIDE_INVERT : GPIO_OVERRIDE_NORMAL);
(state->polarity ==
PWM_POLARITY_INVERSED) ?
GPIO_OVERRIDE_INVERT :
GPIO_OVERRIDE_NORMAL);
ppwm->polarity = state->polarity;
}

Expand All @@ -159,11 +161,11 @@
struct pwm_chip *chip;
bool is_rp1;

ppwm = devm_kzalloc(dev, sizeof(*ppwm), GFP_KERNEL);
if (IS_ERR(ppwm))
return PTR_ERR(ppwm);
chip = devm_pwmchip_alloc(dev, 1, sizeof(*ppwm));
if (IS_ERR(chip))
return PTR_ERR(chip);

chip = &ppwm->chip;
ppwm = pwmchip_get_drvdata(chip);

mutex_init(&ppwm->mutex);

Expand All @@ -182,8 +184,7 @@
is_rp1 = of_device_is_compatible(of_args.np, "raspberrypi,rp1-gpio");
of_node_put(of_args.np);
if (!is_rp1 || of_args.args_count != 2)
return dev_err_probe(dev, -EINVAL,
"not an RP1 gpio\n");
return dev_err_probe(dev, -EINVAL, "not an RP1 gpio\n");

ppwm->gpio = of_args.args[0];

Expand All @@ -196,8 +197,7 @@
ppwm->sm = pio_claim_unused_sm(ppwm->pio, false);
if ((int)ppwm->sm < 0) {
pio_close(ppwm->pio);
return dev_err_probe(dev, -EBUSY,
"%pfw: no free PIO SM\n",
return dev_err_probe(dev, -EBUSY, "%pfw: no free PIO SM\n",
dev_fwnode(dev));
}

Expand All @@ -211,9 +211,9 @@

pwm_program_init(ppwm->pio, ppwm->sm, ppwm->offset, ppwm->gpio);

pwm_pio_resolution = (1000u * 1000 * 1000 * pwm_loop_ticks) / clock_get_hz(clk_sys);
pwm_pio_resolution =
(1000u * 1000 * 1000 * pwm_loop_ticks) / clock_get_hz(clk_sys);

chip->dev = dev;
chip->ops = &pwm_pio_rp1_ops;
chip->atomic = true;
chip->npwm = 1;
Expand All @@ -223,11 +223,13 @@
return devm_pwmchip_add(dev, chip);
}

static void pwm_pio_rp1_remove(struct platform_device *pdev)
static int pwm_pio_rp1_remove(struct platform_device *pdev)
{
struct pwm_pio_rp1 *ppwm = platform_get_drvdata(pdev);

pio_close(ppwm->pio);

return 0;
}

static const struct of_device_id pwm_pio_rp1_dt_ids[] = {
Expand All @@ -237,13 +239,13 @@
MODULE_DEVICE_TABLE(of, pwm_pio_rp1_dt_ids);

static struct platform_driver pwm_pio_rp1_driver = {
.driver = {
.name = "pwm-pio-rp1",
.of_match_table = pwm_pio_rp1_dt_ids,
},
.probe = pwm_pio_rp1_probe,
.remove_new = pwm_pio_rp1_remove,
};
.driver = {
.name = "pwm-pio-rp1",
.of_match_table = pwm_pio_rp1_dt_ids,
},
.probe = pwm_pio_rp1_probe,
.remove = pwm_pio_rp1_remove,
};

Check warning on line 248 in drivers/pwm/pwm-pio-rp1.c

View workflow job for this annotation

GitHub Actions / checks / checks

checkpatch: please, no spaces at the start of a line + };$
module_platform_driver(pwm_pio_rp1_driver);

MODULE_DESCRIPTION("PWM PIO RP1 driver");
Expand Down
41 changes: 13 additions & 28 deletions drivers/pwm/pwm-rp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@
#define PWM_MODE_MASK GENMASK(1, 0)

struct rp1_pwm {
struct pwm_chip chip;
struct device *dev;
void __iomem *base;
struct clk *clk;
};

static inline struct rp1_pwm *to_rp1_pwm(struct pwm_chip *chip)
{
return container_of(chip, struct rp1_pwm, chip);
return pwmchip_get_drvdata(chip);
}

static void rp1_pwm_apply_config(struct pwm_chip *chip, struct pwm_device *pwm)
Expand Down Expand Up @@ -83,7 +81,7 @@ static int rp1_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
u32 value;

if (!clk_rate) {
dev_err(pc->dev, "failed to get clock rate\n");
dev_err(&chip->dev, "failed to get clock rate\n");
return -EINVAL;
}

Expand Down Expand Up @@ -122,45 +120,34 @@ static const struct pwm_ops rp1_pwm_ops = {
.request = rp1_pwm_request,
.free = rp1_pwm_free,
.apply = rp1_pwm_apply,
.owner = THIS_MODULE,
};

static int rp1_pwm_probe(struct platform_device *pdev)
{
struct pwm_chip *chip;
struct rp1_pwm *pc;
struct resource *res;
int ret;

pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
if (!pc)
return -ENOMEM;
chip = devm_pwmchip_alloc(&pdev->dev, 4, sizeof(*pc));

pc->dev = &pdev->dev;
if (IS_ERR(chip))
return PTR_ERR(chip);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pc->base = devm_ioremap_resource(&pdev->dev, res);
pc = to_rp1_pwm(chip);

pc->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pc->base))
return PTR_ERR(pc->base);

pc->clk = devm_clk_get(&pdev->dev, NULL);
pc->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(pc->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk),
"clock not found\n");

ret = clk_prepare_enable(pc->clk);
if (ret)
return ret;

pc->chip.dev = &pdev->dev;
pc->chip.ops = &rp1_pwm_ops;
pc->chip.base = -1;
pc->chip.npwm = 4;
pc->chip.of_xlate = of_pwm_xlate_with_flags;
pc->chip.of_pwm_n_cells = 3;
chip->ops = &rp1_pwm_ops;
chip->of_xlate = of_pwm_xlate_with_flags;

platform_set_drvdata(pdev, pc);

ret = pwmchip_add(&pc->chip);
ret = devm_pwmchip_add(&pdev->dev, chip);
if (ret < 0)
goto add_fail;

Expand All @@ -177,8 +164,6 @@ static int rp1_pwm_remove(struct platform_device *pdev)

clk_disable_unprepare(pc->clk);

pwmchip_remove(&pc->chip);

return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this patch looks like is updating the driver not adding it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cherry picked the (only) commit adding the driver on the rpi linux 6.13 branch. Should I change the description? maybe also squash this and the next commit that fixes this driver to match the pwm interface?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it seems we cannot cherry-pick individual patches maybe just squash all patches and change the description to say that we need to modify the driver to match APIs A and B

}

Expand Down
Loading