smu.c (730745a5c45093982112ddc94cee6a9973455641) | smu.c (a28d3af2a26c89aaa6470ca36edb212e05143d67) |
---|---|
1/* 2 * PowerMac G5 SMU driver 3 * 4 * Copyright 2004 J. Mayer <l_indien@magic.fr> 5 * Copyright 2005 Benjamin Herrenschmidt, IBM Corp. 6 * 7 * Released under the term of the GNU GPL v2. 8 */ --- 570 unchanged lines hidden (view full) --- 579 * above having been done before we reach arch_initcalls 580 */ 581core_initcall(smu_late_init); 582 583/* 584 * sysfs visibility 585 */ 586 | 1/* 2 * PowerMac G5 SMU driver 3 * 4 * Copyright 2004 J. Mayer <l_indien@magic.fr> 5 * Copyright 2005 Benjamin Herrenschmidt, IBM Corp. 6 * 7 * Released under the term of the GNU GPL v2. 8 */ --- 570 unchanged lines hidden (view full) --- 579 * above having been done before we reach arch_initcalls 580 */ 581core_initcall(smu_late_init); 582 583/* 584 * sysfs visibility 585 */ 586 |
587static void smu_create_i2c(struct device_node *np) 588{ 589 char name[32]; 590 u32 *reg = (u32 *)get_property(np, "reg", NULL); 591 592 if (reg != NULL) { 593 sprintf(name, "smu-i2c-%02x", *reg); 594 of_platform_device_create(np, name, &smu->of_dev->dev); 595 } 596} 597 | |
598static void smu_expose_childs(void *unused) 599{ | 587static void smu_expose_childs(void *unused) 588{ |
600 struct device_node *np, *gp; | 589 struct device_node *np; |
601 | 590 |
602 for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) { 603 if (device_is_compatible(np, "smu-i2c-control")) { 604 gp = NULL; 605 while ((gp = of_get_next_child(np, gp)) != NULL) 606 if (device_is_compatible(gp, "i2c-bus")) 607 smu_create_i2c(gp); 608 } else if (device_is_compatible(np, "smu-i2c")) 609 smu_create_i2c(np); | 591 for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) |
610 if (device_is_compatible(np, "smu-sensors")) 611 of_platform_device_create(np, "smu-sensors", 612 &smu->of_dev->dev); | 592 if (device_is_compatible(np, "smu-sensors")) 593 of_platform_device_create(np, "smu-sensors", 594 &smu->of_dev->dev); |
613 } 614 | |
615} 616 617static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); 618 619static int smu_platform_probe(struct of_device* dev, 620 const struct of_device_id *match) 621{ 622 if (!smu) --- 680 unchanged lines hidden --- | 595} 596 597static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); 598 599static int smu_platform_probe(struct of_device* dev, 600 const struct of_device_id *match) 601{ 602 if (!smu) --- 680 unchanged lines hidden --- |