Skip to content

Commit a832eb2

Browse files
committed
Merge tag 'davinci-for-v5.6/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into arm/late
DaVinci SoC updates for v5.6 include migrating DM365 SoC to use drivers/clocksource based driver for timer. This leads to removal of machine specific timer driver. There are two patches adding missing fixed regulators for audio codecs on DM365 and DM644x EVMs. * tag 'davinci-for-v5.6/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: dm644x-evm: Add Fixed regulators needed for tlv320aic33 ARM: davinci: dm365-evm: Add Fixed regulators needed for tlv320aic3101 ARM: davinci: remove legacy timer support ARM: davinci: dm365: switch to using the clocksource driver clocksource: davinci: only enable clockevents once tim34 is initialized Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Olof Johansson <[email protected]>
2 parents 19d52e9 + 5e06d19 commit a832eb2

File tree

10 files changed

+60
-483
lines changed

10 files changed

+60
-483
lines changed

arch/arm/mach-davinci/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
88

99
# Common objects
10-
obj-y := time.o serial.o usb.o \
11-
common.o sram.o
10+
obj-y := serial.o usb.o common.o sram.o
1211

1312
obj-$(CONFIG_DAVINCI_MUX) += mux.o
1413

arch/arm/mach-davinci/board-dm365-evm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <linux/spi/eeprom.h>
3131
#include <linux/v4l2-dv-timings.h>
3232
#include <linux/platform_data/ti-aemif.h>
33+
#include <linux/regulator/fixed.h>
34+
#include <linux/regulator/machine.h>
3335

3436
#include <asm/mach-types.h>
3537
#include <asm/mach/arch.h>
@@ -245,6 +247,19 @@ static struct davinci_i2c_platform_data i2c_pdata = {
245247
.bus_delay = 0 /* usec */,
246248
};
247249

250+
/* Fixed regulator support */
251+
static struct regulator_consumer_supply fixed_supplies_3_3v[] = {
252+
/* Baseboard 3.3V: 5V -> TPS767D301 -> 3.3V */
253+
REGULATOR_SUPPLY("AVDD", "1-0018"),
254+
REGULATOR_SUPPLY("DRVDD", "1-0018"),
255+
REGULATOR_SUPPLY("IOVDD", "1-0018"),
256+
};
257+
258+
static struct regulator_consumer_supply fixed_supplies_1_8v[] = {
259+
/* Baseboard 1.8V: 5V -> TPS767D301 -> 1.8V */
260+
REGULATOR_SUPPLY("DVDD", "1-0018"),
261+
};
262+
248263
static int dm365evm_keyscan_enable(struct device *dev)
249264
{
250265
return davinci_cfg_reg(DM365_KEYSCAN);
@@ -800,6 +815,11 @@ static __init void dm365_evm_init(void)
800815
if (ret)
801816
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
802817

818+
regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v,
819+
ARRAY_SIZE(fixed_supplies_1_8v), 1800000);
820+
regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v,
821+
ARRAY_SIZE(fixed_supplies_3_3v), 3300000);
822+
803823
nvmem_add_cell_table(&davinci_nvmem_cell_table);
804824
nvmem_add_cell_lookups(&davinci_nvmem_cell_lookup, 1);
805825

arch/arm/mach-davinci/board-dm644x-evm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <linux/v4l2-dv-timings.h>
3030
#include <linux/export.h>
3131
#include <linux/leds.h>
32+
#include <linux/regulator/fixed.h>
33+
#include <linux/regulator/machine.h>
3234

3335
#include <media/i2c/tvp514x.h>
3436

@@ -653,6 +655,19 @@ static struct i2c_board_info __initdata i2c_info[] = {
653655
},
654656
};
655657

658+
/* Fixed regulator support */
659+
static struct regulator_consumer_supply fixed_supplies_3_3v[] = {
660+
/* Baseboard 3.3V: 5V -> TPS54310PWP -> 3.3V */
661+
REGULATOR_SUPPLY("AVDD", "1-001b"),
662+
REGULATOR_SUPPLY("DRVDD", "1-001b"),
663+
};
664+
665+
static struct regulator_consumer_supply fixed_supplies_1_8v[] = {
666+
/* Baseboard 1.8V: 5V -> TPS54310PWP -> 1.8V */
667+
REGULATOR_SUPPLY("IOVDD", "1-001b"),
668+
REGULATOR_SUPPLY("DVDD", "1-001b"),
669+
};
670+
656671
#define DM644X_I2C_SDA_PIN GPIO_TO_PIN(2, 12)
657672
#define DM644X_I2C_SCL_PIN GPIO_TO_PIN(2, 11)
658673

@@ -831,6 +846,11 @@ static __init void davinci_evm_init(void)
831846

832847
dm644x_register_clocks();
833848

