gpio-mm-lantiq.c (f3f26c2f4b15b5b56ed87610403e4a98a13d6369) gpio-mm-lantiq.c (68a99b187df3f4675f22a4a3f54c9d7645ab6409)
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
5 *
6 * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
7 */
8

--- 91 unchanged lines hidden (view full) ---

100 ltq_ebu_w32(CPHYSADDR(chip->mmchip.regs) | 0x1, LTQ_EBU_ADDRSEL1);
101
102 ltq_mm_apply(chip);
103}
104
105static int ltq_mm_probe(struct platform_device *pdev)
106{
107 struct ltq_mm *chip;
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
5 *
6 * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
7 */
8

--- 91 unchanged lines hidden (view full) ---

100 ltq_ebu_w32(CPHYSADDR(chip->mmchip.regs) | 0x1, LTQ_EBU_ADDRSEL1);
101
102 ltq_mm_apply(chip);
103}
104
105static int ltq_mm_probe(struct platform_device *pdev)
106{
107 struct ltq_mm *chip;
108 const __be32 *shadow;
108 u32 shadow;
109
110 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
111 if (!chip)
112 return -ENOMEM;
113
114 chip->mmchip.gc.ngpio = 16;
115 chip->mmchip.gc.direction_output = ltq_mm_dir_out;
116 chip->mmchip.gc.set = ltq_mm_set;
117 chip->mmchip.save_regs = ltq_mm_save_regs;
118
119 /* store the shadow value if one was passed by the devicetree */
109
110 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
111 if (!chip)
112 return -ENOMEM;
113
114 chip->mmchip.gc.ngpio = 16;
115 chip->mmchip.gc.direction_output = ltq_mm_dir_out;
116 chip->mmchip.gc.set = ltq_mm_set;
117 chip->mmchip.save_regs = ltq_mm_save_regs;
118
119 /* store the shadow value if one was passed by the devicetree */
120 shadow = of_get_property(pdev->dev.of_node, "lantiq,shadow", NULL);
121 if (shadow)
122 chip->shadow = be32_to_cpu(*shadow);
120 if (!of_property_read_u32(pdev->dev.of_node, "lantiq,shadow", &shadow))
121 chip->shadow = shadow;
123
124 return of_mm_gpiochip_add(pdev->dev.of_node, &chip->mmchip);
125}
126
127static const struct of_device_id ltq_mm_match[] = {
128 { .compatible = "lantiq,gpio-mm" },
129 {},
130};

--- 16 unchanged lines hidden ---
122
123 return of_mm_gpiochip_add(pdev->dev.of_node, &chip->mmchip);
124}
125
126static const struct of_device_id ltq_mm_match[] = {
127 { .compatible = "lantiq,gpio-mm" },
128 {},
129};

--- 16 unchanged lines hidden ---