diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 08:10:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 08:10:51 -0400 |
commit | 3fa2a81e6e77f4308b4a3860aab2a1885a127f47 (patch) | |
tree | 26d40f51deb16757b3c8b26afd5568b201143f56 | |
parent | 83b4a3d79efb291c17cd9b2182e187c1217f8276 (diff) | |
parent | 017300da3a4547d85e52c2484fc0bd759e1bbcdb (diff) |
Merge tag 'phy-for-4.8-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus
Kishon writes:
phy: for 4.8 -rc
*) Fix to get host-only mode working in sun4i
*) Fix a compilation error because of missing header file
*) Other minor fixes
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-rw-r--r-- | drivers/phy/phy-brcm-sata.c | 2 | ||||
-rw-r--r-- | drivers/phy/phy-sun4i-usb.c | 68 | ||||
-rw-r--r-- | drivers/phy/phy-sun9i-usb.c | 4 | ||||
-rw-r--r-- | include/linux/mfd/da8xx-cfgchip.h | 153 |
4 files changed, 202 insertions, 25 deletions
diff --git a/drivers/phy/phy-brcm-sata.c b/drivers/phy/phy-brcm-sata.c index 18d662610075..8ffc44afdb75 100644 --- a/drivers/phy/phy-brcm-sata.c +++ b/drivers/phy/phy-brcm-sata.c | |||
@@ -367,7 +367,7 @@ static int brcm_sata_phy_init(struct phy *phy) | |||
367 | rc = -ENODEV; | 367 | rc = -ENODEV; |
368 | }; | 368 | }; |
369 | 369 | ||
370 | return 0; | 370 | return rc; |
371 | } | 371 | } |
372 | 372 | ||
373 | static const struct phy_ops phy_ops = { | 373 | static const struct phy_ops phy_ops = { |
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index 0a45bc6088ae..8c7eb335622e 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/power_supply.h> | 40 | #include <linux/power_supply.h> |
41 | #include <linux/regulator/consumer.h> | 41 | #include <linux/regulator/consumer.h> |
42 | #include <linux/reset.h> | 42 | #include <linux/reset.h> |
43 | #include <linux/usb/of.h> | ||
43 | #include <linux/workqueue.h> | 44 | #include <linux/workqueue.h> |
44 | 45 | ||
45 | #define REG_ISCR 0x00 | 46 | #define REG_ISCR 0x00 |
@@ -110,6 +111,7 @@ struct sun4i_usb_phy_cfg { | |||
110 | struct sun4i_usb_phy_data { | 111 | struct sun4i_usb_phy_data { |
111 | void __iomem *base; | 112 | void __iomem *base; |
112 | const struct sun4i_usb_phy_cfg *cfg; | 113 | const struct sun4i_usb_phy_cfg *cfg; |
114 | enum usb_dr_mode dr_mode; | ||
113 | struct mutex mutex; | 115 | struct mutex mutex; |
114 | struct sun4i_usb_phy { | 116 | struct sun4i_usb_phy { |
115 | struct phy *phy; | 117 | struct phy *phy; |
@@ -120,6 +122,7 @@ struct sun4i_usb_phy_data { | |||
120 | bool regulator_on; | 122 | bool regulator_on; |
121 | int index; | 123 | int index; |
122 | } phys[MAX_PHYS]; | 124 | } phys[MAX_PHYS]; |
125 | int first_phy; | ||
123 | /* phy0 / otg related variables */ | 126 | /* phy0 / otg related variables */ |
124 | struct extcon_dev *extcon; | 127 | struct extcon_dev *extcon; |
125 | bool phy0_init; | 128 | bool phy0_init; |
@@ -285,16 +288,10 @@ static int sun4i_usb_phy_init(struct phy *_phy) | |||
285 | sun4i_usb_phy0_update_iscr(_phy, 0, ISCR_DPDM_PULLUP_EN); | 288 | sun4i_usb_phy0_update_iscr(_phy, 0, ISCR_DPDM_PULLUP_EN); |
286 | sun4i_usb_phy0_update_iscr(_phy, 0, ISCR_ID_PULLUP_EN); | 289 | sun4i_usb_phy0_update_iscr(_phy, 0, ISCR_ID_PULLUP_EN); |
287 | 290 | ||
288 | if (data->id_det_gpio) { | 291 | /* Force ISCR and cable state updates */ |
289 | /* OTG mode, force ISCR and cable state updates */ | 292 | data->id_det = -1; |
290 | data->id_det = -1; | 293 | data->vbus_det = -1; |
291 | data->vbus_det = -1; | 294 | queue_delayed_work(system_wq, &data->detect, 0); |
292 | queue_delayed_work(system_wq, &data->detect, 0); | ||
293 | } else { | ||
294 | /* Host only mode */ | ||
295 | sun4i_usb_phy0_set_id_detect(_phy, 0); | ||
296 | sun4i_usb_phy0_set_vbus_detect(_phy, 1); | ||
297 | } | ||
298 | } | 295 | } |
299 | 296 | ||
300 | return 0; | 297 | return 0; |
@@ -319,6 +316,19 @@ static int sun4i_usb_phy_exit(struct phy *_phy) | |||
319 | return 0; | 316 | return 0; |
320 | } | 317 | } |
321 | 318 | ||
319 | static int sun4i_usb_phy0_get_id_det(struct sun4i_usb_phy_data *data) | ||
320 | { | ||
321 | switch (data->dr_mode) { | ||
322 | case USB_DR_MODE_OTG: | ||
323 | return gpiod_get_value_cansleep(data->id_det_gpio); | ||
324 | case USB_DR_MODE_HOST: | ||
325 | return 0; | ||
326 | case USB_DR_MODE_PERIPHERAL: | ||
327 | default: | ||
328 | return 1; | ||
329 | } | ||
330 | } | ||
331 | |||
322 | static int sun4i_usb_phy0_get_vbus_det(struct sun4i_usb_phy_data *data) | 332 | static int sun4i_usb_phy0_get_vbus_det(struct sun4i_usb_phy_data *data) |
323 | { | 333 | { |
324 | if (data->vbus_det_gpio) | 334 | if (data->vbus_det_gpio) |
@@ -432,7 +442,10 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) | |||
432 | struct phy *phy0 = data->phys[0].phy; | 442 | struct phy *phy0 = data->phys[0].phy; |
433 | int id_det, vbus_det, id_notify = 0, vbus_notify = 0; | 443 | int id_det, vbus_det, id_notify = 0, vbus_notify = 0; |
434 | 444 | ||
435 | id_det = gpiod_get_value_cansleep(data->id_det_gpio); | 445 | if (phy0 == NULL) |
446 | return; | ||
447 | |||
448 | id_det = sun4i_usb_phy0_get_id_det(data); | ||
436 | vbus_det = sun4i_usb_phy0_get_vbus_det(data); | 449 | vbus_det = sun4i_usb_phy0_get_vbus_det(data); |
437 | 450 | ||
438 | mutex_lock(&phy0->mutex); | 451 | mutex_lock(&phy0->mutex); |
@@ -448,7 +461,8 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) | |||
448 | * without vbus detection report vbus low for long enough for | 461 | * without vbus detection report vbus low for long enough for |
449 | * the musb-ip to end the current device session. | 462 | * the musb-ip to end the current device session. |
450 | */ | 463 | */ |
451 | if (!sun4i_usb_phy0_have_vbus_det(data) && id_det == 0) { | 464 | if (data->dr_mode == USB_DR_MODE_OTG && |
465 | !sun4i_usb_phy0_have_vbus_det(data) && id_det == 0) { | ||
452 | sun4i_usb_phy0_set_vbus_detect(phy0, 0); | 466 | sun4i_usb_phy0_set_vbus_detect(phy0, 0); |
453 | msleep(200); | 467 | msleep(200); |
454 | sun4i_usb_phy0_set_vbus_detect(phy0, 1); | 468 | sun4i_usb_phy0_set_vbus_detect(phy0, 1); |
@@ -474,7 +488,8 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) | |||
474 | * without vbus detection report vbus low for long enough to | 488 | * without vbus detection report vbus low for long enough to |
475 | * the musb-ip to end the current host session. | 489 | * the musb-ip to end the current host session. |
476 | */ | 490 | */ |
477 | if (!sun4i_usb_phy0_have_vbus_det(data) && id_det == 1) { | 491 | if (data->dr_mode == USB_DR_MODE_OTG && |
492 | !sun4i_usb_phy0_have_vbus_det(data) && id_det == 1) { | ||
478 | mutex_lock(&phy0->mutex); | 493 | mutex_lock(&phy0->mutex); |
479 | sun4i_usb_phy0_set_vbus_detect(phy0, 0); | 494 | sun4i_usb_phy0_set_vbus_detect(phy0, 0); |
480 | msleep(1000); | 495 | msleep(1000); |
@@ -519,7 +534,8 @@ static struct phy *sun4i_usb_phy_xlate(struct device *dev, | |||
519 | { | 534 | { |
520 | struct sun4i_usb_phy_data *data = dev_get_drvdata(dev); | 535 | struct sun4i_usb_phy_data *data = dev_get_drvdata(dev); |
521 | 536 | ||
522 | if (args->args[0] >= data->cfg->num_phys) | 537 | if (args->args[0] < data->first_phy || |
538 | args->args[0] >= data->cfg->num_phys) | ||
523 | return ERR_PTR(-ENODEV); | 539 | return ERR_PTR(-ENODEV); |
524 | 540 | ||
525 | return data->phys[args->args[0]].phy; | 541 | return data->phys[args->args[0]].phy; |
@@ -593,13 +609,17 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) | |||
593 | return -EPROBE_DEFER; | 609 | return -EPROBE_DEFER; |
594 | } | 610 | } |
595 | 611 | ||
596 | /* vbus_det without id_det makes no sense, and is not supported */ | 612 | data->dr_mode = of_usb_get_dr_mode_by_phy(np, 0); |
597 | if (sun4i_usb_phy0_have_vbus_det(data) && !data->id_det_gpio) { | 613 | switch (data->dr_mode) { |
598 | dev_err(dev, "usb0_id_det missing or invalid\n"); | 614 | case USB_DR_MODE_OTG: |
599 | return -ENODEV; | 615 | /* otg without id_det makes no sense, and is not supported */ |
600 | } | 616 | if (!data->id_det_gpio) { |
601 | 617 | dev_err(dev, "usb0_id_det missing or invalid\n"); | |
602 | if (data->id_det_gpio) { | 618 | return -ENODEV; |
619 | } | ||
620 | /* fall through */ | ||
621 | case USB_DR_MODE_HOST: | ||
622 | case USB_DR_MODE_PERIPHERAL: | ||
603 | data->extcon = devm_extcon_dev_allocate(dev, | 623 | data->extcon = devm_extcon_dev_allocate(dev, |
604 | sun4i_usb_phy0_cable); | 624 | sun4i_usb_phy0_cable); |
605 | if (IS_ERR(data->extcon)) | 625 | if (IS_ERR(data->extcon)) |
@@ -610,9 +630,13 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) | |||
610 | dev_err(dev, "failed to register extcon: %d\n", ret); | 630 | dev_err(dev, "failed to register extcon: %d\n", ret); |
611 | return ret; | 631 | return ret; |
612 | } | 632 | } |
633 | break; | ||
634 | default: | ||
635 | dev_info(dev, "dr_mode unknown, not registering usb phy0\n"); | ||
636 | data->first_phy = 1; | ||
613 | } | 637 | } |
614 | 638 | ||
615 | for (i = 0; i < data->cfg->num_phys; i++) { | 639 | for (i = data->first_phy; i < data->cfg->num_phys; i++) { |
616 | struct sun4i_usb_phy *phy = data->phys + i; | 640 | struct sun4i_usb_phy *phy = data->phys + i; |
617 | char name[16]; | 641 | char name[16]; |
618 | 642 | ||
diff --git a/drivers/phy/phy-sun9i-usb.c b/drivers/phy/phy-sun9i-usb.c index ac4f31abefe3..28fce4bce638 100644 --- a/drivers/phy/phy-sun9i-usb.c +++ b/drivers/phy/phy-sun9i-usb.c | |||
@@ -141,9 +141,9 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | phy->hsic_clk = devm_clk_get(dev, "hsic_12M"); | 143 | phy->hsic_clk = devm_clk_get(dev, "hsic_12M"); |
144 | if (IS_ERR(phy->clk)) { | 144 | if (IS_ERR(phy->hsic_clk)) { |
145 | dev_err(dev, "failed to get hsic_12M clock\n"); | 145 | dev_err(dev, "failed to get hsic_12M clock\n"); |
146 | return PTR_ERR(phy->clk); | 146 | return PTR_ERR(phy->hsic_clk); |
147 | } | 147 | } |
148 | 148 | ||
149 | phy->reset = devm_reset_control_get(dev, "hsic"); | 149 | phy->reset = devm_reset_control_get(dev, "hsic"); |
diff --git a/include/linux/mfd/da8xx-cfgchip.h b/include/linux/mfd/da8xx-cfgchip.h new file mode 100644 index 000000000000..304985e288d2 --- /dev/null +++ b/include/linux/mfd/da8xx-cfgchip.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * TI DaVinci DA8xx CHIPCFGx registers for syscon consumers. | ||
3 | * | ||
4 | * Copyright (C) 2016 David Lechner <david@lechnology.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_MFD_DA8XX_CFGCHIP_H | ||
18 | #define __LINUX_MFD_DA8XX_CFGCHIP_H | ||
19 | |||
20 | #include <linux/bitops.h> | ||
21 | |||
22 | /* register offset (32-bit registers) */ | ||
23 | #define CFGCHIP(n) ((n) * 4) | ||
24 | |||
25 | /* CFGCHIP0 (PLL0/EDMA3_0) register bits */ | ||
26 | #define CFGCHIP0_PLL_MASTER_LOCK BIT(4) | ||
27 | #define CFGCHIP0_EDMA30TC1DBS(n) ((n) << 2) | ||
28 | #define CFGCHIP0_EDMA30TC1DBS_MASK CFGCHIP0_EDMA30TC1DBS(0x3) | ||
29 | #define CFGCHIP0_EDMA30TC1DBS_16 CFGCHIP0_EDMA30TC1DBS(0x0) | ||
30 | #define CFGCHIP0_EDMA30TC1DBS_32 CFGCHIP0_EDMA30TC1DBS(0x1) | ||
31 | #define CFGCHIP0_EDMA30TC1DBS_64 CFGCHIP0_EDMA30TC1DBS(0x2) | ||
32 | #define CFGCHIP0_EDMA30TC0DBS(n) ((n) << 0) | ||
33 | #define CFGCHIP0_EDMA30TC0DBS_MASK CFGCHIP0_EDMA30TC0DBS(0x3) | ||
34 | #define CFGCHIP0_EDMA30TC0DBS_16 CFGCHIP0_EDMA30TC0DBS(0x0) | ||
35 | #define CFGCHIP0_EDMA30TC0DBS_32 CFGCHIP0_EDMA30TC0DBS(0x1) | ||
36 | #define CFGCHIP0_EDMA30TC0DBS_64 CFGCHIP0_EDMA30TC0DBS(0x2) | ||
37 | |||
38 | /* CFGCHIP1 (eCAP/HPI/EDMA3_1/eHRPWM TBCLK/McASP0 AMUTEIN) register bits */ | ||
39 | #define CFGCHIP1_CAP2SRC(n) ((n) << 27) | ||
40 | #define CFGCHIP1_CAP2SRC_MASK CFGCHIP1_CAP2SRC(0x1f) | ||
41 | #define CFGCHIP1_CAP2SRC_ECAP_PIN CFGCHIP1_CAP2SRC(0x0) | ||
42 | #define CFGCHIP1_CAP2SRC_MCASP0_TX CFGCHIP1_CAP2SRC(0x1) | ||
43 | #define CFGCHIP1_CAP2SRC_MCASP0_RX CFGCHIP1_CAP2SRC(0x2) | ||
44 | #define CFGCHIP1_CAP2SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP2SRC(0x7) | ||
45 | #define CFGCHIP1_CAP2SRC_EMAC_C0_RX CFGCHIP1_CAP2SRC(0x8) | ||
46 | #define CFGCHIP1_CAP2SRC_EMAC_C0_TX CFGCHIP1_CAP2SRC(0x9) | ||
47 | #define CFGCHIP1_CAP2SRC_EMAC_C0_MISC CFGCHIP1_CAP2SRC(0xa) | ||
48 | #define CFGCHIP1_CAP2SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xb) | ||
49 | #define CFGCHIP1_CAP2SRC_EMAC_C1_RX CFGCHIP1_CAP2SRC(0xc) | ||
50 | #define CFGCHIP1_CAP2SRC_EMAC_C1_TX CFGCHIP1_CAP2SRC(0xd) | ||
51 | #define CFGCHIP1_CAP2SRC_EMAC_C1_MISC CFGCHIP1_CAP2SRC(0xe) | ||
52 | #define CFGCHIP1_CAP2SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP2SRC(0xf) | ||
53 | #define CFGCHIP1_CAP2SRC_EMAC_C2_RX CFGCHIP1_CAP2SRC(0x10) | ||
54 | #define CFGCHIP1_CAP2SRC_EMAC_C2_TX CFGCHIP1_CAP2SRC(0x11) | ||
55 | #define CFGCHIP1_CAP2SRC_EMAC_C2_MISC CFGCHIP1_CAP2SRC(0x12) | ||
56 | #define CFGCHIP1_CAP1SRC(n) ((n) << 22) | ||
57 | #define CFGCHIP1_CAP1SRC_MASK CFGCHIP1_CAP1SRC(0x1f) | ||
58 | #define CFGCHIP1_CAP1SRC_ECAP_PIN CFGCHIP1_CAP1SRC(0x0) | ||
59 | #define CFGCHIP1_CAP1SRC_MCASP0_TX CFGCHIP1_CAP1SRC(0x1) | ||
60 | #define CFGCHIP1_CAP1SRC_MCASP0_RX CFGCHIP1_CAP1SRC(0x2) | ||
61 | #define CFGCHIP1_CAP1SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP1SRC(0x7) | ||
62 | #define CFGCHIP1_CAP1SRC_EMAC_C0_RX CFGCHIP1_CAP1SRC(0x8) | ||
63 | #define CFGCHIP1_CAP1SRC_EMAC_C0_TX CFGCHIP1_CAP1SRC(0x9) | ||
64 | #define CFGCHIP1_CAP1SRC_EMAC_C0_MISC CFGCHIP1_CAP1SRC(0xa) | ||
65 | #define CFGCHIP1_CAP1SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xb) | ||
66 | #define CFGCHIP1_CAP1SRC_EMAC_C1_RX CFGCHIP1_CAP1SRC(0xc) | ||
67 | #define CFGCHIP1_CAP1SRC_EMAC_C1_TX CFGCHIP1_CAP1SRC(0xd) | ||
68 | #define CFGCHIP1_CAP1SRC_EMAC_C1_MISC CFGCHIP1_CAP1SRC(0xe) | ||
69 | #define CFGCHIP1_CAP1SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP1SRC(0xf) | ||
70 | #define CFGCHIP1_CAP1SRC_EMAC_C2_RX CFGCHIP1_CAP1SRC(0x10) | ||
71 | #define CFGCHIP1_CAP1SRC_EMAC_C2_TX CFGCHIP1_CAP1SRC(0x11) | ||
72 | #define CFGCHIP1_CAP1SRC_EMAC_C2_MISC CFGCHIP1_CAP1SRC(0x12) | ||
73 | #define CFGCHIP1_CAP0SRC(n) ((n) << 17) | ||
74 | #define CFGCHIP1_CAP0SRC_MASK CFGCHIP1_CAP0SRC(0x1f) | ||
75 | #define CFGCHIP1_CAP0SRC_ECAP_PIN CFGCHIP1_CAP0SRC(0x0) | ||
76 | #define CFGCHIP1_CAP0SRC_MCASP0_TX CFGCHIP1_CAP0SRC(0x1) | ||
77 | #define CFGCHIP1_CAP0SRC_MCASP0_RX CFGCHIP1_CAP0SRC(0x2) | ||
78 | #define CFGCHIP1_CAP0SRC_EMAC_C0_RX_THRESHOLD CFGCHIP1_CAP0SRC(0x7) | ||
79 | #define CFGCHIP1_CAP0SRC_EMAC_C0_RX CFGCHIP1_CAP0SRC(0x8) | ||
80 | #define CFGCHIP1_CAP0SRC_EMAC_C0_TX CFGCHIP1_CAP0SRC(0x9) | ||
81 | #define CFGCHIP1_CAP0SRC_EMAC_C0_MISC CFGCHIP1_CAP0SRC(0xa) | ||
82 | #define CFGCHIP1_CAP0SRC_EMAC_C1_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xb) | ||
83 | #define CFGCHIP1_CAP0SRC_EMAC_C1_RX CFGCHIP1_CAP0SRC(0xc) | ||
84 | #define CFGCHIP1_CAP0SRC_EMAC_C1_TX CFGCHIP1_CAP0SRC(0xd) | ||
85 | #define CFGCHIP1_CAP0SRC_EMAC_C1_MISC CFGCHIP1_CAP0SRC(0xe) | ||
86 | #define CFGCHIP1_CAP0SRC_EMAC_C2_RX_THRESHOLD CFGCHIP1_CAP0SRC(0xf) | ||
87 | #define CFGCHIP1_CAP0SRC_EMAC_C2_RX CFGCHIP1_CAP0SRC(0x10) | ||
88 | #define CFGCHIP1_CAP0SRC_EMAC_C2_TX CFGCHIP1_CAP0SRC(0x11) | ||
89 | #define CFGCHIP1_CAP0SRC_EMAC_C2_MISC CFGCHIP1_CAP0SRC(0x12) | ||
90 | #define CFGCHIP1_HPIBYTEAD BIT(16) | ||
91 | #define CFGCHIP1_HPIENA BIT(15) | ||
92 | #define CFGCHIP0_EDMA31TC0DBS(n) ((n) << 13) | ||
93 | #define CFGCHIP0_EDMA31TC0DBS_MASK CFGCHIP0_EDMA31TC0DBS(0x3) | ||
94 | #define CFGCHIP0_EDMA31TC0DBS_16 CFGCHIP0_EDMA31TC0DBS(0x0) | ||
95 | #define CFGCHIP0_EDMA31TC0DBS_32 CFGCHIP0_EDMA31TC0DBS(0x1) | ||
96 | #define CFGCHIP0_EDMA31TC0DBS_64 CFGCHIP0_EDMA31TC0DBS(0x2) | ||
97 | #define CFGCHIP1_TBCLKSYNC BIT(12) | ||
98 | #define CFGCHIP1_AMUTESEL0(n) ((n) << 0) | ||
99 | #define CFGCHIP1_AMUTESEL0_MASK CFGCHIP1_AMUTESEL0(0xf) | ||
100 | #define CFGCHIP1_AMUTESEL0_LOW CFGCHIP1_AMUTESEL0(0x0) | ||
101 | #define CFGCHIP1_AMUTESEL0_BANK_0 CFGCHIP1_AMUTESEL0(0x1) | ||
102 | #define CFGCHIP1_AMUTESEL0_BANK_1 CFGCHIP1_AMUTESEL0(0x2) | ||
103 | #define CFGCHIP1_AMUTESEL0_BANK_2 CFGCHIP1_AMUTESEL0(0x3) | ||
104 | #define CFGCHIP1_AMUTESEL0_BANK_3 CFGCHIP1_AMUTESEL0(0x4) | ||
105 | #define CFGCHIP1_AMUTESEL0_BANK_4 CFGCHIP1_AMUTESEL0(0x5) | ||
106 | #define CFGCHIP1_AMUTESEL0_BANK_5 CFGCHIP1_AMUTESEL0(0x6) | ||
107 | #define CFGCHIP1_AMUTESEL0_BANK_6 CFGCHIP1_AMUTESEL0(0x7) | ||
108 | #define CFGCHIP1_AMUTESEL0_BANK_7 CFGCHIP1_AMUTESEL0(0x8) | ||
109 | |||
110 | /* CFGCHIP2 (USB PHY) register bits */ | ||
111 | #define CFGCHIP2_PHYCLKGD BIT(17) | ||
112 | #define CFGCHIP2_VBUSSENSE BIT(16) | ||
113 | #define CFGCHIP2_RESET BIT(15) | ||
114 | #define CFGCHIP2_OTGMODE(n) ((n) << 13) | ||
115 | #define CFGCHIP2_OTGMODE_MASK CFGCHIP2_OTGMODE(0x3) | ||
116 | #define CFGCHIP2_OTGMODE_NO_OVERRIDE CFGCHIP2_OTGMODE(0x0) | ||
117 | #define CFGCHIP2_OTGMODE_FORCE_HOST CFGCHIP2_OTGMODE(0x1) | ||
118 | #define CFGCHIP2_OTGMODE_FORCE_DEVICE CFGCHIP2_OTGMODE(0x2) | ||
119 | #define CFGCHIP2_OTGMODE_FORCE_HOST_VBUS_LOW CFGCHIP2_OTGMODE(0x3) | ||
120 | #define CFGCHIP2_USB1PHYCLKMUX BIT(12) | ||
121 | #define CFGCHIP2_USB2PHYCLKMUX BIT(11) | ||
122 | #define CFGCHIP2_PHYPWRDN BIT(10) | ||
123 | #define CFGCHIP2_OTGPWRDN BIT(9) | ||
124 | #define CFGCHIP2_DATPOL BIT(8) | ||
125 | #define CFGCHIP2_USB1SUSPENDM BIT(7) | ||
126 | #define CFGCHIP2_PHY_PLLON BIT(6) | ||
127 | #define CFGCHIP2_SESENDEN BIT(5) | ||
128 | #define CFGCHIP2_VBDTCTEN BIT(4) | ||
129 | #define CFGCHIP2_REFFREQ(n) ((n) << 0) | ||
130 | #define CFGCHIP2_REFFREQ_MASK CFGCHIP2_REFFREQ(0xf) | ||
131 | #define CFGCHIP2_REFFREQ_12MHZ CFGCHIP2_REFFREQ(0x1) | ||
132 | #define CFGCHIP2_REFFREQ_24MHZ CFGCHIP2_REFFREQ(0x2) | ||
133 | #define CFGCHIP2_REFFREQ_48MHZ CFGCHIP2_REFFREQ(0x3) | ||
134 | #define CFGCHIP2_REFFREQ_19_2MHZ CFGCHIP2_REFFREQ(0x4) | ||
135 | #define CFGCHIP2_REFFREQ_38_4MHZ CFGCHIP2_REFFREQ(0x5) | ||
136 | #define CFGCHIP2_REFFREQ_13MHZ CFGCHIP2_REFFREQ(0x6) | ||
137 | #define CFGCHIP2_REFFREQ_26MHZ CFGCHIP2_REFFREQ(0x7) | ||
138 | #define CFGCHIP2_REFFREQ_20MHZ CFGCHIP2_REFFREQ(0x8) | ||
139 | #define CFGCHIP2_REFFREQ_40MHZ CFGCHIP2_REFFREQ(0x9) | ||
140 | |||
141 | /* CFGCHIP3 (EMAC/uPP/PLL1/ASYNC3/PRU/DIV4.5/EMIFA) register bits */ | ||
142 | #define CFGCHIP3_RMII_SEL BIT(8) | ||
143 | #define CFGCHIP3_UPP_TX_CLKSRC BIT(6) | ||
144 | #define CFGCHIP3_PLL1_MASTER_LOCK BIT(5) | ||
145 | #define CFGCHIP3_ASYNC3_CLKSRC BIT(4) | ||
146 | #define CFGCHIP3_PRUEVTSEL BIT(3) | ||
147 | #define CFGCHIP3_DIV45PENA BIT(2) | ||
148 | #define CFGCHIP3_EMA_CLKSRC BIT(1) | ||
149 | |||
150 | /* CFGCHIP4 (McASP0 AMUNTEIN) register bits */ | ||
151 | #define CFGCHIP4_AMUTECLR0 BIT(0) | ||
152 | |||
153 | #endif /* __LINUX_MFD_DA8XX_CFGCHIP_H */ | ||