849+
regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v,
850+
ARRAY_SIZE(fixed_supplies_1_8v), 1800000);
851+
regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v,
852+
ARRAY_SIZE(fixed_supplies_3_3v), 3300000);
853+
834854
dm644x_init_devices();
835855

836856
ret = dm644x_gpio_register();

arch/arm/mach-davinci/devices-da8xx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <mach/common.h>
2222
#include <mach/cputype.h>
2323
#include <mach/da8xx.h>
24-
#include <mach/time.h>
2524

2625
#include "asp.h"
2726
#include "cpuidle.h"

arch/arm/mach-davinci/devices.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <mach/hardware.h>
1818
#include <mach/cputype.h>
1919
#include <mach/mux.h>
20-
#include <mach/time.h>
2120

2221
#include "davinci.h"
2322
#include "irqs.h"
@@ -303,21 +302,3 @@ int davinci_gpio_register(struct resource *res, int size, void *pdata)
303302
davinci_gpio_device.dev.platform_data = pdata;
304303
return platform_device_register(&davinci_gpio_device);
305304
}
306-
307-
/*-------------------------------------------------------------------------*/
308-
309-
/*-------------------------------------------------------------------------*/
310-
311-
struct davinci_timer_instance davinci_timer_instance[2] = {
312-
{
313-
.base = DAVINCI_TIMER0_BASE,
314-
.bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12),
315-
.top_irq = DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34),
316-
},
317-
{
318-
.base = DAVINCI_TIMER1_BASE,
319-
.bottom_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT12),
320-
.top_irq = DAVINCI_INTC_IRQ(IRQ_TINT1_TINT34),
321-
},
322-
};
323-

arch/arm/mach-davinci/dm365.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
#include <mach/cputype.h>
3636
#include <mach/mux.h>
3737
#include <mach/serial.h>
38-
#include <mach/time.h>
38+
39+
#include <clocksource/timer-davinci.h>
3940

4041
#include "asp.h"
4142
#include "davinci.h"
@@ -660,10 +661,16 @@ static struct davinci_id dm365_ids[] = {
660661
},
661662
};
662663

663-
static struct davinci_timer_info dm365_timer_info = {
664-
.timers = davinci_timer_instance,
665-
.clockevent_id = T0_BOT,
666-
.clocksource_id = T0_TOP,
664+
/*
665+
* Bottom half of timer0 is used for clockevent, top half is used for
666+
* clocksource.
667+
*/
668+
static const struct davinci_timer_cfg dm365_timer_cfg = {
669+
.reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_128),
670+
.irq = {
671+
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
672+
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
673+
},
667674
};
668675

669676
#define DM365_UART1_BASE (IO_PHYS + 0x106000)
@@ -723,7 +730,6 @@ static const struct davinci_soc_info davinci_soc_info_dm365 = {
723730
.pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
724731
.pinmux_pins = dm365_pins,
725732
.pinmux_pins_num = ARRAY_SIZE(dm365_pins),
726-
.timer_info = &dm365_timer_info,
727733
.emac_pdata = &dm365_emac_pdata,
728734
.sram_dma = 0x00010000,
729735
.sram_len = SZ_32K,
@@ -771,6 +777,7 @@ void __init dm365_init_time(void)
771777
{
772778
void __iomem *pll1, *pll2, *psc;
773779
struct clk *clk;
780+
int rv;
774781

775782
clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM365_REF_FREQ);
776783

@@ -789,7 +796,8 @@ void __init dm365_init_time(void)
789796
return;
790797
}
791798

792-
davinci_timer_init(clk);
799+
rv = davinci_timer_register(clk, &dm365_timer_cfg);
800+
WARN(rv, "Unable to register the timer: %d\n", rv);
793801
}
794802

795803
void __init dm365_register_clocks(void)

arch/arm/mach-davinci/include/mach/common.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@
2222
#define DAVINCI_INTC_START NR_IRQS
2323
#define DAVINCI_INTC_IRQ(_irqnum) (DAVINCI_INTC_START + (_irqnum))
2424

25-
void davinci_timer_init(struct clk *clk);
26-
27-
struct davinci_timer_instance {
28-
u32 base;
29-
u32 bottom_irq;
30-
u32 top_irq;
31-
unsigned long cmp_off;
32-
unsigned int cmp_irq;
33-
};
34-
35-
struct davinci_timer_info {
36-
struct davinci_timer_instance *timers;
37-
unsigned int clockevent_id;
38-
unsigned int clocksource_id;
39-
};
40-
4125
struct davinci_gpio_controller;
4226

4327
/*
@@ -58,7 +42,6 @@ struct davinci_soc_info {
5842
u32 pinmux_base;
5943
const struct mux_config *pinmux_pins;
6044
unsigned long pinmux_pins_num;
61-
struct davinci_timer_info *timer_info;
6245
int gpio_type;
6346
u32 gpio_base;
6447
unsigned gpio_num;

arch/arm/mach-davinci/include/mach/time.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)