Merge tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
This commit is contained in:
@@ -137,35 +137,6 @@ config USB_ISP1301
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called phy-isp1301.
|
||||
|
||||
config USB_MSM_OTG
|
||||
tristate "Qualcomm on-chip USB OTG controller support"
|
||||
depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST)
|
||||
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
|
||||
depends on RESET_CONTROLLER
|
||||
select USB_PHY
|
||||
help
|
||||
Enable this to support the USB OTG transceiver on Qualcomm chips. It
|
||||
handles PHY initialization, clock management, and workarounds
|
||||
required after resetting the hardware and power management.
|
||||
This driver is required even for peripheral only or host only
|
||||
mode configurations.
|
||||
This driver is not supported on boards like trout which
|
||||
has an external PHY.
|
||||
|
||||
config USB_QCOM_8X16_PHY
|
||||
tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support"
|
||||
depends on ARCH_QCOM || COMPILE_TEST
|
||||
depends on RESET_CONTROLLER
|
||||
select USB_PHY
|
||||
select USB_ULPI_VIEWPORT
|
||||
help
|
||||
Enable this to support the USB transceiver on Qualcomm 8x16 chipsets.
|
||||
It handles PHY initialization, clock management, power management,
|
||||
and workarounds required after resetting the hardware.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called phy-qcom-8x16-usb.
|
||||
|
||||
config USB_MV_OTG
|
||||
tristate "Marvell USB OTG support"
|
||||
depends on USB_EHCI_MV && USB_MV_UDC && PM && USB_OTG
|
||||
|
@@ -19,8 +19,6 @@ obj-$(CONFIG_TWL6030_USB) += phy-twl6030-usb.o
|
||||
obj-$(CONFIG_USB_EHCI_TEGRA) += phy-tegra-usb.o
|
||||
obj-$(CONFIG_USB_GPIO_VBUS) += phy-gpio-vbus-usb.o
|
||||
obj-$(CONFIG_USB_ISP1301) += phy-isp1301.o
|
||||
obj-$(CONFIG_USB_MSM_OTG) += phy-msm-usb.o
|
||||
obj-$(CONFIG_USB_QCOM_8X16_PHY) += phy-qcom-8x16-usb.o
|
||||
obj-$(CONFIG_USB_MV_OTG) += phy-mv-usb.o
|
||||
obj-$(CONFIG_USB_MXS_PHY) += phy-mxs-usb.o
|
||||
obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
|
||||
|
@@ -1,10 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* USB of helper code
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* USB transceiver driver for AB8500 family chips
|
||||
*
|
||||
@@ -5,21 +6,6 @@
|
||||
* Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
|
||||
* Avinash Kumar <avinash.kumar@stericsson.com>
|
||||
* Thirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/err.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2007,2008 Freescale semiconductor, Inc.
|
||||
*
|
||||
@@ -5,20 +6,6 @@
|
||||
* Jerry Huang <Chang-Ming.Huang@freescale.com>
|
||||
*
|
||||
* Initialization based on code from Shlomi Gridish.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@@ -1,19 +1,5 @@
|
||||
/* Copyright (C) 2007,2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. */
|
||||
|
||||
#include <linux/usb/otg-fsm.h>
|
||||
#include <linux/usb/otg.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* NOP USB transceiver for all USB transceiver which are either built-in
|
||||
* into USB IP or which are mostly autonomous.
|
||||
@@ -5,20 +6,6 @@
|
||||
* Copyright (C) 2009 Texas Instruments Inc
|
||||
* Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* Current status:
|
||||
* This provides a "nop" transceiver for PHYs which are
|
||||
* autonomous such as isp1504, isp1707, etc.
|
||||
@@ -224,7 +211,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
|
||||
int err = 0;
|
||||
|
||||
u32 clk_rate = 0;
|
||||
bool needs_vcc = false;
|
||||
bool needs_vcc = false, needs_clk = false;
|
||||
|
||||
if (dev->of_node) {
|
||||
struct device_node *node = dev->of_node;
|
||||
@@ -233,6 +220,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
|
||||
clk_rate = 0;
|
||||
|
||||
needs_vcc = of_property_read_bool(node, "vcc-supply");
|
||||
needs_clk = of_property_read_bool(node, "clocks");
|
||||
nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset",
|
||||
GPIOD_ASIS);
|
||||
err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
|
||||
@@ -275,6 +263,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
|
||||
if (IS_ERR(nop->clk)) {
|
||||
dev_dbg(dev, "Can't get phy clock: %ld\n",
|
||||
PTR_ERR(nop->clk));
|
||||
if (needs_clk)
|
||||
return PTR_ERR(nop->clk);
|
||||
}
|
||||
|
||||
if (!IS_ERR(nop->clk) && clk_rate) {
|
||||
|
@@ -1,11 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* gpio-vbus.c - simple GPIO VBUS sensing driver for B peripheral devices
|
||||
*
|
||||
* Copyright (c) 2008 Philipp Zabel <philipp.zabel@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
@@ -1,22 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* isp1301_omap - ISP 1301 USB transceiver, talking to OMAP OTG controller
|
||||
*
|
||||
* Copyright (C) 2004 Texas Instruments
|
||||
* Copyright (C) 2004 David Brownell
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
@@ -1183,9 +1170,11 @@ static irqreturn_t isp1301_irq(int irq, void *isp)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void isp1301_timer(unsigned long _isp)
|
||||
static void isp1301_timer(struct timer_list *t)
|
||||
{
|
||||
isp1301_defer_work((void *)_isp, WORK_TIMER);
|
||||
struct isp1301 *isp = from_timer(isp, t, timer);
|
||||
|
||||
isp1301_defer_work(isp, WORK_TIMER);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -1222,7 +1211,6 @@ static int isp1301_remove(struct i2c_client *i2c)
|
||||
if (machine_is_omap_h2())
|
||||
gpio_free(2);
|
||||
|
||||
isp->timer.data = 0;
|
||||
set_bit(WORK_STOP, &isp->todo);
|
||||
del_timer_sync(&isp->timer);
|
||||
flush_work(&isp->work);
|
||||
@@ -1507,9 +1495,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
|
||||
}
|
||||
|
||||
INIT_WORK(&isp->work, isp1301_work);
|
||||
init_timer(&isp->timer);
|
||||
isp->timer.function = isp1301_timer;
|
||||
isp->timer.data = (unsigned long) isp;
|
||||
timer_setup(&isp->timer, isp1301_timer, 0);
|
||||
|
||||
i2c_set_clientdata(i2c, isp);
|
||||
isp->client = i2c;
|
||||
|
@@ -1,13 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* NXP ISP1301 USB transceiver driver
|
||||
*
|
||||
* Copyright (C) 2012 Roland Stigge
|
||||
*
|
||||
* Author: Roland Stigge <stigge@antcom.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@@ -1,19 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* phy-keystone - USB PHY, talking to dwc3 controller in Keystone.
|
||||
*
|
||||
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Author: WingMan Kwok <w-kwok2@ti.com>
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2011 Marvell International Ltd. All rights reserved.
|
||||
* Author: Chao Xie <chao.xie@marvell.com>
|
||||
* Neil Zhang <zhangwm@marvell.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -87,9 +83,10 @@ static void mv_otg_run_state_machine(struct mv_otg *mvotg,
|
||||
queue_delayed_work(mvotg->qwork, &mvotg->work, delay);
|
||||
}
|
||||
|
||||
static void mv_otg_timer_await_bcon(unsigned long data)
|
||||
static void mv_otg_timer_await_bcon(struct timer_list *t)
|
||||
{
|
||||
struct mv_otg *mvotg = (struct mv_otg *) data;
|
||||
struct mv_otg *mvotg = from_timer(mvotg, t,
|
||||
otg_ctrl.timer[A_WAIT_BCON_TIMER]);
|
||||
|
||||
mvotg->otg_ctrl.a_wait_bcon_timeout = 1;
|
||||
|
||||
@@ -117,8 +114,7 @@ static int mv_otg_cancel_timer(struct mv_otg *mvotg, unsigned int id)
|
||||
}
|
||||
|
||||
static int mv_otg_set_timer(struct mv_otg *mvotg, unsigned int id,
|
||||
unsigned long interval,
|
||||
void (*callback) (unsigned long))
|
||||
unsigned long interval)
|
||||
{
|
||||
struct timer_list *timer;
|
||||
|
||||
@@ -131,9 +127,6 @@ static int mv_otg_set_timer(struct mv_otg *mvotg, unsigned int id,
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
init_timer(timer);
|
||||
timer->data = (unsigned long) mvotg;
|
||||
timer->function = callback;
|
||||
timer->expires = jiffies + interval;
|
||||
add_timer(timer);
|
||||
|
||||
@@ -459,8 +452,7 @@ run:
|
||||
if (old_state != OTG_STATE_A_HOST)
|
||||
mv_otg_start_host(mvotg, 1);
|
||||
mv_otg_set_timer(mvotg, A_WAIT_BCON_TIMER,
|
||||
T_A_WAIT_BCON,
|
||||
mv_otg_timer_await_bcon);
|
||||
T_A_WAIT_BCON);
|
||||
/*
|
||||
* Now, we directly enter A_HOST. So set b_conn = 1
|
||||
* here. In fact, it need host driver to notify us.
|
||||
@@ -722,7 +714,8 @@ static int mv_otg_probe(struct platform_device *pdev)
|
||||
otg->set_vbus = mv_otg_set_vbus;
|
||||
|
||||
for (i = 0; i < OTG_TIMER_NUM; i++)
|
||||
init_timer(&mvotg->otg_ctrl.timer[i]);
|
||||
timer_setup(&mvotg->otg_ctrl.timer[i],
|
||||
mv_otg_timer_await_bcon, 0);
|
||||
|
||||
r = platform_get_resource_byname(mvotg->pdev,
|
||||
IORESOURCE_MEM, "phyregs");
|
||||
|
@@ -1,10 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2011 Marvell International Ltd. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef __MV_USB_OTG_CONTROLLER__
|
||||
|
@@ -1,14 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2012-2014 Freescale Semiconductor, Inc.
|
||||
* Copyright (C) 2012 Marek Vasut <marex@denx.de>
|
||||
* on behalf of DENX Software Engineering GmbH
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -67,11 +61,26 @@
|
||||
#define ANADIG_ANA_MISC0_SET 0x154
|
||||
#define ANADIG_ANA_MISC0_CLR 0x158
|
||||
|
||||
#define ANADIG_USB1_CHRG_DETECT_SET 0x1b4
|
||||
#define ANADIG_USB1_CHRG_DETECT_CLR 0x1b8
|
||||
#define ANADIG_USB1_CHRG_DETECT_EN_B BIT(20)
|
||||
#define ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B BIT(19)
|
||||
#define ANADIG_USB1_CHRG_DETECT_CHK_CONTACT BIT(18)
|
||||
|
||||
#define ANADIG_USB1_VBUS_DET_STAT 0x1c0
|
||||
#define ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID BIT(3)
|
||||
|
||||
#define ANADIG_USB1_CHRG_DET_STAT 0x1d0
|
||||
#define ANADIG_USB1_CHRG_DET_STAT_DM_STATE BIT(2)
|
||||
#define ANADIG_USB1_CHRG_DET_STAT_CHRG_DETECTED BIT(1)
|
||||
#define ANADIG_USB1_CHRG_DET_STAT_PLUG_CONTACT BIT(0)
|
||||
|
||||
#define ANADIG_USB2_VBUS_DET_STAT 0x220
|
||||
|
||||
#define ANADIG_USB1_LOOPBACK_SET 0x1e4
|
||||
#define ANADIG_USB1_LOOPBACK_CLR 0x1e8
|
||||
#define ANADIG_USB1_LOOPBACK_UTMI_TESTSTART BIT(0)
|
||||
|
||||
#define ANADIG_USB2_LOOPBACK_SET 0x244
|
||||
#define ANADIG_USB2_LOOPBACK_CLR 0x248
|
||||
|
||||
@@ -479,6 +488,144 @@ static int mxs_phy_on_disconnect(struct usb_phy *phy,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MXS_USB_CHARGER_DATA_CONTACT_TIMEOUT 100
|
||||
static int mxs_charger_data_contact_detect(struct mxs_phy *x)
|
||||
{
|
||||
struct regmap *regmap = x->regmap_anatop;
|
||||
int i, stable_contact_count = 0;
|
||||
u32 val;
|
||||
|
||||
/* Check if vbus is valid */
|
||||
regmap_read(regmap, ANADIG_USB1_VBUS_DET_STAT, &val);
|
||||
if (!(val & ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID)) {
|
||||
dev_err(x->phy.dev, "vbus is not valid\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Enable charger detector */
|
||||
regmap_write(regmap, ANADIG_USB1_CHRG_DETECT_CLR,
|
||||
ANADIG_USB1_CHRG_DETECT_EN_B);
|
||||
/*
|
||||
* - Do not check whether a charger is connected to the USB port
|
||||
* - Check whether the USB plug has been in contact with each other
|
||||
*/
|
||||
regmap_write(regmap, ANADIG_USB1_CHRG_DETECT_SET,
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CONTACT |
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B);
|
||||
|
||||
/* Check if plug is connected */
|
||||
for (i = 0; i < MXS_USB_CHARGER_DATA_CONTACT_TIMEOUT; i++) {
|
||||
regmap_read(regmap, ANADIG_USB1_CHRG_DET_STAT, &val);
|
||||
if (val & ANADIG_USB1_CHRG_DET_STAT_PLUG_CONTACT) {
|
||||
stable_contact_count++;
|
||||
if (stable_contact_count > 5)
|
||||
/* Data pin makes contact */
|
||||
break;
|
||||
else
|
||||
usleep_range(5000, 10000);
|
||||
} else {
|
||||
stable_contact_count = 0;
|
||||
usleep_range(5000, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
if (i == MXS_USB_CHARGER_DATA_CONTACT_TIMEOUT) {
|
||||
dev_err(x->phy.dev,
|
||||
"Data pin can't make good contact.\n");
|
||||
/* Disable charger detector */
|
||||
regmap_write(regmap, ANADIG_USB1_CHRG_DETECT_SET,
|
||||
ANADIG_USB1_CHRG_DETECT_EN_B |
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum usb_charger_type mxs_charger_primary_detection(struct mxs_phy *x)
|
||||
{
|
||||
struct regmap *regmap = x->regmap_anatop;
|
||||
enum usb_charger_type chgr_type = UNKNOWN_TYPE;
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* - Do check whether a charger is connected to the USB port
|
||||
* - Do not Check whether the USB plug has been in contact with
|
||||
* each other
|
||||
*/
|
||||
regmap_write(regmap, ANADIG_USB1_CHRG_DETECT_CLR,
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CONTACT |
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B);
|
||||
|
||||
msleep(100);
|
||||
|
||||
/* Check if it is a charger */
|
||||
regmap_read(regmap, ANADIG_USB1_CHRG_DET_STAT, &val);
|
||||
if (!(val & ANADIG_USB1_CHRG_DET_STAT_CHRG_DETECTED)) {
|
||||
chgr_type = SDP_TYPE;
|
||||
dev_dbg(x->phy.dev, "It is a stardard downstream port\n");
|
||||
}
|
||||
|
||||
/* Disable charger detector */
|
||||
regmap_write(regmap, ANADIG_USB1_CHRG_DETECT_SET,
|
||||
ANADIG_USB1_CHRG_DETECT_EN_B |
|
||||
ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B);
|
||||
|
||||
return chgr_type;
|
||||
}
|
||||
|
||||
/*
|
||||
* It must be called after DP is pulled up, which is used to
|
||||
* differentiate DCP and CDP.
|
||||
*/
|
||||
enum usb_charger_type mxs_charger_secondary_detection(struct mxs_phy *x)
|
||||
{
|
||||
struct regmap *regmap = x->regmap_anatop;
|
||||
int val;
|
||||
|
||||
msleep(80);
|
||||
|
||||
regmap_read(regmap, ANADIG_USB1_CHRG_DET_STAT, &val);
|
||||
if (val & ANADIG_USB1_CHRG_DET_STAT_DM_STATE) {
|
||||
dev_dbg(x->phy.dev, "It is a dedicate charging port\n");
|
||||
return DCP_TYPE;
|
||||
} else {
|
||||
dev_dbg(x->phy.dev, "It is a charging downstream port\n");
|
||||
return CDP_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
static enum usb_charger_type mxs_phy_charger_detect(struct usb_phy *phy)
|
||||
{
|
||||
struct mxs_phy *mxs_phy = to_mxs_phy(phy);
|
||||
struct regmap *regmap = mxs_phy->regmap_anatop;
|
||||
void __iomem *base = phy->io_priv;
|
||||
enum usb_charger_type chgr_type = UNKNOWN_TYPE;
|
||||
|
||||
if (mxs_charger_data_contact_detect(mxs_phy))
|
||||
return chgr_type;
|
||||
|
||||
chgr_type = mxs_charger_primary_detection(mxs_phy);
|
||||
|
||||
if (chgr_type != SDP_TYPE) {
|
||||
/* Pull up DP via test */
|
||||
writel_relaxed(BM_USBPHY_DEBUG_CLKGATE,
|
||||
base + HW_USBPHY_DEBUG_CLR);
|
||||
regmap_write(regmap, ANADIG_USB1_LOOPBACK_SET,
|
||||
ANADIG_USB1_LOOPBACK_UTMI_TESTSTART);
|
||||
|
||||
chgr_type = mxs_charger_secondary_detection(mxs_phy);
|
||||
|
||||
/* Stop the test */
|
||||
regmap_write(regmap, ANADIG_USB1_LOOPBACK_CLR,
|
||||
ANADIG_USB1_LOOPBACK_UTMI_TESTSTART);
|
||||
writel_relaxed(BM_USBPHY_DEBUG_CLKGATE,
|
||||
base + HW_USBPHY_DEBUG_SET);
|
||||
}
|
||||
|
||||
return chgr_type;
|
||||
}
|
||||
|
||||
static int mxs_phy_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
@@ -567,6 +714,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
|
||||
mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
|
||||
mxs_phy->phy.type = USB_PHY_TYPE_USB2;
|
||||
mxs_phy->phy.set_wakeup = mxs_phy_set_wakeup;
|
||||
mxs_phy->phy.charger_detect = mxs_phy_charger_detect;
|
||||
|
||||
mxs_phy->clk = clk;
|
||||
mxs_phy->data = of_id->data;
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* OMAP OTG controller driver
|
||||
*
|
||||
@@ -6,15 +7,6 @@
|
||||
* Copyright (C) 2005-2006 Nokia Corporation
|
||||
* Copyright (C) 2004 Texas Instruments
|
||||
* Copyright (C) 2004 David Brownell
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General
|
||||
* Public License. See the file "COPYING" in the main directory of this
|
||||
* archive for more details.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
|
@@ -1,366 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Linaro Limited
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/extcon.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/usb/ulpi.h>
|
||||
|
||||
#define HSPHY_AHBBURST 0x0090
|
||||
#define HSPHY_AHBMODE 0x0098
|
||||
#define HSPHY_GENCONFIG 0x009c
|
||||
#define HSPHY_GENCONFIG_2 0x00a0
|
||||
|
||||
#define HSPHY_USBCMD 0x0140
|
||||
#define HSPHY_ULPI_VIEWPORT 0x0170
|
||||
#define HSPHY_CTRL 0x0240
|
||||
|
||||
#define HSPHY_TXFIFO_IDLE_FORCE_DIS BIT(4)
|
||||
#define HSPHY_SESS_VLD_CTRL_EN BIT(7)
|
||||
#define HSPHY_POR_ASSERT BIT(0)
|
||||
#define HSPHY_RETEN BIT(1)
|
||||
|
||||
#define HSPHY_SESS_VLD_CTRL BIT(25)
|
||||
|
||||
#define ULPI_PWR_CLK_MNG_REG 0x88
|
||||
#define ULPI_PWR_OTG_COMP_DISABLE BIT(0)
|
||||
|
||||
#define ULPI_MISC_A 0x96
|
||||
#define ULPI_MISC_A_VBUSVLDEXTSEL BIT(1)
|
||||
#define ULPI_MISC_A_VBUSVLDEXT BIT(0)
|
||||
|
||||
#define HSPHY_3P3_MIN 3050000 /* uV */
|
||||
#define HSPHY_3P3_MAX 3300000 /* uV */
|
||||
|
||||
#define HSPHY_1P8_MIN 1800000 /* uV */
|
||||
#define HSPHY_1P8_MAX 1800000 /* uV */
|
||||
|
||||
#define HSPHY_VDD_MIN 5
|
||||
#define HSPHY_VDD_MAX 7
|
||||
|
||||
struct phy_8x16 {
|
||||
struct usb_phy phy;
|
||||
void __iomem *regs;
|
||||
struct clk *core_clk;
|
||||
struct clk *iface_clk;
|
||||
struct regulator_bulk_data regulator[3];
|
||||
|
||||
struct reset_control *phy_reset;
|
||||
|
||||
struct gpio_desc *switch_gpio;
|
||||
struct notifier_block reboot_notify;
|
||||
};
|
||||
|
||||
static int phy_8x16_notify_connect(struct usb_phy *phy,
|
||||
enum usb_device_speed speed)
|
||||
{
|
||||
struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy);
|
||||
u32 val;
|
||||
|
||||
val = ULPI_MISC_A_VBUSVLDEXTSEL | ULPI_MISC_A_VBUSVLDEXT;
|
||||
usb_phy_io_write(&qphy->phy, val, ULPI_SET(ULPI_MISC_A));
|
||||
|
||||
val = readl(qphy->regs + HSPHY_USBCMD);
|
||||
val |= HSPHY_SESS_VLD_CTRL;
|
||||
writel(val, qphy->regs + HSPHY_USBCMD);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int phy_8x16_notify_disconnect(struct usb_phy *phy,
|
||||
enum usb_device_speed speed)
|
||||
{
|
||||
struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy);
|
||||
u32 val;
|
||||
|
||||
val = ULPI_MISC_A_VBUSVLDEXT | ULPI_MISC_A_VBUSVLDEXTSEL;
|
||||
usb_phy_io_write(&qphy->phy, val, ULPI_CLR(ULPI_MISC_A));
|
||||
|
||||
val = readl(qphy->regs + HSPHY_USBCMD);
|
||||
val &= ~HSPHY_SESS_VLD_CTRL;
|
||||
writel(val, qphy->regs + HSPHY_USBCMD);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int phy_8x16_vbus_on(struct phy_8x16 *qphy)
|
||||
{
|
||||
phy_8x16_notify_connect(&qphy->phy, USB_SPEED_UNKNOWN);
|
||||
|
||||
/* Switch D+/D- lines to Device connector */
|
||||
gpiod_set_value_cansleep(qphy->switch_gpio, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int phy_8x16_vbus_off(struct phy_8x16 *qphy)
|
||||
{
|
||||
phy_8x16_notify_disconnect(&qphy->phy, USB_SPEED_UNKNOWN);
|
||||
|
||||
/* Switch D+/D- lines to USB HUB */
|
||||
gpiod_set_value_cansleep(qphy->switch_gpio, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int phy_8x16_vbus_notify(struct notifier_block *nb, unsigned long event,
|
||||
void *ptr)
|
||||
{
|
||||
struct usb_phy *usb_phy = container_of(nb, struct usb_phy, vbus_nb);
|
||||
struct phy_8x16 *qphy = container_of(usb_phy, struct phy_8x16, phy);
|
||||
|
||||
if (event)
|
||||
phy_8x16_vbus_on(qphy);
|
||||
else
|
||||
phy_8x16_vbus_off(qphy);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static int phy_8x16_init(struct usb_phy *phy)
|
||||
{
|
||||
struct phy_8x16 *qphy = container_of(phy, struct phy_8x16, phy);
|
||||
u32 val, init[] = {0x44, 0x6B, 0x24, 0x13};
|
||||
u32 addr = ULPI_EXT_VENDOR_SPECIFIC;
|
||||
int idx, state;
|
||||
|
||||
for (idx = 0; idx < ARRAY_SIZE(init); idx++)
|
||||
usb_phy_io_write(phy, init[idx], addr + idx);
|
||||
|
||||
reset_control_reset(qphy->phy_reset);
|
||||
|
||||
/* Assert USB HSPHY_POR */
|
||||
val = readl(qphy->regs + HSPHY_CTRL);
|
||||
val |= HSPHY_POR_ASSERT;
|
||||
writel(val, qphy->regs + HSPHY_CTRL);
|
||||
|
||||
/*
|
||||
* wait for minimum 10 microseconds as suggested in HPG.
|
||||
* Use a slightly larger value since the exact value didn't
|
||||
* work 100% of the time.
|
||||
*/
|
||||
usleep_range(12, 15);
|
||||
|
||||
/* Deassert USB HSPHY_POR */
|
||||
val = readl(qphy->regs + HSPHY_CTRL);
|
||||
val &= ~HSPHY_POR_ASSERT;
|
||||
writel(val, qphy->regs + HSPHY_CTRL);
|
||||
|
||||
usleep_range(10, 15);
|
||||
|
||||
writel(0x00, qphy->regs + HSPHY_AHBBURST);
|
||||
writel(0x08, qphy->regs + HSPHY_AHBMODE);
|
||||
|
||||
/* workaround for rx buffer collision issue */
|
||||
val = readl(qphy->regs + HSPHY_GENCONFIG);
|
||||
val &= ~HSPHY_TXFIFO_IDLE_FORCE_DIS;
|
||||
writel(val, qphy->regs + HSPHY_GENCONFIG);
|
||||
|
||||
val = readl(qphy->regs + HSPHY_GENCONFIG_2);
|
||||
val |= HSPHY_SESS_VLD_CTRL_EN;
|
||||
writel(val, qphy->regs + HSPHY_GENCONFIG_2);
|
||||
|
||||
val = ULPI_PWR_OTG_COMP_DISABLE;
|
||||
usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG));
|
||||
|
||||
state = extcon_get_state(qphy->phy.edev, EXTCON_USB);
|
||||
if (state)
|
||||
phy_8x16_vbus_on(qphy);
|
||||
else
|
||||
phy_8x16_vbus_off(qphy);
|
||||
|
||||
val = usb_phy_io_read(&qphy->phy, ULPI_FUNC_CTRL);
|
||||
val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
|
||||
val |= ULPI_FUNC_CTRL_OPMODE_NORMAL;
|
||||
usb_phy_io_write(&qphy->phy, val, ULPI_FUNC_CTRL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void phy_8x16_shutdown(struct usb_phy *phy)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/* Put the controller in non-driving mode */
|
||||
val = usb_phy_io_read(phy, ULPI_FUNC_CTRL);
|
||||
val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
|
||||
val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
|
||||
usb_phy_io_write(phy, val, ULPI_FUNC_CTRL);
|
||||
}
|
||||
|
||||
static int phy_8x16_read_devicetree(struct phy_8x16 *qphy)
|
||||
{
|
||||
struct device *dev = qphy->phy.dev;
|
||||
int ret;
|
||||
|
||||
qphy->core_clk = devm_clk_get(dev, "core");
|
||||
if (IS_ERR(qphy->core_clk))
|
||||
return PTR_ERR(qphy->core_clk);
|
||||
|
||||
qphy->iface_clk = devm_clk_get(dev, "iface");
|
||||
if (IS_ERR(qphy->iface_clk))
|
||||
return PTR_ERR(qphy->iface_clk);
|
||||
|
||||
qphy->regulator[0].supply = "v3p3";
|
||||
qphy->regulator[1].supply = "v1p8";
|
||||
qphy->regulator[2].supply = "vddcx";
|
||||
|
||||
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(qphy->regulator),
|
||||
qphy->regulator);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
qphy->phy_reset = devm_reset_control_get(dev, "phy");
|
||||
if (IS_ERR(qphy->phy_reset))
|
||||
return PTR_ERR(qphy->phy_reset);
|
||||
|
||||
qphy->switch_gpio = devm_gpiod_get_optional(dev, "switch",
|
||||
GPIOD_OUT_LOW);
|
||||
return PTR_ERR_OR_ZERO(qphy->switch_gpio);
|
||||
}
|
||||
|
||||
static int phy_8x16_reboot_notify(struct notifier_block *this,
|
||||
unsigned long code, void *unused)
|
||||
{
|
||||
struct phy_8x16 *qphy;
|
||||
|
||||
qphy = container_of(this, struct phy_8x16, reboot_notify);
|
||||
|
||||
/*
|
||||
* Ensure that D+/D- lines are routed to uB connector, so
|
||||
* we could load bootloader/kernel at next reboot_notify
|
||||
*/
|
||||
gpiod_set_value_cansleep(qphy->switch_gpio, 0);
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static int phy_8x16_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct phy_8x16 *qphy;
|
||||
struct resource *res;
|
||||
struct usb_phy *phy;
|
||||
int ret;
|
||||
|
||||
qphy = devm_kzalloc(&pdev->dev, sizeof(*qphy), GFP_KERNEL);
|
||||
if (!qphy)
|
||||
return -ENOMEM;
|
||||
|
||||
platform_set_drvdata(pdev, qphy);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
qphy->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(qphy->regs))
|
||||
return PTR_ERR(qphy->regs);
|
||||
|
||||
phy = &qphy->phy;
|
||||
phy->dev = &pdev->dev;
|
||||
phy->label = dev_name(&pdev->dev);
|
||||
phy->init = phy_8x16_init;
|
||||
phy->shutdown = phy_8x16_shutdown;
|
||||
phy->notify_connect = phy_8x16_notify_connect;
|
||||
phy->notify_disconnect = phy_8x16_notify_disconnect;
|
||||
phy->io_priv = qphy->regs + HSPHY_ULPI_VIEWPORT;
|
||||
phy->io_ops = &ulpi_viewport_access_ops;
|
||||
phy->type = USB_PHY_TYPE_USB2;
|
||||
phy->vbus_nb.notifier_call = phy_8x16_vbus_notify;
|
||||
phy->id_nb.notifier_call = NULL;
|
||||
|
||||
ret = phy_8x16_read_devicetree(qphy);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = clk_set_rate(qphy->core_clk, INT_MAX);
|
||||
if (ret < 0)
|
||||
dev_dbg(phy->dev, "Can't boost core clock\n");
|
||||
|
||||
ret = clk_prepare_enable(qphy->core_clk);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = clk_prepare_enable(qphy->iface_clk);
|
||||
if (ret < 0)
|
||||
goto off_core;
|
||||
|
||||
ret = regulator_bulk_enable(ARRAY_SIZE(qphy->regulator),
|
||||
qphy->regulator);
|
||||
if (WARN_ON(ret))
|
||||
goto off_clks;
|
||||
|
||||
ret = usb_add_phy_dev(&qphy->phy);
|
||||
if (ret)
|
||||
goto off_power;
|
||||
|
||||
qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify;
|
||||
register_reboot_notifier(&qphy->reboot_notify);
|
||||
|
||||
return 0;
|
||||
|
||||
off_power:
|
||||
regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
|
||||
off_clks:
|
||||
clk_disable_unprepare(qphy->iface_clk);
|
||||
off_core:
|
||||
clk_disable_unprepare(qphy->core_clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int phy_8x16_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct phy_8x16 *qphy = platform_get_drvdata(pdev);
|
||||
|
||||
unregister_reboot_notifier(&qphy->reboot_notify);
|
||||
|
||||
/*
|
||||
* Ensure that D+/D- lines are routed to uB connector, so
|
||||
* we could load bootloader/kernel at next reboot_notify
|
||||
*/
|
||||
gpiod_set_value_cansleep(qphy->switch_gpio, 0);
|
||||
|
||||
usb_remove_phy(&qphy->phy);
|
||||
|
||||
clk_disable_unprepare(qphy->iface_clk);
|
||||
clk_disable_unprepare(qphy->core_clk);
|
||||
regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id phy_8x16_dt_match[] = {
|
||||
{ .compatible = "qcom,usb-8x16-phy" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, phy_8x16_dt_match);
|
||||
|
||||
static struct platform_driver phy_8x16_driver = {
|
||||
.probe = phy_8x16_probe,
|
||||
.remove = phy_8x16_remove,
|
||||
.driver = {
|
||||
.name = "phy-qcom-8x16-usb",
|
||||
.of_match_table = phy_8x16_dt_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(phy_8x16_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("Qualcomm APQ8016/MSM8916 chipsets USB transceiver driver");
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Tahvo USB transceiver driver
|
||||
*
|
||||
@@ -9,21 +10,12 @@
|
||||
*
|
||||
* Original driver written by Juha Yrjölä, Tony Lindgren and Timo Teräs.
|
||||
* Modified for Retu/Tahvo MFD by Aaro Koskinen.
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General
|
||||
* Public License. See the file "COPYING" in the main directory of this
|
||||
* archive for more details.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/extcon.h>
|
||||
#include <linux/extcon-provider.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/usb/otg.h>
|
||||
@@ -368,7 +360,8 @@ static int tahvo_usb_probe(struct platform_device *pdev)
|
||||
tu->extcon = devm_extcon_dev_allocate(&pdev->dev, tahvo_cable);
|
||||
if (IS_ERR(tu->extcon)) {
|
||||
dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
|
||||
return -ENOMEM;
|
||||
ret = PTR_ERR(tu->extcon);
|
||||
goto err_disable_clk;
|
||||
}
|
||||
|
||||
ret = devm_extcon_dev_register(&pdev->dev, tu->extcon);
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2010 Google, Inc.
|
||||
* Copyright (C) 2013 NVIDIA Corporation
|
||||
@@ -6,16 +7,6 @@
|
||||
* Erik Gilling <konkers@google.com>
|
||||
* Benoit Goby <benoit@android.com>
|
||||
* Venu Byravarasu <vbyravarasu@nvidia.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/resource.h>
|
||||
|
@@ -1,23 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* twl6030_usb - TWL6030 USB transceiver, talking to OMAP OTG driver.
|
||||
*
|
||||
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Author: Hema HK <hemahk@ti.com>
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@@ -1,15 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/export.h>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Generic ULPI USB transceiver support
|
||||
*
|
||||
@@ -7,20 +8,6 @@
|
||||
*
|
||||
* Sascha Hauer <s.hauer@pengutronix.de>
|
||||
* Freescale Semiconductors
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
@@ -1,12 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* phy.c -- USB phy handling
|
||||
*
|
||||
* Copyright (C) 2004-2013 Texas Instruments
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/export.h>
|
||||
|
Reference in New Issue
Block a user