Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361908
b: refs/heads/master
c: 810d601
h: refs/heads/master
v: v3
  • Loading branch information
Chanwoo Choi committed Mar 13, 2013
1 parent bdc62ae commit f41efee
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 79 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 68f8ea184bf7a552b59a38c4b0c7dc243822d2d5
refs/heads/master: 810d601f07ce2481ff776e049c0733ded2abbcc1
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-at91/board-foxg20.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ static struct w1_gpio_platform_data w1_gpio_pdata = {
/* If you choose to use a pin other than PB16 it needs to be 3.3V */
.pin = AT91_PIN_PB16,
.is_open_drain = 1,
.ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device w1_device = {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-at91/board-stamp9g20.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ static struct spi_board_info portuxg20_spi_devices[] = {
static struct w1_gpio_platform_data w1_gpio_pdata = {
.pin = AT91_PIN_PA29,
.is_open_drain = 1,
.ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device w1_device = {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-ixp4xx/vulcan-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ static struct platform_device vulcan_max6369 = {

static struct w1_gpio_platform_data vulcan_w1_gpio_pdata = {
.pin = 14,
.ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device vulcan_w1_gpio = {
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ static struct w1_gpio_platform_data w1_gpio_platform_data = {
.pin = GPIO_ONE_WIRE,
.is_open_drain = 0,
.enable_external_pullup = w1_enable_external_pullup,
.ext_pullup_enable_pin = -EINVAL,
};

struct platform_device raumfeld_w1_gpio_device = {
Expand Down
56 changes: 34 additions & 22 deletions trunk/drivers/extcon/extcon-max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,29 +712,45 @@ static int max8997_muic_probe(struct platform_device *pdev)
goto err_irq;
}

/* Initialize registers according to platform data */
if (pdata->muic_pdata) {
struct max8997_muic_platform_data *mdata = info->muic_pdata;

for (i = 0; i < mdata->num_init_data; i++) {
max8997_write_reg(info->muic, mdata->init_data[i].addr,
mdata->init_data[i].data);
struct max8997_muic_platform_data *muic_pdata
= pdata->muic_pdata;

/* Initialize registers according to platform data */
for (i = 0; i < muic_pdata->num_init_data; i++) {
max8997_write_reg(info->muic,
muic_pdata->init_data[i].addr,
muic_pdata->init_data[i].data);
}
}

/*
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
* h/w path of COMP2/COMN1 on CONTROL1 register.
*/
if (pdata->muic_pdata->path_uart)
info->path_uart = pdata->muic_pdata->path_uart;
else
info->path_uart = CONTROL1_SW_UART;
/*
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
* h/w path of COMP2/COMN1 on CONTROL1 register.
*/
if (muic_pdata->path_uart)
info->path_uart = muic_pdata->path_uart;
else
info->path_uart = CONTROL1_SW_UART;

if (pdata->muic_pdata->path_usb)
info->path_usb = pdata->muic_pdata->path_usb;
else
if (muic_pdata->path_usb)
info->path_usb = muic_pdata->path_usb;
else
info->path_usb = CONTROL1_SW_USB;

/*
* Default delay time for detecting cable state
* after certain time.
*/
if (muic_pdata->detcable_delay_ms)
delay_jiffies =
msecs_to_jiffies(muic_pdata->detcable_delay_ms);
else
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
} else {
info->path_uart = CONTROL1_SW_UART;
info->path_usb = CONTROL1_SW_USB;
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
}

/* Set initial path for UART */
max8997_muic_set_path(info, info->path_uart, true);
Expand All @@ -751,10 +767,6 @@ static int max8997_muic_probe(struct platform_device *pdev)
* driver should notify cable state to upper layer.
*/
INIT_DELAYED_WORK(&info->wq_detcable, max8997_muic_detect_cable_wq);
if (pdata->muic_pdata->detcable_delay_ms)
delay_jiffies = msecs_to_jiffies(pdata->muic_pdata->detcable_delay_ms);
else
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
schedule_delayed_work(&info->wq_detcable, delay_jiffies);

return 0;
Expand Down
29 changes: 9 additions & 20 deletions trunk/drivers/misc/mei/hw-me.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ static void mei_me_intr_disable(struct mei_device *dev)
mei_hcsr_set(hw, hcsr);
}

/**
* mei_me_hw_reset_release - release device from the reset
*
* @dev: the device structure
*/
static void mei_me_hw_reset_release(struct mei_device *dev)
{
struct mei_me_hw *hw = to_me_hw(dev);
u32 hcsr = mei_hcsr_read(hw);

hcsr |= H_IG;
hcsr &= ~H_RST;
mei_hcsr_set(hw, hcsr);
}
/**
* mei_me_hw_reset - resets fw via mei csr register.
*
Expand All @@ -183,14 +169,18 @@ static void mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
if (intr_enable)
hcsr |= H_IE;
else
hcsr |= ~H_IE;
hcsr &= ~H_IE;

mei_hcsr_set(hw, hcsr);

hcsr = mei_hcsr_read(hw) | H_IG;
hcsr &= ~H_RST;

mei_hcsr_set(hw, hcsr);

if (dev->dev_state == MEI_DEV_POWER_DOWN)
mei_me_hw_reset_release(dev);
hcsr = mei_hcsr_read(hw);

dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", mei_hcsr_read(hw));
dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", hcsr);
}

/**
Expand Down Expand Up @@ -476,8 +466,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
mutex_unlock(&dev->device_lock);
return IRQ_HANDLED;
} else {
dev_dbg(&dev->pdev->dev, "Reset Completed.\n");
mei_me_hw_reset_release(dev);
dev_dbg(&dev->pdev->dev, "FW not ready.\n");
mutex_unlock(&dev->device_lock);
return IRQ_HANDLED;
}
Expand Down
18 changes: 0 additions & 18 deletions trunk/drivers/misc/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,24 +183,6 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
mei_cl_all_write_clear(dev);
}

void mei_stop(struct mei_device *dev)
{
dev_dbg(&dev->pdev->dev, "stopping the device.\n");

mutex_lock(&dev->device_lock);

cancel_delayed_work(&dev->timer_work);

mei_wd_stop(dev);

dev->dev_state = MEI_DEV_POWER_DOWN;
mei_reset(dev, 0);

mutex_unlock(&dev->device_lock);

flush_scheduled_work();
}




1 change: 0 additions & 1 deletion trunk/drivers/misc/mei/mei_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ static inline unsigned long mei_secs_to_jiffies(unsigned long sec)
void mei_device_init(struct mei_device *dev);
void mei_reset(struct mei_device *dev, int interrupts);
int mei_hw_init(struct mei_device *dev);
void mei_stop(struct mei_device *dev);

/*
* MEI interrupt functions prototype
Expand Down
52 changes: 45 additions & 7 deletions trunk/drivers/misc/mei/pci-me.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,44 @@ static void mei_remove(struct pci_dev *pdev)

hw = to_me_hw(dev);

mutex_lock(&dev->device_lock);

cancel_delayed_work(&dev->timer_work);

dev_err(&pdev->dev, "stop\n");
mei_stop(dev);
mei_wd_stop(dev);

mei_pdev = NULL;

if (dev->iamthif_cl.state == MEI_FILE_CONNECTED) {
dev->iamthif_cl.state = MEI_FILE_DISCONNECTING;
mei_cl_disconnect(&dev->iamthif_cl);
}
if (dev->wd_cl.state == MEI_FILE_CONNECTED) {
dev->wd_cl.state = MEI_FILE_DISCONNECTING;
mei_cl_disconnect(&dev->wd_cl);
}

/* Unregistering watchdog device */
mei_watchdog_unregister(dev);

/* remove entry if already in list */
dev_dbg(&pdev->dev, "list del iamthif and wd file list.\n");

if (dev->open_handle_count > 0)
dev->open_handle_count--;
mei_cl_unlink(&dev->wd_cl);

if (dev->open_handle_count > 0)
dev->open_handle_count--;
mei_cl_unlink(&dev->iamthif_cl);

dev->iamthif_current_cb = NULL;
dev->me_clients_num = 0;

mutex_unlock(&dev->device_lock);

flush_scheduled_work();

/* disable interrupts */
mei_disable_interrupts(dev);

Expand All @@ -278,20 +308,28 @@ static int mei_pci_suspend(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct mei_device *dev = pci_get_drvdata(pdev);
int err;

if (!dev)
return -ENODEV;
mutex_lock(&dev->device_lock);

dev_err(&pdev->dev, "suspend\n");

mei_stop(dev);
cancel_delayed_work(&dev->timer_work);

mei_disable_interrupts(dev);
/* Stop watchdog if exists */
err = mei_wd_stop(dev);
/* Set new mei state */
if (dev->dev_state == MEI_DEV_ENABLED ||
dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) {
dev->dev_state = MEI_DEV_POWER_DOWN;
mei_reset(dev, 0);
}
mutex_unlock(&dev->device_lock);

free_irq(pdev->irq, dev);
pci_disable_msi(pdev);

return 0;
return err;
}

static int mei_pci_resume(struct device *device)
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/w1/masters/w1-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ static u8 w1_gpio_read_bit(void *data)
return gpio_get_value(pdata->pin) ? 1 : 0;
}

#if defined(CONFIG_OF)
static struct of_device_id w1_gpio_dt_ids[] = {
{ .compatible = "w1-gpio" },
{}
};
MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids);
#endif

static int w1_gpio_probe_dt(struct platform_device *pdev)
{
Expand Down Expand Up @@ -160,7 +158,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
return err;
}

static int w1_gpio_remove(struct platform_device *pdev)
static int __exit w1_gpio_remove(struct platform_device *pdev)
{
struct w1_bus_master *master = platform_get_drvdata(pdev);
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
Expand Down Expand Up @@ -212,7 +210,7 @@ static struct platform_driver w1_gpio_driver = {
.of_match_table = of_match_ptr(w1_gpio_dt_ids),
},
.probe = w1_gpio_probe,
.remove = w1_gpio_remove,
.remove = __exit_p(w1_gpio_remove),
.suspend = w1_gpio_suspend,
.resume = w1_gpio_resume,
};
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
tmp64 = (triplet_ret >> 2);
rn |= (tmp64 << i);

/* ensure we're called from kthread and not by netlink callback */
if (!dev->priv && kthread_should_stop()) {
if (kthread_should_stop()) {
mutex_unlock(&dev->bus_mutex);
dev_dbg(&dev->dev, "Abort w1_search\n");
return;
Expand Down
4 changes: 4 additions & 0 deletions trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ config BUILDTIME_EXTABLE_SORT

menu "General setup"

config EXPERIMENTAL
bool
default y

config BROKEN
bool

Expand Down

0 comments on commit f41efee

Please sign in to comment.