本文整理匯總了C++中DMSG_PANIC函數的典型用法代碼示例。如果您正苦於以下問題:C++ DMSG_PANIC函數的具體用法?C++ DMSG_PANIC怎麽用?C++ DMSG_PANIC使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DMSG_PANIC函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: get_usb_cfg
/*
*******************************************************************************
* get_usb_cfg
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static s32 get_usb_cfg(struct sw_hci_hcd *sw_hci)
{
__s32 ret = 0;
/* usbc enable */
ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_used", (int *)&sw_hci->used, 64);
if(ret != 0) {
DMSG_PANIC("ERR: get usbc2 enable failed\n");
//return -1;
}
/* request gpio */
ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_drv_vbus_gpio", (int *)&sw_hci->drv_vbus_gpio_set, 64);
if(ret != 0) {
DMSG_PANIC("ERR: get usbc%d(%s) id failed\n", sw_hci->usbc_no, usbc_name[sw_hci->usbc_no]);
return -1;
}
/* host_init_state */
ret = script_parser_fetch(usbc_name[sw_hci->usbc_no], "usb_host_init_state", (int *)&(sw_hci->host_init_state), 64);
if(ret != 0) {
DMSG_PANIC("ERR: script_parser_fetch host_init_state failed\n");
return -1;
}
return 0;
}
示例2: clock_init
/*
*******************************************************************************
* clock_init
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static s32 clock_init(struct sw_hci_hcd *sw_hci, u32 ohci)
{
if(ohci){ /* ohci */
sw_hci->sie_clk = clk_get(NULL, "ahb_ohci0");
if (IS_ERR(sw_hci->sie_clk)){
DMSG_PANIC("ERR: get ohci%d abh clk failed.\n", (sw_hci->usbc_no - 1));
goto failed;
}
sw_hci->ohci_gate = clk_get(NULL, "usb_ohci0");
if (IS_ERR(sw_hci->ohci_gate)){
DMSG_PANIC("ERR: get ohci%d gate clk failed.\n", (sw_hci->usbc_no - 1));
goto failed;
}
}else{ /* ehci */
sw_hci->sie_clk = clk_get(NULL, "ahb_ehci0");
if (IS_ERR(sw_hci->sie_clk)){
DMSG_PANIC("ERR: get ehci%d abh clk failed.\n", (sw_hci->usbc_no - 1));
goto failed;
}
}
sw_hci->phy_gate = clk_get(NULL, "usb_phy1");
if (IS_ERR(sw_hci->phy_gate)){
DMSG_PANIC("ERR: get usb%d phy_gate failed.\n", sw_hci->usbc_no);
goto failed;
}
sw_hci->phy_reset = clk_get(NULL, "usb_phy1");
if (IS_ERR(sw_hci->phy_reset)){
DMSG_PANIC("ERR: get usb%d phy_reset failed.\n", sw_hci->usbc_no);
goto failed;
}
return 0;
failed:
if(sw_hci->sie_clk){
clk_put(sw_hci->sie_clk);
sw_hci->sie_clk = NULL;
}
if(sw_hci->phy_gate){
clk_put(sw_hci->phy_gate);
sw_hci->phy_gate = NULL;
}
if(sw_hci->phy_reset){
clk_put(sw_hci->phy_reset);
sw_hci->phy_reset = NULL;
}
if(sw_hci->ohci_gate){
clk_put(sw_hci->ohci_gate);
sw_hci->ohci_gate = NULL;
}
return -1;
}
示例3: sw_ohci_hcd_suspend
/*
*******************************************************************************
* sw_ohci_hcd_suspend
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static int sw_ohci_hcd_suspend(struct device *dev)
{
struct sw_hci_hcd *sw_ohci = NULL;
struct usb_hcd *hcd = NULL;
struct ohci_hcd *ohci = NULL;
unsigned long flags = 0;
int rc = 0;
if(dev == NULL){
DMSG_PANIC("ERR: Argment is invalid\n");
return 0;
}
hcd = dev_get_drvdata(dev);
if(hcd == NULL){
DMSG_PANIC("ERR: hcd is null\n");
return 0;
}
sw_ohci = dev->platform_data;
if(sw_ohci == NULL){
DMSG_PANIC("ERR: sw_ohci is null\n");
return 0;
}
if(sw_ohci->probe == 0){
DMSG_PANIC("ERR: sw_ohci is disable, can not suspend\n");
return 0;
}
ohci = hcd_to_ohci(hcd);
if(ohci == NULL){
DMSG_PANIC("ERR: ohci is null\n");
return 0;
}
DMSG_INFO("[%s]: sw_ohci_hcd_suspend\n", sw_ohci->hci_name);
/* Root hub was already suspended. Disable irq emission and
* mark HW unaccessible, bail out if RH has been resumed. Use
* the spinlock to properly synchronize with possible pending
* RH suspend or resume activity.
*
* This is still racy as hcd->state is manipulated outside of
* any locks =P But that will be a different fix.
*/
spin_lock_irqsave(&ohci->lock, flags);
ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
(void)ohci_readl(ohci, &ohci->regs->intrdisable);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
spin_unlock_irqrestore(&ohci->lock, flags);
sw_stop_ohc(sw_ohci);
return rc;
}
示例4: sunxi_otg_resume
static int sunxi_otg_resume(struct device *dev)
{
struct platform_device *pdev = NULL;
struct sunxi_otgc *otgc = NULL;
int ret;
pdev = sunxi_otg_pdev;
if(pdev == NULL){
DMSG_PANIC("%s, pdev is NULL\n", __func__);
return 0;
}
otgc = platform_get_drvdata(pdev);
if(otgc == NULL){
DMSG_PANIC("%s, otgc is NULL\n", __func__);
return 0;
}
DMSG_INFO("start:%s, otgc_work_mode:%d\n", __func__, otgc_work_mode);
if(otgc_work_mode == 0){
DMSG_INFO("end:%s, otgc driver is no work and no need resume\n", __func__);
atomic_set(&thread_suspend_flag, 0);
goto end;
}
sunxi_open_usb_clock(otgc);
sunxi_set_mode(otgc, otgc_work_mode);
switch(otgc_work_mode){
case SUNXI_GCTL_PRTCAP_HOST:
sunxi_core_soft_reset(otgc->regs);
sunxi_host_set_vbus(otgc, 1);
break;
case SUNXI_GCTL_PRTCAP_DEVICE:
ret = sunxi_core_init(otgc);
if (ret) {
dev_err(&pdev->dev, "failed to initialize core, %s_%d\n", __func__, __LINE__);
atomic_set(&thread_suspend_flag, 0);
return ret;
}
sunxi_gadget_resume(otgc);
atomic_set(&thread_suspend_flag, 0);
break;
default:
return 0;
}
end:
pm_runtime_disable(&pdev->dev);
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
DMSG_INFO("end: %s\n", __func__);
return 0;
}
示例5: sw_hcd_port_suspend
/*
*******************************************************************************
* sw_hcd_port_suspend
*
* Description:
* suspend USB port
*
* Parameters:
* sw_hcd : input. USB¿ØÖÆÆ÷
* do_suspend : input. flag. is suspend USB port or not?
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static void sw_hcd_port_suspend(struct sw_hcd *sw_hcd, bool do_suspend)
{
u8 power = 0;
void __iomem *usbc_base = sw_hcd->mregs;
if (!is_host_active(sw_hcd)){
DMSG_PANIC("ERR: usb host is not active\n");
return;
}
/* NOTE: this doesn't necessarily put PHY into low power mode,
* turning off its clock; that's a function of PHY integration and
* sw_hcd_POWER_ENSUSPEND. PHY may need a clock (sigh) to detect
* SE0 changing to connect (J) or wakeup (K) states.
*/
power = USBC_Readb(USBC_REG_PCTL(usbc_base));
if (do_suspend) {
int retries = 10000;
DMSG_INFO("[sw_hcd]: suspend port.\n");
power &= ~(1 << USBC_BP_POWER_H_RESUME);
power |= (1 << USBC_BP_POWER_H_SUSPEND);
USBC_Writeb(power, USBC_REG_PCTL(usbc_base));
/* Needed for OPT A tests */
power = USBC_Readb(USBC_REG_PCTL(usbc_base));
while (power & (1 << USBC_BP_POWER_H_SUSPEND)) {
power = USBC_Readb(USBC_REG_PCTL(usbc_base));
if (retries-- < 1)
break;
}
DMSG_DBG_HCD("DBG: Root port suspended, power %02x\n", power);
sw_hcd->port1_status |= USB_PORT_STAT_SUSPEND;
}else if (power & (1 << USBC_BP_POWER_H_SUSPEND)){
DMSG_INFO("[sw_hcd]: suspend portend, resume port.\n");
power &= ~(1 << USBC_BP_POWER_H_SUSPEND);
power |= (1 << USBC_BP_POWER_H_RESUME);
USBC_Writeb(power, USBC_REG_PCTL(usbc_base));
DMSG_DBG_HCD("DBG: Root port resuming, power %02x\n", power);
/* later, GetPortStatus will stop RESUME signaling */
sw_hcd->port1_status |= SW_HCD_PORT_STAT_RESUME;
sw_hcd->rh_timer = jiffies + msecs_to_jiffies(20);
}else{
DMSG_PANIC("WRN: sw_hcd_port_suspend nothing to do\n");
}
return ;
}
示例6: sw_hci_sun5i_exit
/*
*******************************************************************************
* sw_hci_sun5i_exit
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static void __exit sw_hci_sun5i_exit(void)
{
#ifdef CONFIG_USB_SW_SUN5I_EHCI0
if(sw_ehci0.used){
platform_device_unregister(&sw_usb_ehci_device[0]);
}else{
DMSG_PANIC("ERR: usb%d %s is disable\n", sw_ehci0.usbc_no, sw_ehci0.hci_name);
}
#endif
#ifdef CONFIG_USB_SW_SUN5I_OHCI0
if(sw_ohci0.used){
platform_device_unregister(&sw_usb_ohci_device[0]);
}else{
DMSG_PANIC("ERR: usb%d %s is disable\n", sw_ohci0.usbc_no, sw_ohci0.hci_name);
}
#endif
#ifdef CONFIG_USB_SW_SUN5I_EHCI1
if(sw_ehci1.used){
platform_device_unregister(&sw_usb_ehci_device[1]);
}else{
DMSG_PANIC("ERR: usb%d %s is disable\n", sw_ehci1.usbc_no, sw_ehci1.hci_name);
}
#endif
#ifdef CONFIG_USB_SW_SUN5I_OHCI1
if(sw_ohci1.used){
platform_device_unregister(&sw_usb_ohci_device[1]);
}else{
DMSG_PANIC("ERR: usb%d %s is disable\n", sw_ohci1.usbc_no, sw_ohci1.hci_name);
}
#endif
/* USB1 */
exit_sw_hci(&sw_ehci0, 0);
exit_sw_hci(&sw_ohci0, 1);
free_pin(usb1_drv_vbus_Handle);
usb1_drv_vbus_Handle = 0;
/* USB2 */
exit_sw_hci(&sw_ehci1, 0);
exit_sw_hci(&sw_ohci1, 1);
free_pin(usb2_drv_vbus_Handle);
usb2_drv_vbus_Handle = 0;
return ;
}
示例7: sunxi_pin_init
static int sunxi_pin_init(struct sunxi_otgc *otgc)
{
int ret = 0;
script_item_value_type_e type = 0;
script_item_u item_temp;
/* usbc drv_vbus */
type = script_get_item("usbc0", "usb_drv_vbus_gpio", &(otgc->port_ctl.drv_vbus.gpio_set));
if (type == SCIRPT_ITEM_VALUE_TYPE_PIO) {
otgc->port_ctl.drv_vbus.valid = 1;
} else {
otgc->port_ctl.drv_vbus.valid = 0;
DMSG_PANIC("ERR: get usbc det_vbus failed\n");
}
if (otgc->port_ctl.drv_vbus.valid) {
ret = gpio_request(otgc->port_ctl.drv_vbus.gpio_set.gpio.gpio, "otg_drv_vbus");
if (ret != 0) {
DMSG_PANIC("ERR: gpio_request failed\n");
otgc->port_ctl.drv_vbus.valid = 0;
} else {
gpio_direction_output(otgc->port_ctl.drv_vbus.gpio_set.gpio.gpio, 0);
}
}
/* get regulator io information */
type = script_get_item("usbc0", "usb_regulator_io", &item_temp);
if (type == SCIRPT_ITEM_VALUE_TYPE_STR) {
if (!strcmp(item_temp.str, "nocare")) {
DMSG_INFO("get usbc0_regulator is nocare\n");
otgc->port_ctl.regulator_io = NULL;
}else{
otgc->port_ctl.regulator_io = item_temp.str;
type = script_get_item("usbc0", "usb_regulator_vol", &item_temp);
if(type == SCIRPT_ITEM_VALUE_TYPE_INT){
otgc->port_ctl.regulator_value = item_temp.val;
}else{
DMSG_INFO("get usbc0_value is failed\n");
otgc->port_ctl.regulator_value = 0;
}
}
}else {
DMSG_INFO("get usbc0_regulator is failed\n");
otgc->port_ctl.regulator_io = NULL;
}
return 0;
}
示例8: sw_ehci_hcd_suspend
/*
*******************************************************************************
* sw_ehci_hcd_suspend
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static int sw_ehci_hcd_suspend(struct device *dev)
{
struct sw_hci_hcd *sw_ehci = NULL;
struct usb_hcd *hcd = NULL;
struct ehci_hcd *ehci = NULL;
unsigned long flags = 0;
if(dev == NULL){
DMSG_PANIC("ERR: Argment is invalid\n");
return 0;
}
hcd = dev_get_drvdata(dev);
if(hcd == NULL){
DMSG_PANIC("ERR: hcd is null\n");
return 0;
}
sw_ehci = dev->platform_data;
if(sw_ehci == NULL){
DMSG_PANIC("ERR: sw_ehci is null\n");
return 0;
}
if(sw_ehci->probe == 0){
DMSG_PANIC("ERR: sw_ehci is disable, can not suspend\n");
return 0;
}
ehci = hcd_to_ehci(hcd);
if(ehci == NULL){
DMSG_PANIC("ERR: ehci is null\n");
return 0;
}
DMSG_INFO("[%s]: sw_ehci_hcd_suspend\n", sw_ehci->hci_name);
spin_lock_irqsave(&ehci->lock, flags);
ehci_prepare_ports_for_controller_suspend(ehci, device_may_wakeup(dev));
ehci_writel(ehci, 0, &ehci->regs->intr_enable);
(void)ehci_readl(ehci, &ehci->regs->intr_enable);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
spin_unlock_irqrestore(&ehci->lock, flags);
sw_stop_ehci(sw_ehci);
return 0;
}
示例9: open_usb_clock
/*
*******************************************************************************
* open_usb_clock
*
* Description:
*
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
u32 open_usb_clock(sw_udc_io_t *sw_udc_io)
{
DMSG_INFO_UDC("open_usb_clock\n");
if(sw_udc_io->sie_clk && sw_udc_io->phy_clk && sw_udc_io->phy0_clk && !sw_udc_io->clk_is_open){
clk_enable(sw_udc_io->sie_clk);
mdelay(10);
clk_enable(sw_udc_io->phy_clk);
clk_enable(sw_udc_io->phy0_clk);
clk_reset(sw_udc_io->phy0_clk, 0);
mdelay(10);
sw_udc_io->clk_is_open = 1;
}else{
DMSG_PANIC("ERR: clock handle is null, sie_clk(0x%p), phy_clk(0x%p), phy0_clk(0x%p), open(%d)\n",
sw_udc_io->sie_clk, sw_udc_io->phy_clk, sw_udc_io->phy0_clk, sw_udc_io->clk_is_open);
}
UsbPhyInit(0);
#if 0
DMSG_INFO("[udc0]: open, 0x60(0x%x), 0xcc(0x%x)\n",
(u32)USBC_Readl(SW_VA_CCM_IO_BASE + 0x60),
(u32)USBC_Readl(SW_VA_CCM_IO_BASE + 0xcc));
#endif
return 0;
}
示例10: ShowPictureEx
/*
*******************************************************************************
* ShowPictureEx
*
* Description:
* 把圖片數據解析到指定的地址中,並且顯示出來.
* 如果指定的地址為NULL, 則可以存放在任何地址。
*
* Parameters:
* Para : input. Boot階段的參數。
* Path : input. 圖片存放在介質中的位置,如“c:\logo.bmp”
* Addr : input. 存放解析後的圖片,
*
* Return value:
* 0 : 成功
* !0 : 失敗
*
* note:
* void
*
*******************************************************************************
*/
__u32 ShowPictureEx(char *Path, __u32 address)
{
Picture_t PictureInfo;
__s32 ret = 0;
display_layer_info_t *layer_para = NULL;
/* 參數初始化 */
if(!board_res.layer_hd)
{
return 0;
}
memset(&PictureInfo, 0, sizeof(Picture_t));
ret = Parse_Pic_BMP_ByPath(Path, &PictureInfo, address);
if(ret != 0)
{
DMSG_PANIC("ERR: Parse_Pic_BMP failed\n");
goto error;
}
/* 顯示圖片 */
layer_para = ui_AllocLayerPara(&PictureInfo);
ShowLayer(board_res.layer_hd, layer_para, board_res.display_source);
#ifndef SPEED_UP_BOOT
wBoot_timer_delay(50);
#endif
return (__u32)layer_para;
error:
return 0;
}
示例11: hci_port_configure
static void hci_port_configure(struct sw_hci_hcd *sw_hci, u32 enable)
{
unsigned long reg_value = 0;
u32 usbc_sdram_hpcr = 0;
void __iomem *addr = NULL;
if (sw_hci->usbc_no == 1) {
usbc_sdram_hpcr = SW_SDRAM_REG_HPCR_USB1;
} else if (sw_hci->usbc_no == 2) {
usbc_sdram_hpcr = SW_SDRAM_REG_HPCR_USB2;
} else {
DMSG_PANIC("EER: unkown usbc_no(%d)\n", sw_hci->usbc_no);
return;
}
addr = (void __iomem*) SW_VA_DRAM_IO_BASE + usbc_sdram_hpcr;
reg_value = readl(addr);
if (enable)
reg_value |= BIT(SW_SDRAM_BP_HPCR_ACCESS_EN);
else
reg_value &= ~BIT(SW_SDRAM_BP_HPCR_ACCESS_EN);
writel(reg_value, addr);
return;
}
示例12: close_clock
static int close_clock(struct sw_hci_hcd *sw_hci, u32 ohci)
{
DMSG_INFO("[%s]: close clock\n", sw_hci->hci_name);
if (sw_hci->sie_clk && sw_hci->phy_gate
&& sw_hci->phy_reset && sw_hci->clk_is_open) {
sw_hci->clk_is_open = 0;
if (ohci && sw_hci->ohci_gate)
clk_disable(sw_hci->ohci_gate);
clk_reset(sw_hci->phy_reset, 1);
clk_disable(sw_hci->phy_reset);
clk_disable(sw_hci->phy_gate);
clk_disable(sw_hci->sie_clk);
} else {
DMSG_PANIC
("[%s]: wrn: open clock failed, (0x%p, 0x%p, 0x%p, %d, 0x%p)\n",
sw_hci->hci_name, sw_hci->sie_clk, sw_hci->phy_gate,
sw_hci->phy_reset, sw_hci->clk_is_open, sw_hci->ohci_gate);
}
dbg_clocks(sw_hci);
return 0;
}
示例13: open_clock
static int open_clock(struct sw_hci_hcd *sw_hci, u32 ohci)
{
DMSG_INFO("[%s]: open clock\n", sw_hci->hci_name);
if (sw_hci->sie_clk && sw_hci->phy_gate
&& sw_hci->phy_reset && !sw_hci->clk_is_open) {
sw_hci->clk_is_open = 1;
clk_enable(sw_hci->phy_gate);
clk_enable(sw_hci->phy_reset);
clk_reset(sw_hci->phy_reset, 0);
if (ohci && sw_hci->ohci_gate)
clk_enable(sw_hci->ohci_gate);
mdelay(10);
clk_enable(sw_hci->sie_clk);
mdelay(10);
UsbPhyInit(sw_hci->usbc_no);
} else {
DMSG_PANIC
("[%s]: wrn: open clock failed, (0x%p, 0x%p, 0x%p, %d, 0x%p)\n",
sw_hci->hci_name, sw_hci->sie_clk, sw_hci->phy_gate,
sw_hci->phy_reset, sw_hci->clk_is_open, sw_hci->ohci_gate);
}
dbg_clocks(sw_hci);
return 0;
}
示例14: rmmod_host_driver
static void rmmod_host_driver(struct usb_msg_center_info *center_info)
{
DMSG_INFO("\n\nrmmod_host_driver\n\n");
#if defined (CONFIG_ARCH_SUN8IW8) || defined (CONFIG_ARCH_SUN8IW7)
#if defined(CONFIG_USB_SUNXI_EHCI0)
sunxi_usb_disable_ehci(0);
#endif
#if defined(CONFIG_USB_SUNXI_OHCI0)
sunxi_usb_disable_ohci(0);
#endif
#else
{
int ret = 0;
ret = sunxi_usb_host0_disable();
if (ret != 0) {
DMSG_PANIC("err: disable hcd0 failed\n");
return;
}
}
#endif
set_usb_role(center_info, USB_ROLE_NULL);
return;
}
示例15: close_clock
/*
*******************************************************************************
* close_clock
*
* Description:
* void
*
* Parameters:
* void
*
* Return value:
* void
*
* note:
* void
*
*******************************************************************************
*/
static int close_clock(struct sw_hci_hcd *sw_hci, u32 ohci)
{
DMSG_INFO("[%s]: close clock\n", sw_hci->hci_name);
if(sw_hci->sie_clk && sw_hci->phy_gate
&& sw_hci->phy_reset && sw_hci->clk_is_open){
sw_hci->clk_is_open = 0;
if(ohci && sw_hci->ohci_gate){
clk_disable(sw_hci->ohci_gate);
}
clk_reset(sw_hci->phy_reset, 1);
clk_disable(sw_hci->phy_reset);
clk_disable(sw_hci->phy_gate);
clk_disable(sw_hci->sie_clk);
}else{
DMSG_PANIC("[%s]: wrn: open clock failed, (0x%p, 0x%p, 0x%p, %d, 0x%p)\n",
sw_hci->hci_name,
sw_hci->sie_clk, sw_hci->phy_gate,
sw_hci->phy_reset, sw_hci->clk_is_open,
sw_hci->ohci_gate);
}
DMSG_DEBUG("[%s]: close clock, 0x60(0x%x), 0xcc(0x%x)\n",
sw_hci->hci_name,
(u32)USBC_Readl(SW_VA_CCM_IO_BASE + 0x60),
(u32)USBC_Readl(SW_VA_CCM_IO_BASE + 0xcc));
return 0;
}