1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
3 // Copyright (c) 2018 BayLibre, SAS.
4 // Author: Jerome Brunet <jbrunet@baylibre.com>
7 #include <linux/module.h>
8 #include <linux/of_irq.h>
9 #include <linux/of_platform.h>
10 #include <linux/regmap.h>
11 #include <sound/soc.h>
12 #include <sound/soc-dai.h>
13 #include <sound/pcm_params.h>
16 #define PDM_CTRL_EN BIT(31)
17 #define PDM_CTRL_OUT_MODE BIT(29)
18 #define PDM_CTRL_BYPASS_MODE BIT(28)
19 #define PDM_CTRL_RST_FIFO BIT(16)
20 #define PDM_CTRL_CHAN_RSTN_MASK GENMASK(15, 8)
21 #define PDM_CTRL_CHAN_RSTN(x) ((x) << 8)
22 #define PDM_CTRL_CHAN_EN_MASK GENMASK(7, 0)
23 #define PDM_CTRL_CHAN_EN(x) ((x) << 0)
24 #define PDM_HCIC_CTRL1 0x04
25 #define PDM_FILTER_EN BIT(31)
26 #define PDM_HCIC_CTRL1_GAIN_SFT_MASK GENMASK(29, 24)
27 #define PDM_HCIC_CTRL1_GAIN_SFT(x) ((x) << 24)
28 #define PDM_HCIC_CTRL1_GAIN_MULT_MASK GENMASK(23, 16)
29 #define PDM_HCIC_CTRL1_GAIN_MULT(x) ((x) << 16)
30 #define PDM_HCIC_CTRL1_DSR_MASK GENMASK(8, 4)
31 #define PDM_HCIC_CTRL1_DSR(x) ((x) << 4)
32 #define PDM_HCIC_CTRL1_STAGE_NUM_MASK GENMASK(3, 0)
33 #define PDM_HCIC_CTRL1_STAGE_NUM(x) ((x) << 0)
34 #define PDM_HCIC_CTRL2 0x08
35 #define PDM_F1_CTRL 0x0c
36 #define PDM_LPF_ROUND_MODE_MASK GENMASK(17, 16)
37 #define PDM_LPF_ROUND_MODE(x) ((x) << 16)
38 #define PDM_LPF_DSR_MASK GENMASK(15, 12)
39 #define PDM_LPF_DSR(x) ((x) << 12)
40 #define PDM_LPF_STAGE_NUM_MASK GENMASK(8, 0)
41 #define PDM_LPF_STAGE_NUM(x) ((x) << 0)
42 #define PDM_LPF_MAX_STAGE 336
44 #define PDM_F2_CTRL 0x10
45 #define PDM_F3_CTRL 0x14
46 #define PDM_HPF_CTRL 0x18
47 #define PDM_HPF_SFT_STEPS_MASK GENMASK(20, 16)
48 #define PDM_HPF_SFT_STEPS(x) ((x) << 16)
49 #define PDM_HPF_OUT_FACTOR_MASK GENMASK(15, 0)
50 #define PDM_HPF_OUT_FACTOR(x) ((x) << 0)
51 #define PDM_CHAN_CTRL 0x1c
52 #define PDM_CHAN_CTRL_POINTER_WIDTH 8
53 #define PDM_CHAN_CTRL_POINTER_MAX ((1 << PDM_CHAN_CTRL_POINTER_WIDTH) - 1)
54 #define PDM_CHAN_CTRL_NUM 4
55 #define PDM_CHAN_CTRL1 0x20
56 #define PDM_COEFF_ADDR 0x24
57 #define PDM_COEFF_DATA 0x28
58 #define PDM_CLKG_CTRL 0x2c
63 unsigned int round_mode
;
64 const unsigned int *tap
;
76 unsigned int out_factor
;
80 struct axg_pdm_filters
{
81 struct axg_pdm_hcic hcic
;
82 struct axg_pdm_hpf hpf
;
83 struct axg_pdm_lpf lpf
[PDM_LPF_NUM
];
87 const struct axg_pdm_filters
*filters
;
88 unsigned int sys_rate
;
92 const struct axg_pdm_cfg
*cfg
;
99 static void axg_pdm_enable(struct regmap
*map
)
102 regmap_update_bits(map
, PDM_CTRL
, PDM_CTRL_RST_FIFO
, PDM_CTRL_RST_FIFO
);
103 regmap_update_bits(map
, PDM_CTRL
, PDM_CTRL_RST_FIFO
, 0);
106 regmap_update_bits(map
, PDM_CTRL
, PDM_CTRL_EN
, PDM_CTRL_EN
);
109 static void axg_pdm_disable(struct regmap
*map
)
111 regmap_update_bits(map
, PDM_CTRL
, PDM_CTRL_EN
, 0);
114 static void axg_pdm_filters_enable(struct regmap
*map
, bool enable
)
116 unsigned int val
= enable
? PDM_FILTER_EN
: 0;
118 regmap_update_bits(map
, PDM_HCIC_CTRL1
, PDM_FILTER_EN
, val
);
119 regmap_update_bits(map
, PDM_F1_CTRL
, PDM_FILTER_EN
, val
);
120 regmap_update_bits(map
, PDM_F2_CTRL
, PDM_FILTER_EN
, val
);
121 regmap_update_bits(map
, PDM_F3_CTRL
, PDM_FILTER_EN
, val
);
122 regmap_update_bits(map
, PDM_HPF_CTRL
, PDM_FILTER_EN
, val
);
125 static int axg_pdm_trigger(struct snd_pcm_substream
*substream
, int cmd
,
126 struct snd_soc_dai
*dai
)
128 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
131 case SNDRV_PCM_TRIGGER_START
:
132 case SNDRV_PCM_TRIGGER_RESUME
:
133 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
134 axg_pdm_enable(priv
->map
);
137 case SNDRV_PCM_TRIGGER_STOP
:
138 case SNDRV_PCM_TRIGGER_SUSPEND
:
139 case SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
140 axg_pdm_disable(priv
->map
);
148 static unsigned int axg_pdm_get_os(struct axg_pdm
*priv
)
150 const struct axg_pdm_filters
*filters
= priv
->cfg
->filters
;
151 unsigned int os
= filters
->hcic
.ds
;
155 * The global oversampling factor is defined by the down sampling
156 * factor applied by each filter (HCIC and LPFs)
159 for (i
= 0; i
< PDM_LPF_NUM
; i
++)
160 os
*= filters
->lpf
[i
].ds
;
165 static int axg_pdm_set_sysclk(struct axg_pdm
*priv
, unsigned int os
,
168 unsigned int sys_rate
= os
* 2 * rate
* PDM_CHAN_CTRL_POINTER_MAX
;
171 * Set the default system clock rate unless it is too fast for
172 * for the requested sample rate. In this case, the sample pointer
173 * counter could overflow so set a lower system clock rate
175 if (sys_rate
< priv
->cfg
->sys_rate
)
176 return clk_set_rate(priv
->sysclk
, sys_rate
);
178 return clk_set_rate(priv
->sysclk
, priv
->cfg
->sys_rate
);
181 static int axg_pdm_set_sample_pointer(struct axg_pdm
*priv
)
183 unsigned int spmax
, sp
, val
;
186 /* Max sample counter value per half period of dclk */
187 spmax
= DIV_ROUND_UP_ULL((u64
)clk_get_rate(priv
->sysclk
),
188 clk_get_rate(priv
->dclk
) * 2);
190 /* Check if sysclk is not too fast - should not happen */
191 if (WARN_ON(spmax
> PDM_CHAN_CTRL_POINTER_MAX
))
194 /* Capture the data when we are at 75% of the half period */
197 for (i
= 0, val
= 0; i
< PDM_CHAN_CTRL_NUM
; i
++)
198 val
|= sp
<< (PDM_CHAN_CTRL_POINTER_WIDTH
* i
);
200 regmap_write(priv
->map
, PDM_CHAN_CTRL
, val
);
201 regmap_write(priv
->map
, PDM_CHAN_CTRL1
, val
);
206 static void axg_pdm_set_channel_mask(struct axg_pdm
*priv
,
207 unsigned int channels
)
209 unsigned int mask
= GENMASK(channels
- 1, 0);
211 /* Put all channel in reset */
212 regmap_update_bits(priv
->map
, PDM_CTRL
,
213 PDM_CTRL_CHAN_RSTN_MASK
, 0);
215 /* Take the necessary channels out of reset and enable them */
216 regmap_update_bits(priv
->map
, PDM_CTRL
,
217 PDM_CTRL_CHAN_RSTN_MASK
|
218 PDM_CTRL_CHAN_EN_MASK
,
219 PDM_CTRL_CHAN_RSTN(mask
) |
220 PDM_CTRL_CHAN_EN(mask
));
223 static int axg_pdm_hw_params(struct snd_pcm_substream
*substream
,
224 struct snd_pcm_hw_params
*params
,
225 struct snd_soc_dai
*dai
)
227 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
228 unsigned int os
= axg_pdm_get_os(priv
);
229 unsigned int rate
= params_rate(params
);
233 switch (params_width(params
)) {
235 val
= PDM_CTRL_OUT_MODE
;
241 dev_err(dai
->dev
, "unsupported sample width\n");
245 regmap_update_bits(priv
->map
, PDM_CTRL
, PDM_CTRL_OUT_MODE
, val
);
247 ret
= axg_pdm_set_sysclk(priv
, os
, rate
);
249 dev_err(dai
->dev
, "failed to set system clock\n");
253 ret
= clk_set_rate(priv
->dclk
, rate
* os
);
255 dev_err(dai
->dev
, "failed to set dclk\n");
259 ret
= axg_pdm_set_sample_pointer(priv
);
261 dev_err(dai
->dev
, "invalid clock setting\n");
265 axg_pdm_set_channel_mask(priv
, params_channels(params
));
270 static int axg_pdm_startup(struct snd_pcm_substream
*substream
,
271 struct snd_soc_dai
*dai
)
273 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
276 ret
= clk_prepare_enable(priv
->dclk
);
278 dev_err(dai
->dev
, "enabling dclk failed\n");
282 /* Enable the filters */
283 axg_pdm_filters_enable(priv
->map
, true);
288 static void axg_pdm_shutdown(struct snd_pcm_substream
*substream
,
289 struct snd_soc_dai
*dai
)
291 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
293 axg_pdm_filters_enable(priv
->map
, false);
294 clk_disable_unprepare(priv
->dclk
);
297 static const struct snd_soc_dai_ops axg_pdm_dai_ops
= {
298 .trigger
= axg_pdm_trigger
,
299 .hw_params
= axg_pdm_hw_params
,
300 .startup
= axg_pdm_startup
,
301 .shutdown
= axg_pdm_shutdown
,
304 static void axg_pdm_set_hcic_ctrl(struct axg_pdm
*priv
)
306 const struct axg_pdm_hcic
*hcic
= &priv
->cfg
->filters
->hcic
;
309 val
= PDM_HCIC_CTRL1_STAGE_NUM(hcic
->steps
);
310 val
|= PDM_HCIC_CTRL1_DSR(hcic
->ds
);
311 val
|= PDM_HCIC_CTRL1_GAIN_MULT(hcic
->mult
);
312 val
|= PDM_HCIC_CTRL1_GAIN_SFT(hcic
->shift
);
314 regmap_update_bits(priv
->map
, PDM_HCIC_CTRL1
,
315 PDM_HCIC_CTRL1_STAGE_NUM_MASK
|
316 PDM_HCIC_CTRL1_DSR_MASK
|
317 PDM_HCIC_CTRL1_GAIN_MULT_MASK
|
318 PDM_HCIC_CTRL1_GAIN_SFT_MASK
,
322 static void axg_pdm_set_lpf_ctrl(struct axg_pdm
*priv
, unsigned int index
)
324 const struct axg_pdm_lpf
*lpf
= &priv
->cfg
->filters
->lpf
[index
];
325 unsigned int offset
= index
* regmap_get_reg_stride(priv
->map
)
329 val
= PDM_LPF_STAGE_NUM(lpf
->tap_num
);
330 val
|= PDM_LPF_DSR(lpf
->ds
);
331 val
|= PDM_LPF_ROUND_MODE(lpf
->round_mode
);
333 regmap_update_bits(priv
->map
, offset
,
334 PDM_LPF_STAGE_NUM_MASK
|
336 PDM_LPF_ROUND_MODE_MASK
,
340 static void axg_pdm_set_hpf_ctrl(struct axg_pdm
*priv
)
342 const struct axg_pdm_hpf
*hpf
= &priv
->cfg
->filters
->hpf
;
345 val
= PDM_HPF_OUT_FACTOR(hpf
->out_factor
);
346 val
|= PDM_HPF_SFT_STEPS(hpf
->steps
);
348 regmap_update_bits(priv
->map
, PDM_HPF_CTRL
,
349 PDM_HPF_OUT_FACTOR_MASK
|
350 PDM_HPF_SFT_STEPS_MASK
,
354 static int axg_pdm_set_lpf_filters(struct axg_pdm
*priv
)
356 const struct axg_pdm_lpf
*lpf
= priv
->cfg
->filters
->lpf
;
357 unsigned int count
= 0;
360 for (i
= 0; i
< PDM_LPF_NUM
; i
++)
361 count
+= lpf
[i
].tap_num
;
363 /* Make sure the coeffs fit in the memory */
364 if (count
>= PDM_LPF_MAX_STAGE
)
367 /* Set the initial APB bus register address */
368 regmap_write(priv
->map
, PDM_COEFF_ADDR
, 0);
370 /* Set the tap filter values of all 3 filters */
371 for (i
= 0; i
< PDM_LPF_NUM
; i
++) {
372 axg_pdm_set_lpf_ctrl(priv
, i
);
374 for (j
= 0; j
< lpf
[i
].tap_num
; j
++)
375 regmap_write(priv
->map
, PDM_COEFF_DATA
, lpf
[i
].tap
[j
]);
381 static int axg_pdm_dai_probe(struct snd_soc_dai
*dai
)
383 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
386 ret
= clk_prepare_enable(priv
->pclk
);
388 dev_err(dai
->dev
, "enabling pclk failed\n");
393 * sysclk must be set and enabled as well to access the pdm registers
394 * Accessing the register w/o it will give a bus error.
396 ret
= clk_set_rate(priv
->sysclk
, priv
->cfg
->sys_rate
);
398 dev_err(dai
->dev
, "setting sysclk failed\n");
402 ret
= clk_prepare_enable(priv
->sysclk
);
404 dev_err(dai
->dev
, "enabling sysclk failed\n");
408 /* Make sure the device is initially disabled */
409 axg_pdm_disable(priv
->map
);
411 /* Make sure filter bypass is disabled */
412 regmap_update_bits(priv
->map
, PDM_CTRL
, PDM_CTRL_BYPASS_MODE
, 0);
414 /* Load filter settings */
415 axg_pdm_set_hcic_ctrl(priv
);
416 axg_pdm_set_hpf_ctrl(priv
);
418 ret
= axg_pdm_set_lpf_filters(priv
);
420 dev_err(dai
->dev
, "invalid filter configuration\n");
427 clk_disable_unprepare(priv
->sysclk
);
429 clk_disable_unprepare(priv
->pclk
);
433 static int axg_pdm_dai_remove(struct snd_soc_dai
*dai
)
435 struct axg_pdm
*priv
= snd_soc_dai_get_drvdata(dai
);
437 clk_disable_unprepare(priv
->sysclk
);
438 clk_disable_unprepare(priv
->pclk
);
443 static struct snd_soc_dai_driver axg_pdm_dai_drv
= {
446 .stream_name
= "Capture",
449 .rates
= SNDRV_PCM_RATE_CONTINUOUS
,
452 .formats
= (SNDRV_PCM_FMTBIT_S24_LE
|
453 SNDRV_PCM_FMTBIT_S32_LE
),
455 .ops
= &axg_pdm_dai_ops
,
456 .probe
= axg_pdm_dai_probe
,
457 .remove
= axg_pdm_dai_remove
,
460 static const struct snd_soc_component_driver axg_pdm_component_drv
= {};
462 static const struct regmap_config axg_pdm_regmap_cfg
= {
466 .max_register
= PDM_STS
,
469 static const unsigned int lpf1_default_tap
[] = {
470 0x000014, 0xffffb2, 0xfffed9, 0xfffdce, 0xfffd45,
471 0xfffe32, 0x000147, 0x000645, 0x000b86, 0x000e21,
472 0x000ae3, 0x000000, 0xffeece, 0xffdca8, 0xffd212,
473 0xffd7d1, 0xfff2a7, 0x001f4c, 0x0050c2, 0x0072aa,
474 0x006ff1, 0x003c32, 0xffdc4e, 0xff6a18, 0xff0fef,
475 0xfefbaf, 0xff4c40, 0x000000, 0x00ebc8, 0x01c077,
476 0x02209e, 0x01c1a4, 0x008e60, 0xfebe52, 0xfcd690,
477 0xfb8fa5, 0xfba498, 0xfd9812, 0x0181ce, 0x06f5f3,
478 0x0d112f, 0x12a958, 0x169686, 0x18000e, 0x169686,
479 0x12a958, 0x0d112f, 0x06f5f3, 0x0181ce, 0xfd9812,
480 0xfba498, 0xfb8fa5, 0xfcd690, 0xfebe52, 0x008e60,
481 0x01c1a4, 0x02209e, 0x01c077, 0x00ebc8, 0x000000,
482 0xff4c40, 0xfefbaf, 0xff0fef, 0xff6a18, 0xffdc4e,
483 0x003c32, 0x006ff1, 0x0072aa, 0x0050c2, 0x001f4c,
484 0xfff2a7, 0xffd7d1, 0xffd212, 0xffdca8, 0xffeece,
485 0x000000, 0x000ae3, 0x000e21, 0x000b86, 0x000645,
486 0x000147, 0xfffe32, 0xfffd45, 0xfffdce, 0xfffed9,
490 static const unsigned int lpf2_default_tap
[] = {
491 0x00050a, 0xfff004, 0x0002c1, 0x003c12, 0xffa818,
492 0xffc87d, 0x010aef, 0xff5223, 0xfebd93, 0x028f41,
493 0xff5c0e, 0xfc63f8, 0x055f81, 0x000000, 0xf478a0,
494 0x11c5e3, 0x2ea74d, 0x11c5e3, 0xf478a0, 0x000000,
495 0x055f81, 0xfc63f8, 0xff5c0e, 0x028f41, 0xfebd93,
496 0xff5223, 0x010aef, 0xffc87d, 0xffa818, 0x003c12,
497 0x0002c1, 0xfff004, 0x00050a,
500 static const unsigned int lpf3_default_tap
[] = {
501 0x000000, 0x000081, 0x000000, 0xfffedb, 0x000000,
502 0x00022d, 0x000000, 0xfffc46, 0x000000, 0x0005f7,
503 0x000000, 0xfff6eb, 0x000000, 0x000d4e, 0x000000,
504 0xffed1e, 0x000000, 0x001a1c, 0x000000, 0xffdcb0,
505 0x000000, 0x002ede, 0x000000, 0xffc2d1, 0x000000,
506 0x004ebe, 0x000000, 0xff9beb, 0x000000, 0x007dd7,
507 0x000000, 0xff633a, 0x000000, 0x00c1d2, 0x000000,
508 0xff11d5, 0x000000, 0x012368, 0x000000, 0xfe9c45,
509 0x000000, 0x01b252, 0x000000, 0xfdebf6, 0x000000,
510 0x0290b8, 0x000000, 0xfcca0d, 0x000000, 0x041d7c,
511 0x000000, 0xfa8152, 0x000000, 0x07e9c6, 0x000000,
512 0xf28fb5, 0x000000, 0x28b216, 0x3fffde, 0x28b216,
513 0x000000, 0xf28fb5, 0x000000, 0x07e9c6, 0x000000,
514 0xfa8152, 0x000000, 0x041d7c, 0x000000, 0xfcca0d,
515 0x000000, 0x0290b8, 0x000000, 0xfdebf6, 0x000000,
516 0x01b252, 0x000000, 0xfe9c45, 0x000000, 0x012368,
517 0x000000, 0xff11d5, 0x000000, 0x00c1d2, 0x000000,
518 0xff633a, 0x000000, 0x007dd7, 0x000000, 0xff9beb,
519 0x000000, 0x004ebe, 0x000000, 0xffc2d1, 0x000000,
520 0x002ede, 0x000000, 0xffdcb0, 0x000000, 0x001a1c,
521 0x000000, 0xffed1e, 0x000000, 0x000d4e, 0x000000,
522 0xfff6eb, 0x000000, 0x0005f7, 0x000000, 0xfffc46,
523 0x000000, 0x00022d, 0x000000, 0xfffedb, 0x000000,
528 * These values are sane defaults for the axg platform:
530 * - Latency = 38700 (?)
532 * TODO: There is a lot of different HCIC, LPFs and HPF configurations possible.
533 * the configuration may depend on the dmic used by the platform, the
534 * expected tradeoff between latency and quality, etc ... If/When other
535 * settings are required, we should add a fw interface to this driver to
536 * load new filter settings.
538 static const struct axg_pdm_filters axg_default_filters
= {
546 .out_factor
= 0x8000,
553 .tap
= lpf1_default_tap
,
554 .tap_num
= ARRAY_SIZE(lpf1_default_tap
),
559 .tap
= lpf2_default_tap
,
560 .tap_num
= ARRAY_SIZE(lpf2_default_tap
),
565 .tap
= lpf3_default_tap
,
566 .tap_num
= ARRAY_SIZE(lpf3_default_tap
)
571 static const struct axg_pdm_cfg axg_pdm_config
= {
572 .filters
= &axg_default_filters
,
573 .sys_rate
= 250000000,
576 static const struct of_device_id axg_pdm_of_match
[] = {
578 .compatible
= "amlogic,axg-pdm",
579 .data
= &axg_pdm_config
,
582 MODULE_DEVICE_TABLE(of
, axg_pdm_of_match
);
584 static int axg_pdm_probe(struct platform_device
*pdev
)
586 struct device
*dev
= &pdev
->dev
;
587 struct axg_pdm
*priv
;
588 struct resource
*res
;
592 priv
= devm_kzalloc(dev
, sizeof(*priv
), GFP_KERNEL
);
595 platform_set_drvdata(pdev
, priv
);
597 priv
->cfg
= of_device_get_match_data(dev
);
599 dev_err(dev
, "failed to match device\n");
603 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
604 regs
= devm_ioremap_resource(dev
, res
);
606 return PTR_ERR(regs
);
608 priv
->map
= devm_regmap_init_mmio(dev
, regs
, &axg_pdm_regmap_cfg
);
609 if (IS_ERR(priv
->map
)) {
610 dev_err(dev
, "failed to init regmap: %ld\n",
612 return PTR_ERR(priv
->map
);
615 priv
->pclk
= devm_clk_get(dev
, "pclk");
616 if (IS_ERR(priv
->pclk
)) {
617 ret
= PTR_ERR(priv
->pclk
);
618 if (ret
!= -EPROBE_DEFER
)
619 dev_err(dev
, "failed to get pclk: %d\n", ret
);
623 priv
->dclk
= devm_clk_get(dev
, "dclk");
624 if (IS_ERR(priv
->dclk
)) {
625 ret
= PTR_ERR(priv
->dclk
);
626 if (ret
!= -EPROBE_DEFER
)
627 dev_err(dev
, "failed to get dclk: %d\n", ret
);
631 priv
->sysclk
= devm_clk_get(dev
, "sysclk");
632 if (IS_ERR(priv
->sysclk
)) {
633 ret
= PTR_ERR(priv
->sysclk
);
634 if (ret
!= -EPROBE_DEFER
)
635 dev_err(dev
, "failed to get dclk: %d\n", ret
);
639 return devm_snd_soc_register_component(dev
, &axg_pdm_component_drv
,
640 &axg_pdm_dai_drv
, 1);
643 static struct platform_driver axg_pdm_pdrv
= {
644 .probe
= axg_pdm_probe
,
647 .of_match_table
= axg_pdm_of_match
,
650 module_platform_driver(axg_pdm_pdrv
);
652 MODULE_DESCRIPTION("Amlogic AXG PDM Input driver");
653 MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
654 MODULE_LICENSE("GPL v2");