diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/adb-iop.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/ans-lcd.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/macio-adb.c | 15 | ||||
-rw-r--r-- | drivers/macintosh/macio_asic.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/rack-meter.c | 6 | ||||
-rw-r--r-- | drivers/macintosh/via-macii.c | 14 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 16 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu68k.c | 103 |
8 files changed, 102 insertions, 68 deletions
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c index 15db69d8ba69..ca623e6446e4 100644 --- a/drivers/macintosh/adb-iop.c +++ b/drivers/macintosh/adb-iop.c @@ -53,13 +53,13 @@ static void adb_iop_poll(void); static int adb_iop_reset_bus(void); struct adb_driver adb_iop_driver = { - "ISM IOP", - adb_iop_probe, - adb_iop_init, - adb_iop_send_request, - adb_iop_autopoll, - adb_iop_poll, - adb_iop_reset_bus + .name = "ISM IOP", + .probe = adb_iop_probe, + .init = adb_iop_init, + .send_request = adb_iop_send_request, + .autopoll = adb_iop_autopoll, + .poll = adb_iop_poll, + .reset_bus = adb_iop_reset_bus }; static void adb_iop_end_req(struct adb_request *req, int state) diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c index 1de81d922d8a..c8e078b911c7 100644 --- a/drivers/macintosh/ans-lcd.c +++ b/drivers/macintosh/ans-lcd.c @@ -201,3 +201,4 @@ anslcd_exit(void) module_init(anslcd_init); module_exit(anslcd_exit); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 9a6223add30e..eb3adfb7f88d 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c @@ -70,14 +70,13 @@ static void macio_adb_poll(void); static int macio_adb_reset_bus(void); struct adb_driver macio_adb_driver = { - "MACIO", - macio_probe, - macio_init, - macio_send_request, - /*macio_write,*/ - macio_adb_autopoll, - macio_adb_poll, - macio_adb_reset_bus + .name = "MACIO", + .probe = macio_probe, + .init = macio_init, + .send_request = macio_send_request, + .autopoll = macio_adb_autopoll, + .poll = macio_adb_poll, + .reset_bus = macio_adb_reset_bus, }; int macio_probe(void) diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 62f541f968f6..07074820a167 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -375,6 +375,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, dev->ofdev.dev.of_node = np; dev->ofdev.archdata.dma_mask = 0xffffffffUL; dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask; + dev->ofdev.dev.coherent_dma_mask = dev->ofdev.archdata.dma_mask; dev->ofdev.dev.parent = parent; dev->ofdev.dev.bus = &macio_bus_type; dev->ofdev.dev.release = macio_release_dev; diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 910b5b6f96b1..1f29d2413c74 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -154,8 +154,8 @@ static void rackmeter_do_pause(struct rackmeter *rm, int pause) DBDMA_DO_STOP(rm->dma_regs); return; } - memset(rdma->buf1, 0, ARRAY_SIZE(rdma->buf1)); - memset(rdma->buf2, 0, ARRAY_SIZE(rdma->buf2)); + memset(rdma->buf1, 0, sizeof(rdma->buf1)); + memset(rdma->buf2, 0, sizeof(rdma->buf2)); rm->dma_buf_v->mark = 0; @@ -397,7 +397,7 @@ static int rackmeter_probe(struct macio_dev* mdev, } /* Create and initialize our instance data */ - rm = kzalloc(sizeof(struct rackmeter), GFP_KERNEL); + rm = kzalloc(sizeof(*rm), GFP_KERNEL); if (rm == NULL) { printk(KERN_ERR "rackmeter: failed to allocate memory !\n"); rc = -ENOMEM; diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index 4ba06a1695ea..cf6f7d52d6be 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -91,13 +91,13 @@ static void macii_poll(void); static int macii_reset_bus(void); struct adb_driver via_macii_driver = { - "Mac II", - macii_probe, - macii_init, - macii_send_request, - macii_autopoll, - macii_poll, - macii_reset_bus + .name = "Mac II", + .probe = macii_probe, + .init = macii_init, + .send_request = macii_send_request, + .autopoll = macii_autopoll, + .poll = macii_poll, + .reset_bus = macii_reset_bus, }; static enum macii_state { diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 94c0f3f7df69..433dbeddfcf9 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -198,14 +198,14 @@ static const struct file_operations pmu_battery_proc_fops; static const struct file_operations pmu_options_proc_fops; #ifdef CONFIG_ADB -struct adb_driver via_pmu_driver = { - "PMU", - pmu_probe, - pmu_init, - pmu_send_request, - pmu_adb_autopoll, - pmu_poll_adb, - pmu_adb_reset_bus +const struct adb_driver via_pmu_driver = { + .name = "PMU", + .probe = pmu_probe, + .init = pmu_init, + .send_request = pmu_send_request, + .autopoll = pmu_adb_autopoll, + .poll = pmu_poll_adb, + .reset_bus = pmu_adb_reset_bus, }; #endif /* CONFIG_ADB */ diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 25465fb91ec9..d545ed45e482 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c @@ -109,6 +109,7 @@ static int pmu_autopoll(int devs); void pmu_poll(void); static int pmu_reset_bus(void); +static int init_pmu(void); static void pmu_start(void); static void send_byte(int x); static void recv_byte(void); @@ -119,13 +120,13 @@ static void pmu_enable_backlight(int on); static void pmu_set_brightness(int level); struct adb_driver via_pmu_driver = { - "68K PMU", - pmu_probe, - pmu_init, - pmu_send_request, - pmu_autopoll, - pmu_poll, - pmu_reset_bus + .name = "68K PMU", + .probe = pmu_probe, + .init = pmu_init, + .send_request = pmu_send_request, + .autopoll = pmu_autopoll, + .poll = pmu_poll, + .reset_bus = pmu_reset_bus, }; /* @@ -171,23 +172,76 @@ static s8 pmu_data_len[256][2] = { /*f8*/ {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1}, }; -int pmu_probe(void) +int __init find_via_pmu(void) { - if (macintosh_config->adb_type == MAC_ADB_PB1) { + switch (macintosh_config->adb_type) { + case MAC_ADB_PB1: pmu_kind = PMU_68K_V1; - } else if (macintosh_config->adb_type == MAC_ADB_PB2) { + break; + case MAC_ADB_PB2: pmu_kind = PMU_68K_V2; - } else { + break; + default: + pmu_kind = PMU_UNKNOWN; return -ENODEV; } pmu_state = idle; + if (!init_pmu()) + goto fail_init; + + pr_info("adb: PMU 68K driver v0.5 for Unified ADB\n"); + + return 1; + +fail_init: + pmu_kind = PMU_UNKNOWN; return 0; } -static int -pmu_init(void) +static int pmu_probe(void) +{ + if (pmu_kind == PMU_UNKNOWN) + return -ENODEV; + return 0; +} + +static int pmu_init(void) +{ + if (pmu_kind == PMU_UNKNOWN) + return -ENODEV; + return 0; +} + +static int __init via_pmu_start(void) +{ + if (pmu_kind == PMU_UNKNOWN) + return -ENODEV; + + if (request_irq(IRQ_MAC_ADB_SR, pmu_interrupt, 0, "PMU_SR", + pmu_interrupt)) { + pr_err("%s: can't get SR irq\n", __func__); + return -ENODEV; + } + if (request_irq(IRQ_MAC_ADB_CL, pmu_interrupt, 0, "PMU_CL", + pmu_interrupt)) { + pr_err("%s: can't get CL irq\n", __func__); + free_irq(IRQ_MAC_ADB_SR, pmu_interrupt); + return -ENODEV; + } + + pmu_fully_inited = 1; + + /* Enable backlight */ + pmu_enable_backlight(1); + + return 0; +} + +arch_initcall(via_pmu_start); + +static int __init init_pmu(void) { int timeout; volatile struct adb_request req; @@ -238,28 +292,7 @@ pmu_init(void) bright_req_2.complete = 1; bright_req_3.complete = 1; - if (request_irq(IRQ_MAC_ADB_SR, pmu_interrupt, 0, "pmu-shift", - pmu_interrupt)) { - printk(KERN_ERR "pmu_init: can't get irq %d\n", - IRQ_MAC_ADB_SR); - return -EAGAIN; - } - if (request_irq(IRQ_MAC_ADB_CL, pmu_interrupt, 0, "pmu-clock", - pmu_interrupt)) { - printk(KERN_ERR "pmu_init: can't get irq %d\n", - IRQ_MAC_ADB_CL); - free_irq(IRQ_MAC_ADB_SR, pmu_interrupt); - return -EAGAIN; - } - - pmu_fully_inited = 1; - - /* Enable backlight */ - pmu_enable_backlight(1); - - printk("adb: PMU 68K driver v0.5 for Unified ADB.\n"); - - return 0; + return 1; } int |