mirror of
https://github.com/patjak/facetimehd.git
synced 2026-04-09 11:02:31 +02:00
bcwc_pcie: Skeleton for power up/down sequence
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
||||
bcwc_pcie-objs := bcwc_drv.o
|
||||
bcwc_pcie-objs := bcwc_hw.o bcwc_drv.o
|
||||
obj-m := bcwc_pcie.o
|
||||
|
||||
KVERSION := $(shell uname -r)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include "bcwc_drv.h"
|
||||
#include "bcwc_hw.h"
|
||||
|
||||
static int bcwc_pci_reserve_mem(struct bcwc_private *dev_priv)
|
||||
{
|
||||
@@ -151,6 +152,8 @@ static int bcwc_pci_probe(struct pci_dev *pdev,
|
||||
pci_set_master(pdev);
|
||||
pci_set_drvdata(pdev, dev_priv);
|
||||
|
||||
bcwc_hw_init(dev_priv);
|
||||
|
||||
return 0;
|
||||
fail_msi:
|
||||
pci_disable_msi(pdev);
|
||||
|
||||
87
bcwc_hw.c
Normal file
87
bcwc_hw.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Broadcom PCIe 1570 webcam driver
|
||||
*
|
||||
* Copyright (C) 2014 Patrik Jakobsson (patrik.r.jakobsson@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 "bcwc_drv.h"
|
||||
#include "bcwc_hw.h"
|
||||
|
||||
#if 0
|
||||
static int bcwc_hw_set_core_clk(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_aspm_enable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_aspm_disable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int bcwc_hw_irq_enable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_irq_disable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_sensor_enable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_sensor_disable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_s2chip_enable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bcwc_hw_s2chip_disable(struct bcwc_private *dev_priv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* What I've figured out about the power on sequence so far */
|
||||
static int bcwc_hw_power_on(struct bcwc_private *dev_priv)
|
||||
{
|
||||
bcwc_hw_s2chip_enable(dev_priv);
|
||||
bcwc_hw_sensor_enable(dev_priv);
|
||||
bcwc_hw_irq_enable(dev_priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* What I've figured out about the power off sequence so far */
|
||||
static int bcwc_hw_power_off(struct bcwc_private *dev_priv)
|
||||
{
|
||||
bcwc_hw_irq_disable(dev_priv);
|
||||
bcwc_hw_sensor_disable(dev_priv);
|
||||
bcwc_hw_s2chip_disable(dev_priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bcwc_hw_init(struct bcwc_private *dev_priv)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
return 0;
|
||||
}
|
||||
24
bcwc_hw.h
Normal file
24
bcwc_hw.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Broadcom PCIe 1570 webcam driver
|
||||
*
|
||||
* Copyright (C) 2014 Patrik Jakobsson (patrik.r.jakobsson@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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BCWC_HW_H
|
||||
#define _BCWC_HW_H
|
||||
|
||||
#define BCWC_LINK_REG_READ(offset) ioread32(dev_priv->link_io + (offset))
|
||||
#define BCWC_LINK_REG_WRITE(val, offset) iowrite32((val), \
|
||||
dev_priv->link_io + (offset))
|
||||
#define BCWC_DEV_REG_READ(offset) ioread32(dev_priv->dev_io + (offset))
|
||||
#define BCWC_DEV_REG_WRITE(val, offset) iowrite32((val), \
|
||||
dev_priv->dev_io + (offset))
|
||||
|
||||
extern int bcwc_hw_init(struct bcwc_private *dev_priv);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user